Sfoglia il codice sorgente

fix: update something

shc 9 mesi fa
parent
commit
02ee060f36

+ 28 - 23
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/SysUserServiceImpl.java

@@ -751,9 +751,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 
         if (SecurityUtils.getRoles().contains(1)) {
             return baseMapper.getUserVosPage(page, userDTO, new DataScope());
-        } else if (SecurityUtils.getRoles().contains(2) || SecurityUtils.getRoles().contains(35)) {
+        }
+        else if (SecurityUtils.getRoles().contains(2) /*|| SecurityUtils.getRoles().contains(35)*/) {
             // 人数据权限
-            List<Integer> bcRoles = Stream.of(2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 19, 31, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49).collect(Collectors.toList());
+            List<Integer> bcRoles = Stream.of(2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 19, 31, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50).collect(Collectors.toList());
             if (CollUtil.isNotEmpty(userDTO.getRole())) {
                 Collection<Integer> intersection = CollUtil.intersectionDistinct(bcRoles, userDTO.getRole());
                 if (CollUtil.isEmpty(intersection)) {
@@ -764,27 +765,31 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
                 userDTO.setRole(bcRoles);
             }
             return baseMapper.getUserVosPage(page, userDTO, new DataScope());
-        } else if (SecurityUtils.getRoles().contains(19)) {
-            // CSM只能查看自己维护的企业下的用户, 以及下属维护的企业下的用户
-            Integer userId = SecurityUtils.getUser().getId();
-            // 递归查询下属关联的userId
-            Set<Integer> allUserIds = sysCsmUserRelationService.recurseCsmLowerUserId(Collections.singleton(userId), new AtomicInteger(10));
-            userDTO.setCsmUserIdList(allUserIds);
-            return baseMapper.getUserVosPage(page, userDTO, new DataScope());
-        } else if (SecurityUtils.getRoles().contains(35)) {
-            // BC总负责人数据权限
-            List<Integer> bcRoles = Stream.of(3, 4, 5, 6, 7, 9, 10, 11, 13, 19, 31, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 ,48, 49).collect(Collectors.toList());
-            if (CollUtil.isNotEmpty(userDTO.getRole())) {
-                Collection<Integer> intersection = CollUtil.intersectionDistinct(bcRoles, userDTO.getRole());
-                if (CollUtil.isEmpty(intersection)) {
-                    return page;
-                }
-                userDTO.setRole(new ArrayList<>(intersection));
-            } else {
-                userDTO.setRole(bcRoles);
-            }
-            return baseMapper.getUserVosPage(page, userDTO, new DataScope());
-        } else if (SecurityUtils.getRoles().contains(47)) {
+        }
+        // else if (SecurityUtils.getRoles().contains(19)) {
+        //     // CSM只能查看自己维护的企业下的用户, 以及下属维护的企业下的用户
+        //     Integer userId = SecurityUtils.getUser().getId();
+        //     // 递归查询下属关联的userId
+        //     Set<Integer> allUserIds = sysCsmUserRelationService.recurseCsmLowerUserId(Collections.singleton(userId), new AtomicInteger(10));
+        //     userDTO.setCsmUserIdList(allUserIds);
+        //     return baseMapper.getUserVosPage(page, userDTO, new DataScope());
+        // } else if (SecurityUtils.getRoles().contains(35)) {
+        //     // BC总负责人数据权限
+        //     List<Integer> bcRoles = Stream.of(3, 4, 5, 6, 7, 9, 10, 11, 13, 19, 31, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 ,48, 49).collect(Collectors.toList());
+        //     if (CollUtil.isNotEmpty(userDTO.getRole())) {
+        //         Collection<Integer> intersection = CollUtil.intersectionDistinct(bcRoles, userDTO.getRole());
+        //         if (CollUtil.isEmpty(intersection)) {
+        //             return page;
+        //         }
+        //         userDTO.setRole(new ArrayList<>(intersection));
+        //     } else {
+        //         userDTO.setRole(bcRoles);
+        //     }
+        //     return baseMapper.getUserVosPage(page, userDTO, new DataScope());
+        // }
+
+        // 备案管理员
+        else if (SecurityUtils.getRoles().contains(47)) {
             userDTO.setRole(ListUtil.of(5, 6));
             return baseMapper.getUserVosPage(page, userDTO, new DataScope());
         }