Merge branch 'dev' of http://blit.7drlb.com:8888/r/moral into dev
| | |
| | | * </p> |
| | | * |
| | | * @author moral |
| | | * @since 2021-03-09 |
| | | * @since 2021-04-19 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | |
| | | */ |
| | | private String isDelete; |
| | | |
| | | /** |
| | | * 描述 |
| | | */ |
| | | private String desc; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | |
| | | * </p> |
| | | * |
| | | * @author moral |
| | | * @since 2021-03-09 |
| | | * @since 2021-04-16 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 父Id |
| | | */ |
| | | private Integer parentId; |
| | | |
| | | /** |
| | | * 数据类型Id |
| | |
| | | */ |
| | | @TableField("dataValue") |
| | | private String dataValue; |
| | | |
| | | /** |
| | | * 排列顺序 |
| | | */ |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * 创建时间 |
| | |
| | | * </p> |
| | | * |
| | | * @author moral |
| | | * @since 2021-03-09 |
| | | * @since 2021-04-16 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | |
| | | private String desc; |
| | | |
| | | /** |
| | | * 系统内置 无法更改 |
| | | */ |
| | | private Integer system; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createTime; |
| | |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | |
| | | Object orgId = orgInfo.get("id"); |
| | | QueryWrapper<UserLog> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("organization_id", orgId); |
| | | Object type = parameters.get("type"); |
| | | if (type != null) { |
| | | queryWrapper.eq("type", type); |
| | | List<Object> types = (List<Object>) parameters.get("types"); |
| | | if (!types.isEmpty()) { |
| | | queryWrapper.in("type", types); |
| | | } |
| | | queryWrapper.orderByDesc("create_time"); |
| | | Integer page = (Integer) parameters.get("page"); |
| | |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="is_delete" property="isDelete" /> |
| | | <result column="desc" property="desc" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.moral.api.entity.SysDictData"> |
| | | <id column="id" property="id" /> |
| | | <result column="parent_id" property="parentId" /> |
| | | <result column="dict_type_id" property="dictTypeId" /> |
| | | <result column="dataKey" property="dataKey" /> |
| | | <result column="dataValue" property="dataValue" /> |
| | | <result column="sort" property="sort" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="is_delete" property="isDelete" /> |
| | |
| | | <id column="id" property="id" /> |
| | | <result column="name" property="name" /> |
| | | <result column="desc" property="desc" /> |
| | | <result column="system" property="system" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="is_delete" property="isDelete" /> |
| | |
| | | TIME_FORMAT_INVALID(-18,"时间格式无效"), |
| | | TIME_INVALID(-19,"时间无效"), |
| | | GROUP_EXIST(-20, "组已存在"), |
| | | ROLE_IS_EXPIRE(-21, "用户名无效"), |
| | | ROLE_IS_NULL(-22, "密码无效"), |
| | | MENU_IS_EXPIRE(-23, "用户已过期"), |
| | | MENU_IS_NULL(-24, "组已存在"), |
| | | ROLE_IS_EXPIRE(-21, "该角色名不存在"), |
| | | ROLE_IS_NULL(-22, "角色不存在"), |
| | | MENU_IS_EXPIRE(-23, "该菜单名不存在"), |
| | | MENU_IS_NULL(-24, "菜单不存在"), |
| | | PARAMETERS_NOT_REQUIREMENT(-25, "参数不符合要求"), |
| | | DICTTYPE_NOT_EXIST(-26,"字典类型不存在"), |
| | | DICTTYPE_EXIST(-27,"字典类型已经存在"), |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | * </p> |
| | | * |
| | | * @author moral |
| | | * @since 2021-03-09 |
| | | * @since 2021-04-13 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 操作类型 |
| | | */ |
| | | private String type; |
| | | |
| | | /** |
| | | * 操作描述 |
| | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | private LocalDateTime createTime; |
| | | private Date createTime; |
| | | |
| | | |
| | | @Override |
| | |
| | | public Map<String, Object> updateRoleMenu(List list, int id) { |
| | | Map<String,Object> resultMap = new HashMap<>(); |
| | | List<ManageMenu> manageMenusOld = manageMenuMapper.getManageMenuByRoleId(id); |
| | | if (list.size()==0){ |
| | | resultMap.put("code",ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode()); |
| | | resultMap.put("msg",ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); |
| | | return resultMap; |
| | | } |
| | | QueryWrapper<ManageRoleMenu> wrapper = new QueryWrapper(); |
| | | wrapper.eq("role_id",id); |
| | | wrapper.eq("is_delete",0); |
| | | List<Map> result = manageRoleMenuMapper.getDataByMenuIds(list,id); |
| | | List<Map> result = new ArrayList<>(); |
| | | if (list.size()==0){ |
| | | result = result; |
| | | }else { |
| | | result = manageRoleMenuMapper.getDataByMenuIds(list,id); |
| | | } |
| | | List<Map> result1 = manageRoleMenuMapper.getDataByRoleId(id); |
| | | if (manageRoleMenuMapper.selectCount(wrapper)==0 || result.size()==0){ |
| | | List<Map> insertList = new ArrayList<>(); |
| | |
| | | map.put("menu_id",Integer.parseInt(temp.toString())); |
| | | insertList.add(map); |
| | | } |
| | | manageRoleMenuMapper.insertBatch(insertList); |
| | | if (insertList.size()!=0){ |
| | | manageRoleMenuMapper.insertBatch(insertList); |
| | | } |
| | | } |
| | | List updateList = new ArrayList(); |
| | | for (Map manageRoleMenu:result1) { |
| | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.moral.api.entity.UserLog"> |
| | | <id column="id" property="id" /> |
| | | <result column="type" property="type" /> |
| | | <result column="content" property="content" /> |
| | | <result column="organization_id" property="organizationId" /> |
| | | <result column="operate_id" property="operateId" /> |