czh %!s(int64=2) %!d(string=hai) anos
pai
achega
3d8aa0732e
Modificáronse 18 ficheiros con 539 adicións e 242 borrados
  1. 2 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/ApprovalEnum.java
  2. 30 26
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/CommonBusinessService.java
  3. 71 64
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractLogisticsService.java
  4. 73 65
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractTradeService.java
  5. 5 0
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/dto/req/CooperateManageQueryReqDto.java
  6. 1 1
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/report/QueryAllCooperateInfoExcel.java
  7. 2 0
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/vo/res/QueryAllCooperateInfoResVo.java
  8. 71 38
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmCooperateApplyService.java
  9. 63 41
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmCooperateManageService.java
  10. 17 4
      sckw-modules/sckw-manage/src/main/resources/mapper/KwmCooperateMapper.xml
  11. 14 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/controller/KwsEnterpriseController.java
  12. 5 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/pojo/FindPojoParam.java
  13. 65 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/report/EntCustomerExcel.java
  14. 65 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/report/EntSettleExcel.java
  15. 6 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/req/EntFindPageReqVo.java
  16. 5 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/EntFindPageResVo.java
  17. 38 1
      sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java
  18. 6 0
      sckw-modules/sckw-system/src/main/resources/mapper/KwsEnterpriseDao.xml

+ 2 - 2
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/ApprovalEnum.java

@@ -30,10 +30,10 @@ public enum ApprovalEnum {
         this.name = name;
     }
 
-    public static ApprovalEnum getName(int code){
+    public static String getName(int code){
         for (ApprovalEnum approvalEnum : values()) {
             if (approvalEnum.getCode() == code) {
-                return approvalEnum;
+                return approvalEnum.getName();
             }
         }
         return null;

+ 30 - 26
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/CommonBusinessService.java

@@ -198,32 +198,36 @@ public class CommonBusinessService {
 
 
     public void sendTradePassMessage(KwcContractTrade kwcContractTrade) {
-        List<KwcContractTradeUnit> kwcContractTradeUnits = kwcContractTradeUnitService.queryByContractId(kwcContractTrade.getId());
-        Map<Integer, KwcContractTradeUnit> collect = kwcContractTradeUnits.stream().collect(Collectors.toMap(KwcContractTradeUnit::getUnitType, Function.identity()));
-
-        KwcContractTradeUnit kwcContractTradeUnit = collect.get(CooperateTypeEnum.PURCHASER.getCode());
-        Long entId1 = kwcContractTradeUnit.getEntId();
-
-        EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntCacheById(entId1);
-        Map<String, Object> map = new HashMap<>();
-        map.put("entName", entCacheResDto1.getFirmName());
-        map.put("contract_no", kwcContractTrade.getContractNo());
-        map.put("name", kwcContractTrade.getName());
-        sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(kwcContractTrade.getCreateBy()).setEntId(kwcContractTrade.getEntId())),
-                MessageEnum.SAELCONTRACT_SUCCESS_CONTRACT,
-                map,
-                saleSendContract,
-                appSaleSendContract);
-
-        EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(entId1);
-        KwcContractTradeUnit kwcContractTradeUnit2 = collect.get(CooperateTypeEnum.SUPPLIER.getCode());
-        EntCacheResDto entCacheResDto2 = remoteSystemService.queryEntCacheById(kwcContractTradeUnit2.getEntId());
-        map.put("entName", entCacheResDto2.getFirmName());
-        sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto.getContactsId()).setEntId(entCacheResDto.getId())),
-                MessageEnum.BUYCONTRACT_SUCCESS_CONTRACT,
-                map,
-                purchaseSendContract,
-                appPurchaseSendContract);
+        try {
+            List<KwcContractTradeUnit> kwcContractTradeUnits = kwcContractTradeUnitService.queryByContractId(kwcContractTrade.getId());
+            Map<Integer, KwcContractTradeUnit> collect = kwcContractTradeUnits.stream().collect(Collectors.toMap(KwcContractTradeUnit::getUnitType, Function.identity()));
+
+            KwcContractTradeUnit kwcContractTradeUnit = collect.get(CooperateTypeEnum.PURCHASER.getCode());
+            Long entId1 = kwcContractTradeUnit.getEntId();
+
+            EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntCacheById(entId1);
+            Map<String, Object> map = new HashMap<>();
+            map.put("entName", entCacheResDto1.getFirmName());
+            map.put("contract_no", kwcContractTrade.getContractNo());
+            map.put("name", kwcContractTrade.getName());
+            sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(kwcContractTrade.getCreateBy()).setEntId(kwcContractTrade.getEntId())),
+                    MessageEnum.SAELCONTRACT_SUCCESS_CONTRACT,
+                    map,
+                    saleSendContract,
+                    appSaleSendContract);
+
+            EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(entId1);
+            KwcContractTradeUnit kwcContractTradeUnit2 = collect.get(CooperateTypeEnum.SUPPLIER.getCode());
+            EntCacheResDto entCacheResDto2 = remoteSystemService.queryEntCacheById(kwcContractTradeUnit2.getEntId());
+            map.put("entName", entCacheResDto2.getFirmName());
+            sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto.getContactsId()).setEntId(entCacheResDto.getId())),
+                    MessageEnum.BUYCONTRACT_SUCCESS_CONTRACT,
+                    map,
+                    purchaseSendContract,
+                    appPurchaseSendContract);
+        } catch (Exception e) {
+           log.error("合同签约成功消息出错:", e);
+        }
     }
 
     /**

+ 71 - 64
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractLogisticsService.java

@@ -426,10 +426,9 @@ public class KwcContractLogisticsService {
             ESignCallBackReqVo eSignCallBackReqVo = new ESignCallBackReqVo();
             eSignCallBackReqVo.setContractId(id);
             eSignCallBackReqVo.setStatus(ContractStatusEnum.SIGNED.getCode());
-            commonBusinessService.approval(eSignCallBackReqVo);
             //发送消息
             sendLogisticsMessage(kwcContractLogistics);
-            commonBusinessService.sendLogisticsPassMessage(kwcContractLogistics);
+            commonBusinessService.approval(eSignCallBackReqVo);
         }
 
     }
@@ -437,41 +436,45 @@ public class KwcContractLogisticsService {
 
 
     private void sendLogisticsMessage(KwcContractLogistics kwcContractLogistics) {
-        List<KwcContractLogisticsUnit> kwcContractLogisticsUnits = kwcContractLogisticsUnitService.queryByContractId(kwcContractLogistics.getId());
-        Map<Integer, KwcContractLogisticsUnit> collect = kwcContractLogisticsUnits.stream().collect(Collectors.toMap(KwcContractLogisticsUnit::getUnitType, Function.identity()));
-        KwcContractLogisticsUnit kwcContractLogisticsUnit = collect.get(CooperateTypeEnum.CARRIAGE.getCode());
-        EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(kwcContractLogisticsUnit.getEntId());
-        Map<String, Object> map = new HashMap<>();
-        map.put("entName", entCacheResDto.getFirmName());
-        map.put("contract_no", kwcContractLogistics.getContractNo());
-        map.put("name", kwcContractLogistics.getName());
-        MessageEnum messageEnum;
-        if (Objects.nonNull(kwcContractLogistics.getContractPid())) {
-            messageEnum = MessageEnum.SAELCONTRACT_SUBMIT_DATA;
-        } else {
-            messageEnum = MessageEnum.SAELCONTRACT_SEND_CONTRACT;
-        }
-        commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(kwcContractLogistics.getCreateBy()).setEntId(kwcContractLogistics.getEntId())),
-                messageEnum,
-                map,
-                consignmentSendContract,
-                appConsignmentSendContract);
-
-
-        if (Objects.nonNull(kwcContractLogistics.getContractPid())) {
-            messageEnum = MessageEnum.BUYCONTRACT_SUPPLYPROCESS_SEND;
-        } else {
-            messageEnum = MessageEnum.BUYCONTRACT_PROCESS_SEND;
-        }
-
-        EntCacheResDto entCacheResDto2 = remoteSystemService.queryEntTreeById(kwcContractLogisticsUnit.getEntId());
-        EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntCacheById(kwcContractLogistics.getEntId());
-        map.put("entName", entCacheResDto1.getFirmName());
-        commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto2.getContactsId()).setEntId(entCacheResDto2.getId())),
-                messageEnum,
-                map,
-                acceptanceSendContract,
-                appAcceptanceSendContract);
+        try {
+            List<KwcContractLogisticsUnit> kwcContractLogisticsUnits = kwcContractLogisticsUnitService.queryByContractId(kwcContractLogistics.getId());
+            Map<Integer, KwcContractLogisticsUnit> collect = kwcContractLogisticsUnits.stream().collect(Collectors.toMap(KwcContractLogisticsUnit::getUnitType, Function.identity()));
+            KwcContractLogisticsUnit kwcContractLogisticsUnit = collect.get(CooperateTypeEnum.CARRIAGE.getCode());
+            EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(kwcContractLogisticsUnit.getEntId());
+            Map<String, Object> map = new HashMap<>();
+            map.put("entName", entCacheResDto.getFirmName());
+            map.put("contract_no", kwcContractLogistics.getContractNo());
+            map.put("name", kwcContractLogistics.getName());
+            MessageEnum messageEnum;
+            if (Objects.nonNull(kwcContractLogistics.getContractPid())) {
+                messageEnum = MessageEnum.SAELCONTRACT_SUBMIT_DATA;
+            } else {
+                messageEnum = MessageEnum.SAELCONTRACT_SEND_CONTRACT;
+            }
+            commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(kwcContractLogistics.getCreateBy()).setEntId(kwcContractLogistics.getEntId())),
+                    messageEnum,
+                    map,
+                    consignmentSendContract,
+                    appConsignmentSendContract);
+
+
+            if (Objects.nonNull(kwcContractLogistics.getContractPid())) {
+                messageEnum = MessageEnum.BUYCONTRACT_SUPPLYPROCESS_SEND;
+            } else {
+                messageEnum = MessageEnum.BUYCONTRACT_PROCESS_SEND;
+            }
+
+            EntCacheResDto entCacheResDto2 = remoteSystemService.queryEntTreeById(kwcContractLogisticsUnit.getEntId());
+            EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntCacheById(kwcContractLogistics.getEntId());
+            map.put("entName", entCacheResDto1.getFirmName());
+            commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto2.getContactsId()).setEntId(entCacheResDto2.getId())),
+                    messageEnum,
+                    map,
+                    acceptanceSendContract,
+                    appAcceptanceSendContract);
+        } catch (Exception e) {
+            log.error("合同签约流程已发起消息出错:", e);
+        }
     }
 
 
@@ -595,33 +598,37 @@ public class KwcContractLogisticsService {
 
 
         //发送消息
-        List<KwcContractLogisticsUnit> kwcContractLogisticsUnits = kwcContractLogisticsUnitService.queryByContractId(kwcContractLogistic.getId());
-        Map<Integer, KwcContractLogisticsUnit> collect = kwcContractLogisticsUnits.stream().collect(Collectors.toMap(KwcContractLogisticsUnit::getUnitType, Function.identity()));
-        KwcContractLogisticsUnit kwcContractLogisticsUnit = collect.get(CooperateTypeEnum.CARRIAGE.getCode());
-        Long entId = kwcContractLogisticsUnit.getEntId();
-        EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(entId);
-        Map<String, Object> map = new HashMap<>();
-        map.put("entName", entCacheResDto.getFirmName());
-        map.put("contract_no", kwcContractLogistic.getContractNo());
-        map.put("name", kwcContractLogistic.getName());
-
-        commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(kwcContractLogistic.getCreateBy()).setEntId(kwcContractLogistic.getEntId())),
-                MessageEnum.SAELCONTRACT_COMPLETE_CONTRACT,
-                map,
-                consignmentSendContract,
-                appConsignmentSendContract);
-
-
-        KwcContractLogisticsUnit kwcContractLogisticsUnit2 = collect.get(CooperateTypeEnum.CONSIGN.getCode());
-        Long entId1 = kwcContractLogisticsUnit2.getEntId();
-        EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntCacheById(entId1);
-        EntCacheResDto entCacheResDto2 = remoteSystemService.queryEntTreeById(entId);
-        map.put("entName", entCacheResDto1.getFirmName());
-        commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto2.getContactsId()).setEntId(entCacheResDto2.getId())),
-                MessageEnum.BUYCONTRACT_COMPLETE_CONTRACT,
-                map,
-                acceptanceSendContract,
-                appAcceptanceSendContract);
+        try {
+            List<KwcContractLogisticsUnit> kwcContractLogisticsUnits = kwcContractLogisticsUnitService.queryByContractId(kwcContractLogistic.getId());
+            Map<Integer, KwcContractLogisticsUnit> collect = kwcContractLogisticsUnits.stream().collect(Collectors.toMap(KwcContractLogisticsUnit::getUnitType, Function.identity()));
+            KwcContractLogisticsUnit kwcContractLogisticsUnit = collect.get(CooperateTypeEnum.CARRIAGE.getCode());
+            Long entId = kwcContractLogisticsUnit.getEntId();
+            EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(entId);
+            Map<String, Object> map = new HashMap<>();
+            map.put("entName", entCacheResDto.getFirmName());
+            map.put("contract_no", kwcContractLogistic.getContractNo());
+            map.put("name", kwcContractLogistic.getName());
+
+            commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(kwcContractLogistic.getCreateBy()).setEntId(kwcContractLogistic.getEntId())),
+                    MessageEnum.SAELCONTRACT_COMPLETE_CONTRACT,
+                    map,
+                    consignmentSendContract,
+                    appConsignmentSendContract);
+
+
+            KwcContractLogisticsUnit kwcContractLogisticsUnit2 = collect.get(CooperateTypeEnum.CONSIGN.getCode());
+            Long entId1 = kwcContractLogisticsUnit2.getEntId();
+            EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntCacheById(entId1);
+            EntCacheResDto entCacheResDto2 = remoteSystemService.queryEntTreeById(entId);
+            map.put("entName", entCacheResDto1.getFirmName());
+            commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto2.getContactsId()).setEntId(entCacheResDto2.getId())),
+                    MessageEnum.BUYCONTRACT_COMPLETE_CONTRACT,
+                    map,
+                    acceptanceSendContract,
+                    appAcceptanceSendContract);
+        } catch (Exception e) {
+           log.error("完结合同消息出错:", e);
+        }
     }
 
 

+ 73 - 65
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractTradeService.java

@@ -493,51 +493,55 @@ public class KwcContractTradeService {
             ESignCallBackReqVo eSignCallBackReqVo = new ESignCallBackReqVo();
             eSignCallBackReqVo.setContractId(id);
             eSignCallBackReqVo.setStatus(ContractStatusEnum.SIGNED.getCode());
-            commonBusinessService.approval(eSignCallBackReqVo);
             //发送消息
             sendTradeMessage(kwcContractTrade);
-            commonBusinessService.sendTradePassMessage(kwcContractTrade);
+            //审批通过
+            commonBusinessService.approval(eSignCallBackReqVo);
         }
     }
 
 
     private void sendTradeMessage(KwcContractTrade kwcContractTrade) {
-        List<KwcContractTradeUnit> kwcContractTradeUnits = kwcContractTradeUnitService.queryByContractId(kwcContractTrade.getId());
-        Map<Integer, KwcContractTradeUnit> collect = kwcContractTradeUnits.stream().collect(Collectors.toMap(KwcContractTradeUnit::getUnitType, Function.identity()));
-        KwcContractTradeUnit kwcContractTradeUnit = collect.get(CooperateTypeEnum.PURCHASER.getCode());
-        EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(kwcContractTradeUnit.getEntId());
-        Map<String, Object> map = new HashMap<>();
-        map.put("entName", entCacheResDto.getFirmName());
-        map.put("contract_no", kwcContractTrade.getContractNo());
-        map.put("name", kwcContractTrade.getName());
-        MessageEnum messageEnum;
-        if (Objects.nonNull(kwcContractTrade.getContractPid())) {
-            messageEnum = MessageEnum.SAELCONTRACT_SUBMIT_DATA;
-        } else {
-            messageEnum = MessageEnum.SAELCONTRACT_SEND_CONTRACT;
-        }
-        commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(kwcContractTrade.getCreateBy()).setEntId(kwcContractTrade.getEntId())),
-                messageEnum,
-                map,
-                saleSendContract,
-                appSaleSendContract);
-
-
-        if (Objects.nonNull(kwcContractTrade.getContractPid())) {
-            messageEnum = MessageEnum.BUYCONTRACT_SUPPLYPROCESS_SEND;
-        } else {
-            messageEnum = MessageEnum.BUYCONTRACT_PROCESS_SEND;
-        }
-
-        EntCacheResDto entCacheResDto2 = remoteSystemService.queryEntTreeById(kwcContractTradeUnit.getEntId());
-        KwcContractTradeUnit kwcContractTradeUnit2 = collect.get(CooperateTypeEnum.SUPPLIER.getCode());
-        EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntCacheById(kwcContractTradeUnit2.getEntId());
-        map.put("entName", entCacheResDto1.getFirmName());
-        commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto2.getContactsId()).setEntId(entCacheResDto2.getId())),
-                messageEnum,
-                map,
-                purchaseSendContract,
-                appPurchaseSendContract);
+        try {
+            List<KwcContractTradeUnit> kwcContractTradeUnits = kwcContractTradeUnitService.queryByContractId(kwcContractTrade.getId());
+            Map<Integer, KwcContractTradeUnit> collect = kwcContractTradeUnits.stream().collect(Collectors.toMap(KwcContractTradeUnit::getUnitType, Function.identity()));
+            KwcContractTradeUnit kwcContractTradeUnit = collect.get(CooperateTypeEnum.PURCHASER.getCode());
+            EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(kwcContractTradeUnit.getEntId());
+            Map<String, Object> map = new HashMap<>();
+            map.put("entName", entCacheResDto.getFirmName());
+            map.put("contract_no", kwcContractTrade.getContractNo());
+            map.put("name", kwcContractTrade.getName());
+            MessageEnum messageEnum;
+            if (Objects.nonNull(kwcContractTrade.getContractPid())) {
+                messageEnum = MessageEnum.SAELCONTRACT_SUBMIT_DATA;
+            } else {
+                messageEnum = MessageEnum.SAELCONTRACT_SEND_CONTRACT;
+            }
+            commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(kwcContractTrade.getCreateBy()).setEntId(kwcContractTrade.getEntId())),
+                    messageEnum,
+                    map,
+                    saleSendContract,
+                    appSaleSendContract);
+
+
+            if (Objects.nonNull(kwcContractTrade.getContractPid())) {
+                messageEnum = MessageEnum.BUYCONTRACT_SUPPLYPROCESS_SEND;
+            } else {
+                messageEnum = MessageEnum.BUYCONTRACT_PROCESS_SEND;
+            }
+
+            EntCacheResDto entCacheResDto2 = remoteSystemService.queryEntTreeById(kwcContractTradeUnit.getEntId());
+            KwcContractTradeUnit kwcContractTradeUnit2 = collect.get(CooperateTypeEnum.SUPPLIER.getCode());
+            EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntCacheById(kwcContractTradeUnit2.getEntId());
+            map.put("entName", entCacheResDto1.getFirmName());
+            commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto2.getContactsId()).setEntId(entCacheResDto2.getId())),
+                    messageEnum,
+                    map,
+                    purchaseSendContract,
+                    appPurchaseSendContract);
+        } catch (Exception e) {
+           log.error("合同签约流程已发起消息出错:", e);
+        }
     }
 
 
@@ -667,33 +671,37 @@ public class KwcContractTradeService {
         tradeOrderInfoService.contractSignCompleted(contractSignCompletedParam);
 
         //发送消息
-        List<KwcContractTradeUnit> kwcContractTradeUnits = kwcContractTradeUnitService.queryByContractId(kwcContractTrade.getId());
-        Map<Integer, KwcContractTradeUnit> collect = kwcContractTradeUnits.stream().collect(Collectors.toMap(KwcContractTradeUnit::getUnitType, Function.identity()));
-        KwcContractTradeUnit kwcContractTradeUnit = collect.get(CooperateTypeEnum.CARRIAGE.getCode());
-        Long entId = kwcContractTradeUnit.getEntId();
-        EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(entId);
-        Map<String, Object> map = new HashMap<>();
-        map.put("entName", entCacheResDto.getFirmName());
-        map.put("contract_no", kwcContractTrade.getContractNo());
-        map.put("name", kwcContractTrade.getName());
-
-        commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(kwcContractTrade.getCreateBy()).setEntId(kwcContractTrade.getEntId())),
-                MessageEnum.SAELCONTRACT_COMPLETE_CONTRACT,
-                map,
-                saleSendContract,
-                appSaleSendContract);
-
-
-        KwcContractTradeUnit kwcContractTradeUnit2 = collect.get(CooperateTypeEnum.CONSIGN.getCode());
-        Long entId1 = kwcContractTradeUnit2.getEntId();
-        EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntCacheById(entId1);
-        EntCacheResDto entCacheResDto2 = remoteSystemService.queryEntTreeById(entId);
-        map.put("entName", entCacheResDto1.getFirmName());
-        commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto2.getContactsId()).setEntId(entCacheResDto2.getId())),
-                MessageEnum.BUYCONTRACT_COMPLETE_CONTRACT,
-                map,
-                purchaseSendContract,
-                appPurchaseSendContract);
+        try {
+            List<KwcContractTradeUnit> kwcContractTradeUnits = kwcContractTradeUnitService.queryByContractId(kwcContractTrade.getId());
+            Map<Integer, KwcContractTradeUnit> collect = kwcContractTradeUnits.stream().collect(Collectors.toMap(KwcContractTradeUnit::getUnitType, Function.identity()));
+            KwcContractTradeUnit kwcContractTradeUnit = collect.get(CooperateTypeEnum.PURCHASER.getCode());
+            Long entId = kwcContractTradeUnit.getEntId();
+            EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(entId);
+            Map<String, Object> map = new HashMap<>();
+            map.put("entName", entCacheResDto.getFirmName());
+            map.put("contract_no", kwcContractTrade.getContractNo());
+            map.put("name", kwcContractTrade.getName());
+
+            commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(kwcContractTrade.getCreateBy()).setEntId(kwcContractTrade.getEntId())),
+                    MessageEnum.SAELCONTRACT_COMPLETE_CONTRACT,
+                    map,
+                    saleSendContract,
+                    appSaleSendContract);
+
+
+            KwcContractTradeUnit kwcContractTradeUnit2 = collect.get(CooperateTypeEnum.SUPPLIER.getCode());
+            Long entId1 = kwcContractTradeUnit2.getEntId();
+            EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntCacheById(entId1);
+            EntCacheResDto entCacheResDto2 = remoteSystemService.queryEntTreeById(entId);
+            map.put("entName", entCacheResDto1.getFirmName());
+            commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto2.getContactsId()).setEntId(entCacheResDto2.getId())),
+                    MessageEnum.BUYCONTRACT_COMPLETE_CONTRACT,
+                    map,
+                    purchaseSendContract,
+                    appPurchaseSendContract);
+        } catch (Exception e) {
+            log.error("完结合同消息出错:", e);
+        }
     }
 
 

+ 5 - 0
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/dto/req/CooperateManageQueryReqDto.java

@@ -48,6 +48,11 @@ public class CooperateManageQueryReqDto {
      */
     private List<Long> currentEntIdList;
 
+    /**
+     * 当前企业下的员工
+     */
+    private List<Long> currentUserIdList;
+
     /**
      * 对方企业id
      */

+ 1 - 1
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/report/QueryAllCooperateInfoExcel.java

@@ -28,7 +28,7 @@ public class QueryAllCooperateInfoExcel implements Serializable {
      * 状态名
      */
     @ExcelProperty(value = "合作状态")
-    private Integer statusName;
+    private String statusName;
 
 
     /**

+ 2 - 0
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/vo/res/QueryAllCooperateInfoResVo.java

@@ -123,4 +123,6 @@ public class QueryAllCooperateInfoResVo implements Serializable {
      */
     private String remark;
 
+    private Long id;
+
 }

+ 71 - 38
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmCooperateApplyService.java

@@ -35,7 +35,9 @@ import com.sckw.manage.model.vo.res.FindListGroupResVo;
 import com.sckw.stream.enums.MessageEnum;
 import com.sckw.stream.model.UserInfo;
 import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.RemoteUserService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
+import com.sckw.system.api.model.dto.res.FindEntUserResDto;
 import com.sckw.system.api.model.dto.res.UserCacheResDto;
 import jakarta.servlet.http.HttpServletResponse;
 import lombok.extern.slf4j.Slf4j;
@@ -69,6 +71,9 @@ public class KwmCooperateApplyService {
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private RemoteSystemService remoteSystemService;
 
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteUserService remoteUserService;
+
     @Value(value = "${jumpUrl.cooperateApplyUrl}")
     private String cooperateApplyUrl;
 
@@ -226,6 +231,15 @@ public class KwmCooperateApplyService {
                 cooperateManageQueryReqDto.setTargetEntIdList(entCacheResDtos.stream().map(EntCacheResDto::getId).toList());
             }
         }
+
+
+        List<FindEntUserResDto> entUser = remoteUserService.findEntUser(entId);
+        if(CollectionUtils.isEmpty(entUser)) {
+            cooperateManageQueryReqDto.setCurrentUserIdList(Collections.singletonList(LoginUserHolder.getUserId()));
+        } else {
+            cooperateManageQueryReqDto.setCurrentUserIdList(entUser.stream().map(FindEntUserResDto::getUserId).toList());
+        }
+
         return cooperateManageQueryReqDto;
     }
 
@@ -280,25 +294,29 @@ public class KwmCooperateApplyService {
         saveInitiate(reqVo, currentEntId, chooseCooperateTypes);
 
         //发起合作申请消息
-        EntCacheResDto targetEntCacheResDto = remoteSystemService.queryEntCacheById(reqVo.getTargetEntId());
-        Map<String, Object> map = new HashMap<>(Global.NUMERICAL_FOUR);
-        map.put("entName", targetEntCacheResDto.getFirmName());
-        map.put("createByName", LoginUserHolder.getUserName());
-        commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(LoginUserHolder.getUserId()).setEntId(LoginUserHolder.getEntId())),
-                MessageEnum.SUBMIT_COOPERATE,
-                map,
-                cooperateApplyUrl,
-                appCooperateApplyUrl);
-
-        //合作申请待审核消息
-        EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(reqVo.getEntId());
-        EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntTreeById(reqVo.getTargetEntId());
-        map.put("entName", entCacheResDto.getFirmName());
-        commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto1.getContactsId()).setEntId(entCacheResDto1.getId())),
-                MessageEnum.COOPERATE_WAIT_APPROVAL,
-                map,
-                cooperateApplyUrl,
-                appCooperateApplyUrl);
+        try {
+            EntCacheResDto targetEntCacheResDto = remoteSystemService.queryEntCacheById(reqVo.getTargetEntId());
+            Map<String, Object> map = new HashMap<>(Global.NUMERICAL_FOUR);
+            map.put("entName", targetEntCacheResDto.getFirmName());
+            map.put("createByName", LoginUserHolder.getUserName());
+            commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(LoginUserHolder.getUserId()).setEntId(LoginUserHolder.getEntId())),
+                    MessageEnum.SUBMIT_COOPERATE,
+                    map,
+                    cooperateApplyUrl,
+                    appCooperateApplyUrl);
+
+            //合作申请待审核消息
+            EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(reqVo.getEntId());
+            EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntTreeById(reqVo.getTargetEntId());
+            map.put("entName", entCacheResDto.getFirmName());
+            commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto1.getContactsId()).setEntId(entCacheResDto1.getId())),
+                    MessageEnum.COOPERATE_WAIT_APPROVAL,
+                    map,
+                    cooperateApplyUrl,
+                    appCooperateApplyUrl);
+        } catch (Exception e) {
+           log.error("发起合作申请消息出错:", e);
+        }
     }
 
 
@@ -551,30 +569,45 @@ public class KwmCooperateApplyService {
         for (String id : reqVo.getIds().split(Global.COMMA)) {
             if (reqVo.getApprove().equals(CooperateStatusEnum.OK.getCode())) {
                 commonBusinessService.bingManager(reqVo.getManager(), Long.parseLong(id));
-
-                KwmCooperate kwmCooperate = kwmCooperateMapper.selectById(Long.parseLong(id));
-                EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(kwmCooperate.getEntId());
-                Map<String, Object> map = new HashMap<>(Global.NUMERICAL_TWO);
-                map.put("entName", entCacheResDto.getFirmName());
-                commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto.getContactsId()).setEntId(entCacheResDto.getId())),
-                        MessageEnum.COOPERATE_PASS,
-                        map,
-                        cooperateManageUrl,
-                        appCooperateApplyUrl);
+                passMessage(id);
             } else {
-                KwmCooperate kwmCooperate = kwmCooperateMapper.selectById(Long.parseLong(id));
-                EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(kwmCooperate.getEntId());
-                Map<String, Object> map = new HashMap<>(Global.NUMERICAL_TWO);
-                map.put("entName", entCacheResDto.getFirmName());
-                commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto.getContactsId()).setEntId(entCacheResDto.getId())),
-                        MessageEnum.COOPERATE_REFUSED,
-                        map,
-                        cooperateApplyUrl,
-                        appCooperateApplyUrl);
+                refuseMessage(id);
             }
         }
     }
 
+    private void refuseMessage(String id) {
+        try {
+            KwmCooperate kwmCooperate = kwmCooperateMapper.selectById(Long.parseLong(id));
+            EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(kwmCooperate.getEntId());
+            Map<String, Object> map = new HashMap<>(Global.NUMERICAL_TWO);
+            map.put("entName", entCacheResDto.getFirmName());
+            commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto.getContactsId()).setEntId(entCacheResDto.getId())),
+                    MessageEnum.COOPERATE_REFUSED,
+                    map,
+                    cooperateApplyUrl,
+                    appCooperateApplyUrl);
+        } catch (NumberFormatException e) {
+            log.error("合作申请审核驳回消息出错:", e);
+        }
+    }
+
+    private void passMessage(String id) {
+        try {
+            KwmCooperate kwmCooperate = kwmCooperateMapper.selectById(Long.parseLong(id));
+            EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(kwmCooperate.getEntId());
+            Map<String, Object> map = new HashMap<>(Global.NUMERICAL_TWO);
+            map.put("entName", entCacheResDto.getFirmName());
+            commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto.getContactsId()).setEntId(entCacheResDto.getId())),
+                    MessageEnum.COOPERATE_PASS,
+                    map,
+                    cooperateManageUrl,
+                    appCooperateApplyUrl);
+        } catch (Exception e) {
+            log.error("合作申请审核通过消息出错:", e);
+        }
+    }
+
 
     /**
      * @param reqVo 全量入参

+ 63 - 41
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmCooperateManageService.java

@@ -1,10 +1,12 @@
 package com.sckw.manage.service;
 
+import java.io.IOException;
 import java.util.Date;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.sckw.core.exception.BusinessException;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.enums.CooperateStatusEnum;
@@ -36,6 +38,8 @@ import com.sckw.stream.enums.MessageEnum;
 import com.sckw.stream.model.UserInfo;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.order.api.dubbo.TradeOrderInfoService;
+import com.sckw.system.api.RemoteUserService;
+import com.sckw.system.api.model.dto.res.FindEntUserResDto;
 import com.sckw.system.api.model.dto.res.UserCacheResDto;
 import com.sckw.transport.api.dubbo.TransportDubboService;
 import com.sckw.payment.api.dubbo.PaymentDubboService;
@@ -73,6 +77,9 @@ public class KwmCooperateManageService {
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private RemoteSystemService remoteSystemService;
 
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteUserService remoteUserService;
+
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private TradeOrderInfoService tradeOrderInfoService;
 
@@ -163,6 +170,13 @@ public class KwmCooperateManageService {
                 cooperateManageQueryReqDto.setTargetEntIdList(entCacheResDtos.stream().map(EntCacheResDto::getId).toList());
             }
         }
+
+        List<FindEntUserResDto> entUser = remoteUserService.findEntUser(entId);
+        if(CollectionUtils.isEmpty(entUser)) {
+            cooperateManageQueryReqDto.setCurrentUserIdList(Collections.singletonList(LoginUserHolder.getUserId()));
+        } else {
+            cooperateManageQueryReqDto.setCurrentUserIdList(entUser.stream().map(FindEntUserResDto::getUserId).toList());
+        }
         return cooperateManageQueryReqDto;
     }
 
@@ -229,46 +243,49 @@ public class KwmCooperateManageService {
             }
         });
 
-        Map<String, Object> map = new HashMap<>(Global.NUMERICAL_FOUR);
-        for (KwmCooperate kwmCooperate : kwmCooperates) {
-            Long targetEntId = kwmCooperate.getEntId().equals(LoginUserHolder.getEntId()) ? kwmCooperate.getInviteeEntId() : kwmCooperate.getInviterEntId();
-            Long entId = kwmCooperate.getEntId().equals(LoginUserHolder.getEntId()) ? kwmCooperate.getInviterEntId() : kwmCooperate.getInviteeEntId();
-            EntCacheResDto targetEntCacheResDto = remoteSystemService.queryEntCacheById(targetEntId);
-            EntCacheResDto targetEntTreeCacheResDto = remoteSystemService.queryEntTreeById(targetEntId);
-            EntCacheResDto ourEntCacheResDto = remoteSystemService.queryEntCacheById(entId);
-            EntCacheResDto ourEntTopCacheResDto = remoteSystemService.queryEntCacheById(kwmCooperate.getEntId());
-            if (type.equals(CooperateStatusEnum.PASS.getCode())) {
-                map.put("entName", targetEntCacheResDto.getFirmName());
-                map.put("createByName", LoginUserHolder.getUserName());
-                commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(ourEntTopCacheResDto.getContactsId()).setEntId(ourEntTopCacheResDto.getId())),
-                        MessageEnum.COOPERATE_DISSOLVE,
-                        map,
-                        cooperateManageUrl,
-                        appCooperateApplyUrl);
-
-                map.put("entName", ourEntCacheResDto.getFirmName());
-                commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(targetEntTreeCacheResDto.getContactsId()).setEntId(targetEntTreeCacheResDto.getId())),
-                        MessageEnum.COOPERATE_DISSOLVED,
-                        map,
-                        cooperateManageUrl,
-                        appCooperateApplyUrl);
-            } else {
-                map.put("entName", targetEntCacheResDto.getFirmName());
-                map.put("createByName", LoginUserHolder.getUserName());
-                commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(ourEntTopCacheResDto.getContactsId()).setEntId(ourEntTopCacheResDto.getId())),
-                        MessageEnum.COOPERATE_RESTORE,
-                        map,
-                        cooperateManageUrl,
-                        appCooperateApplyUrl);
-
-                map.put("entName", ourEntCacheResDto.getFirmName());
-                commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(targetEntTreeCacheResDto.getContactsId()).setEntId(targetEntTreeCacheResDto.getId())),
-                        MessageEnum.COOPERATE_RESTORED,
-                        map,
-                        cooperateManageUrl,
-                        appCooperateApplyUrl);
+        try {
+            Map<String, Object> map = new HashMap<>(Global.NUMERICAL_FOUR);
+            for (KwmCooperate kwmCooperate : kwmCooperates) {
+                Long targetEntId = kwmCooperate.getEntId().equals(LoginUserHolder.getEntId()) ? kwmCooperate.getInviteeEntId() : kwmCooperate.getInviterEntId();
+                Long entId = kwmCooperate.getEntId().equals(LoginUserHolder.getEntId()) ? kwmCooperate.getInviterEntId() : kwmCooperate.getInviteeEntId();
+                EntCacheResDto targetEntCacheResDto = remoteSystemService.queryEntCacheById(targetEntId);
+                EntCacheResDto targetEntTreeCacheResDto = remoteSystemService.queryEntTreeById(targetEntId);
+                EntCacheResDto ourEntCacheResDto = remoteSystemService.queryEntCacheById(entId);
+                EntCacheResDto ourEntTopCacheResDto = remoteSystemService.queryEntCacheById(kwmCooperate.getEntId());
+                if (type.equals(CooperateStatusEnum.PASS.getCode())) {
+                    map.put("entName", targetEntCacheResDto.getFirmName());
+                    map.put("createByName", LoginUserHolder.getUserName());
+                    commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(ourEntTopCacheResDto.getContactsId()).setEntId(ourEntTopCacheResDto.getId())),
+                            MessageEnum.COOPERATE_DISSOLVE,
+                            map,
+                            cooperateManageUrl,
+                            appCooperateApplyUrl);
+
+                    map.put("entName", ourEntCacheResDto.getFirmName());
+                    commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(targetEntTreeCacheResDto.getContactsId()).setEntId(targetEntTreeCacheResDto.getId())),
+                            MessageEnum.COOPERATE_DISSOLVED,
+                            map,
+                            cooperateManageUrl,
+                            appCooperateApplyUrl);
+                } else {
+                    map.put("entName", targetEntCacheResDto.getFirmName());
+                    map.put("createByName", LoginUserHolder.getUserName());
+                    commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(ourEntTopCacheResDto.getContactsId()).setEntId(ourEntTopCacheResDto.getId())),
+                            MessageEnum.COOPERATE_RESTORE,
+                            map,
+                            cooperateManageUrl,
+                            appCooperateApplyUrl);
+
+                    map.put("entName", ourEntCacheResDto.getFirmName());
+                    commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(targetEntTreeCacheResDto.getContactsId()).setEntId(targetEntTreeCacheResDto.getId())),
+                            MessageEnum.COOPERATE_RESTORED,
+                            map,
+                            cooperateManageUrl,
+                            appCooperateApplyUrl);
+                }
             }
-
+        } catch (Exception e) {
+           log.error("合作关系恢复/解除消息出错:", e);
         }
 
     }
@@ -780,7 +797,7 @@ public class KwmCooperateManageService {
             queryAllCooperateInfoResVo.setInviteeContacts(item.getInviteeContacts());
             queryAllCooperateInfoResVo.setInviteeContactsPhone(item.getInviteePhone());
             queryAllCooperateInfoResVo.setCreateTime(item.getCreateTime());
-
+            queryAllCooperateInfoResVo.setId(item.getId());
             UserCacheResDto userCacheResDto = userCacheResDtoMap.get(item.getCreateBy());
             queryAllCooperateInfoResVo.setCreateByName(Objects.nonNull(userCacheResDto) ? userCacheResDto.getName() : "");
             queryAllCooperateInfoResVo.setPhone(Objects.nonNull(userCacheResDto) ? userCacheResDto.getPhone() : "");
@@ -803,7 +820,12 @@ public class KwmCooperateManageService {
         if (CollectionUtils.isEmpty(list)) {
             throw new SystemException("导出数据为空");
         }
-        ExcelUtil.downData(response, QueryAllCooperateInfoExcel.class, BeanUtils.copyToList(getAllCooperateInfoVo(list), QueryAllCooperateInfoExcel.class));
+        List<QueryAllCooperateInfoResVo> allCooperateInfoVo = getAllCooperateInfoVo(list);
+        if (CollectionUtils.isEmpty(allCooperateInfoVo)) {
+            throw new SystemException("导出数据为空");
+        }
+        List<QueryAllCooperateInfoExcel> queryAllCooperateInfoExcels = BeanUtils.copyToList(allCooperateInfoVo, QueryAllCooperateInfoExcel.class);
+        ExcelUtil.downData(response, QueryAllCooperateInfoExcel.class, queryAllCooperateInfoExcels);
     }
 
 }

+ 17 - 4
sckw-modules/sckw-manage/src/main/resources/mapper/KwmCooperateMapper.xml

@@ -64,10 +64,16 @@
                and b.create_time &lt; date_add(#{reqDto.endTime}, INTERVAL 1 DAY)
            </if>
            <if test="reqDto.applyTypeCode != null and reqDto.applyTypeCode == 1">
-               and a.ent_id = #{reqDto.currentEntId}
+               and b.create_by in
+               <foreach collection="reqDto.currentUserIdList" item="item" open="(" close=")" separator=",">
+                   #{item}
+               </foreach>
            </if>
            <if test="reqDto.applyTypeCode != null and reqDto.applyTypeCode == 2">
-               and a.ent_id != #{reqDto.currentEntId}
+               and b.create_by not in
+               <foreach collection="reqDto.currentUserIdList" item="item" open="(" close=")" separator=",">
+                   #{item}
+               </foreach>
            </if>
            <if test="reqDto.cooperateTypes != null and reqDto.cooperateTypes.size() > 0">
                and exists (select 1
@@ -190,11 +196,18 @@
             and b.create_time &lt; date_add(#{reqDto.endTime}, INTERVAL 1 DAY)
         </if>
         <if test="reqDto.applyTypeCode != null and reqDto.applyTypeCode == 1">
-            and a.ent_id = #{reqDto.currentEntId}
+            and b.create_by in
+            <foreach collection="reqDto.currentUserIdList" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
         </if>
         <if test="reqDto.applyTypeCode != null and reqDto.applyTypeCode == 2">
-            and a.ent_id != #{reqDto.currentEntId}
+            and b.create_by not in
+            <foreach collection="reqDto.currentUserIdList" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
         </if>
+
         <if test="reqDto.cooperateTypes != null and reqDto.cooperateTypes.size() > 0">
             and exists (select 1
                             from kwm_cooperate_type c

+ 14 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/controller/KwsEnterpriseController.java

@@ -6,8 +6,10 @@ import com.sckw.system.model.KwsEnterprise;
 import com.sckw.system.model.vo.req.*;
 import com.sckw.system.model.vo.req.FindListReqVo;
 import com.sckw.system.service.KwsEnterpriseService;
+import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 import java.util.Map;
 
@@ -272,4 +274,16 @@ public class KwsEnterpriseController {
         return HttpResult.ok(kwsEntService.queryCustomerGroup(reqVo));
     }
 
+    /**
+     * @desc: 入驻认证/客户列表导出
+     * @author: czh
+     * @date: 2023/9/21
+     */
+    @PostMapping(value = "exportEntSettle", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void exportEntSettle(@RequestBody EntFindPageReqVo pageReqVo, HttpServletResponse response) {
+        kwsEntService.exportEntSettle(pageReqVo, response);
+    }
+
+
+
 }

+ 5 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/pojo/FindPojoParam.java

@@ -73,4 +73,9 @@ public class FindPojoParam extends PageRequest {
      */
     private Integer customer;
 
+    /**
+     * 企业id
+     */
+    private List<Long> idList;
+
 }

+ 65 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/report/EntCustomerExcel.java

@@ -0,0 +1,65 @@
+package com.sckw.system.model.report;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sckw.excel.annotation.ExcelContext;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author czh
+ * @desc 入驻认证导出
+ * @date 2023/9/21
+ */
+@Data
+@ExcelContext(fileName = "客户列表", sheetName = "客户列表")
+public class EntCustomerExcel implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -621415158085036877L;
+
+    @ExcelProperty(value = "状态")
+    private String statusName;
+
+    @ExcelProperty(value = "企业名称")
+    private String firmName;
+
+    @ExcelProperty(value = "供应属性")
+    private String ent1;
+
+    @ExcelProperty(value = "采购属性")
+    private String ent2;
+
+    @ExcelProperty(value = "4PL物流")
+    private String ent3;
+
+    @ExcelProperty(value = "3PL物流")
+    private String ent4;
+
+    @ExcelProperty(value = "企业代表")
+    private String contacts;
+
+    @ExcelProperty(value = "联系电话")
+    private String phone;
+
+    @ExcelProperty(value = "入驻类型")
+    private String entryTypeStr;
+
+    @ExcelProperty(value = "注册时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date regTime;
+
+    @ExcelProperty(value = "审批时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date approvalTime;
+
+    @ExcelProperty(value = "创建人")
+    private String createByName;
+
+}

+ 65 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/report/EntSettleExcel.java

@@ -0,0 +1,65 @@
+package com.sckw.system.model.report;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sckw.excel.annotation.ExcelContext;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author czh
+ * @desc 入驻认证导出
+ * @date 2023/9/21
+ */
+@Data
+@ExcelContext(fileName = "入驻认证", sheetName = "入驻认证")
+public class EntSettleExcel implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -621415158085036877L;
+
+    @ExcelProperty(value = "状态")
+    private String approvalName;
+
+    @ExcelProperty(value = "企业名称")
+    private String firmName;
+
+    @ExcelProperty(value = "供应属性")
+    private String ent1;
+
+    @ExcelProperty(value = "采购属性")
+    private String ent2;
+
+    @ExcelProperty(value = "4PL物流")
+    private String ent3;
+
+    @ExcelProperty(value = "3PL物流")
+    private String ent4;
+
+    @ExcelProperty(value = "企业代表")
+    private String contacts;
+
+    @ExcelProperty(value = "联系电话")
+    private String phone;
+
+    @ExcelProperty(value = "入驻类型")
+    private String entryTypeStr;
+
+    @ExcelProperty(value = "注册时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date regTime;
+
+    @ExcelProperty(value = "审批时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date approvalTime;
+
+    @ExcelProperty(value = "创建人")
+    private String createByName;
+
+}

+ 6 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/req/EntFindPageReqVo.java

@@ -5,6 +5,7 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 /**
  * @author czh
@@ -94,6 +95,11 @@ public class EntFindPageReqVo extends PageRequest implements Serializable {
      */
     private Long entId;
 
+    /**
+     * 企业id
+     */
+    private List<Long> idList;
+
     /**
      * 查企业客户
      */

+ 5 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/EntFindPageResVo.java

@@ -54,6 +54,11 @@ public class EntFindPageResVo implements Serializable {
      */
     private Integer approval;
 
+    /**
+     * 资料审批状态(0未审批、1通过、2未通过、3审批中)
+     */
+    private String approvalName;
+
     /**
      * 审批时间
      */

+ 38 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java

@@ -14,6 +14,7 @@ import com.sckw.core.utils.*;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.model.EntCertificateInfo;
+import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.stream.enums.MessageEnum;
 import com.sckw.stream.model.UserInfo;
 import com.sckw.system.api.model.dto.req.RegisterReqDto;
@@ -25,9 +26,12 @@ import com.sckw.system.model.pojo.FindEntListPojo;
 import com.sckw.system.model.pojo.FindEntUserPojo;
 import com.sckw.system.model.pojo.FindManagePojo;
 import com.sckw.system.model.pojo.FindPojoParam;
+import com.sckw.system.model.report.EntCustomerExcel;
+import com.sckw.system.model.report.EntSettleExcel;
 import com.sckw.system.model.vo.req.*;
 import com.sckw.system.model.vo.res.*;
 import com.sckw.system.model.vo.res.KwsUserResVo;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -219,6 +223,7 @@ public class KwsEnterpriseService {
         for (FindEntListPojo item : list) {
             EntFindPageResVo entFindPageResVo = new EntFindPageResVo();
             BeanUtils.copyProperties(item, entFindPageResVo);
+            entFindPageResVo.setApprovalName(ApprovalEnum.getName(entFindPageResVo.getApproval()));
             entFindPageResVo.setApprovalTime(item.getApprovalTime());
             entFindPageResVo.setEntTypes(item.getType());
             entFindPageResVo.setEntryType(item.getSystemType().equals(SystemTypeEnum.MANAGE.getCode()) ? EntryTypeEnum.PLATFORM.getCode() : EntryTypeEnum.SELF.getCode());
@@ -779,7 +784,7 @@ public class KwsEnterpriseService {
         findListGroupResVo.setApproval(code);
         List<FindEntListPojo> findEntListPojos = collect.get(code);
         findListGroupResVo.setCount(CollectionUtils.isEmpty(findEntListPojos) ? Global.NO : findEntListPojos.size());
-        findListGroupResVo.setApprovalName(ApprovalEnum.getName(code).getName());
+        findListGroupResVo.setApprovalName(ApprovalEnum.getName(code));
         return findListGroupResVo;
     }
 
@@ -1125,4 +1130,36 @@ public class KwsEnterpriseService {
         result.add(queryCustomerResVo2);
         return result;
     }
+
+
+    /**
+     * @desc: 入驻认证导出
+     * @author: czh
+     * @date: 2023/9/21
+     */
+    public void exportEntSettle(EntFindPageReqVo reqVo, HttpServletResponse response) {
+        List<FindEntListPojo> list = findPojo(reqVo);
+        List<EntFindPageResVo> result = new ArrayList<>();
+
+        if (CollectionUtils.isEmpty(list)) {
+            throw new SystemException("导出数据为空");
+        }
+
+        for (FindEntListPojo item : list) {
+            EntFindPageResVo entFindPageResVo = new EntFindPageResVo();
+            BeanUtils.copyProperties(item, entFindPageResVo);
+            entFindPageResVo.setApprovalTime(item.getApprovalTime());
+            entFindPageResVo.setEntTypes(item.getType());
+            entFindPageResVo.setEntryType(item.getSystemType().equals(SystemTypeEnum.MANAGE.getCode()) ? EntryTypeEnum.PLATFORM.getCode() : EntryTypeEnum.SELF.getCode());
+            entFindPageResVo.setEntryTypeStr(EntryTypeEnum.getName(entFindPageResVo.getEntryType()).getName());
+            result.add(entFindPageResVo);
+        }
+
+        if (Objects.isNull(reqVo.getCustomer())) {
+            ExcelUtil.downData(response, EntSettleExcel.class, BeanUtils.copyToList(result, EntSettleExcel.class));
+        } else {
+            ExcelUtil.downData(response, EntCustomerExcel.class, BeanUtils.copyToList(result, EntCustomerExcel.class));
+        }
+    }
+
 }

+ 6 - 0
sckw-modules/sckw-system/src/main/resources/mapper/KwsEnterpriseDao.xml

@@ -145,6 +145,12 @@
     <if test="dto.entryType != null and dto.entryType == 2">
       and k.system_type = 1
     </if>
+      <if test="dto.idList != null and dto.idList.size() > 0">
+        and a.id in
+        <foreach collection="dto.idList" item="item" separator="," open="(" close=")">
+          #{item}
+        </foreach>
+      </if>
     <choose>
       <when test="dto.entDept != null and dto.entDept == 0">
         and not exists (