‘linchangsheng’ hai 9 meses
pai
achega
c5125bac64

+ 11 - 1
mall-server-api/src/main/java/com/gree/mall/manager/logic/admin/AdminDeptLogic.java

@@ -14,6 +14,7 @@ import com.gree.mall.manager.plus.entity.*;
 import com.gree.mall.manager.plus.service.AdminDeptService;
 import com.gree.mall.manager.plus.service.AdminDeptWebsitService;
 import com.gree.mall.manager.plus.service.AdminUserDeptRelaService;
+import com.gree.mall.manager.plus.service.AdminWebsitService;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
 import lombok.extern.slf4j.Slf4j;
@@ -47,6 +48,9 @@ public class AdminDeptLogic {
     @Autowired
     AdminUserDeptRelaService adminUserDeptRelaService;
 
+    @Autowired
+    AdminWebsitService adminWebsitService;
+
 
 
     public List<AdminDeptTree> tree(HttpServletRequest request) {
@@ -165,6 +169,7 @@ public class AdminDeptLogic {
             List<AdminDeptTree> children = adminDeptTree.getChildren();
             for (AdminDeptTree child : children) {
                 List<AdminDeptWebsit> adminDeptWebsits = adminDeptWebsitService.lambdaQuery().eq(AdminDeptWebsit::getAdminDeptId, child.getAdminDeptId()).list();
+
                 for (AdminDeptWebsit adminDeptWebsit : adminDeptWebsits) {
                     AdminDeptTree adminDeptTreeWebsit = new AdminDeptTree();
                     adminDeptTreeWebsit.setIsWebsit(true);
@@ -174,10 +179,15 @@ public class AdminDeptLogic {
                     child.getChildren().add(adminDeptTreeWebsit);
 
                 }
+                AdminWebsit adminWebsit = adminWebsitService.lambdaQuery().eq(AdminWebsit::getName, child.getDeptName()).last("limit 1").one();
+
+                if (adminWebsit != null){
+                    child.setAdminDeptId(adminWebsit.getWebsitId());
+                    child.setIsWebsit(true);
+                }
             }
         }
 
-
         return trees;
     }
 }