‘linchangsheng’ 4 周之前
父节点
当前提交
3eabfa24e1
共有 1 个文件被更改,包括 9 次插入5 次删除
  1. 9 5
      src/main/java/com/gree/mall/manager/logic/admin/AdminUserLogic.java

+ 9 - 5
src/main/java/com/gree/mall/manager/logic/admin/AdminUserLogic.java

@@ -395,17 +395,21 @@ public class AdminUserLogic {
         if (CollectionUtil.isNotEmpty(deptList)) {
             // 找出部门下的商家
             for (String deptId : deptList) {
+
+
+                // 遍历部门递归找出子部门
+                this.querySubDeptId(deptId, deptIdList);
+                deptIdList.add(deptId);
+            }
+
+            for (String deptss : deptIdList) {
                 final List<AdminDeptWebsit> adminDeptWebsits = adminDeptWebsitService.lambdaQuery()
-                        .eq(AdminDeptWebsit::getAdminDeptId, deptId)
+                        .eq(AdminDeptWebsit::getAdminDeptId, deptss)
                         .list();
                 final List<String> websitIds = adminDeptWebsits.stream()
                         .map(AdminDeptWebsit::getWebsitId)
                         .collect(Collectors.toList());
                 websitIdList.addAll(websitIds);
-
-                // 遍历部门递归找出子部门
-                this.querySubDeptId(deptId, deptIdList);
-                deptIdList.add(deptId);
             }
         }