| | |
| | | * 超级管理员 |
| | | */ |
| | | public static final String ROLE_SUPER_NAME = "超级管理员"; |
| | | public static final Long ROLE_SUPER_NAME_ID = 1L; |
| | | |
| | | /** |
| | | * 普通管理员(没有菜单管理权限和公司管理权限) |
| | | */ |
| | | public static final String ROLE_ADMIN_NAME = "普通管理员"; |
| | | public static final Long ROLE_ADMIN_NAME_ID = 6L; |
| | | |
| | | //角色名称 |
| | | private String roleName; |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private String roleName; |
| | | |
| | | @TableField(exist = false) |
| | | private Long roleId; |
| | | } |
| | |
| | | long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId(); |
| | | if(companyId > UserEntity.USER_BELONG_TOP){ |
| | | userEntity.setCompanyId(companyId); |
| | | userEntity.setRoleName(RoleEntity.ROLE_ADMIN_NAME); |
| | | userEntity.setRoleId(RoleEntity.ROLE_ADMIN_NAME_ID); |
| | | }else if(companyId == UserEntity.USER_BELONG_TOP){ |
| | | userEntity.setRoleName(RoleEntity.ROLE_SUPER_NAME); |
| | | userEntity.setRoleId(RoleEntity.ROLE_SUPER_NAME_ID); |
| | | } |
| | | if(StrUtil.isNotEmpty(adminUserDto.getUsername())){ |
| | | userEntity.setUsername(adminUserDto.getUsername()); |
| | |
| | | <where> |
| | | and a.id not in ( |
| | | SELECT b.user_id FROM t_user_role b |
| | | WHERE b.role_id in ( SELECT id FROM t_role WHERE role_name = #{record.roleName}) |
| | | WHERE b.role_id in ( SELECT id FROM t_role WHERE role_id = #{record.roleId}) |
| | | ) |
| | | <if test="record != null" > |
| | | <if test="record.username!=null"> |