Explorar el Código

feat: 增加事业部系统管理员

shc hace 9 meses
padre
commit
72bb37ef2f

+ 7 - 2
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/SysRoleController.java

@@ -170,9 +170,14 @@ public class SysRoleController {
         // 获取当前登陆用户的角色列表
         List<Integer> rolesIdList = SecurityUtils.getRoles();
 
-        // 平台管理员
         LambdaQueryWrapper<SysRole> queryWrapper = Wrappers.lambdaQuery();
-        if (rolesIdList.contains(2)) {
+        // 事业部系统管理员
+        if (rolesIdList.contains(50)) {
+            List<Integer> bizSysAdminIgnoreRoleIds = Stream.of(1, 2).collect(Collectors.toList());
+            queryWrapper.notIn(SysRole::getRoleId, bizSysAdminIgnoreRoleIds).orderByAsc(SysRole::getRoleId);
+        }
+        // 平台管理员
+        else if (rolesIdList.contains(2)) {
             queryWrapper.ne(SysRole::getRoleId, 1).orderByAsc(SysRole::getRoleId);
         } else if (rolesIdList.contains(1)) {
             queryWrapper.orderByAsc(SysRole::getRoleId);