From 7580baafef32d3c67c43b27c106f91dfaabcb570 Mon Sep 17 00:00:00 2001 From: lishangbu Date: Fri, 24 Dec 2021 20:26:25 +0800 Subject: [PATCH] =?UTF-8?q?:boom:=20Introducing=20breaking=20changes.?= =?UTF-8?q?=E4=BD=BF=E7=94=A8mybatis=20plus=E7=9A=84=E9=9B=AA=E8=8A=B1?= =?UTF-8?q?=E7=AE=97=E6=B3=95=E4=B8=BB=E9=94=AE=E7=AD=96=E7=95=A5=E4=BD=9C?= =?UTF-8?q?=E4=B8=BA=E9=BB=98=E8=AE=A4=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/v3.4.2->v.3.5.0.diff.sql | 47 +++++++++++++++++++ .../common/core/constant/CommonConstants.java | 2 +- .../pig/common/security/service/PigUser.java | 6 +-- .../common/security/util/SecurityUtils.java | 6 +-- .../pig4cloud/pig/admin/api/dto/RoleDTO.java | 2 +- .../pig4cloud/pig/admin/api/dto/UserDTO.java | 4 +- .../pig4cloud/pig/admin/api/dto/UserInfo.java | 2 +- .../pig/admin/api/entity/SysDept.java | 8 ++-- .../pig/admin/api/entity/SysDeptRelation.java | 6 ++- .../pig/admin/api/entity/SysDict.java | 5 +- .../pig/admin/api/entity/SysDictItem.java | 7 +-- .../pig/admin/api/entity/SysFile.java | 2 +- .../pig/admin/api/entity/SysLog.java | 2 +- .../pig/admin/api/entity/SysMenu.java | 6 +-- .../pig/admin/api/entity/SysRole.java | 4 +- .../pig/admin/api/entity/SysRoleMenu.java | 4 +- .../pig/admin/api/entity/SysUser.java | 6 +-- .../pig/admin/api/entity/SysUserRole.java | 4 +- .../admin/api/feign/RemoteDeptService.java | 2 +- .../admin/api/feign/RemoteUserService.java | 2 +- .../pig4cloud/pig/admin/api/vo/RoleVo.java | 2 +- .../pig/admin/api/vo/UserExcelVO.java | 2 +- .../pig/admin/api/vo/UserInfoVO.java | 2 +- .../pig4cloud/pig/admin/api/vo/UserVO.java | 4 +- .../pig/admin/controller/DeptController.java | 9 ++-- .../pig/admin/controller/DictController.java | 8 ++-- .../pig/admin/controller/MenuController.java | 14 +++--- .../pig/admin/controller/RoleController.java | 4 +- .../pig/admin/controller/UserController.java | 6 +-- .../admin/mapper/SysDeptRelationMapper.java | 2 +- .../pig/admin/mapper/SysMenuMapper.java | 2 +- .../pig/admin/mapper/SysRoleMapper.java | 2 +- .../pig/admin/mapper/SysUserMapper.java | 2 +- .../pig/admin/mapper/SysUserRoleMapper.java | 2 +- .../admin/service/SysDeptRelationService.java | 2 +- .../pig/admin/service/SysDeptService.java | 10 ++-- .../pig/admin/service/SysDictItemService.java | 2 +- .../pig/admin/service/SysDictService.java | 2 +- .../pig/admin/service/SysMenuService.java | 8 ++-- .../pig/admin/service/SysRoleMenuService.java | 2 +- .../pig/admin/service/SysRoleService.java | 2 +- .../pig/admin/service/SysUserService.java | 4 +- .../impl/SysDeptRelationServiceImpl.java | 2 +- .../service/impl/SysDeptServiceImpl.java | 23 +++++---- .../service/impl/SysDictItemServiceImpl.java | 2 +- .../service/impl/SysDictServiceImpl.java | 2 +- .../service/impl/SysMenuServiceImpl.java | 22 ++++----- .../service/impl/SysRoleMenuServiceImpl.java | 4 +- .../service/impl/SysRoleServiceImpl.java | 2 +- .../service/impl/SysUserServiceImpl.java | 14 +++--- .../main/resources/mapper/SysRoleMapper.xml | 25 +++++++--- .../pig/codegen/entity/GenDatasourceConf.java | 5 +- .../pig/codegen/entity/GenFormConf.java | 5 +- .../main/resources/template/Entity.java.vm | 3 +- 54 files changed, 198 insertions(+), 131 deletions(-) create mode 100644 db/v3.4.2->v.3.5.0.diff.sql diff --git a/db/v3.4.2->v.3.5.0.diff.sql b/db/v3.4.2->v.3.5.0.diff.sql new file mode 100644 index 00000000..4248e4c9 --- /dev/null +++ b/db/v3.4.2->v.3.5.0.diff.sql @@ -0,0 +1,47 @@ +SET FOREIGN_KEY_CHECKS=0; + +-- 核心库 +USE `pig`; + +ALTER TABLE `sys_dept` MODIFY COLUMN `dept_id` bigint NOT NULL FIRST; + +ALTER TABLE `sys_dept` MODIFY COLUMN `parent_id` bigint NULL DEFAULT NULL COMMENT '父节点' AFTER `del_flag`; + +ALTER TABLE `sys_dept_relation` MODIFY COLUMN `ancestor` bigint NOT NULL COMMENT '祖先节点' FIRST; + +ALTER TABLE `sys_dept_relation` MODIFY COLUMN `descendant` bigint NOT NULL COMMENT '后代节点' AFTER `ancestor`; + +ALTER TABLE `sys_dict` MODIFY COLUMN `id` bigint NOT NULL COMMENT '编号' FIRST; + +ALTER TABLE `sys_dict_item` MODIFY COLUMN `id` bigint NOT NULL COMMENT '编号' FIRST; + +ALTER TABLE `sys_dict_item` MODIFY COLUMN `dict_id` bigint NOT NULL COMMENT '字典ID' AFTER `id`; + +ALTER TABLE `sys_file` MODIFY COLUMN `id` bigint NOT NULL COMMENT '编号' FIRST; + +ALTER TABLE `sys_log` MODIFY COLUMN `id` bigint NOT NULL COMMENT '编号' FIRST; + +ALTER TABLE `sys_menu` MODIFY COLUMN `menu_id` bigint NOT NULL COMMENT '菜单ID' FIRST; + +ALTER TABLE `sys_role` MODIFY COLUMN `role_id` bigint NOT NULL FIRST; + +ALTER TABLE `sys_role_menu` MODIFY COLUMN `role_id` bigint NOT NULL COMMENT '角色ID' FIRST; + +ALTER TABLE `sys_role_menu` MODIFY COLUMN `menu_id` bigint NOT NULL COMMENT '菜单ID' AFTER `role_id`; + +ALTER TABLE `sys_user` MODIFY COLUMN `user_id` bigint NOT NULL COMMENT '主键ID' FIRST; + +ALTER TABLE `sys_user` MODIFY COLUMN `dept_id` bigint NULL DEFAULT NULL COMMENT '部门ID' AFTER `avatar`; + +ALTER TABLE `sys_user_role` MODIFY COLUMN `user_id` bigint NOT NULL COMMENT '用户ID' FIRST; + +ALTER TABLE `sys_user_role` MODIFY COLUMN `role_id` bigint NOT NULL COMMENT '角色ID' AFTER `user_id`; + +-- 代码生成器 +USE `pig_codegen`; + +ALTER TABLE `pig_codegen_backup`.`gen_datasource_conf` MODIFY COLUMN `id` bigint NOT NULL COMMENT '主键' FIRST; + +ALTER TABLE `pig_codegen_backup`.`gen_form_conf` MODIFY COLUMN `id` bigint NOT NULL COMMENT 'ID' FIRST; + +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file diff --git a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CommonConstants.java b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CommonConstants.java index d184d04e..c0e0b136 100644 --- a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CommonConstants.java +++ b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CommonConstants.java @@ -40,7 +40,7 @@ public interface CommonConstants { /** * 菜单树根节点 */ - Integer MENU_TREE_ROOT_ID = -1; + Long MENU_TREE_ROOT_ID = -1L; /** * 菜单 diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUser.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUser.java index ec0b9f55..5c7c4dbb 100755 --- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUser.java +++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUser.java @@ -32,13 +32,13 @@ public class PigUser extends User { * 用户ID */ @Getter - private final Integer id; + private final Long id; /** * 部门ID */ @Getter - private final Integer deptId; + private final Long deptId; /** * 手机号 @@ -46,7 +46,7 @@ public class PigUser extends User { @Getter private final String phone; - public PigUser(Integer id, Integer deptId, String username, String password, String phone, boolean enabled, + public PigUser(Long id, Long deptId, String username, String password, String phone, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection authorities) { super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities); diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/util/SecurityUtils.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/util/SecurityUtils.java index d10f2c80..292636ec 100755 --- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/util/SecurityUtils.java +++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/util/SecurityUtils.java @@ -69,15 +69,15 @@ public class SecurityUtils { * 获取用户角色信息 * @return 角色集合 */ - public List getRoles() { + public List getRoles() { Authentication authentication = getAuthentication(); Collection authorities = authentication.getAuthorities(); - List roleIds = new ArrayList<>(); + List roleIds = new ArrayList<>(); authorities.stream().filter(granted -> StrUtil.startWith(granted.getAuthority(), SecurityConstants.ROLE)) .forEach(granted -> { String id = StrUtil.removePrefix(granted.getAuthority(), SecurityConstants.ROLE); - roleIds.add(Integer.parseInt(id)); + roleIds.add(Long.parseLong(id)); }); return roleIds; } diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/RoleDTO.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/RoleDTO.java index 23960bff..5f5f0fdb 100755 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/RoleDTO.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/RoleDTO.java @@ -31,7 +31,7 @@ public class RoleDTO extends SysRole { /** * 角色部门Id */ - private Integer roleDeptId; + private Long roleDeptId; /** * 部门名称 diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/UserDTO.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/UserDTO.java index 40989b0f..90aa1e65 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/UserDTO.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/UserDTO.java @@ -33,9 +33,9 @@ public class UserDTO extends SysUser { /** * 角色ID */ - private List role; + private List role; - private Integer deptId; + private Long deptId; /** * 新密码 diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/UserInfo.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/UserInfo.java index 5773744d..d96f05d7 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/UserInfo.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/dto/UserInfo.java @@ -46,7 +46,7 @@ public class UserInfo implements Serializable { /** * 角色集合 */ - private Integer[] roles; + private Long[] roles; /** * 角色集合 diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDept.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDept.java index 6f547391..62b28500 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDept.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDept.java @@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.pig4cloud.pig.common.mybatis.base.BaseEntity; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -34,15 +35,16 @@ import javax.validation.constraints.NotBlank; * @author lengleng * @since 2019/2/1 */ +@ApiModel(value = "部门") @Data @EqualsAndHashCode(callSuper = true) public class SysDept extends BaseEntity { private static final long serialVersionUID = 1L; - @TableId(value = "dept_id", type = IdType.AUTO) + @TableId(value = "dept_id", type = IdType.ASSIGN_ID) @ApiModelProperty(value = "部门id") - private Integer deptId; + private Long deptId; /** * 部门名称 @@ -61,7 +63,7 @@ public class SysDept extends BaseEntity { * 父级部门id */ @ApiModelProperty(value = "父级部门id") - private Integer parentId; + private Long parentId; /** * 是否删除 -1:已删除 0:正常 diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDeptRelation.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDeptRelation.java index 4f9c0dcd..e68e55ef 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDeptRelation.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDeptRelation.java @@ -17,6 +17,7 @@ package com.pig4cloud.pig.admin.api.entity; import com.baomidou.mybatisplus.extension.activerecord.Model; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -29,6 +30,7 @@ import lombok.EqualsAndHashCode; * @author lengleng * @since 2019/2/1 */ +@ApiModel(value = "部门关系") @Data @EqualsAndHashCode(callSuper = true) public class SysDeptRelation extends Model { @@ -39,12 +41,12 @@ public class SysDeptRelation extends Model { * 祖先节点 */ @ApiModelProperty(value = "祖先节点") - private Integer ancestor; + private Long ancestor; /** * 后代节点 */ @ApiModelProperty(value = "后代节点") - private Integer descendant; + private Long descendant; } diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDict.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDict.java index 765aa17e..73254cb9 100755 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDict.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDict.java @@ -15,6 +15,7 @@ */ package com.pig4cloud.pig.admin.api.entity; +import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; @@ -40,9 +41,9 @@ public class SysDict extends BaseEntity { /** * 编号 */ - @TableId + @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "字典编号") - private Integer id; + private Long id; /** * 类型 diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDictItem.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDictItem.java index a4e7a46b..e83bf480 100755 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDictItem.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysDictItem.java @@ -15,6 +15,7 @@ */ package com.pig4cloud.pig.admin.api.entity; +import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.pig4cloud.pig.common.mybatis.base.BaseEntity; @@ -39,15 +40,15 @@ public class SysDictItem extends BaseEntity { /** * 编号 */ - @TableId + @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "字典项id") - private Integer id; + private Long id; /** * 所属字典类id */ @ApiModelProperty(value = "所属字典类id") - private Integer dictId; + private Long dictId; /** * 数据值 diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysFile.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysFile.java index d712ee15..78882a35 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysFile.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysFile.java @@ -39,7 +39,7 @@ public class SysFile extends BaseEntity { /** * 编号 */ - @TableId(type = IdType.AUTO) + @TableId(type = IdType.ASSIGN_ID) private Long id; /** diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysLog.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysLog.java index 5f8ca7a8..df3f5839 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysLog.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysLog.java @@ -47,7 +47,7 @@ public class SysLog extends BaseEntity { /** * 编号 */ - @TableId(value = "id", type = IdType.AUTO) + @TableId(value = "id", type = IdType.ASSIGN_ID) @ExcelProperty("日志编号") @ApiModelProperty(value = "日志编号") @JsonSerialize(using = ToStringSerializer.class) diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysMenu.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysMenu.java index b60d0caf..101bf48d 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysMenu.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysMenu.java @@ -44,9 +44,9 @@ public class SysMenu extends BaseEntity { /** * 菜单ID */ - @TableId(value = "menu_id", type = IdType.AUTO) + @TableId(value = "menu_id", type = IdType.ASSIGN_ID) @ApiModelProperty(value = "菜单id") - private Integer menuId; + private Long menuId; /** * 菜单名称 @@ -66,7 +66,7 @@ public class SysMenu extends BaseEntity { */ @NotNull(message = "菜单父ID不能为空") @ApiModelProperty(value = "菜单父id") - private Integer parentId; + private Long parentId; /** * 图标 diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysRole.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysRole.java index 50b2c6d1..8f595532 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysRole.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysRole.java @@ -40,9 +40,9 @@ public class SysRole extends BaseEntity { private static final long serialVersionUID = 1L; - @TableId(value = "role_id", type = IdType.AUTO) + @TableId(value = "role_id", type = IdType.ASSIGN_ID) @ApiModelProperty(value = "角色编号") - private Integer roleId; + private Long roleId; @NotBlank(message = "角色名称 不能为空") @ApiModelProperty(value = "角色名称") diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysRoleMenu.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysRoleMenu.java index 9c0d29f2..cf83e51f 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysRoleMenu.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysRoleMenu.java @@ -39,12 +39,12 @@ public class SysRoleMenu extends Model { * 角色ID */ @ApiModelProperty(value = "角色id") - private Integer roleId; + private Long roleId; /** * 菜单ID */ @ApiModelProperty(value = "菜单id") - private Integer menuId; + private Long menuId; } diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysUser.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysUser.java index b9b22508..7d23faba 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysUser.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysUser.java @@ -42,9 +42,9 @@ public class SysUser extends BaseEntity { /** * 主键ID */ - @TableId(value = "user_id", type = IdType.AUTO) + @TableId(value = "user_id", type = IdType.ASSIGN_ID) @ApiModelProperty(value = "主键id") - private Integer userId; + private Long userId; /** * 用户名 @@ -87,7 +87,7 @@ public class SysUser extends BaseEntity { * 部门ID */ @ApiModelProperty(value = "用户所属部门id") - private Integer deptId; + private Long deptId; /** * 0-正常,1-删除 diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysUserRole.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysUserRole.java index 9b3b8682..f901efad 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysUserRole.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysUserRole.java @@ -39,12 +39,12 @@ public class SysUserRole extends Model { * 用户ID */ @ApiModelProperty(value = "用户id") - private Integer userId; + private Long userId; /** * 角色ID */ @ApiModelProperty(value = "角色id") - private Integer roleId; + private Long roleId; } diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteDeptService.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteDeptService.java index 340e763c..2dee548b 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteDeptService.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteDeptService.java @@ -37,7 +37,7 @@ public interface RemoteDeptService { * @return 返回子级id列表 */ @GetMapping("/dept/child-id/{deptId}") - R> listChildDeptId(@PathVariable("deptId") Integer deptId, + R> listChildDeptId(@PathVariable("deptId") Long deptId, @RequestHeader(SecurityConstants.FROM) String from); } diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteUserService.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteUserService.java index 5a91b760..bfb354af 100755 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteUserService.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteUserService.java @@ -61,7 +61,7 @@ public interface RemoteUserService { * @return 用户 id 集合 */ @GetMapping("/user/ids") - R> listUserIdByDeptIds(@RequestParam("deptIds") Set deptIds, + R> listUserIdByDeptIds(@RequestParam("deptIds") Set deptIds, @RequestHeader(SecurityConstants.FROM) String from); } diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/RoleVo.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/RoleVo.java index 783093db..0475127c 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/RoleVo.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/RoleVo.java @@ -30,7 +30,7 @@ public class RoleVo { /** * 角色id */ - private Integer roleId; + private Long roleId; /** * 菜单列表 diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/UserExcelVO.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/UserExcelVO.java index 5c0c5cf2..06e254b0 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/UserExcelVO.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/UserExcelVO.java @@ -24,7 +24,7 @@ public class UserExcelVO implements Serializable { * 主键ID */ @ExcelProperty("用户编号") - private Integer userId; + private Long userId; /** * 用户名 diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/UserInfoVO.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/UserInfoVO.java index ab1451ce..32195cc4 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/UserInfoVO.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/UserInfoVO.java @@ -44,6 +44,6 @@ public class UserInfoVO implements Serializable { /** * 角色集合 */ - private Integer[] roles; + private Long[] roles; } diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/UserVO.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/UserVO.java index b030955f..f6d4ef33 100644 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/UserVO.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/vo/UserVO.java @@ -35,7 +35,7 @@ public class UserVO implements Serializable { /** * 主键ID */ - private Integer userId; + private Long userId; /** * 用户名 @@ -85,7 +85,7 @@ public class UserVO implements Serializable { /** * 部门ID */ - private Integer deptId; + private Long deptId; /** * 部门名称 diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/DeptController.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/DeptController.java index 9dd62e37..9f2bd284 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/DeptController.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/DeptController.java @@ -51,8 +51,8 @@ public class DeptController { * @param id ID * @return SysDept */ - @GetMapping("/{id}") - public R getById(@PathVariable Integer id) { + @GetMapping("/{id:\\d+}") + public R getById(@PathVariable Long id) { return R.ok(sysDeptService.getById(id)); } @@ -94,7 +94,7 @@ public class DeptController { @SysLog("删除部门") @DeleteMapping("/{id}") @PreAuthorize("@pms.hasPermission('sys_dept_del')") - public R removeById(@PathVariable Integer id) { + public R removeById(@PathVariable Long id) { return R.ok(sysDeptService.removeDeptById(id)); } @@ -107,7 +107,6 @@ public class DeptController { @PutMapping @PreAuthorize("@pms.hasPermission('sys_dept_edit')") public R update(@Valid @RequestBody SysDept sysDept) { - sysDept.setUpdateTime(LocalDateTime.now()); return R.ok(sysDeptService.updateDeptById(sysDept)); } @@ -129,7 +128,7 @@ public class DeptController { */ @Inner @GetMapping(value = "/child-id/{deptId}") - public R> listChildDeptId(@PathVariable Integer deptId) { + public R> listChildDeptId(@PathVariable Long deptId) { return R.ok(sysDeptService.listChildDeptId(deptId)); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/DictController.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/DictController.java index 80a08d11..ddbaefa3 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/DictController.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/DictController.java @@ -59,7 +59,7 @@ public class DictController { * @return 字典信息 */ @GetMapping("/{id}") - public R getById(@PathVariable Integer id) { + public R getById(@PathVariable Long id) { return R.ok(sysDictService.getById(id)); } @@ -104,7 +104,7 @@ public class DictController { @SysLog("删除字典") @DeleteMapping("/{id}") @PreAuthorize("@pms.hasPermission('sys_dict_del')") - public R removeById(@PathVariable Integer id) { + public R removeById(@PathVariable Long id) { sysDictService.removeDict(id); return R.ok(); } @@ -139,7 +139,7 @@ public class DictController { * @return R */ @GetMapping("/item/{id}") - public R getDictItemById(@PathVariable("id") Integer id) { + public R getDictItemById(@PathVariable("id") Long id) { return R.ok(sysDictItemService.getById(id)); } @@ -174,7 +174,7 @@ public class DictController { */ @SysLog("删除字典项") @DeleteMapping("/item/{id}") - public R removeDictItemById(@PathVariable Integer id) { + public R removeDictItemById(@PathVariable Long id) { sysDictItemService.removeDictItem(id); return R.ok(); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java index eda0cc43..1138e7e2 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java @@ -49,7 +49,7 @@ public class MenuController { * @return 当前用户的树形菜单 */ @GetMapping - public R getUserMenu(Integer parentId) { + public R getUserMenu(Long parentId) { // 获取符合条件的菜单 Set menuSet = SecurityUtils.getRoles().stream().map(sysMenuService::findMenuByRoleId) .flatMap(Collection::stream).collect(Collectors.toSet()); @@ -63,7 +63,7 @@ public class MenuController { * @return 树形菜单 */ @GetMapping(value = "/tree") - public R getTree(boolean lazy, Integer parentId) { + public R getTree(boolean lazy, Long parentId) { return R.ok(sysMenuService.treeMenu(lazy, parentId)); } @@ -73,7 +73,7 @@ public class MenuController { * @return 属性集合 */ @GetMapping("/tree/{roleId}") - public R getRoleTree(@PathVariable Integer roleId) { + public R getRoleTree(@PathVariable Long roleId) { return R.ok( sysMenuService.findMenuByRoleId(roleId).stream().map(SysMenu::getMenuId).collect(Collectors.toList())); } @@ -83,8 +83,8 @@ public class MenuController { * @param id 菜单ID * @return 菜单详细信息 */ - @GetMapping("/{id}") - public R getById(@PathVariable Integer id) { + @GetMapping("/{id:\\d+}") + public R getById(@PathVariable Long id) { return R.ok(sysMenuService.getById(id)); } @@ -107,9 +107,9 @@ public class MenuController { * @return success/false */ @SysLog("删除菜单") - @DeleteMapping("/{id}") + @DeleteMapping("/{id:\\d+}") @PreAuthorize("@pms.hasPermission('sys_menu_del')") - public R removeById(@PathVariable Integer id) { + public R removeById(@PathVariable Long id) { return R.ok(sysMenuService.removeMenuById(id)); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/RoleController.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/RoleController.java index 1abb38b4..4eb41cb3 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/RoleController.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/RoleController.java @@ -51,7 +51,7 @@ public class RoleController { * @return 角色信息 */ @GetMapping("/{id}") - public R getById(@PathVariable Integer id) { + public R getById(@PathVariable Long id) { return R.ok(sysRoleService.getById(id)); } @@ -87,7 +87,7 @@ public class RoleController { @SysLog("删除角色") @DeleteMapping("/{id}") @PreAuthorize("@pms.hasPermission('sys_role_del')") - public R removeById(@PathVariable Integer id) { + public R removeById(@PathVariable Long id) { return R.ok(sysRoleService.removeRoleById(id)); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/UserController.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/UserController.java index 79ce6d82..e052d6b9 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/UserController.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/UserController.java @@ -93,7 +93,7 @@ public class UserController { */ @Inner @GetMapping("/ids") - public R> listUserIdByDeptIds(@RequestParam("deptIds") Set deptIds) { + public R> listUserIdByDeptIds(@RequestParam("deptIds") Set deptIds) { return R.ok(userService.listUserIdByDeptIds(deptIds)); } @@ -103,7 +103,7 @@ public class UserController { * @return 用户信息 */ @GetMapping("/{id}") - public R user(@PathVariable Integer id) { + public R user(@PathVariable Long id) { return R.ok(userService.getUserVoById(id)); } @@ -127,7 +127,7 @@ public class UserController { @SysLog("删除用户信息") @DeleteMapping("/{id}") @PreAuthorize("@pms.hasPermission('sys_user_del')") - public R userDel(@PathVariable Integer id) { + public R userDel(@PathVariable Long id) { SysUser sysUser = userService.getById(id); return R.ok(userService.removeUserById(sysUser)); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysDeptRelationMapper.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysDeptRelationMapper.java index 4e44346c..ed1dd96d 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysDeptRelationMapper.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysDeptRelationMapper.java @@ -41,7 +41,7 @@ public interface SysDeptRelationMapper extends BaseMapper { * 删除部门节点关系,同时删除所有关联此部门子节点的部门关系 * @param id 待删除的部门节点ID */ - void deleteDeptRelationsById(Integer id); + void deleteDeptRelationsById(Long id); /** * 新增部门节点关系 diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysMenuMapper.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysMenuMapper.java index 3d45e9d5..f4312bf1 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysMenuMapper.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysMenuMapper.java @@ -38,6 +38,6 @@ public interface SysMenuMapper extends BaseMapper { * @param roleId 角色ID * @return */ - Set listMenusByRoleId(Integer roleIds); + Set listMenusByRoleId(Long roleIds); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysRoleMapper.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysRoleMapper.java index 2c9ec2d2..6779e35a 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysRoleMapper.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysRoleMapper.java @@ -38,6 +38,6 @@ public interface SysRoleMapper extends BaseMapper { * @param userId * @return */ - List listRolesByUserId(Integer userId); + List listRolesByUserId(Long userId); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysUserMapper.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysUserMapper.java index cd68cbf4..0c22c826 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysUserMapper.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysUserMapper.java @@ -58,7 +58,7 @@ public interface SysUserMapper extends BaseMapper { * @param id 用户ID * @return userVo */ - UserVO getUserVoById(Integer id); + UserVO getUserVoById(Long id); /** * 查询用户列表 diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysUserRoleMapper.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysUserRoleMapper.java index 95b44ef5..e0de4b70 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysUserRoleMapper.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysUserRoleMapper.java @@ -39,6 +39,6 @@ public interface SysUserRoleMapper extends BaseMapper { * @author 寻欢·李 * @date 2017年12月7日 16:31:38 */ - Boolean deleteByUserId(@Param("userId") Integer userId); + Boolean deleteByUserId(@Param("userId") Long userId); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDeptRelationService.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDeptRelationService.java index f1a601a5..72cbb950 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDeptRelationService.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDeptRelationService.java @@ -40,7 +40,7 @@ public interface SysDeptRelationService extends IService { * 通过ID删除部门关系 * @param id */ - void removeDeptRelationById(Integer id); + void removeDeptRelationById(Long id); /** * 更新部门关系 diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDeptService.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDeptService.java index 8329e9b9..2005be34 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDeptService.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDeptService.java @@ -36,13 +36,13 @@ public interface SysDeptService extends IService { * 查询部门树菜单 * @return 树 */ - List> listDeptTrees(); + List> listDeptTrees(); /** * 查询用户部门树 * @return */ - List> listCurrentUserDeptTrees(); + List> listCurrentUserDeptTrees(); /** * 添加信息部门 @@ -56,7 +56,7 @@ public interface SysDeptService extends IService { * @param id 部门 ID * @return 成功、失败 */ - Boolean removeDeptById(Integer id); + Boolean removeDeptById(Long id); /** * 更新部门 @@ -68,8 +68,8 @@ public interface SysDeptService extends IService { /** * 查找指定部门的子部门id列表 * @param deptId 部门id - * @return List + * @return List */ - List listChildDeptId(Integer deptId); + List listChildDeptId(Long deptId); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDictItemService.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDictItemService.java index 831d8bbe..d9af4afe 100755 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDictItemService.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDictItemService.java @@ -31,7 +31,7 @@ public interface SysDictItemService extends IService { * @param id 字典项ID * @return */ - void removeDictItem(Integer id); + void removeDictItem(Long id); /** * 更新字典项 diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDictService.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDictService.java index 98eeb5f0..006ff466 100755 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDictService.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDictService.java @@ -31,7 +31,7 @@ public interface SysDictService extends IService { * @param id * @return */ - void removeDict(Integer id); + void removeDict(Long id); /** * 更新字典 diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysMenuService.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysMenuService.java index ecea1fca..7519d802 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysMenuService.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysMenuService.java @@ -38,14 +38,14 @@ public interface SysMenuService extends IService { * @param roleId 角色ID * @return 菜单列表 */ - Set findMenuByRoleId(Integer roleId); + Set findMenuByRoleId(Long roleId); /** * 级联删除菜单 * @param id 菜单ID * @return true成功, false失败 */ - Boolean removeMenuById(Integer id); + Boolean removeMenuById(Long id); /** * 更新菜单信息 @@ -60,7 +60,7 @@ public interface SysMenuService extends IService { * @param parentId 父节点ID * @return */ - List> treeMenu(boolean lazy, Integer parentId); + List> treeMenu(boolean lazy, Long parentId); /** * 查询菜单 @@ -68,6 +68,6 @@ public interface SysMenuService extends IService { * @param parentId * @return */ - List> filterMenu(Set menuSet, Integer parentId); + List> filterMenu(Set menuSet, Long parentId); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysRoleMenuService.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysRoleMenuService.java index f20bafcc..16592347 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysRoleMenuService.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysRoleMenuService.java @@ -36,6 +36,6 @@ public interface SysRoleMenuService extends IService { * @param menuIds 菜单ID拼成的字符串,每个id之间根据逗号分隔 * @return */ - Boolean saveRoleMenus(String role, Integer roleId, String menuIds); + Boolean saveRoleMenus(String role, Long roleId, String menuIds); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysRoleService.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysRoleService.java index 1e82c1cd..bad70caf 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysRoleService.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysRoleService.java @@ -34,6 +34,6 @@ public interface SysRoleService extends IService { * @param id * @return */ - Boolean removeRoleById(Integer id); + Boolean removeRoleById(Long id); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysUserService.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysUserService.java index 799c0c80..01902623 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysUserService.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysUserService.java @@ -77,7 +77,7 @@ public interface SysUserService extends IService { * @param id 用户ID * @return 用户信息 */ - UserVO getUserVoById(Integer id); + UserVO getUserVoById(Long id); /** * 查询上级部门的用户信息 @@ -113,6 +113,6 @@ public interface SysUserService extends IService { * @param deptIds 部门 id 列表 * @return userIdList */ - List listUserIdByDeptIds(Set deptIds); + List listUserIdByDeptIds(Set deptIds); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDeptRelationServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDeptRelationServiceImpl.java index 2ca4c3be..f777a585 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDeptRelationServiceImpl.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDeptRelationServiceImpl.java @@ -75,7 +75,7 @@ public class SysDeptRelationServiceImpl extends ServiceImpl impl */ @Override @Transactional(rollbackFor = Exception.class) - public Boolean removeDeptById(Integer id) { + public Boolean removeDeptById(Long id) { // 级联删除部门 - List idList = sysDeptRelationService + List idList = sysDeptRelationService .list(Wrappers.query().lambda().eq(SysDeptRelation::getAncestor, id)).stream() .map(SysDeptRelation::getDescendant).collect(Collectors.toList()); @@ -106,7 +106,7 @@ public class SysDeptServiceImpl extends ServiceImpl impl } @Override - public List listChildDeptId(Integer deptId) { + public List listChildDeptId(Long deptId) { List deptRelations = sysDeptRelationService.list(Wrappers.lambdaQuery() .eq(SysDeptRelation::getAncestor, deptId).ne(SysDeptRelation::getDescendant, deptId)); if (CollUtil.isNotEmpty(deptRelations)) { @@ -120,7 +120,7 @@ public class SysDeptServiceImpl extends ServiceImpl impl * @return 树 */ @Override - public List> listDeptTrees() { + public List> listDeptTrees() { return getDeptTree(this.list(Wrappers.emptyWrapper())); } @@ -129,9 +129,9 @@ public class SysDeptServiceImpl extends ServiceImpl impl * @return */ @Override - public List> listCurrentUserDeptTrees() { - Integer deptId = SecurityUtils.getUser().getDeptId(); - List descendantIdList = sysDeptRelationService + public List> listCurrentUserDeptTrees() { + Long deptId = SecurityUtils.getUser().getDeptId(); + List descendantIdList = sysDeptRelationService .list(Wrappers.query().lambda().eq(SysDeptRelation::getAncestor, deptId)).stream() .map(SysDeptRelation::getDescendant).collect(Collectors.toList()); @@ -144,11 +144,10 @@ public class SysDeptServiceImpl extends ServiceImpl impl * @param depts 部门 * @return */ - private List> getDeptTree(List depts) { - List> collect = depts.stream() - .filter(dept -> dept.getDeptId().intValue() != dept.getParentId()) + private List> getDeptTree(List depts) { + List> collect = depts.stream().filter(dept -> dept.getDeptId().intValue() != dept.getParentId()) .sorted(Comparator.comparingInt(SysDept::getSort)).map(dept -> { - TreeNode treeNode = new TreeNode(); + TreeNode treeNode = new TreeNode(); treeNode.setId(dept.getDeptId()); treeNode.setParentId(dept.getParentId()); treeNode.setName(dept.getName()); @@ -160,7 +159,7 @@ public class SysDeptServiceImpl extends ServiceImpl impl return treeNode; }).collect(Collectors.toList()); - return TreeUtil.build(collect, 0); + return TreeUtil.build(collect, 0L); } } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDictItemServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDictItemServiceImpl.java index d2079732..e659c39a 100755 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDictItemServiceImpl.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDictItemServiceImpl.java @@ -47,7 +47,7 @@ public class SysDictItemServiceImpl extends ServiceImpl impl @Override @Transactional(rollbackFor = Exception.class) @CacheEvict(value = CacheConstants.DICT_DETAILS, allEntries = true) - public void removeDict(Integer id) { + public void removeDict(Long id) { SysDict dict = this.getById(id); // 系统内置 Assert.state(!DictTypeEnum.SYSTEM.getType().equals(dict.getSystem()), "系统内置字典项目不能删除"); diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java index bdbcb8bb..ecefa2a0 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java @@ -62,7 +62,7 @@ public class SysMenuServiceImpl extends ServiceImpl impl @Override @Cacheable(value = CacheConstants.MENU_DETAILS, key = "#roleId + '_menu'", unless = "#result == null") - public Set findMenuByRoleId(Integer roleId) { + public Set findMenuByRoleId(Long roleId) { return baseMapper.listMenusByRoleId(roleId); } @@ -74,7 +74,7 @@ public class SysMenuServiceImpl extends ServiceImpl impl @Override @Transactional(rollbackFor = Exception.class) @CacheEvict(value = CacheConstants.MENU_DETAILS, allEntries = true) - public Boolean removeMenuById(Integer id) { + public Boolean removeMenuById(Long id) { // 查询父节点为当前节点的节点 List menuList = this.list(Wrappers.query().lambda().eq(SysMenu::getParentId, id)); @@ -98,18 +98,18 @@ public class SysMenuServiceImpl extends ServiceImpl impl * @return */ @Override - public List> treeMenu(boolean lazy, Integer parentId) { + public List> treeMenu(boolean lazy, Long parentId) { if (!lazy) { - List> collect = baseMapper + List> collect = baseMapper .selectList(Wrappers.lambdaQuery().orderByAsc(SysMenu::getSort)).stream() .map(getNodeFunction()).collect(Collectors.toList()); return TreeUtil.build(collect, CommonConstants.MENU_TREE_ROOT_ID); } - Integer parent = parentId == null ? CommonConstants.MENU_TREE_ROOT_ID : parentId; + Long parent = parentId == null ? CommonConstants.MENU_TREE_ROOT_ID : parentId; - List> collect = baseMapper + List> collect = baseMapper .selectList( Wrappers.lambdaQuery().eq(SysMenu::getParentId, parent).orderByAsc(SysMenu::getSort)) .stream().map(getNodeFunction()).collect(Collectors.toList()); @@ -124,18 +124,18 @@ public class SysMenuServiceImpl extends ServiceImpl impl * @return */ @Override - public List> filterMenu(Set all, Integer parentId) { - List> collect = all.stream() + public List> filterMenu(Set all, Long parentId) { + List> collect = all.stream() .filter(menu -> MenuTypeEnum.LEFT_MENU.getType().equals(menu.getType())) .filter(menu -> StrUtil.isNotBlank(menu.getPath())).map(getNodeFunction()).collect(Collectors.toList()); - Integer parent = parentId == null ? CommonConstants.MENU_TREE_ROOT_ID : parentId; + Long parent = parentId == null ? CommonConstants.MENU_TREE_ROOT_ID : parentId; return TreeUtil.build(collect, parent); } @NotNull - private Function> getNodeFunction() { + private Function> getNodeFunction() { return menu -> { - TreeNode node = new TreeNode<>(); + TreeNode node = new TreeNode<>(); node.setId(menu.getMenuId()); node.setName(menu.getName()); node.setParentId(menu.getParentId()); diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysRoleMenuServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysRoleMenuServiceImpl.java index 43cfc9fc..0ba1cdb7 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysRoleMenuServiceImpl.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysRoleMenuServiceImpl.java @@ -55,7 +55,7 @@ public class SysRoleMenuServiceImpl extends ServiceImplquery().lambda().eq(SysRoleMenu::getRoleId, roleId)); if (StrUtil.isBlank(menuIds)) { @@ -64,7 +64,7 @@ public class SysRoleMenuServiceImpl extends ServiceImpl roleMenuList = Arrays.stream(menuIds.split(StrUtil.COMMA)).map(menuId -> { SysRoleMenu roleMenu = new SysRoleMenu(); roleMenu.setRoleId(roleId); - roleMenu.setMenuId(Integer.valueOf(menuId)); + roleMenu.setMenuId(Long.valueOf(menuId)); return roleMenu; }).collect(Collectors.toList()); diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysRoleServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysRoleServiceImpl.java index 0829dbb4..bbadc384 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysRoleServiceImpl.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysRoleServiceImpl.java @@ -51,7 +51,7 @@ public class SysRoleServiceImpl extends ServiceImpl impl @Override @Transactional(rollbackFor = Exception.class) @CacheEvict(value = CacheConstants.MENU_DETAILS, allEntries = true) - public Boolean removeRoleById(Integer id) { + public Boolean removeRoleById(Long id) { sysRoleMenuMapper.delete(Wrappers.update().lambda().eq(SysRoleMenu::getRoleId, id)); return this.removeById(id); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java index 3864f033..e7834917 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java @@ -108,8 +108,8 @@ public class SysUserServiceImpl extends ServiceImpl impl List roleList = sysRoleMapper.listRolesByUserId(sysUser.getUserId()); userInfo.setRoleList(roleList); // 设置角色列表 (ID) - List roleIds = roleList.stream().map(SysRole::getRoleId).collect(Collectors.toList()); - userInfo.setRoles(ArrayUtil.toArray(roleIds, Integer.class)); + List roleIds = roleList.stream().map(SysRole::getRoleId).collect(Collectors.toList()); + userInfo.setRoles(ArrayUtil.toArray(roleIds, Long.class)); // 设置权限列表(menu.permission) Set permissions = roleIds.stream().map(sysMenuService::findMenuByRoleId).flatMap(Collection::stream) .filter(m -> MenuTypeEnum.BUTTON.getType().equals(m.getType())).map(SysMenu::getPermission) @@ -136,7 +136,7 @@ public class SysUserServiceImpl extends ServiceImpl impl * @return 用户信息 */ @Override - public UserVO getUserVoById(Integer id) { + public UserVO getUserVoById(Long id) { return baseMapper.getUserVoById(id); } @@ -208,7 +208,7 @@ public class SysUserServiceImpl extends ServiceImpl impl return null; } - Integer parentId = sysDept.getParentId(); + Long parentId = sysDept.getParentId(); return this.list(Wrappers.query().lambda().eq(SysUser::getDeptId, parentId)); } @@ -295,10 +295,10 @@ public class SysUserServiceImpl extends ServiceImpl impl } @Override - public List listUserIdByDeptIds(Set deptIds) { + public List listUserIdByDeptIds(Set deptIds) { return this.listObjs( Wrappers.lambdaQuery(SysUser.class).select(SysUser::getUserId).in(SysUser::getDeptId, deptIds), - Integer.class::cast); + Long.class::cast); } /** @@ -313,7 +313,7 @@ public class SysUserServiceImpl extends ServiceImpl impl // 根据部门名称查询部门ID userDTO.setDeptId(deptOptional.get().getDeptId()); // 根据角色名称查询角色ID - List roleIdList = roleCollList.stream().map(SysRole::getRoleId).collect(Collectors.toList()); + List roleIdList = roleCollList.stream().map(SysRole::getRoleId).collect(Collectors.toList()); userDTO.setRole(roleIdList); // 插入用户 this.saveUser(userDTO); diff --git a/pig-upms/pig-upms-biz/src/main/resources/mapper/SysRoleMapper.xml b/pig-upms/pig-upms-biz/src/main/resources/mapper/SysRoleMapper.xml index 9b9d3931..7e2038fd 100644 --- a/pig-upms/pig-upms-biz/src/main/resources/mapper/SysRoleMapper.xml +++ b/pig-upms/pig-upms-biz/src/main/resources/mapper/SysRoleMapper.xml @@ -17,7 +17,6 @@ - @@ -27,13 +26,27 @@ + + + + + SELECT r.role_id, + r.role_name, + r.role_code, + r.role_desc, + r.del_flag, + r.create_time, + r.update_time, + r.update_by, + r.create_by + FROM sys_role r, + sys_user_role ur + WHERE r.role_id = ur.role_id + AND r.del_flag = 0 + and ur.user_id = #{userId} + diff --git a/pig-visual/pig-codegen/src/main/java/com/pig4cloud/pig/codegen/entity/GenDatasourceConf.java b/pig-visual/pig-codegen/src/main/java/com/pig4cloud/pig/codegen/entity/GenDatasourceConf.java index 8185b28a..caec1e5c 100755 --- a/pig-visual/pig-codegen/src/main/java/com/pig4cloud/pig/codegen/entity/GenDatasourceConf.java +++ b/pig-visual/pig-codegen/src/main/java/com/pig4cloud/pig/codegen/entity/GenDatasourceConf.java @@ -15,6 +15,7 @@ */ package com.pig4cloud.pig.codegen.entity; +import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; @@ -36,8 +37,8 @@ public class GenDatasourceConf extends BaseEntity { /** * 主键 */ - @TableId - private Integer id; + @TableId(type = IdType.ASSIGN_ID) + private Long id; /** * 名称 diff --git a/pig-visual/pig-codegen/src/main/java/com/pig4cloud/pig/codegen/entity/GenFormConf.java b/pig-visual/pig-codegen/src/main/java/com/pig4cloud/pig/codegen/entity/GenFormConf.java index 769f5e76..f51aecf0 100755 --- a/pig-visual/pig-codegen/src/main/java/com/pig4cloud/pig/codegen/entity/GenFormConf.java +++ b/pig-visual/pig-codegen/src/main/java/com/pig4cloud/pig/codegen/entity/GenFormConf.java @@ -16,6 +16,7 @@ package com.pig4cloud.pig.codegen.entity; +import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.pig4cloud.pig.common.mybatis.base.BaseEntity; @@ -39,9 +40,9 @@ public class GenFormConf extends BaseEntity { /** * ID */ - @TableId + @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "ID") - private Integer id; + private Long id; /** * 表名称 diff --git a/pig-visual/pig-codegen/src/main/resources/template/Entity.java.vm b/pig-visual/pig-codegen/src/main/resources/template/Entity.java.vm index c6c14b04..ffef6066 100755 --- a/pig-visual/pig-codegen/src/main/resources/template/Entity.java.vm +++ b/pig-visual/pig-codegen/src/main/resources/template/Entity.java.vm @@ -17,6 +17,7 @@ #set($excludeColumns = ["create_time","update_time","create_by","update_by"]) package ${package}.${moduleName}.entity; +import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.pig4cloud.pig.common.mybatis.base.BaseEntity; @@ -47,7 +48,7 @@ public class ${className} extends BaseEntity { * $column.comments */ #if($column.columnName == $pk.columnName) - @TableId + @TableId(type = IdType.ASSIGN_ID) #end @ApiModelProperty(value="$column.comments"#if($column.hidden),hidden=$column.hidden#end) private $column.attrType $column.lowerAttrName;