Browse Source

no message

FengChaoYu 3 weeks ago
parent
commit
08732ba050

+ 2 - 1
src/main/java/com/gree/mall/manager/controller/admin/AdminDeptController.java

@@ -11,6 +11,7 @@ import com.gree.mall.manager.helper.ResponseHelper;
 import com.gree.mall.manager.logic.admin.AdminDeptLogic;
 import com.gree.mall.manager.plus.entity.AdminDept;
 import com.gree.mall.manager.utils.excel.ExcelUtils;
+import com.gree.mall.manager.zfire.bean.DeptZfireParamBean;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
 import io.swagger.annotations.Api;
@@ -56,7 +57,7 @@ public class AdminDeptController {
     @PostMapping("/list")
     @ApiOperation(value = "部门列表")
     public ResponseHelper<IPage<AdminDeptWebsitVO>> list(
-            @RequestBody ZfireParamBean zfireParamBean
+            @RequestBody DeptZfireParamBean zfireParamBean
     ) throws RemoteServiceException {
         IPage<AdminDeptWebsitVO> adminDeptVOIPage = adminDeptLogic.list(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
         return ResponseHelper.success(adminDeptVOIPage, new TypeReference<AdminDeptWebsitVO>() {});

+ 4 - 3
src/main/java/com/gree/mall/manager/logic/admin/AdminDeptLogic.java

@@ -18,8 +18,8 @@ import com.gree.mall.manager.plus.service.AdminDeptWebsitService;
 import com.gree.mall.manager.plus.service.AdminUserPermissionsRelaService;
 import com.gree.mall.manager.plus.service.AdminWebsitService;
 import com.gree.mall.manager.utils.StringUtil;
+import com.gree.mall.manager.zfire.bean.DeptZfireParamBean;
 import com.gree.mall.manager.zfire.bean.QueryParamBean;
-import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -90,7 +90,7 @@ public class AdminDeptLogic {
         return adminDeptTrees;
     }
 
-    public IPage<AdminDeptWebsitVO> list(Page page, ZfireParamBean zfireParam) {
+    public IPage<AdminDeptWebsitVO> list(Page page, DeptZfireParamBean zfireParam) {
         //获取当前登录企业id
         AdminUserCom adminUser = commonLogic.getAdminUser();
 
@@ -108,8 +108,9 @@ public class AdminDeptLogic {
         FieldUtils.supplyParam(zfireParam, AdminDeptWebsitVO.class);
 
         IPage<AdminDeptWebsitVO> adminDeptWebsitVOIPage = adminMapper.list(page, zfireParam);
-        if (isAll) {
+        if (isAll && CollectionUtil.isEmpty(adminDeptWebsitVOIPage.getRecords())) {
             final List<AdminWebsit> websitList = adminWebsitService.lambdaQuery()
+                    .eq(StringUtils.isNotBlank(zfireParam.getCurDeptId()), AdminWebsit::getCompanyWechatId, zfireParam.getCurDeptId())
                     .list();
             if (CollectionUtil.isNotEmpty(websitList)) {
                 List<AdminDeptWebsitVO> voList = new ArrayList<>();

+ 15 - 0
src/main/java/com/gree/mall/manager/zfire/bean/DeptZfireParamBean.java

@@ -0,0 +1,15 @@
+package com.gree.mall.manager.zfire.bean;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class DeptZfireParamBean extends ZfireParamBean {
+
+    @ApiModelProperty(value = "当前部门id")
+    private String curDeptId;
+
+}