15928045575 %!s(int64=2) %!d(string=hai) anos
pai
achega
92a7de98a0
Modificáronse 100 ficheiros con 2272 adicións e 358 borrados
  1. 2 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictEnum.java
  2. 1 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictTypeEnum.java
  3. 6 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/GlobalSystemExceptionHandler.java
  4. 35 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/SuccessBusinessException.java
  5. 2 2
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/CooperateStatusEnum.java
  6. 40 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/config/easyexcel/LongStringConverter.java
  7. 2 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/context/Enums.java
  8. 5 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/enums/Source.java
  9. 14 6
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/utils/ExcelUtil.java
  10. 2 1
      sckw-common/sckw-common-excel/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  11. 6 1
      sckw-common/sckw-common-stream/src/main/java/com/sckw/stream/model/SckwMessage.java
  12. 9 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java
  13. 3 3
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/controller/KwcCarrierController.java
  14. 3 3
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/controller/KwcCheckedController.java
  15. 6 3
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/controller/KwcContractSaleController.java
  16. 5 4
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/controller/KwcPurchaseController.java
  17. 29 20
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractLogisticsService.java
  18. 26 14
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractTradeService.java
  19. 3 0
      sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractLogisticsMapper.xml
  20. 21 9
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverController.java
  21. 10 7
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfFleetController.java
  22. 18 7
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java
  23. 11 7
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckReportController.java
  24. 7 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfDriverMapper.java
  25. 8 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfTruckMapper.java
  26. 7 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfDriverVo.java
  27. 7 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfFleetVo.java
  28. 7 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckReportVo.java
  29. 7 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckVo.java
  30. 9 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java
  31. 9 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckService.java
  32. 26 0
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverMapper.xml
  33. 26 0
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckMapper.xml
  34. 5 9
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/controller/KwmAddressController.java
  35. 5 3
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/controller/KwmCooperateApplyController.java
  36. 32 6
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/controller/KwmCooperateManageController.java
  37. 10 0
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/dao/KwmCooperateMapper.java
  38. 5 0
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/dto/res/CooperateManageQueryResDto.java
  39. 76 0
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/report/AddressQueryExport.java
  40. 59 0
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/report/CooperateManageExport.java
  41. 129 0
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/report/QueryAllCooperateInfoExcel.java
  42. 1 1
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/vo/req/AddressQueryReqVo.java
  43. 46 0
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/vo/req/QueryAllCooperateInfoReqDto.java
  44. 5 0
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/vo/res/AddressQueryResVo.java
  45. 126 0
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/vo/res/QueryAllCooperateInfoResVo.java
  46. 9 2
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/CommonBusinessService.java
  47. 24 27
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmAddressService.java
  48. 49 15
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmCooperateApplyService.java
  49. 147 21
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmCooperateManageService.java
  50. 87 46
      sckw-modules/sckw-manage/src/main/resources/mapper/KwmCooperateMapper.xml
  51. 2 1
      sckw-modules/sckw-message/src/main/java/com/sckw/message/enums/MsgStatusEnum.java
  52. 2 1
      sckw-modules/sckw-message/src/main/java/com/sckw/message/service/KwmMessageUserService.java
  53. 31 5
      sckw-modules/sckw-message/src/main/java/com/sckw/message/service/MessageService.java
  54. 3 2
      sckw-modules/sckw-message/src/main/java/com/sckw/message/service/SckwMessageHandlerService.java
  55. 15 2
      sckw-modules/sckw-message/src/main/java/com/sckw/message/service/SmsService.java
  56. 2 2
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/ExportTransportDemandParam.java
  57. 2 2
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/SelectTransportDemandParam.java
  58. 2 2
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/StatisticTransportDemandParam.java
  59. 26 17
      sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderService.java
  60. 11 9
      sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTransportDemandService.java
  61. 2 2
      sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwpWantBuyService.java
  62. 6 2
      sckw-modules/sckw-order/src/main/resources/mapper/KwoTradeOrderMapper.xml
  63. 11 3
      sckw-modules/sckw-order/src/main/resources/mapper/KwoWantBuyMapper.xml
  64. 2 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/WalletController.java
  65. 3 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/app/AppKwpLedgerLogisticsController.java
  66. 8 5
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/app/AppKwpLedgerTradeController.java
  67. 23 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/app/AppKwpSettlementLogisticsController.java
  68. 6 10
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/LedgerLogisticsController.java
  69. 8 13
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/LedgerTradeController.java
  70. 23 3
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementLogisticsController.java
  71. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementTradeController.java
  72. 4 4
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementWalletController.java
  73. 7 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpLedgerLogisticsMapper.java
  74. 9 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpLedgerTradeMapper.java
  75. 24 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementLogisticsMapper.java
  76. 9 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementOfflineMapper.java
  77. 5 5
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementRecordMapper.java
  78. 9 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementWalletMapper.java
  79. 2 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/PayCenterEnum.java
  80. 22 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/Id.java
  81. 1 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/SettlementLogisticsDto.java
  82. 23 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/wallet/ChannelStatistics.java
  83. 2 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/LedgerLogistics.java
  84. 22 5
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/LedgerSell.java
  85. 3 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/PrePayWalletVo.java
  86. 67 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/SettlementRecord.java
  87. 109 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/SettlementVo.java
  88. 151 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/excel/LedgerLogisticsExport.java
  89. 147 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/excel/LedgerTradeExport.java
  90. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/FinanceCount.java
  91. 4 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/FundVo.java
  92. 7 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerTradeService.java
  93. 41 5
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementLogisticsService.java
  94. 9 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementOfflineService.java
  95. 5 4
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementRecordService.java
  96. 17 5
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementTradeService.java
  97. 5 3
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementWalletService.java
  98. 33 3
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/PayCenterService.java
  99. 120 7
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WalletService.java
  100. 38 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WorkbenchService.java

+ 2 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictEnum.java

@@ -6,6 +6,7 @@ import lombok.Getter;
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @author lfdc
@@ -109,7 +110,7 @@ public enum DictEnum {
                 list.add(dict);
             }
         }
-        return list.stream().sorted(Comparator.comparing(DictEnum::getValue)).toList();
+        return list.stream().sorted(Comparator.comparing(DictEnum::getValue)).collect(Collectors.toList());
     }
 
 }

+ 1 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictTypeEnum.java

@@ -12,6 +12,7 @@ import lombok.Getter;
 @AllArgsConstructor
 public enum DictTypeEnum {
     MSG_CATEGORY("msg_category", "消息分类"),
+    MSG_STATUS("msg_status", "消息状态"),
     SEND_SMS_TYPE("send_sms_type", "发送短信类型"),
     INTEGRAL_TYPE("integral_type", "积分类型"),
     UNIT_TYPE("unit_type", "商品单位类型"),

+ 6 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/GlobalSystemExceptionHandler.java

@@ -28,6 +28,12 @@ public class GlobalSystemExceptionHandler {
         log.error("业务异常:", e);
         return HttpResult.error(e.getCode(), e.getMessage());
     }
+    @ExceptionHandler(value = SuccessBusinessException.class)
+    @ResponseBody
+    public HttpResult handlerRuntimeException(SuccessBusinessException e) {
+        log.error("状态码为正常的业务:", e);
+        return HttpResult.error(HttpStatus.SUCCESS_CODE, e.getMessage());
+    }
 
     @ExceptionHandler(value = RuntimeException.class)
     @ResponseBody

+ 35 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/SuccessBusinessException.java

@@ -0,0 +1,35 @@
+package com.sckw.core.exception;
+
+import lombok.Getter;
+
+import java.io.Serial;
+
+/**
+ * 状态码为正常的业务异常
+ *
+ * @Author yzc
+ * @Description 自定义业务异常
+ * @createTime 2023年06月08日 10:05:00
+ */
+@Getter
+public class SuccessBusinessException extends RuntimeException {
+    @Serial
+    private static final long serialVersionUID = 6955463132739776238L;
+    /**
+     * 异常信息
+     **/
+    private final String msg;
+    private Object[] param;
+
+    public SuccessBusinessException(String msg) {
+        super(msg);
+        this.msg = msg;
+    }
+
+    public SuccessBusinessException(String msg, Object... param) {
+        super(msg);
+        this.msg = msg;
+        this.param = param;
+    }
+
+}

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

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

+ 40 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/config/easyexcel/LongStringConverter.java

@@ -0,0 +1,40 @@
+package com.sckw.excel.config.easyexcel;
+
+import cn.hutool.core.convert.Convert;
+import com.alibaba.excel.converters.Converter;
+import com.alibaba.excel.enums.CellDataTypeEnum;
+import com.alibaba.excel.metadata.GlobalConfiguration;
+import com.alibaba.excel.metadata.data.ReadCellData;
+import com.alibaba.excel.metadata.data.WriteCellData;
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.Objects;
+
+
+@Slf4j
+public class LongStringConverter implements Converter<Long> {
+    @Override
+    public Class<Long> supportJavaTypeKey() {
+        return Long.class;
+    }
+
+    @Override
+    public CellDataTypeEnum supportExcelTypeKey() {
+        return CellDataTypeEnum.STRING;
+    }
+
+    @Override
+    public Long convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
+        return Convert.toLong(cellData.getData());
+    }
+
+    @Override
+    public WriteCellData<String> convertToExcelData(Long value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
+        if (Objects.nonNull(value)) {
+            String str = Convert.toStr(value);
+            return new WriteCellData<>(str);
+        }
+        return new WriteCellData<>("");
+    }
+}

+ 2 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/context/Enums.java

@@ -4,6 +4,7 @@ import com.sckw.core.common.enums.NumberConstant;
 import com.sckw.core.exception.SourceInitializeException;
 import com.sckw.core.model.enums.LogisticsOrderEnum;
 import com.sckw.excel.translate.Sources;
+import jakarta.annotation.PostConstruct;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.Ordered;
 import org.springframework.data.redis.core.RedisTemplate;
@@ -27,6 +28,7 @@ public class Enums implements Source, Ordered {
     @Autowired
     private RedisTemplate<String, Object> redisTemplate;
 
+
     public Enums() {
         initial();
     }

+ 5 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/enums/Source.java

@@ -11,6 +11,8 @@ package com.sckw.excel.translate.enums;
  * @copyright
  */
 public enum Source {
+
+    TEST("com.sckw.excel.translate.context.Enums"),
     /**
      * 字典
      */
@@ -45,6 +47,9 @@ public enum Source {
         if (clazzName.equals(ENUMS.getClazz())) {
             return ENUMS;
         }
+        if (clazzName.equals(TEST.getClazz())) {
+            return TEST;
+        }
         return null;
     }
 }

+ 14 - 6
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/utils/ExcelUtil.java

@@ -11,10 +11,7 @@ import com.sckw.core.model.constant.Global;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.annotation.ExcelContext;
 import com.sckw.excel.annotation.ExcelSelected;
-import com.sckw.excel.config.easyexcel.ExcelSelectedResolve;
-import com.sckw.excel.config.easyexcel.LocalDateTimeConverter;
-import com.sckw.excel.config.easyexcel.RowWriteHandlerImpl;
-import com.sckw.excel.config.easyexcel.SelectedSheetWriteHandler;
+import com.sckw.excel.config.easyexcel.*;
 import jakarta.servlet.http.HttpServletResponse;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.util.Assert;
@@ -41,14 +38,24 @@ import java.util.Map;
  */
 @Slf4j
 public class ExcelUtil {
-
+    /**
+     * 数据导出
+     *
+     * @param response
+     * @param clazz
+     * @param data
+     * @param <T>
+     */
     public static <T> void downData(HttpServletResponse response, Class<T> clazz, List<T> data) {
         Assert.notNull(clazz, "clazz can't be null");
         Assert.isTrue(data != null && !data.isEmpty(), "data can't be empty");
         try {
             ExcelContext excelContext = clazz.getAnnotation(ExcelContext.class);
             buildResponse(response, excelContext.fileName());
-            EasyExcel.write(response.getOutputStream(), clazz).autoCloseStream(Boolean.FALSE).sheet(excelContext.sheetName()).doWrite(data);
+            EasyExcel.write(response.getOutputStream(), clazz)
+                    .autoCloseStream(Boolean.FALSE)
+                    .registerConverter(new LongStringConverter())
+                    .sheet(excelContext.sheetName()).doWrite(data);
         } catch (Exception e) {
             buildResponse(response, e);
         }
@@ -248,4 +255,5 @@ public class ExcelUtil {
 
         return selectedMap;
     }
+
 }

+ 2 - 1
sckw-common/sckw-common-excel/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -1 +1,2 @@
-com.sckw.excel.translate.SourceUtil
+com.sckw.excel.translate.SourceUtil
+com.sckw.excel.translate.context.Enums

+ 6 - 1
sckw-common/sckw-common-stream/src/main/java/com/sckw/stream/model/SckwMessage.java

@@ -42,10 +42,15 @@ public class SckwMessage {
     private Map<String, Object> params;
 
     /**
-     * 消息跳转url
+     * 消息跳转url(废弃)
      */
     private String msgUrl;
 
+    /**
+     * 消息跳转urls(key为app、pc,value为对应的跳转地址)
+     */
+    private Map<String, String> msgUrls;
+
     /**
      * 推送设备类型
      */

+ 9 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java

@@ -40,6 +40,15 @@ public interface RemoteSystemService {
      */
     List<SysDictResDto> queryDictByType(String type);
 
+    /**
+     * @param type 类型
+     * @return SysDictResDto
+     * @desc: 根据类型id查字典,先查redis,没查到查数据库,查出来了存redis
+     * @author: czh
+     * @date: 2023/7/5
+     */
+    Map<String, Map<String, String>> queryDictByType(List<String> type);
+
     /**
      * @param type 字典类型,value key
      * @return SysDictResDto

+ 3 - 3
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/controller/KwcCarrierController.java

@@ -3,9 +3,9 @@ package com.sckw.contract.controller;
 import com.sckw.contract.model.vo.req.IdReqVo;
 import com.sckw.contract.model.vo.req.QueryListReqVo;
 import com.sckw.contract.service.KwcContractLogisticsService;
-import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.enums.EntTypeEnum;
 import com.sckw.core.web.response.HttpResult;
+import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -57,9 +57,9 @@ public class KwcCarrierController {
      * @date 2023/7/17
      */
     @PostMapping("export")
-    public void export(@Valid @RequestBody QueryListReqVo reqVo) {
+    public void export(@Valid @RequestBody QueryListReqVo reqVo, HttpServletResponse response) {
         reqVo.setEntType(EntTypeEnum.LOGISTICS4.getCode());
-        kwcContractLogisticsService.export(reqVo);
+        kwcContractLogisticsService.export(reqVo, response);
     }
 
 

+ 3 - 3
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/controller/KwcCheckedController.java

@@ -142,10 +142,10 @@ public class KwcCheckedController {
      * @author: czh
      * @date 2023/7/17
      */
-    @PostMapping("export")
-    public void export(@Valid @RequestBody QueryListReqVo reqVo) {
+    @PostMapping(value = "export", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void export(@Valid @RequestBody QueryListReqVo reqVo, HttpServletResponse response) {
         reqVo.setEntType(EntTypeEnum.LOGISTICS3.getCode());
-        kwcContractLogisticsService.export(reqVo);
+        kwcContractLogisticsService.export(reqVo, response);
     }
 
 

+ 6 - 3
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/controller/KwcContractSaleController.java

@@ -1,5 +1,6 @@
 package com.sckw.contract.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.sckw.contract.model.vo.req.*;
 import com.sckw.contract.service.KwcContractTradeService;
 import com.sckw.core.exception.SystemException;
@@ -15,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Properties;
+
 
 /**
  * @author czh
@@ -139,10 +142,10 @@ public class KwcContractSaleController {
      * @author: czh
      * @date 2023/7/17
      */
-    @PostMapping("export")
-    public void export(@Valid @RequestBody QueryListReqVo reqVo) {
+    @PostMapping(value = "export", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void export(@Valid @RequestBody QueryListReqVo reqVo, HttpServletResponse response) {
         reqVo.setEntType(EntTypeEnum.SUPPLIER.getCode());
-        kwcContractTradeService.export(reqVo);
+        kwcContractTradeService.export(reqVo, response);
     }
 
     /**

+ 5 - 4
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/controller/KwcPurchaseController.java

@@ -3,11 +3,12 @@ package com.sckw.contract.controller;
 import com.sckw.contract.model.vo.req.IdReqVo;
 import com.sckw.contract.model.vo.req.QueryListReqVo;
 import com.sckw.contract.service.KwcContractTradeService;
-import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.enums.EntTypeEnum;
 import com.sckw.core.web.response.HttpResult;
+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.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -57,10 +58,10 @@ public class KwcPurchaseController {
      * @author: czh
      * @date 2023/7/17
      */
-    @PostMapping("export")
-    public void export(@Valid @RequestBody QueryListReqVo reqVo) {
+    @PostMapping(value = "export", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void export(@Valid @RequestBody QueryListReqVo reqVo, HttpServletResponse response) {
         reqVo.setEntType(EntTypeEnum.PURCHASER.getCode());
-        kwcContractTradeService.export(reqVo);
+        kwcContractTradeService.export(reqVo, response);
     }
 
     /**

+ 29 - 20
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractLogisticsService.java

@@ -72,8 +72,8 @@ public class KwcContractLogisticsService {
     @Autowired
     private KwcContractLogisticsUnitService kwcContractLogisticsUnitService;
 
-    @Autowired
-    private RemoteContractServiceImpl remoteContractService;
+    //@Autowired
+    //private RemoteContractServiceImpl remoteContractService;
 
     @Autowired
     private CommonBusinessService commonBusinessService;
@@ -87,8 +87,8 @@ public class KwcContractLogisticsService {
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private GoodsInfoService goodsInfoService;
 
-    @Value(value = "${jumpUrl.saleSendContract}")
-    private String saleSendContract;
+    @Value(value = "${jumpUrl.tradeSendContract}")
+    private String  tradeSendContract;
 
     /**
      * @param reqVo 新增入参
@@ -141,7 +141,7 @@ public class KwcContractLogisticsService {
         commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(kwcContractLogistics.getCreateBy()).setEntId(entId)),
                 messageEnum,
                 map,
-                saleSendContract);
+                tradeSendContract);
         return contactId;
     }
 
@@ -528,6 +528,9 @@ public class KwcContractLogisticsService {
         if (kwcContractLogisticsMapper.updateById(kwcContractLogistic) <= 0) {
             throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
         }
+        kwcContractLogisticsTrackService.saveContractLogisticsTrack(kwcContractLogistic.getId(), ContractTrackEnum.OVER.getCode());
+
+
         //发送消息
         Long entId = kwcContractLogistic.getEntId();
         EntCacheResDto entCacheResDto = remoteSystemService.queryEntTreeById(entId);
@@ -540,7 +543,8 @@ public class KwcContractLogisticsService {
         commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(kwcContractLogistic.getCreateBy()).setEntId(entId)),
                 messageEnum,
                 map,
-                saleSendContract);
+                tradeSendContract);
+
     }
 
 
@@ -644,27 +648,32 @@ public class KwcContractLogisticsService {
         return list;
     }
 
-    public void export(QueryListReqVo reqVo) {
+    public void export(QueryListReqVo reqVo, HttpServletResponse response) {
         QueryListReqDto queryListReqDto = new QueryListReqDto();
         BeanUtils.copyProperties(reqVo, queryListReqDto);
-        queryListReqDto.setEntId(LoginUserHolder.getEntId());
-        if (StringUtils.isNotBlank(reqVo.getIds())) {
-            List<Long> idList = Arrays.stream(reqVo.getIds().split(Global.COMMA)).map(Long::parseLong).toList();
-            queryListReqDto.setIdList(idList);
+        List<Long> allEnt = new ArrayList<>();
+        if (Objects.isNull(reqVo.getEntId())) {
+            queryListReqDto.setEntId(LoginUserHolder.getEntId());
         }
+        allEnt.add(queryListReqDto.getEntId());
 
-        List<QueryListResVo> queryListResVos = new ArrayList<>();
+        EntCacheResDto entCacheResDto = remoteSystemService.queryEntTreeById(queryListReqDto.getEntId());
+        if (Objects.nonNull(entCacheResDto)) {
+            EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntTreeById(entCacheResDto.getId());
+            List<EntCacheResDto> child = entCacheResDto1.getChild();
+            if (CollectionUtils.isNotEmpty(child)) {
+                allEnt.addAll(child.stream().map(EntCacheResDto::getId).toList());
+            }
+        }
+        queryListReqDto.setAllEnt(allEnt);
         List<QueryListResDto> queryListResDtos = kwcContractLogisticsMapper.queryList(queryListReqDto);
-        if (CollectionUtils.isNotEmpty(queryListResDtos)) {
-            queryListResVos = getQueryListResVos(queryListResDtos);
+        if (CollectionUtils.isEmpty(queryListResDtos)) {
+            throw new SystemException("导出数据为空");
         }
 
-        try {
-            EasyExcelUtil.writeSingleExcel("物流合同.xlsx", "sheet1", queryListResVos, QueryListResVo.class);
-        } catch (IOException e) {
-//            log.error("导出失败:", e);
-            throw new SystemException(HttpStatus.CODE_10301, HttpStatus.MSG_014);
-        }
+        List<QueryListResVo> list = getQueryListResVos(queryListResDtos);
+        List<LogisticsListExport> dataList = BeanUtils.copyToList(list, LogisticsListExport.class);
+        ExcelUtil.downData(response, LogisticsListExport.class, dataList);
     }
 
 

+ 26 - 14
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/KwcContractTradeService.java

@@ -3,12 +3,14 @@ package com.sckw.contract.service;
 import java.io.IOException;
 import java.util.Date;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.contract.model.dto.req.QueryListReqDto;
 import com.sckw.contract.model.dto.res.QueryListResDto;
 import com.sckw.contract.model.entity.*;
+import com.sckw.contract.model.report.LogisticsListExport;
 import com.sckw.contract.model.report.TradeListExport;
 import com.sckw.contract.model.vo.req.*;
 
@@ -18,6 +20,7 @@ import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.enums.ContractStatusEnum;
+import com.sckw.core.model.enums.ContractTrackEnum;
 import com.sckw.core.model.enums.EntTypeEnum;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
@@ -87,6 +90,8 @@ public class KwcContractTradeService {
     @Value(value = "${jumpUrl.saleSendContract}")
     private String saleSendContract;
 
+
+
     /**
      * @return PageResult
      * @desc: 分页查询
@@ -589,6 +594,7 @@ public class KwcContractTradeService {
         if (kwcContractTradeMapper.updateById(kwcContractTrade) <= 0) {
             throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
         }
+        kwcContractTradeTrackService.saveContractTradeTrack(kwcContractTrade.getId(), ContractTrackEnum.OVER.getCode());
 
         //完结相关订单
         ContractSignCompletedParam contractSignCompletedParam = new ContractSignCompletedParam();
@@ -643,26 +649,32 @@ public class KwcContractTradeService {
      * @author: czh
      * @date 2023/7/17
      */
-    public void export(QueryListReqVo reqVo) {
+    public void export(QueryListReqVo reqVo, HttpServletResponse response) {
         QueryListReqDto queryListReqDto = new QueryListReqDto();
         BeanUtils.copyProperties(reqVo, queryListReqDto);
-        queryListReqDto.setEntId(LoginUserHolder.getEntId());
-        if (StringUtils.isNotBlank(reqVo.getIds())) {
-            List<Long> idList = Arrays.stream(reqVo.getIds().split(Global.COMMA)).map(Long::parseLong).toList();
-            queryListReqDto.setIdList(idList);
+        List<Long> allEnt = new ArrayList<>();
+        if (Objects.isNull(reqVo.getEntId())) {
+            queryListReqDto.setEntId(LoginUserHolder.getEntId());
         }
+        allEnt.add(queryListReqDto.getEntId());
 
-        List<QueryListResVo> queryListResVos = new ArrayList<>();
-        List<QueryListResDto> queryListResDtos = kwcContractTradeMapper.queryList(queryListReqDto);
-        if (CollectionUtils.isNotEmpty(queryListResDtos)) {
-            queryListResVos = getQueryListResVos(queryListResDtos);
+        EntCacheResDto entCacheResDto = remoteSystemService.queryEntTreeById(queryListReqDto.getEntId());
+        if (Objects.nonNull(entCacheResDto)) {
+            EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntTreeById(entCacheResDto.getId());
+            List<EntCacheResDto> child = entCacheResDto1.getChild();
+            if (CollectionUtils.isNotEmpty(child)) {
+                allEnt.addAll(child.stream().map(EntCacheResDto::getId).toList());
+            }
         }
-        try {
-            EasyExcelUtil.writeSingleExcel("贸易合同.xlsx", "sheet1", queryListResVos, QueryListResVo.class);
-        } catch (IOException e) {
-            log.error("导出失败:", e);
-            throw new SystemException(HttpStatus.CODE_10301, HttpStatus.MSG_014);
+        queryListReqDto.setAllEnt(allEnt);
+        List<QueryListResDto> queryListResDtos = kwcContractTradeMapper.queryList(queryListReqDto);
+        if (CollectionUtils.isEmpty(queryListResDtos)) {
+            throw new SystemException("导出数据为空");
         }
+
+        List<QueryListResVo> list = getQueryListResVos(queryListResDtos);
+        List<LogisticsListExport> dataList = BeanUtils.copyToList(list, LogisticsListExport.class);
+        ExcelUtil.downData(response, LogisticsListExport.class, dataList);
     }
 
     /**

+ 3 - 0
sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractLogisticsMapper.xml

@@ -119,6 +119,9 @@
         <if test="signingWay != null">
             and a.signing_way = #{signingWay}
         </if>
+        <if test="charging != null">
+            and a.charging = #{charging}
+        </if>
         <if test="keywords != null and keywords != ''">
             and (b.firm_name like concat('%', #{keywords}, '%') or
                  e.firm_name like concat('%', #{keywords}, '%') or

+ 21 - 9
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverController.java

@@ -2,15 +2,15 @@ package com.sckw.fleet.controller;
 
 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.SystemTypeEnum;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
-import com.sckw.excel.easyexcel.RequestHolder;
+import com.sckw.core.web.response.ResponseUtil;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.fleet.model.dto.*;
 import com.sckw.fleet.model.vo.*;
@@ -18,9 +18,12 @@ import com.sckw.fleet.service.KwfDriverService;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -125,17 +128,16 @@ public class KwfDriverController {
      * @author zk
      * @date 2023/07/11
      **/
-    @PostMapping("/export")
-    public void export(@RequestBody Map<String, Object> params) {
+    @PostMapping(value = "/export", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void export(@RequestBody Map<String, Object> params, HttpServletResponse response) {
         /**分页数据**/
         List<KwfDriverVo> drivers = driverService.findPage(params);
 
-        if (!CollectionUtils.isEmpty(drivers)) {
-            HttpServletResponse response = RequestHolder.getResponse();
-            ExcelUtil.downData(response, KwfDriverVo.class, drivers);
-            //return null;
+        if (CollectionUtils.isEmpty(drivers)) {
+            throw new BusinessException("没有您想导出的数据!");
         }
-        //return HttpResult.error("无数据!");
+        ExcelUtil.downData(response, KwfDriverVo.class, drivers);
+        //ResponseUtil.writer(response, HttpResult.error("没有您想导出的数据!"));
     }
 
     /**
@@ -251,4 +253,14 @@ public class KwfDriverController {
         return driverService.forgetPassword(params);
     }
 
+    /**
+     * @desc 企业司机统计
+     * @author zk
+     * @date 2023/9/18
+     **/
+    @GetMapping("/driverStatistics")
+    public HttpResult driverStatistics() {
+        return HttpResult.ok(driverService.driverStatistics());
+    }
+
 }

+ 10 - 7
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfFleetController.java

@@ -2,12 +2,14 @@ package com.sckw.fleet.controller;
 
 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.enums.SystemTypeEnum;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.core.web.response.ResponseUtil;
 import com.sckw.excel.easyexcel.RequestHolder;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.fleet.model.dto.KwfFleetDto;
@@ -16,8 +18,11 @@ import com.sckw.fleet.service.KwfFleetService;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
@@ -78,18 +83,16 @@ public class KwfFleetController {
      * @author zk
      * @date 2023/07/11
      **/
-    @PostMapping("/export")
-    public HttpResult export(@RequestBody Map<String, Object> params) {
+    @PostMapping(value = "/export", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void export(@RequestBody Map<String, Object> params, HttpServletResponse response) {
         params.put("entId", LoginUserHolder.getEntId());
         /**查询分页数据**/
         List<KwfFleetVo> fleets = fleetService.findPage(params);
 
-        if (!CollectionUtils.isEmpty(fleets)) {
-            HttpServletResponse response = RequestHolder.getResponse();
-            ExcelUtil.downData(response, KwfFleetVo.class, fleets);
-            return null;
+        if (CollectionUtils.isEmpty(fleets)) {
+            throw new BusinessException("没有您想导出的数据!");
         }
-        return HttpResult.error("无数据!");
+        ExcelUtil.downData(response, KwfFleetVo.class, fleets);
     }
 
     /**

+ 18 - 7
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 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.SystemTypeEnum;
@@ -14,6 +15,7 @@ import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.core.web.response.ResponseUtil;
 import com.sckw.excel.easyexcel.RequestHolder;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.fleet.model.dto.GpsByTruckNoDto;
@@ -27,6 +29,7 @@ import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import java.io.BufferedReader;
@@ -136,17 +139,15 @@ public class KwfTruckController {
      * @author zk
      * @date 2023/07/11
      **/
-    @PostMapping("/export")
-    public HttpResult export(@RequestBody Map<String, Object> params) {
+    @PostMapping(value = "/export", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void export(@RequestBody Map<String, Object> params, HttpServletResponse response) {
         /**查询数据**/
         List<KwfTruckVo> trucks = truckService.findPage(params);
 
-        if (!CollectionUtils.isEmpty(trucks)) {
-            HttpServletResponse response = RequestHolder.getResponse();
-            ExcelUtil.downData(response, KwfTruckVo.class, trucks);
-            return null;
+        if (CollectionUtils.isEmpty(trucks)) {
+            throw new BusinessException("没有您想导出的数据!");
         }
-        return HttpResult.error("无数据!");
+        ExcelUtil.downData(response, KwfTruckVo.class, trucks);
     }
 
     /**
@@ -216,6 +217,16 @@ public class KwfTruckController {
         return truckService.transportLicenseEdit(params);
     }
 
+    /**
+     * @desc 企业车辆统计
+     * @author zk
+     * @date 2023/9/18
+     **/
+    @GetMapping("/truckStatistics")
+    public HttpResult truckStatistics() {
+        return HttpResult.ok(truckService.truckStatistics());
+    }
+
     /**
      * @param params {truckNo 車牌號}
      * @desc 车辆查询(业务关联+归属车辆)

+ 11 - 7
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckReportController.java

@@ -2,12 +2,15 @@ package com.sckw.fleet.controller;
 
 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.enums.SystemTypeEnum;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.core.web.response.ResponseUtil;
 import com.sckw.excel.easyexcel.RequestHolder;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.fleet.model.KwfTruckReport;
@@ -18,9 +21,12 @@ import com.sckw.fleet.service.KwfTruckReportService;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
@@ -71,18 +77,16 @@ public class KwfTruckReportController {
      * @author zk
      * @date 2023/07/18
      **/
-    @PostMapping("/export")
-    public HttpResult export(@RequestBody Map<String, Object> params) {
+    @PostMapping(value = "/export", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void export(@RequestBody Map<String, Object> params, HttpServletResponse response) {
         params.put("entId", LoginUserHolder.getEntId());
         /**查询数据**/
         List<KwfTruckReportVo> trucks = reportService.findPage(params);
 
-        if (!CollectionUtils.isEmpty(trucks)) {
-            HttpServletResponse response = RequestHolder.getResponse();
-            ExcelUtil.downData(response, KwfTruckReportVo.class, trucks);
-            return null;
+        if (CollectionUtils.isEmpty(trucks)) {
+            throw new BusinessException("没有您想导出的数据!");
         }
-        return HttpResult.error("无数据!");
+        ExcelUtil.downData(response, KwfTruckReportVo.class, trucks);
     }
 
     /**

+ 7 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfDriverMapper.java

@@ -68,4 +68,11 @@ public interface KwfDriverMapper extends BaseMapper<KwfDriver> {
      * @return
      */
     KwfDriver findEntDriver(KwfDriver params);
+
+    /**
+     * 企业司机统计
+     * @param entId 企业id
+     * @return
+     */
+    Map<String, Object> driverStatistics(@Param("entId") Long entId);
 }

+ 8 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfTruckMapper.java

@@ -86,4 +86,12 @@ public interface KwfTruckMapper extends BaseMapper<KwfTruck> {
      * @return
      */
     List<KwfTruckMonitorVo> findTruckByAll(Map<String, Object> params);
+
+
+    /**
+     * 企业车辆统计
+     * @param entId 企业id
+     * @return
+     */
+    Map<String, Object> truckStatistics(@Param("entId") Long entId);
 }

+ 7 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfDriverVo.java

@@ -5,7 +5,9 @@ import com.alibaba.excel.annotation.ExcelProperty;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.sckw.excel.annotation.ExcelContext;
 import lombok.Data;
-
+import lombok.experimental.Accessors;
+import java.io.Serial;
+import java.io.Serializable;
 import java.util.Date;
 
 /**
@@ -14,8 +16,11 @@ import java.util.Date;
  * @date 2023/7/7 0007
  */
 @Data
+@Accessors(chain = true)
 @ExcelContext(fileName = "司机信息", sheetName = "司机信息")
-public class KwfDriverVo {
+public class KwfDriverVo implements Serializable {
+    @Serial
+    private static final long serialVersionUID = -7951209824419412386L;
 
     /**
      * 司机主键id

+ 7 - 1
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfFleetVo.java

@@ -4,6 +4,9 @@ import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.sckw.excel.annotation.ExcelContext;
 import lombok.Data;
+import lombok.experimental.Accessors;
+import java.io.Serial;
+import java.io.Serializable;
 
 /**
  * @author zk
@@ -11,8 +14,11 @@ import lombok.Data;
  * @date 2023/7/6 0006
  */
 @Data
+@Accessors(chain = true)
 @ExcelContext(fileName = "车队班组信息", sheetName = "车队班组信息")
-public class KwfFleetVo {
+public class KwfFleetVo implements Serializable {
+    @Serial
+    private static final long serialVersionUID = -7951209824419412686L;
 
     /**
      * 主键id

+ 7 - 1
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckReportVo.java

@@ -4,6 +4,9 @@ import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.sckw.excel.annotation.ExcelContext;
 import lombok.Data;
+import lombok.experimental.Accessors;
+import java.io.Serial;
+import java.io.Serializable;
 
 /**
  * @desc 车辆上报
@@ -11,8 +14,11 @@ import lombok.Data;
  * @date 2023/7/15
  */
 @Data
+@Accessors(chain = true)
 @ExcelContext(fileName = "车辆上报信息", sheetName = "车辆上报信息")
-public class KwfTruckReportVo {
+public class KwfTruckReportVo implements Serializable {
+    @Serial
+    private static final long serialVersionUID = -7951209824419412486L;
 
     /**
      * 车辆主键id

+ 7 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckVo.java

@@ -5,7 +5,9 @@ import com.alibaba.excel.annotation.ExcelProperty;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.sckw.excel.annotation.ExcelContext;
 import lombok.Data;
-
+import lombok.experimental.Accessors;
+import java.io.Serial;
+import java.io.Serializable;
 import java.util.Date;
 
 /**
@@ -14,8 +16,11 @@ import java.util.Date;
  * @date 2023/7/11 0011
  */
 @Data
+@Accessors(chain = true)
 @ExcelContext(fileName = "车辆信息", sheetName = "车辆信息")
-public class KwfTruckVo {
+public class KwfTruckVo implements Serializable {
+    @Serial
+    private static final long serialVersionUID = -7951209824419412586L;
 
     /**
      * 车辆信息主键id

+ 9 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java

@@ -841,6 +841,15 @@ public class KwfDriverService {
         }
     }
 
+    /**
+     * @desc 企业司机统计
+     * @author zk
+     * @date 2023/9/18
+     **/
+    public Map<String, Object> driverStatistics() {
+        return driverDao.driverStatistics(LoginUserHolder.getEntId());
+    }
+
     /**
      * @param type 字典类型
      * @param value 字典值

+ 9 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckService.java

@@ -633,6 +633,15 @@ public class KwfTruckService {
         }
     }
 
+    /**
+     * @desc 企业车辆统计
+     * @author zk
+     * @date 2023/9/18
+     **/
+    public Map<String, Object> truckStatistics() {
+        return truckDao.truckStatistics(LoginUserHolder.getEntId());
+    }
+
     /**
      * @param params {truckNo 車牌號}
      * @desc 车辆查询(业务关联+归属车辆)

+ 26 - 0
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverMapper.xml

@@ -305,4 +305,30 @@
         and dr.id = #{id, jdbcType=VARCHAR}
     </select>
 
+    <select id="driverStatistics" resultType="java.util.Map" >
+        select
+            tabA.abnormalTotal, tabB.idleTotal, tabC.inTaskTotal, (tabB.idleTotal + tabC.inTaskTotal) allTotal
+        from
+        (SELECT
+        count(1) abnormalTotal, '' indexNum
+        from kwf_driver tr
+        left join kwf_driver_ent tre on tre.driver_id = tr.id
+        where tr.del_flag = 0 and tre.del_flag = 0 and tr.auth_status = 3 and tre.ent_id = #{entId, jdbcType=BIGINT}
+        ) tabA
+        left join
+        (SELECT
+        count(1) idleTotal, '' indexNum
+        from kwf_driver tr
+        left join kwf_driver_ent tre on tre.driver_id = tr.id
+        where tr.del_flag = 0 and tre.del_flag = 0 and tr.business_status = 0 and tre.ent_id = #{entId, jdbcType=BIGINT}
+        ) tabB	on tabB.indexNum = tabA.indexNum
+        left join
+        (SELECT
+        count(1) inTaskTotal, '' indexNum
+        from kwf_driver tr
+        left join kwf_driver_ent tre on tre.driver_id = tr.id
+        where tr.del_flag = 0 and tre.del_flag = 0 and tr.business_status = 1 and tre.ent_id = #{entId, jdbcType=BIGINT}
+        ) tabC	on tabC.indexNum = tabA.indexNum
+    </select>
+
 </mapper>

+ 26 - 0
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckMapper.xml

@@ -359,4 +359,30 @@
         </if>
     </select>
 
+    <select id="truckStatistics" resultType="java.util.Map" >
+        select
+        tabA.abnormalTotal, tabB.idleTotal, tabC.inTaskTotal, (tabB.idleTotal + tabC.inTaskTotal) allTotal
+        from
+        (SELECT
+        count(1) abnormalTotal, '' indexNum
+        from kwf_truck tr
+        left join kwf_truck_ent tre on tre.truck_id = tr.id
+        where tr.del_flag = 0 and tre.del_flag = 0 and tr.auth_status = 3 and tre.ent_id = #{entId, jdbcType=BIGINT}
+        ) tabA
+        left join
+        (SELECT
+        count(1) idleTotal, '' indexNum
+        from kwf_truck tr
+        left join kwf_truck_ent tre on tre.truck_id = tr.id
+        where tr.del_flag = 0 and tre.del_flag = 0 and tr.business_status = 0 and tre.ent_id = #{entId, jdbcType=BIGINT}
+        ) tabB	on tabB.indexNum = tabA.indexNum
+        left join
+        (SELECT
+        count(1) inTaskTotal, '' indexNum
+        from kwf_truck tr
+        left join kwf_truck_ent tre on tre.truck_id = tr.id
+        where tr.del_flag = 0 and tre.del_flag = 0 and tr.business_status = 1 and tre.ent_id = #{entId, jdbcType=BIGINT}
+        ) tabC	on tabC.indexNum = tabA.indexNum
+    </select>
+
 </mapper>

+ 5 - 9
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/controller/KwmAddressController.java

@@ -4,8 +4,10 @@ import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.manage.model.vo.req.*;
 import com.sckw.manage.service.KwmAddressService;
+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.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -95,9 +97,9 @@ public class KwmAddressController {
      * @author: czh
      * @date: 2023/7/12
      */
-    @PostMapping("/export")
-    public void export(@Valid @RequestBody AddressQueryReqVo reqVo) {
-        kwmAddressService.export(reqVo);
+    @PostMapping(value = "export", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void export(@Valid @RequestBody AddressQueryReqVo reqVo, HttpServletResponse response) {
+        kwmAddressService.export(reqVo, response);
     }
 
     /**
@@ -124,10 +126,4 @@ public class KwmAddressController {
         return HttpResult.ok(kwmAddressService.detail(reqVo.getId()));
     }
 
-    @PostMapping("test")
-    public HttpResult test() {
-        kwmAddressService.test();
-        return HttpResult.ok();
-    }
-
 }

+ 5 - 3
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/controller/KwmCooperateApplyController.java

@@ -7,8 +7,10 @@ import com.sckw.manage.model.vo.req.CooperateApproveReqVo;
 import com.sckw.manage.model.vo.req.IdsReqVo;
 import com.sckw.manage.model.vo.req.InitiateReqVo;
 import com.sckw.manage.service.KwmCooperateApplyService;
+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.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -83,9 +85,9 @@ public class KwmCooperateApplyController {
      * @author: czh
      * @date: 2023/7/11
      */
-    @PostMapping("/export")
-    public void export(@Valid @RequestBody CooperateApplyQueryReqVo reqVo) {
-        kwmCooperateApplyService.export(reqVo);
+    @PostMapping(value = "export", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void export(@Valid @RequestBody CooperateApplyQueryReqVo reqVo, HttpServletResponse response) {
+        kwmCooperateApplyService.export(reqVo, response);
     }
 
 

+ 32 - 6
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/controller/KwmCooperateManageController.java

@@ -5,8 +5,11 @@ import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.manage.model.vo.req.*;
 import com.sckw.manage.service.KwmCooperateManageService;
+import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -107,9 +110,9 @@ public class KwmCooperateManageController {
      * @author: czh
      * @date: 2023/7/11
      */
-    @PostMapping("export")
-    public void export(@Valid @RequestBody CooperateManageQueryReqVo reqVo) {
-        kwmCooperateManageService.export(reqVo);
+    @PostMapping(value = "export", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void export(@Valid @RequestBody CooperateManageQueryReqVo reqVo, HttpServletResponse response) {
+        kwmCooperateManageService.export(reqVo, response);
     }
 
     /**
@@ -132,7 +135,7 @@ public class KwmCooperateManageController {
      * @date: 2023/7/22
      */
     @PostMapping("findEntCooperate")
-    public HttpResult findEntCooperate(@RequestBody FindEntCooperateReqVo reqVo) {
+    public HttpResult findEntCooperate(@Valid @RequestBody FindEntCooperateReqVo reqVo) {
         return HttpResult.ok(kwmCooperateManageService.findEntCooperate(reqVo));
     }
 
@@ -145,7 +148,7 @@ public class KwmCooperateManageController {
      * @date: 2023/8/1
      */
     @PostMapping("findCooperateByEnt")
-    public HttpResult findCooperateByEnt(@RequestBody FindCooperateByEntReqVo reqVo) {
+    public HttpResult findCooperateByEnt(@Valid @RequestBody FindCooperateByEntReqVo reqVo) {
         return HttpResult.ok(kwmCooperateManageService.findCooperateByEnt(reqVo));
     }
 
@@ -157,8 +160,31 @@ public class KwmCooperateManageController {
      * @date: 2023/7/22
      */
     @PostMapping("findTargetEntCooperateInOur")
-    public HttpResult findTargetEntCooperateInOur(@RequestBody FindCooperateByEntReqVo reqVo) {
+    public HttpResult findTargetEntCooperateInOur(@Valid @RequestBody FindCooperateByEntReqVo reqVo) {
         return HttpResult.ok(kwmCooperateManageService.findTargetEntCooperateInOur(reqVo));
     }
 
+    /**
+     * @param reqVo 分页入参
+     * @return HttpResult
+     * @desc: 运营端查合作信息
+     * @author: czh
+     * @date: 2023/9/15
+     */
+    @PostMapping("queryAllCooperateInfoByPage")
+    public HttpResult queryAllCooperateInfoByPage(@RequestBody CooperateManageQueryReqVo reqVo) {
+        return HttpResult.ok(kwmCooperateManageService.queryAllCooperateInfoByPage(reqVo));
+    }
+
+    /**
+     * @param reqVo 查询入参
+     * @desc: 导出
+     * @author: czh
+     * @date: 2023/7/11
+     */
+    @PostMapping(value = "exportAllCooperateInfo", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void exportAllCooperateInfo(@RequestBody CooperateManageQueryReqVo reqVo, HttpServletResponse response) {
+        kwmCooperateManageService.exportAllCooperateInfo(reqVo, response);
+    }
+
 }

+ 10 - 0
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/dao/KwmCooperateMapper.java

@@ -6,6 +6,7 @@ import com.sckw.manage.model.entity.KwmCooperate;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.manage.model.vo.req.FindCooperateByEntReqVo;
 import com.sckw.manage.model.vo.req.FindEntCooperateReqVo;
+import com.sckw.manage.model.vo.req.QueryAllCooperateInfoReqDto;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -55,6 +56,15 @@ public interface KwmCooperateMapper extends BaseMapper<KwmCooperate> {
      * @date: 2023/8/16
      */
     List<KwmCooperate> findEntCooperate(FindEntCooperateReqVo reqVo);
+
+    /**
+     * @param reqDto 入参
+     * @return CooperateManageQueryResDto
+     * @desc: 运营端查合作信息
+     * @author: czh
+     * @date: 2023/9/15
+     */
+    List<CooperateManageQueryResDto> queryAllCooperateInfoList(@Param(value = "reqDto") QueryAllCooperateInfoReqDto reqDto);
 }
 
 

+ 5 - 0
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/dto/res/CooperateManageQueryResDto.java

@@ -82,6 +82,11 @@ public class CooperateManageQueryResDto {
      */
     private Date createTime;
 
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
     /**
      * 对方企业id
      */

+ 76 - 0
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/report/AddressQueryExport.java

@@ -0,0 +1,76 @@
+package com.sckw.manage.model.report;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sckw.excel.annotation.ExcelContext;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author czh
+ * @desc 地点档案列表信息
+ * @date 2023/9/14
+ */
+@Data
+@Accessors(chain = true)
+@ExcelContext(fileName = "地点档案列表信息", sheetName = "地点档案列表信息")
+public class AddressQueryExport implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 9153289220823593050L;
+
+    @ExcelProperty(value = "地址名称")
+    private String name;
+
+    @ExcelProperty(value = "地址类型")
+    private String typeName;
+
+    @ExcelProperty(value = "企业名称")
+    private String entName;
+
+    @ExcelProperty(value = "电子围栏")
+    private String fence;
+
+    @ExcelProperty(value = "默认类型")
+    private String defaultTypeName;
+
+    @ExcelProperty(value = "联系人")
+    private String contacts;
+
+    @ExcelProperty(value = "联系电话")
+    private String phone;
+
+    @ExcelProperty(value = "所属区域")
+    private String cityName;
+
+    @ExcelProperty(value = "详细地址")
+    private String detailAddress;
+
+    @ExcelProperty(value = "经度")
+    private String lng;
+
+    @ExcelProperty(value = "纬度")
+    private String lat;
+
+    @ExcelProperty(value = "创建人")
+    private String createByName;
+
+    @ExcelProperty(value = "创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @ExcelProperty(value = "修改时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    @ExcelProperty(value = "备注")
+    private String remark;
+
+}

+ 59 - 0
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/report/CooperateManageExport.java

@@ -0,0 +1,59 @@
+package com.sckw.manage.model.report;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.sckw.excel.annotation.ExcelContext;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author czh
+ * @desc 合作信息
+ * @date 2023/9/14
+ */
+@Data
+@Accessors(chain = true)
+@ExcelContext(fileName = "合作信息", sheetName = "合作信息")
+public class CooperateManageExport implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -5491364851093075646L;
+
+    @ExcelProperty(value = "申请类型")
+    private String applyType;
+
+    @ExcelProperty(value = "合作状态")
+    private String status;
+
+    @ExcelProperty(value = "合作单位名称")
+    private String targetEntName;
+
+    @ExcelProperty(value = "我方单位名称")
+    private String entName;
+
+    @ExcelProperty(value = "供应单位")
+    private String ent1;
+
+    @ExcelProperty(value = "采购单位")
+    private String ent2;
+
+    @ExcelProperty(value = "托运单位")
+    private String ent3;
+
+    @ExcelProperty(value = "承运单位")
+    private String ent4;
+
+    @ExcelProperty(value = "合作单位联系人")
+    private String contacts;
+
+    @ExcelProperty(value = "联系电话")
+    private String phone;
+
+    @ExcelProperty(value = "我方联系人")
+    private String manager;
+
+    @ExcelProperty(value = "联系电话")
+    private String managerPhone;
+}

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

@@ -0,0 +1,129 @@
+package com.sckw.manage.model.report;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sckw.excel.annotation.ExcelContext;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author czh
+ * @desc 运营端查合作信息
+ * @date 2023/9/15
+ */
+@Data
+@Accessors(chain = true)
+@ExcelContext(fileName = "合作信息", sheetName = "合作信息")
+public class QueryAllCooperateInfoExcel implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 823363899004504362L;
+
+    /**
+     * 状态名
+     */
+    @ExcelProperty(value = "合作状态")
+    private Integer statusName;
+
+
+    /**
+     * 邀请企业名
+     */
+    @ExcelProperty(value = "邀请单位名称")
+    private String inviterEntName;
+
+    /**
+     * 受邀企业名
+     */
+    @ExcelProperty(value = "受邀单位名称")
+    private String inviteeEntName;
+
+    /**
+     * 采购单位
+     */
+    @ExcelProperty(value = "采购单位")
+    private String ent1;
+
+    /**
+     * 供应单位
+     */
+    @ExcelProperty(value = "供应单位")
+    private String ent2;
+
+    /**
+     * 托运单位
+     */
+    @ExcelProperty(value = "托运单位")
+    private String ent3;
+
+    /**
+     * 承运单位
+     */
+    @ExcelProperty(value = "承运单位")
+    private String ent4;
+
+
+    /**
+     * 邀请单位客户经理
+     */
+    @ExcelProperty(value = "邀请单位客户经理")
+    private String inviterContacts;
+
+    /**
+     * 邀请经理电话
+     */
+    @ExcelProperty(value = "邀请经理电话")
+    private String inviterContactsPhone;
+
+    /**
+     * 受邀单位客户经理
+     */
+    @ExcelProperty(value = "受邀单位客户经理")
+    private String inviteeContacts;
+
+    /**
+     * 受邀经理电话
+     */
+    @ExcelProperty(value = "受邀经理电话")
+    private String inviteeContactsPhone;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ExcelProperty(value = "创建时间")
+    private Date createTime;
+
+    /**
+     * 创建人
+     */
+    @ExcelProperty(value = "创建人")
+    private String createByName;
+
+    /**
+     * 联系电话
+     */
+    @ExcelProperty(value = "联系电话")
+    private String phone;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ExcelProperty(value = "最近更新时间")
+    private Date updateTime;
+
+    /**
+     * 备注
+     */
+    @ExcelProperty(value = "备注")
+    private String remark;
+
+}

+ 1 - 1
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/vo/req/AddressQueryReqVo.java

@@ -54,6 +54,6 @@ public class AddressQueryReqVo extends PageRequest implements Serializable {
     /**
      * 主键
      */
-    private String ids;
+    private List<Long> ids;
 
 }

+ 46 - 0
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/vo/req/QueryAllCooperateInfoReqDto.java

@@ -0,0 +1,46 @@
+package com.sckw.manage.model.vo.req;
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author czh
+ * @desc 运营端查合作信息
+ * @date 2023/9/15
+ */
+@Data
+public class QueryAllCooperateInfoReqDto {
+
+    /**
+     * 单位名称、联系人、电话
+     */
+    private String keywords;
+
+    /**
+     * 开始时间(时间戳)
+     */
+    private Date startTime;
+
+    /**
+     * 结束时间(时间戳)
+     */
+    private Date endTime;
+
+    /**
+     * id集合
+     */
+    private List<Long> ids;
+
+    /**
+     * 合作属性
+     */
+    private List<Integer> cooperateTypes;
+
+    /**
+     * 要查询的企业id
+     */
+    private List<Long> queryEntIdList;
+
+}

+ 5 - 0
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/model/vo/res/AddressQueryResVo.java

@@ -121,4 +121,9 @@ public class AddressQueryResVo implements Serializable {
      */
     private Integer defaultType;
 
+    /**
+     * 企业名称
+     */
+    private String entName;
+
 }

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

@@ -0,0 +1,126 @@
+package com.sckw.manage.model.vo.res;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+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/15
+ */
+@Data
+public class QueryAllCooperateInfoResVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -6887505191222426315L;
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    /**
+     * 状态名
+     */
+    private String statusName;
+
+    /**
+     * 邀请企业id
+     */
+    private Long inviterEntId;
+
+    /**
+     * 邀请企业名
+     */
+    private String inviterEntName;
+
+    /**
+     * 受邀企业id
+     */
+    private Long inviteeEntId;
+
+    /**
+     * 受邀企业名
+     */
+    private String inviteeEntName;
+
+    /**
+     * 采购单位
+     */
+    private String ent1;
+
+    /**
+     * 供应单位
+     */
+    private String ent2;
+
+    /**
+     * 托运单位
+     */
+    private String ent3;
+
+    /**
+     * 承运单位
+     */
+    private String ent4;
+
+    /**
+     * 合作属性
+     */
+    private String cooperateTypes;
+
+    /**
+     * 邀请单位客户经理
+     */
+    private String inviterContacts;
+
+    /**
+     * 邀请经理电话
+     */
+    private String inviterContactsPhone;
+
+    /**
+     * 受邀单位客户经理
+     */
+    private String inviteeContacts;
+
+    /**
+     * 受邀经理电话
+     */
+    private String inviteeContactsPhone;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /**
+     * 创建人
+     */
+    private String createByName;
+
+    /**
+     * 联系电话
+     */
+    private String phone;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 9 - 2
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/CommonBusinessService.java

@@ -3,6 +3,7 @@ package com.sckw.manage.service;
 import com.alibaba.fastjson2.JSON;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.enums.ClientTypeEnum;
 import com.sckw.core.model.enums.CooperateStatusEnum;
 import com.sckw.core.model.enums.CooperateTypeEnum;
 import com.sckw.core.utils.AsyncThreadUtils;
@@ -367,12 +368,18 @@ public class CommonBusinessService {
     }
 
 
-    public void sendSystemMessage(List<UserInfo> userInfos, MessageEnum messageEnum, Map<String, Object> map, String msgUrl) {
+    public void sendSystemMessage(List<UserInfo> userInfos, MessageEnum messageEnum, Map<String, Object> map, String msgUrl, String appMsgUrl) {
         SckwMessage msg = new SckwMessage();
+        Map<String, String> msgUrls = new HashMap<>(Global.NUMERICAL_FOUR);
+        msgUrls.put(ClientTypeEnum.pc.getValue(), msgUrl);
+        if (StringUtils.isNotBlank(appMsgUrl)) {
+            msgUrls.put(ClientTypeEnum.app.getValue(), appMsgUrl);
+        }
+
         msg.setRequestId(UUIDUtils.get32UUID())
                 .setMessageEnum(messageEnum)
                 .setParams(map)
-                .setMsgUrl(msgUrl)
+                .setMsgUrls(msgUrls)
                 .setUserInfos(userInfos)
                 .setCreateBy(LoginUserHolder.getUserId());
         AsyncThreadUtils.submit(new AsyncProcess(msg, streamBridge));

+ 24 - 27
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmAddressService.java

@@ -11,6 +11,7 @@ import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.enums.AddressDefaultTypeEnum;
+import com.sckw.core.model.enums.SystemTypeEnum;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.BeanUtils;
@@ -20,10 +21,12 @@ import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.excel.utils.EasyExcelUtil;
+import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.manage.api.model.dto.res.EntAddressResDto;
 import com.sckw.manage.dao.KwmAddressMapper;
 import com.sckw.manage.dubbo.RemoteManageServiceImpl;
 import com.sckw.manage.model.entity.KwmAddress;
+import com.sckw.manage.model.report.AddressQueryExport;
 import com.sckw.manage.model.vo.req.*;
 import com.sckw.manage.model.vo.res.AddressDetailResVo;
 import com.sckw.manage.model.vo.res.AddressQueryResVo;
@@ -34,6 +37,7 @@ import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
 import com.sckw.system.api.model.dto.res.UserCacheResDto;
 import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -93,7 +97,6 @@ public class KwmAddressService {
         LambdaQueryWrapper<KwmAddress> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(Objects.nonNull(reqVo.getCityCode()), KwmAddress::getCityCode, reqVo.getCityCode()).
                 eq(Objects.nonNull(reqVo.getType()), KwmAddress::getType, reqVo.getType()).
-                eq(KwmAddress::getEntId, LoginUserHolder.getEntId()).
                 eq(KwmAddress::getDelFlag, Global.NO).
                 and(StringUtils.isNotBlank(reqVo.getKeywords()),
                         wq -> wq.like(KwmAddress::getDetailAddress, reqVo.getKeywords()).or().
@@ -108,9 +111,14 @@ public class KwmAddressService {
             wrapper.lt(KwmAddress::getCreateTime, DateUtil.offsetDay(reqVo.getEndTime(), 1));
         }
 
-        if (StringUtils.isNotBlank(reqVo.getIds())) {
-            wrapper.in(KwmAddress::getId, Arrays.stream(reqVo.getIds().split(Global.COMMA)).map(Long::parseLong).toList());
+        if (CollectionUtils.isNotEmpty(reqVo.getIds())) {
+            wrapper.in(KwmAddress::getId, reqVo.getIds());
         }
+
+        if (!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode())) {
+            wrapper.eq(KwmAddress::getEntId, LoginUserHolder.getEntId());
+        }
+
         return kwmAddressMapper.selectList(wrapper);
     }
 
@@ -126,8 +134,9 @@ public class KwmAddressService {
         List<AddressQueryResVo> list = new ArrayList<>();
         List<Long> userIds = kwmAddresses.stream().map(KwmAddress::getCreateBy).distinct().toList();
         List<Integer> types = kwmAddresses.stream().map(KwmAddress::getType).distinct().toList();
+        List<Long> endIds = kwmAddresses.stream().map(KwmAddress::getEntId).distinct().toList();
         Map<Long, UserCacheResDto> userCacheResDtoMap = commonBusinessService.queryUserCacheMapByIds(userIds);
-
+        Map<Long, EntCacheResDto> entCacheResDtoMap = commonBusinessService.queryEntCacheMapByIds(endIds);
         StringBuilder keys = new StringBuilder();
         for (Integer type : types) {
             keys.append(DictTypeEnum.ADDRESS_TYPE.getType()).append(Global.POUND).append(type).append(Global.COMMA);
@@ -141,6 +150,7 @@ public class KwmAddressService {
             addressQueryResVo.setType(item.getType());
             UserCacheResDto userCacheResDto = userCacheResDtoMap.get(item.getCreateBy());
             SysDictResDto sysDictResDto = stringSysDictResDtoMap.get(DictTypeEnum.ADDRESS_TYPE.getType() + Global.POUND + item.getType());
+            EntCacheResDto entCacheResDto = entCacheResDtoMap.get(item.getEntId());
             if (Objects.nonNull(sysDictResDto)) {
                 addressQueryResVo.setTypeName(sysDictResDto.getLabel());
             }
@@ -148,6 +158,7 @@ public class KwmAddressService {
             if (Objects.nonNull(userCacheResDto)) {
                 addressQueryResVo.setCreateByName(userCacheResDto.getName());
             }
+
             if (Objects.nonNull(sysDictResDto)) {
                 addressQueryResVo.setTypeName(sysDictResDto.getLabel());
             }
@@ -156,6 +167,10 @@ public class KwmAddressService {
                 addressQueryResVo.setDefaultTypeName(AddressDefaultTypeEnum.getName(item.getDefaultType()).getName());
             }
 
+            if (Objects.nonNull(entCacheResDto)) {
+                addressQueryResVo.setEntName(entCacheResDto.getFirmName());
+            }
+
             addressQueryResVo.setFenceStatus(StringUtils.isNotBlank(item.getFence()) ? "已设置" : "未设置");
             list.add(addressQueryResVo);
         });
@@ -362,19 +377,13 @@ public class KwmAddressService {
      * @author: czh
      * @date: 2023/7/12
      */
-    public void export(AddressQueryReqVo reqVo) {
+    public void export(AddressQueryReqVo reqVo, HttpServletResponse response) {
         List<KwmAddress> kwmAddressList = findList(reqVo);
-        List<AddressQueryResVo> list = new ArrayList<>();
-        if (CollectionUtils.isNotEmpty(kwmAddressList)) {
-            list = getAddressQueryResVo(kwmAddressList);
-        }
-
-        try {
-            EasyExcelUtil.writeSingleExcel("地址管理.xlsx", "sheet1", list, AddressQueryResVo.class);
-        } catch (IOException e) {
-            log.error("导出失败:", e);
-            throw new SystemException(HttpStatus.CODE_10301, HttpStatus.MSG_014);
+        if (CollectionUtils.isEmpty(kwmAddressList)) {
+            throw new SystemException("导出数据为空");
         }
+        List<AddressQueryResVo> list = getAddressQueryResVo(kwmAddressList);
+        ExcelUtil.downData(response, AddressQueryExport.class, BeanUtils.copyToList(list, AddressQueryExport.class));
     }
 
     /**
@@ -435,16 +444,4 @@ public class KwmAddressService {
         return addressDetailResVo;
     }
 
-    public void test() {
-        Map<String, Object> map = new HashMap<>();
-        map.put("entName", "测试企业");
-        map.put("createByName", LoginUserHolder.getUserName());
-        commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(LoginUserHolder.getUserId()).setEntId(LoginUserHolder.getEntId())),
-                MessageEnum.SUBMIT_COOPERATE,
-                map,
-                "testUrl");
-
-        String msg = "{\"createBy\":156382319433748480,\"messageEnum\":\"SUBMIT_COOPERATE\",\"msgUrl\":\"testUrl\",\"params\":{\"createByName\":\"楚镇豪-企业管理员\",\"entName\":\"徐长卿\"},\"requestId\":\"cefb6b5357ce48d9a11ffc94da83c879\",\"userInfos\":[{\"entId\":156382319450525696,\"userId\":156382319433748480}]}";
-        streamBridge.send("sckw-message", com.alibaba.fastjson2.JSON.toJSONString(msg));
-    }
 }

+ 49 - 15
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmCooperateApplyService.java

@@ -9,12 +9,14 @@ import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.enums.CooperateStatusEnum;
+import com.sckw.core.model.enums.CooperateTypeEnum;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.*;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.excel.utils.EasyExcelUtil;
+import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.manage.dao.KwmCooperateMapper;
 import com.sckw.manage.dao.KwmCooperateTypeMapper;
 import com.sckw.manage.model.dto.req.CooperateManageQueryReqDto;
@@ -22,6 +24,8 @@ import com.sckw.manage.model.dto.res.CooperateManageQueryResDto;
 import com.sckw.manage.model.dto.res.CooperateQueryDto;
 import com.sckw.manage.model.entity.KwmCooperate;
 import com.sckw.manage.model.entity.KwmCooperateType;
+import com.sckw.manage.model.report.AddressQueryExport;
+import com.sckw.manage.model.report.CooperateManageExport;
 import com.sckw.manage.model.vo.req.CooperateApplyQueryReqVo;
 import com.sckw.manage.model.vo.req.CooperateApproveReqVo;
 import com.sckw.manage.model.vo.req.IdsReqVo;
@@ -33,6 +37,7 @@ import com.sckw.stream.model.UserInfo;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.UserCacheResDto;
+import jakarta.servlet.http.HttpServletResponse;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -67,6 +72,12 @@ public class KwmCooperateApplyService {
     @Value(value = "${jumpUrl.cooperateApplyUrl}")
     private String cooperateApplyUrl;
 
+    @Value(value = "${jumpUrl.cooperateManageUrl}")
+    private String cooperateManageUrl;
+
+    @Value(value = "${jumpUrl.appCooperateApplyUrl}")
+    private String appCooperateApplyUrl;
+
     /**
      * @param reqVo 分页入参
      * @return HttpResult
@@ -279,7 +290,8 @@ public class KwmCooperateApplyService {
         commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(LoginUserHolder.getUserId()).setEntId(LoginUserHolder.getEntId())),
                 MessageEnum.SUBMIT_COOPERATE,
                 map,
-                cooperateApplyUrl);
+                cooperateApplyUrl,
+                appCooperateApplyUrl);
 
         //合作申请待审核消息
         EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(reqVo.getEntId());
@@ -288,7 +300,8 @@ public class KwmCooperateApplyService {
         commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto1.getContactsId()).setEntId(entCacheResDto1.getId())),
                 MessageEnum.COOPERATE_WAIT_APPROVAL,
                 map,
-                cooperateApplyUrl);
+                cooperateApplyUrl,
+                appCooperateApplyUrl);
     }
 
 
@@ -529,7 +542,8 @@ public class KwmCooperateApplyService {
                 commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto.getContactsId()).setEntId(entCacheResDto.getId())),
                         MessageEnum.COOPERATE_PASS,
                         map,
-                        cooperateApplyUrl);
+                        cooperateManageUrl,
+                        appCooperateApplyUrl);
             } else {
                 KwmCooperate kwmCooperate = kwmCooperateMapper.selectById(Long.parseLong(id));
                 EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(kwmCooperate.getEntId());
@@ -538,7 +552,8 @@ public class KwmCooperateApplyService {
                 commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(entCacheResDto.getContactsId()).setEntId(entCacheResDto.getId())),
                         MessageEnum.COOPERATE_REFUSED,
                         map,
-                        cooperateApplyUrl);
+                        cooperateApplyUrl,
+                        appCooperateApplyUrl);
             }
         }
     }
@@ -550,22 +565,41 @@ public class KwmCooperateApplyService {
      * @author: czh
      * @date: 2023/7/11
      */
-    public void export(CooperateApplyQueryReqVo reqVo) {
+    public void export(CooperateApplyQueryReqVo reqVo, HttpServletResponse response) {
         CooperateManageQueryReqDto reqDto = buildQueryParam(reqVo);
         List<CooperateManageQueryResDto> list = kwmCooperateMapper.findList(reqDto);
         if (CollectionUtils.isEmpty(list)) {
-            return;
+            throw new SystemException("导出数据为空");
         }
+
         List<CooperateManageQueryResVo> cooperateManageQueryResVos = getCooperateManageQueryResVos(list);
-        if (CollectionUtils.isEmpty(cooperateManageQueryResVos)) {
-            return;
-        }
-        try {
-            EasyExcelUtil.writeSingleExcel("合作申请.xlsx", "sheet1", cooperateManageQueryResVos, CooperateManageQueryResVo.class);
-        } catch (IOException e) {
-            log.error("导出失败:", e);
-            throw new SystemException(HttpStatus.CODE_10301, HttpStatus.MSG_014);
-        }
+        List<CooperateManageExport> result = new ArrayList<>();
+        cooperateManageQueryResVos.forEach(item -> {
+            CooperateManageExport cooperateManageExport = new CooperateManageExport();
+            BeanUtils.copyProperties(item, cooperateManageExport);
+            cooperateManageExport.setStatus(CooperateStatusEnum.getName(item.getStatus()));
+            cooperateManageExport.setApplyType(item.getApplyTypeCode().equals(1) ? "我方发起" : "对方发起");
+
+            String cooperateTypes = item.getCooperateTypes();
+            if (cooperateTypes.contains(String.valueOf(CooperateTypeEnum.SUPPLIER.getCode()))) {
+                cooperateManageExport.setEnt1("是");
+            }
+
+            if (cooperateTypes.contains(String.valueOf(CooperateTypeEnum.PURCHASER.getCode()))) {
+                cooperateManageExport.setEnt2("是");
+            }
+
+            if (cooperateTypes.contains(String.valueOf(CooperateTypeEnum.CONSIGN.getCode()))) {
+                cooperateManageExport.setEnt3("是");
+            }
+
+            if (cooperateTypes.contains(String.valueOf(CooperateTypeEnum.CARRIAGE.getCode()))) {
+                cooperateManageExport.setEnt4("是");
+            }
+            result.add(cooperateManageExport);
+        });
+
+        ExcelUtil.downData(response, CooperateManageExport.class, result);
     }
 
 

+ 147 - 21
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmCooperateManageService.java

@@ -1,6 +1,5 @@
 package com.sckw.manage.service;
 
-import java.io.IOException;
 import java.util.Date;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -9,6 +8,7 @@ import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.enums.CooperateStatusEnum;
+import com.sckw.core.model.enums.CooperateTypeEnum;
 import com.sckw.core.model.enums.SystemTypeEnum;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
@@ -18,28 +18,32 @@ import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
-import com.sckw.excel.utils.EasyExcelUtil;
+import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.manage.dao.KwmCooperateMapper;
 import com.sckw.manage.dao.KwmCooperateTypeMapper;
 import com.sckw.manage.model.dto.req.CooperateManageQueryReqDto;
 import com.sckw.manage.model.dto.res.CooperateManageQueryResDto;
+import com.sckw.manage.model.entity.KwmAddress;
 import com.sckw.manage.model.entity.KwmCooperate;
 import com.sckw.manage.model.entity.KwmCooperateType;
-import com.sckw.manage.model.vo.req.BindManagerReqVo;
-import com.sckw.manage.model.vo.req.CooperateManageQueryReqVo;
-import com.sckw.manage.model.vo.req.FindCooperateByEntReqVo;
-import com.sckw.manage.model.vo.req.FindEntCooperateReqVo;
+import com.sckw.manage.model.report.AddressQueryExport;
+import com.sckw.manage.model.report.CooperateManageExport;
+import com.sckw.manage.model.report.QueryAllCooperateInfoExcel;
+import com.sckw.manage.model.vo.req.*;
 import com.sckw.manage.model.vo.res.*;
 import com.sckw.payment.api.model.constant.OrderEnum;
 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.model.dto.res.UserCacheResDto;
 import com.sckw.transport.api.dubbo.TransportDubboService;
 import com.sckw.payment.api.dubbo.PaymentDubboService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
+import jakarta.servlet.http.HttpServletResponse;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
+import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -81,6 +85,9 @@ public class KwmCooperateManageService {
     @Value(value = "${jumpUrl.cooperateManageUrl}")
     private String cooperateManageUrl;
 
+    @Value(value = "${jumpUrl.appCooperateApplyUrl}")
+    private String appCooperateApplyUrl;
+
     /**
      * @param reqVo 分页入参
      * @return PageResult
@@ -236,26 +243,30 @@ public class KwmCooperateManageService {
                 commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(ourEntTopCacheResDto.getContactsId()).setEntId(ourEntTopCacheResDto.getId())),
                         MessageEnum.COOPERATE_DISSOLVE,
                         map,
-                        cooperateManageUrl);
+                        cooperateManageUrl,
+                        appCooperateApplyUrl);
 
                 map.put("entName", ourEntCacheResDto.getFirmName());
                 commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(targetEntTreeCacheResDto.getContactsId()).setEntId(targetEntTreeCacheResDto.getId())),
                         MessageEnum.COOPERATE_DISSOLVED,
                         map,
-                        cooperateManageUrl);
+                        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);
+                        cooperateManageUrl,
+                        appCooperateApplyUrl);
 
                 map.put("entName", ourEntCacheResDto.getFirmName());
                 commonBusinessService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(targetEntTreeCacheResDto.getContactsId()).setEntId(targetEntTreeCacheResDto.getId())),
                         MessageEnum.COOPERATE_RESTORED,
                         map,
-                        cooperateManageUrl);
+                        cooperateManageUrl,
+                        appCooperateApplyUrl);
             }
 
         }
@@ -339,23 +350,39 @@ public class KwmCooperateManageService {
      * @author: czh
      * @date: 2023/7/11
      */
-    public void export(CooperateManageQueryReqVo reqVo) {
+    public void export(CooperateManageQueryReqVo reqVo, HttpServletResponse response) {
         CooperateManageQueryReqDto reqDto = buildQueryParam(reqVo);
         List<CooperateManageQueryResDto> list = kwmCooperateMapper.findManageList(reqDto);
         if (CollectionUtils.isEmpty(list)) {
-            return;
+            throw new SystemException("导出数据为空");
         }
         List<CooperateManageQueryResVo> cooperateManageQueryResVos = commonBusinessService.getCooperateManageQueryResVos(list);
-        if (CollectionUtils.isEmpty(cooperateManageQueryResVos)) {
-            return;
-        }
+        List<CooperateManageExport> result = new ArrayList<>();
+        cooperateManageQueryResVos.forEach(item -> {
+            CooperateManageExport cooperateManageExport = new CooperateManageExport();
+            BeanUtils.copyProperties(item, cooperateManageExport);
+            cooperateManageExport.setStatus(CooperateStatusEnum.getName(item.getStatus()));
+            cooperateManageExport.setApplyType(item.getApplyTypeCode().equals(1) ? "我方发起" : "对方发起");
+            String cooperateTypes = item.getCooperateTypes();
+            if (cooperateTypes.contains(String.valueOf(CooperateTypeEnum.SUPPLIER.getCode()))) {
+                cooperateManageExport.setEnt1("是");
+            }
 
-        try {
-            EasyExcelUtil.writeSingleExcel("合作管理.xlsx", "sheet1", cooperateManageQueryResVos, CooperateManageQueryResVo.class);
-        } catch (IOException e) {
-            log.error("导出失败:", e);
-            throw new SystemException(HttpStatus.CODE_10301, HttpStatus.MSG_014);
-        }
+            if (cooperateTypes.contains(String.valueOf(CooperateTypeEnum.PURCHASER.getCode()))) {
+                cooperateManageExport.setEnt2("是");
+            }
+
+            if (cooperateTypes.contains(String.valueOf(CooperateTypeEnum.CONSIGN.getCode()))) {
+                cooperateManageExport.setEnt3("是");
+            }
+
+            if (cooperateTypes.contains(String.valueOf(CooperateTypeEnum.CARRIAGE.getCode()))) {
+                cooperateManageExport.setEnt4("是");
+            }
+
+            result.add(cooperateManageExport);
+        });
+        ExcelUtil.downData(response, CooperateManageExport.class, result);
     }
 
     /**
@@ -653,4 +680,103 @@ public class KwmCooperateManageService {
         return kwmCooperateMapper.selectList(wrapper);
     }
 
+
+    /**
+     * @param reqVo 分页入参
+     * @return QueryAllCooperateInfoResVo
+     * @desc: 运营端查合作信息
+     * @author: czh
+     * @date: 2023/9/15
+     */
+    public PageResult queryAllCooperateInfoByPage(CooperateManageQueryReqVo reqVo) {
+        PageHelper.startPage(reqVo.getPage(), reqVo.getPageSize());
+        List<CooperateManageQueryResDto> list = kwmCooperateMapper.queryAllCooperateInfoList(getQueryAllCooperateInfoReqDto(reqVo));
+        if (CollectionUtils.isEmpty(list)) {
+            return PageHelperUtil.getPageResult(new PageInfo<>());
+        }
+
+        return PageHelperUtil.getPageResult(new PageInfo<>(getAllCooperateInfoVo(list)), list, reqVo.getPageSize());
+    }
+
+
+    /**
+     * 构建入参
+     */
+    private QueryAllCooperateInfoReqDto getQueryAllCooperateInfoReqDto(CooperateManageQueryReqVo reqVo) {
+        QueryAllCooperateInfoReqDto queryAllCooperateInfoReqDto = new QueryAllCooperateInfoReqDto();
+        BeanUtils.copyProperties(reqVo, queryAllCooperateInfoReqDto);
+        String cooperateTypes = reqVo.getCooperateTypes();
+        if (StringUtils.isNotBlank(cooperateTypes)) {
+            queryAllCooperateInfoReqDto.setCooperateTypes(Arrays.stream(cooperateTypes.split(Global.COMMA)).map(Integer::parseInt).toList());
+        }
+
+        if (StringUtils.isNotBlank(reqVo.getKeywords())) {
+            List<EntCacheResDto> entCacheResDtos = remoteSystemService.queryEntCacheByName(reqVo.getKeywords());
+            if (CollectionUtils.isNotEmpty(entCacheResDtos)) {
+                queryAllCooperateInfoReqDto.setQueryEntIdList(entCacheResDtos.stream().map(EntCacheResDto::getId).toList());
+            }
+        }
+        return queryAllCooperateInfoReqDto;
+    }
+
+    /**
+     * 获取返参
+     */
+    private List<QueryAllCooperateInfoResVo> getAllCooperateInfoVo(List<CooperateManageQueryResDto> list) {
+        List<Long> inviteeEntIds = list.stream().map(CooperateManageQueryResDto::getInviteeEntId).toList();
+        List<Long> inviterEntIds = list.stream().map(CooperateManageQueryResDto::getInviterEntId).toList();
+        List<Long> userIds = list.stream().map(CooperateManageQueryResDto::getCreateBy).toList();
+        List<Long> allEntIds = new ArrayList<>();
+        allEntIds.addAll(inviterEntIds);
+        allEntIds.addAll(inviteeEntIds);
+        Map<Long, EntCacheResDto> entCacheResDtoMap = remoteSystemService.queryEntCacheMapByIds(allEntIds);
+        Map<Long, UserCacheResDto> userCacheResDtoMap = remoteSystemService.queryUserCacheMapByIds(userIds);
+
+        List<QueryAllCooperateInfoResVo> result = new ArrayList<>();
+        list.forEach(item -> {
+            QueryAllCooperateInfoResVo queryAllCooperateInfoResVo = new QueryAllCooperateInfoResVo();
+            queryAllCooperateInfoResVo.setStatus(item.getStatus());
+            queryAllCooperateInfoResVo.setStatusName(CooperateStatusEnum.getName(item.getStatus()));
+            queryAllCooperateInfoResVo.setInviterEntId(item.getInviterEntId());
+            queryAllCooperateInfoResVo.setInviteeEntId(item.getInviteeEntId());
+            EntCacheResDto entCacheResDto = entCacheResDtoMap.get(item.getInviterEntId());
+            queryAllCooperateInfoResVo.setInviterEntName(Objects.nonNull(entCacheResDto) ? entCacheResDto.getFirmName() : "");
+            EntCacheResDto entCacheResDto1 = entCacheResDtoMap.get(item.getInviteeEntId());
+            queryAllCooperateInfoResVo.setInviteeEntName(Objects.nonNull(entCacheResDto1) ? entCacheResDto1.getFirmName() : "");
+            queryAllCooperateInfoResVo.setCooperateTypes(item.getTypes());
+            queryAllCooperateInfoResVo.setEnt1(item.getTypes().contains(String.valueOf(CooperateTypeEnum.SUPPLIER.getCode())) ? "是" : "");
+            queryAllCooperateInfoResVo.setEnt2(item.getTypes().contains(String.valueOf(CooperateTypeEnum.PURCHASER.getCode())) ? "是" : "");
+            queryAllCooperateInfoResVo.setEnt3(item.getTypes().contains(String.valueOf(CooperateTypeEnum.CONSIGN.getCode())) ? "是" : "");
+            queryAllCooperateInfoResVo.setEnt4(item.getTypes().contains(String.valueOf(CooperateTypeEnum.CARRIAGE.getCode())) ? "是" : "");
+            queryAllCooperateInfoResVo.setInviterContacts(item.getInviterContacts());
+            queryAllCooperateInfoResVo.setInviterContactsPhone(item.getInviterPhone());
+            queryAllCooperateInfoResVo.setInviteeContacts(item.getInviteeContacts());
+            queryAllCooperateInfoResVo.setInviteeContactsPhone(item.getInviteePhone());
+            queryAllCooperateInfoResVo.setCreateTime(item.getCreateTime());
+
+            UserCacheResDto userCacheResDto = userCacheResDtoMap.get(item.getCreateBy());
+            queryAllCooperateInfoResVo.setCreateByName(Objects.nonNull(userCacheResDto) ? userCacheResDto.getName(): "");
+            queryAllCooperateInfoResVo.setPhone(Objects.nonNull(userCacheResDto) ? userCacheResDto.getPhone() : "");
+            queryAllCooperateInfoResVo.setUpdateTime(item.getUpdateTime());
+            queryAllCooperateInfoResVo.setRemark(item.getRemark());
+            result.add(queryAllCooperateInfoResVo);
+        });
+        return result;
+    }
+
+
+    /**
+     * @param reqVo 查询入参
+     * @desc: 导出
+     * @author: czh
+     * @date: 2023/7/11
+     */
+    public void exportAllCooperateInfo(CooperateManageQueryReqVo reqVo, HttpServletResponse response) {
+        List<CooperateManageQueryResDto> list = kwmCooperateMapper.queryAllCooperateInfoList(getQueryAllCooperateInfoReqDto(reqVo));
+        if (CollectionUtils.isEmpty(list)) {
+            throw new SystemException("导出数据为空");
+        }
+        ExcelUtil.downData(response, QueryAllCooperateInfoExcel.class, BeanUtils.copyToList(getAllCooperateInfoVo(list), QueryAllCooperateInfoExcel.class));
+    }
+
 }

+ 87 - 46
sckw-modules/sckw-manage/src/main/resources/mapper/KwmCooperateMapper.xml

@@ -4,55 +4,27 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sckw.manage.dao.KwmCooperateMapper">
 
-    <resultMap id="BaseResultMap" type="com.sckw.manage.model.entity.KwmCooperate">
-            <id property="id" column="id" jdbcType="BIGINT"/>
-            <result property="entId" column="ent_id" jdbcType="BIGINT"/>
-            <result property="inviterEntId" column="inviter_ent_id" jdbcType="BIGINT"/>
-            <result property="inviteeEntId" column="invitee_ent_id" jdbcType="BIGINT"/>
-            <result property="inviterContacts" column="inviter_contacts" jdbcType="VARCHAR"/>
-            <result property="inviterPhone" column="inviter_phone" jdbcType="VARCHAR"/>
-            <result property="inviteeContacts" column="invitee_contacts" jdbcType="VARCHAR"/>
-            <result property="inviteePhone" column="invitee_phone" jdbcType="VARCHAR"/>
-            <result property="remark" column="remark" jdbcType="VARCHAR"/>
-            <result property="status" column="status" jdbcType="INTEGER"/>
-            <result property="createBy" column="create_by" jdbcType="BIGINT"/>
-            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
-            <result property="updateBy" column="update_by" jdbcType="BIGINT"/>
-            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
-            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
-    </resultMap>
-
-    <sql id="Base_Column_List">
-        id,ent_id,inviter_ent_id,
-        invitee_ent_id,inviter_contacts,inviter_phone,
-        invitee_contacts,invitee_phone,remark,
-        status,create_by,create_time,
-        update_by,update_time,del_flag
-    </sql>
-
     <select id="findList" parameterType="com.sckw.manage.model.dto.req.CooperateManageQueryReqDto"
             resultType="com.sckw.manage.model.dto.res.CooperateManageQueryResDto">
         SELECT a.id,
-        b.status,
-        group_concat(b.type) types,
-        min(a.ent_id) entId,
-        min(a.invitee_ent_id) inviteeEntId,
-        min(a.inviter_ent_id) inviterEntId,
-        min(a.invitee_contacts) inviteeContacts,
-        min(a.inviter_contacts) inviterContacts,
-        min(a.invitee_contacts_id) inviteeContactsId,
-        min(a.inviter_contacts_id) inviterContactsId,
-        min(a.invitee_phone) inviteePhone,
-        min(a.inviter_phone) inviterPhone,
-        min(b.create_time) createTime,
-        min(b.create_by) createBy,
-        min(a.remark) remark,
-        min(a.approval_remark) approvalRemark,
-        case when min(a.ent_id) = #{reqDto.currentEntId} then min(a.invitee_ent_id) else min(a.inviter_ent_id) end
-        targetEntId,
-        case when min(a.ent_id) = #{reqDto.currentEntId} then min(a.inviter_ent_id) else min(a.invitee_ent_id) end
-        ourEntId,
-        case when min(a.ent_id) = #{reqDto.currentEntId} then 1 else 2 end applyTypeCode
+            b.status,
+            group_concat(b.type) types,
+            min(a.ent_id) entId,
+            min(a.invitee_ent_id) inviteeEntId,
+            min(a.inviter_ent_id) inviterEntId,
+            min(a.invitee_contacts) inviteeContacts,
+            min(a.inviter_contacts) inviterContacts,
+            min(a.invitee_contacts_id) inviteeContactsId,
+            min(a.inviter_contacts_id) inviterContactsId,
+            min(a.invitee_phone) inviteePhone,
+            min(a.inviter_phone) inviterPhone,
+            min(b.create_time) createTime,
+            min(b.create_by) createBy,
+            min(a.remark) remark,
+            min(a.approval_remark) approvalRemark,
+            case when min(a.ent_id) = #{reqDto.currentEntId} then min(a.invitee_ent_id) else min(a.inviter_ent_id) end targetEntId,
+            case when min(a.ent_id) = #{reqDto.currentEntId} then min(a.inviter_ent_id) else min(a.invitee_ent_id) end ourEntId,
+            case when min(a.ent_id) = #{reqDto.currentEntId} then 1 else 2 end applyTypeCode
         FROM kwm_cooperate a
         LEFT JOIN kwm_cooperate_type b ON a.id = b.cooperate_id
         WHERE a.del_flag = 0
@@ -272,4 +244,73 @@
                 )
     </select>
 
+    <select id="queryAllCooperateInfoList"
+            resultType="com.sckw.manage.model.dto.res.CooperateManageQueryResDto">
+        SELECT a.id,
+               min(a.status) status,
+               group_concat(b.type) types,
+               min(a.ent_id) entId,
+               min(a.invitee_ent_id) inviteeEntId,
+               min(a.inviter_ent_id) inviterEntId,
+               min(a.invitee_contacts) inviteeContacts,
+               min(a.inviter_contacts) inviterContacts,
+               min(a.invitee_contacts_id) inviteeContactsId,
+               min(a.inviter_contacts_id) inviterContactsId,
+               min(a.invitee_phone) inviteePhone,
+               min(a.inviter_phone) inviterPhone,
+               min(b.create_time) createTime,
+               min(b.update_time) updateTime,
+               min(b.create_by) createBy,
+               min(a.remark) remark
+          FROM kwm_cooperate a
+          LEFT JOIN kwm_cooperate_type b ON a.id = b.cooperate_id and b.status = 1 and b.del_flag = 0
+         WHERE a.del_flag = 0
+           and a.status in (1,2)
+        <if test="reqDto.cooperateTypes != null and reqDto.cooperateTypes.size() > 0">
+            and exists (select 1
+                          from kwm_cooperate_type c
+                         where c.cooperate_id = a.id
+                           and c.status = b.status
+                           and c.del_flag = 0
+                           and c.type in
+                        <foreach collection="reqDto.cooperateTypes" item="item" open="(" close=")" separator=",">
+                            #{item}
+                        </foreach>
+                        )
+        </if>
+        <if test="reqDto.startTime != null">
+            and b.create_time >= #{reqDto.startTime}
+        </if>
+        <if test="reqDto.endTime != null">
+            and b.create_time &lt; date_add(#{reqDto.endTime}, INTERVAL 1 DAY)
+        </if>
+        <if test="reqDto.ids != null and reqDto.ids.size() > 0">
+             and a.id in
+            <foreach collection="reqDto.ids" separator="," open="(" close=")" item="item">
+                #{item}
+            </foreach>
+        </if>
+        <if test="reqDto.queryEntIdList != null and reqDto.queryEntIdList.size() > 0">
+            and (a.inviter_ent_id in
+                    <foreach collection="reqDto.queryEntIdList" item="item" open="(" close=")" separator=",">
+                        #{item}
+                    </foreach>
+                    or
+                a.invitee_ent_id in
+                    <foreach collection="reqDto.queryEntIdList" item="item" open="(" close=")" separator=",">
+                        #{item}
+                    </foreach>
+                )
+        </if>
+        <if test="reqDto.keywords != null and (reqDto.queryEntIdList == null or reqDto.queryEntIdList.size() == 0)">
+            and (a.invitee_contacts like concat('%', #{reqDto.keywords}, '%') or
+                 a.inviter_contacts like concat('%', #{reqDto.keywords}, '%') or
+                 a.invitee_phone like concat('%', #{reqDto.keywords}, '%') or
+                 a.inviter_phone like concat('%', #{reqDto.keywords}, '%')
+                )
+        </if>
+        group by a.id
+        order by a.create_time desc
+    </select>
+
 </mapper>

+ 2 - 1
sckw-modules/sckw-message/src/main/java/com/sckw/message/enums/MsgStatusEnum.java

@@ -7,6 +7,7 @@ import java.util.Arrays;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Objects;
+import java.util.stream.Collectors;
 
 /**
  * @desc: 消息状态枚举
@@ -39,6 +40,6 @@ public enum MsgStatusEnum {
 
     public static List<MsgStatusEnum> getSortList() {
         MsgStatusEnum[] enums = MsgStatusEnum.values();
-        return Arrays.stream(enums).sorted(Comparator.comparingInt(MsgStatusEnum::getCode)).toList();
+        return Arrays.stream(enums).sorted(Comparator.comparingInt(MsgStatusEnum::getCode)).collect(Collectors.toList());
     }
 }

+ 2 - 1
sckw-modules/sckw-message/src/main/java/com/sckw/message/service/KwmMessageUserService.java

@@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 import java.util.Objects;
+import java.util.stream.Collectors;
 
 /**
  * @desc: 用户消息相关service
@@ -39,7 +40,7 @@ public class KwmMessageUserService {
      */
     public List<Long> getMsgIdsByUserId(Long userId) {
         List<KwmMessageUser> list = getByUserId(userId);
-        return list.stream().map(KwmMessageUser::getMsgId).toList();
+        return list.stream().map(KwmMessageUser::getMsgId).collect(Collectors.toList());
     }
 
     /**

+ 31 - 5
sckw-modules/sckw-message/src/main/java/com/sckw/message/service/MessageService.java

@@ -1,6 +1,6 @@
 package com.sckw.message.service;
 
-import com.sckw.core.common.enums.enums.DictEnum;
+import com.alibaba.fastjson2.JSONObject;
 import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.Global;
@@ -122,14 +122,29 @@ public class MessageService {
         if (CollectionUtils.isEmpty(list)) {
             return Collections.emptyList();
         }
+        Map<String, String> categoryMap, statusMap;
+        Map<String, Map<String, String>> dictMap = remoteSystemService.queryDictByType(
+                Arrays.asList(DictTypeEnum.MSG_CATEGORY.getType(), DictTypeEnum.MSG_STATUS.getType()));
+        if (CollectionUtils.isNotEmpty(dictMap)) {
+            categoryMap = dictMap.get(DictTypeEnum.MSG_CATEGORY.getType());
+            statusMap = dictMap.get(DictTypeEnum.MSG_STATUS.getType());
+        } else {
+            categoryMap = new HashMap<>();
+            statusMap = new HashMap<>();
+        }
+        String clientType = LoginUserHolder.getClientType();
         List<Long> userIds = list.stream().map(MessageListDTO::getCreateBy).toList();
         Map<Long, UserCacheResDto> map = remoteSystemService.queryUserCacheMapByIds(userIds);
         List<KwmMessageListResVO> result = new ArrayList<>(list.size());
         list.forEach(e -> {
             UserCacheResDto user = map.get(e.getCreateBy());
             KwmMessageListResVO res = BeanUtils.copyProperties(e, KwmMessageListResVO.class);
-            res.setStatusLabel(MsgStatusEnum.getNameByCode(res.getStatus()));
-            res.setCategoryLabel(DictEnum.getLabel(DictTypeEnum.MSG_CATEGORY.getType(), e.getCategory()));
+            if (Objects.nonNull(e.getUrl())) {
+                Map<String, Object> urlMap = JSONObject.parse(e.getUrl());
+                res.setUrl(Objects.isNull(urlMap.get(clientType)) ? null : urlMap.get(clientType).toString());
+            }
+            res.setStatusLabel(statusMap.get(String.valueOf(e.getStatus())));
+            res.setCategoryLabel(categoryMap.get(e.getCategory()));
             if (Objects.nonNull(user)) {
                 res.setCreateByName(user.getName());
                 EntCacheResDto entInfo = user.getEntInfo();
@@ -207,6 +222,11 @@ public class MessageService {
         }
         KwmMessageUser kwmMessageUser = msgList.get(0);
         KwmMessage message = kwmMessageService.getById(kwmMessageUser.getMsgId());
+        if (Objects.nonNull(message.getUrl())) {
+            String clientType = LoginUserHolder.getClientType();
+            Map<String, Object> urlMap = JSONObject.parse(message.getUrl());
+            message.setUrl(Objects.isNull(urlMap.get(clientType)) ? null : urlMap.get(clientType).toString());
+        }
         //更新用户消息为已读状态
         kwmMessageUserService.readByMsgIds(ids);
         return message;
@@ -268,11 +288,17 @@ public class MessageService {
         if (CollectionUtils.isEmpty(result)) {
             return Collections.emptyList();
         }
+        String clientType = LoginUserHolder.getClientType();
         result.forEach(e -> {
             dto.setStatus(e.getStatus()).setType(e.getType());
             UserMsgCenterLatestMsgDTO msg = kwmMessageUserService.getLatestMsg(dto);
-            e.setId(msg.getId()).setTitle(msg.getTitle()).setContent(msg.getContent())
-                    .setUrl(msg.getUrl()).setCreateTime(msg.getCreateTime());
+            if (Objects.nonNull(msg.getUrl())) {
+                Map<String, Object> urlMap = JSONObject.parse(msg.getUrl());
+                e.setUrl(Objects.isNull(urlMap.get(clientType)) ? null : urlMap.get(clientType).toString());
+            }
+            e.setId(msg.getId()).setTitle(msg.getTitle())
+                    .setContent(msg.getContent())
+                    .setCreateTime(msg.getCreateTime());
         });
         return result;
     }

+ 3 - 2
sckw-modules/sckw-message/src/main/java/com/sckw/message/service/SckwMessageHandlerService.java

@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
+import java.util.Objects;
 
 /**
  * @desc: message消息处理service
@@ -61,8 +62,8 @@ public class SckwMessageHandlerService {
                 .title(messageEnum.getTitle())
                 .content(content)
                 .clientType(messageEnum.getPushType())
-                .url(sckwMessage.getMsgUrl())
-                .params(JSON.toJSONString(sckwMessage.getParams()))
+                .url(Objects.isNull(sckwMessage.getMsgUrls()) ? null : JSON.toJSONString(sckwMessage.getMsgUrls()))
+                .params(Objects.isNull(sckwMessage.getParams()) ? null : JSON.toJSONString(sckwMessage.getParams()))
                 .build();
         kwmMessage.setCreateBy(createBy);
         kwmMessage.setUpdateBy(createBy);

+ 15 - 2
sckw-modules/sckw-message/src/main/java/com/sckw/message/service/SmsService.java

@@ -1,10 +1,10 @@
 package com.sckw.message.service;
 
 import com.alibaba.fastjson2.JSON;
-import com.sckw.core.common.enums.enums.DictEnum;
 import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.message.model.vo.req.GetSmsVerifyCoderReqVO;
@@ -13,11 +13,14 @@ import com.sckw.redis.constant.RedisConstant;
 import com.sckw.redis.utils.RedissonUtils;
 import com.sckw.stream.enums.SmsCodeEnum;
 import com.sckw.stream.model.SckwSms;
+import com.sckw.system.api.RemoteSystemService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.cloud.stream.function.StreamBridge;
 import org.springframework.stereotype.Service;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Objects;
@@ -34,6 +37,9 @@ public class SmsService {
 
     private final StreamBridge streamBridge;
 
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
+
     /**
      * @param param
      * @return com.sckw.core.web.response.HttpResult
@@ -42,8 +48,15 @@ public class SmsService {
      * @date: 2023-06-13 13:43
      */
     public void sendVerifyCode(SendSmsVerifyCoderReqVO param) {
+        Map<String, Map<String, String>> dict = remoteSystemService.queryDictByType(Collections.singletonList(DictTypeEnum.SEND_SMS_TYPE.getType()));
+        Map<String, String> map;
+        if (CollectionUtils.isNotEmpty(dict)){
+            map = dict.get(DictTypeEnum.SEND_SMS_TYPE.getType());
+        }else {
+            map = new HashMap<>();
+        }
         String type = param.getType();
-        if (Objects.isNull(DictEnum.getLabel(DictTypeEnum.SEND_SMS_TYPE.getType(), type))) {
+        if (Objects.isNull(map.get(type))) {
             throw new BusinessException("非法短信类型!");
         }
         String phone = param.getPhone();

+ 2 - 2
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/ExportTransportDemandParam.java

@@ -25,13 +25,13 @@ public class ExportTransportDemandParam {
     /**
      * 创建时间开始
      */
-    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date startCreateTime;
 
     /**
      * 创建时间结束
      */
-    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endCreateTime;
 
     /**

+ 2 - 2
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/SelectTransportDemandParam.java

@@ -26,13 +26,13 @@ public class SelectTransportDemandParam extends PageRequest {
     /**
      * 创建时间开始
      */
-    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date startCreateTime;
 
     /**
      * 创建时间结束
      */
-    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endCreateTime;
 
     /**

+ 2 - 2
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/StatisticTransportDemandParam.java

@@ -25,13 +25,13 @@ public class StatisticTransportDemandParam {
     /**
      * 创建时间开始
      */
-    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date startCreateTime;
 
     /**
      * 创建时间结束
      */
-    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endCreateTime;
 
     /**

+ 26 - 17
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderService.java

@@ -11,6 +11,7 @@ import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.enums.ClientTypeEnum;
 import com.sckw.core.model.enums.CooperateTypeEnum;
 import com.sckw.core.model.enums.OrderRuleEnum;
 import com.sckw.core.model.enums.RedisOrderGenerateEnum;
@@ -96,11 +97,17 @@ public class KwoTradeOrderService {
     private final KwoTradeOrderContractService kwoTradeOrderContractService;
     private final KwoTradeOrderTrackService kwoTradeOrderTrackService;
 
-    @Value("${valet.order.list.url}")
-    private String valetOrderListUrl;
+    @Value("${url.order.list.valet.pc}")
+    private String pcValetListUrl;
 
-    @Value("${purchase.order.list.url}")
-    private String purchaseOrderListUrl;
+    @Value("${url.order.list.valet.app}")
+    private String appValetListUrl;
+
+    @Value("${url.order.list.purchase.pc}")
+    private String pcPurchaseListUrl;
+
+    @Value("${url.order.list.purchase.app}")
+    private String appPurchaseListUrl;
 
     /**
      * @desc: 采购下单草稿
@@ -321,10 +328,10 @@ public class KwoTradeOrderService {
             if (!Objects.equals(procureUser.getUserId(), LoginUserHolder.getUserId())) {
                 userInfos.add(procureUser);
             }
-            sendMsg(MessageEnum.ORDER_INITIATE_PURCHASE, map, purchaseOrderListUrl, userInfos);
+            sendMsg(MessageEnum.ORDER_INITIATE_PURCHASE, map, pcPurchaseListUrl, appPurchaseListUrl, userInfos);
             //给供应企业联系人发消息
             map.put("firmName", procureFireName);
-            sendMsg(MessageEnum.ORDER_NEW_PENDING, map, valetOrderListUrl, List.of(supplyUser));
+            sendMsg(MessageEnum.ORDER_NEW_PENDING, map, pcValetListUrl, appValetListUrl, List.of(supplyUser));
         } else {
             //代客下单
             //给创建人及供应企业联系人发消息
@@ -332,10 +339,10 @@ public class KwoTradeOrderService {
             if (!Objects.equals(supplyUser.getUserId(), LoginUserHolder.getUserId())) {
                 userInfos.add(supplyUser);
             }
-            sendMsg(MessageEnum.ORDER_INITIATE_SALE, map, valetOrderListUrl, userInfos);
+            sendMsg(MessageEnum.ORDER_INITIATE_SALE, map, pcValetListUrl, appValetListUrl, userInfos);
             //给采购企业联系人发消息
             map.put("firmName", supplyFireName);
-            sendMsg(MessageEnum.ORDER_NEW_VALET_MSG, map, purchaseOrderListUrl, List.of(procureUser));
+            sendMsg(MessageEnum.ORDER_NEW_VALET_MSG, map, pcPurchaseListUrl, appPurchaseListUrl, List.of(procureUser));
         }
     }
 
@@ -345,16 +352,18 @@ public class KwoTradeOrderService {
      * @date: 2023-09-06 15:57
      * @Param msgEnum: 消息枚举
      * @Param params: 消息变量
-     * @Param url: 消息调转url
+     * @Param pcUrl: pc消息调转url
+     * @Param appUrl: app消息调转url
      * @Param userInfos:  发送消息用户集合
      * @return: void
      */
-    private void sendMsg(MessageEnum msgEnum, Map<String, Object> params, String url, List<UserInfo> userInfos) {
-        SckwMessage msg = new SckwMessage();
-        msg.setRequestId(UUIDUtils.get32UUID())
-                .setMessageEnum(msgEnum)
-                .setParams(params)
-                .setMsgUrl(url)
+    private void sendMsg(MessageEnum msgEnum, Map<String, Object> params, String pcUrl, String appUrl, List<UserInfo> userInfos) {
+        Map<String, String> urls = new HashMap<>();
+        urls.put(ClientTypeEnum.pc.getValue(), pcUrl);
+        urls.put(ClientTypeEnum.app.getValue(), appUrl);
+        SckwMessage msg = new SckwMessage(msgEnum);
+        msg.setParams(params)
+                .setMsgUrls(urls)
                 .setUserInfos(userInfos)
                 .setCreateBy(LoginUserHolder.getUserId());
         log.info("有新的提醒消息:{}", JSON.toJSONString(msg));
@@ -980,7 +989,7 @@ public class KwoTradeOrderService {
         map.put("firmName", purchase.getFirmName());
         UserInfo supplyUser = new UserInfo();
         supplyUser.setUserId(supply.getContactsId()).setEntId(supply.getTopEntId());
-        sendMsg(MessageEnum.ORDER_REJECT_VALET, map, valetOrderListUrl, List.of(supplyUser));
+        sendMsg(MessageEnum.ORDER_REJECT_VALET, map, pcValetListUrl, appValetListUrl, List.of(supplyUser));
         //给订单创建人及采购企业联系人发消息
         map.put("firmName", supply.getFirmName());
         List<UserInfo> userInfos = new ArrayList<>();
@@ -992,7 +1001,7 @@ public class KwoTradeOrderService {
             purchaseUser.setUserId(purchase.getContactsId()).setEntId(purchase.getTopEntId());
             userInfos.add(purchaseUser);
         }
-        sendMsg(MessageEnum.ORDER_REJECT_PURCHASE, map, purchaseOrderListUrl, userInfos);
+        sendMsg(MessageEnum.ORDER_REJECT_PURCHASE, map, pcPurchaseListUrl, appPurchaseListUrl, userInfos);
     }
 
     /**

+ 11 - 9
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTransportDemandService.java

@@ -24,14 +24,16 @@ import com.sckw.order.dao.KwoTransportDemandMapper;
 import com.sckw.order.model.KwoTransportDemand;
 import com.sckw.order.model.dto.TransportDemandExport;
 import com.sckw.order.model.vo.req.*;
-import com.sckw.order.model.vo.res.*;
+import com.sckw.order.model.vo.res.TransportDemandContactInfoRes;
+import com.sckw.order.model.vo.res.TransportDemandDetailRes;
+import com.sckw.order.model.vo.res.TransportDemandListRes;
+import com.sckw.order.model.vo.res.TransportDemandSquaresListRes;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
-import org.springframework.data.mongodb.core.aggregation.ArrayOperators;
 import org.springframework.stereotype.Service;
 
 import java.util.*;
@@ -203,7 +205,7 @@ public class KwoTransportDemandService {
                     .setStatusLabel(DictEnum.getLabel(DictTypeEnum.TRANSPORT_DEMAND_STATUS.getType(), String.valueOf(e.getStatus())))
                     .setLoadAddress(loadAreaName + loadDetailAddress)
                     .setUnloadAddress(unloadAreaName + unloadDetailAddress)
-                    .setEntName(entMap != null ? entMap.get(e.getEntId()) : null);
+                    .setEntName(entMap.get(e.getEntId()));
             result.add(demand);
         });
         return PageResult.build(param.getPage(), param.getPageSize(), demandPage.getTotal(), result);
@@ -217,13 +219,12 @@ public class KwoTransportDemandService {
      * @return: com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<com.sckw.order.model.KwoTransportDemand>
      */
     private LambdaQueryWrapper<KwoTransportDemand> buildWrapper(ExportTransportDemandParam param) {
-        Long entId = !Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode()) ? LoginUserHolder.getEntId() : null;
         LambdaQueryWrapper<KwoTransportDemand> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(KwoTransportDemand::getDelFlag, Global.NO);
         if (!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode())) {
-            wrapper.eq(KwoTransportDemand::getEntId, entId);
-        } else {
-            wrapper.in(KwoTransportDemand::getStatus, 1 , 2);
+            wrapper.eq(KwoTransportDemand::getEntId, LoginUserHolder.getEntId());
+        } else if (Objects.isNull(param.getStatus())) {
+            wrapper.in(KwoTransportDemand::getStatus, 1, 2);
         }
         if (StringUtils.isNotBlank(param.getIds())) {
             List<Long> ids = StringUtils.splitStrToList(param.getIds(), ",", Long.class);
@@ -231,7 +232,7 @@ public class KwoTransportDemandService {
             return wrapper;
         }
         if (Objects.nonNull(param.getEndCreateTime())) {
-            wrapper.le(KwoTransportDemand::getCreateTime, DateUtil.offsetDay(param.getEndCreateTime(), 1));
+            wrapper.le(KwoTransportDemand::getCreateTime, param.getEndCreateTime());
         }
         wrapper.ge(Objects.nonNull(param.getStartCreateTime()), KwoTransportDemand::getCreateTime, param.getStartCreateTime())
                 .eq(Objects.nonNull(param.getStatus()), KwoTransportDemand::getStatus, param.getStatus())
@@ -429,7 +430,7 @@ public class KwoTransportDemandService {
             }
         }
         Integer unloadCode = param.getUnloadAreaCode();
-        if (Objects.nonNull(unloadCode) && Objects.nonNull(param.getLoadAreaLevel())) {
+        if (Objects.nonNull(unloadCode) && Objects.nonNull(param.getUnloadAreaLevel())) {
             switch (param.getUnloadAreaLevel()) {
                 case 1 ->
                         wrapper.likeRight(KwoTransportDemand::getUnloadAreaCode, Integer.valueOf(String.valueOf(unloadCode).substring(0, 2)));
@@ -447,6 +448,7 @@ public class KwoTransportDemandService {
                 wrapper.like(KwoTransportDemand::getName, param.getKeywords());
             }
         }
+        wrapper.last("order by RAND()");
         Page<KwoTransportDemand> kwpGoodsPage = kwoTransportDemandMapper.selectPage(page, wrapper);
         List<KwoTransportDemand> list = kwpGoodsPage.getRecords();
         if (CollectionUtils.isEmpty(list)) {

+ 2 - 2
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwpWantBuyService.java

@@ -141,7 +141,7 @@ public class KwpWantBuyService {
             List<String> goodsTypes = goodsTypeHandle(wantBuySelectParam);
             wantBuySelectParam.setGoodsTypeValueSearch(goodsTypes);
         }
-        wantBuySelectParam.setEntId(LoginUserHolder.getSystemType() != SystemTypeEnum.MANAGE.getCode() ? LoginUserHolder.getEntId() : null);
+        wantBuySelectParam.setEntId(!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode()) ? LoginUserHolder.getEntId() : null);
         wantBuySelectParam.setSystemType(LoginUserHolder.getSystemType());
 
         PageHelper.startPage(wantBuySelectParam.getPage(), wantBuySelectParam.getPageSize());
@@ -490,7 +490,7 @@ public class KwpWantBuyService {
                 selectParam.setGoodsTypeValueSearch(goodsTypes);
             }
         }
-        selectParam.setEntId(LoginUserHolder.getSystemType() != SystemTypeEnum.MANAGE.getCode() ? LoginUserHolder.getEntId() : null);
+        selectParam.setEntId(!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode()) ? LoginUserHolder.getEntId() : null);
         selectParam.setSystemType(LoginUserHolder.getSystemType());
 
         List<WantBuySelectRes> wantBuyDto = kwpWantBuyMapper.pageSelect(selectParam);

+ 6 - 2
sckw-modules/sckw-order/src/main/resources/mapper/KwoTradeOrderMapper.xml

@@ -15,8 +15,12 @@
         FROM kwo_trade_order o
                  LEFT JOIN kwo_trade_order_unit u
                            ON o.id = u.t_order_id
-        WHERE o.del_flag = 0
-          AND o.status != 0 and u.del_flag = 0 AND u.top_ent_id = #{topEntId}
+        <where>
+            o.del_flag = 0 AND o.status NOT IN (0, 2) AND u.del_flag = 0
+            <if test="topEntId != null ">
+                and u.top_ent_id = #{topEntId}
+            </if>
+        </where>
         GROUP BY u.unit_type
     </select>
 

+ 11 - 3
sckw-modules/sckw-order/src/main/resources/mapper/KwoWantBuyMapper.xml

@@ -51,10 +51,17 @@
             and kb.create_time &lt;= #{wantBuyReq.endCreateTime,jdbcType=TIMESTAMP}
         </if>
         <if test="wantBuyReq.tradings != null and wantBuyReq.tradings.size() > 0">
-            and kt.trading in
-            <foreach collection="wantBuyReq.tradings" item="item" open="(" close=")" separator=",">
-                #{item,jdbcType=VARCHAR}
+            <!--私用and条件-->
+<!--            and kt.trading in-->
+<!--            <foreach collection="wantBuyReq.tradings" item="item" open="(" close=")" separator=",">-->
+<!--                #{item,jdbcType=VARCHAR}-->
+<!--            </foreach>-->
+            <!-- 使用 AND 条件 -->
+            and (
+            <foreach collection="wantBuyReq.tradings" item="item" separator=" and ">
+                kt.trading = #{item,jdbcType=VARCHAR}
             </foreach>
+            )
         </if>
         <if test="wantBuyReq.wantBuyIds != null and wantBuyReq.wantBuyIds.size() > 0">
             and kb.id in
@@ -143,5 +150,6 @@
             <include refid="where" />
         </where>
         group by kb.id
+        order by RAND()
     </select>
 </mapper>

+ 2 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/WalletController.java

@@ -158,7 +158,7 @@ public class WalletController {
      */
     @GetMapping("prePayCount")
     public HttpResult prePayCount(String entName) {
-        return HttpResult.ok(walletService.walletCount(entName));
+        return HttpResult.ok(walletService.prePayCount(entName));
     }
 
     /**
@@ -179,7 +179,7 @@ public class WalletController {
      */
     @GetMapping("preReceiveCount")
     public HttpResult preReceiveCount(String entName) {
-        return HttpResult.ok(walletService.walletCount(entName));
+        return HttpResult.ok(walletService.preReceiveCount(entName));
     }
 
     /**

+ 3 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/app/AppKwpLedgerLogisticsController.java

@@ -4,6 +4,7 @@ import com.sckw.core.model.vo.TableTop;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.payment.model.constant.LedgerEnum;
 import com.sckw.payment.model.constant.LogisticsUnitType;
+import com.sckw.payment.model.dto.Id;
 import com.sckw.payment.model.vo.req.*;
 import com.sckw.payment.service.KwpLedgerLogisticsService;
 import jakarta.annotation.Resource;
@@ -189,8 +190,8 @@ public class AppKwpLedgerLogisticsController {
      * @return
      */
     @DeleteMapping("delete")
-    public HttpResult delete(@RequestParam("id") @NotBlank(message = "物流对账单id不能为空") String id) {
-        return HttpResult.ok(kwpLedgerLogisticsService.remove(Long.valueOf(id)));
+    public HttpResult delete(@RequestBody @Valid Id id) {
+        return HttpResult.ok(kwpLedgerLogisticsService.remove(id.getIdLong()));
     }
 
     /**

+ 8 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/app/AppKwpLedgerTradeController.java

@@ -2,6 +2,7 @@ package com.sckw.payment.controller.app;
 
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.payment.model.constant.TradeUnitType;
+import com.sckw.payment.model.dto.Id;
 import com.sckw.payment.model.vo.req.*;
 import com.sckw.payment.service.KwpLedgerTradeService;
 import jakarta.annotation.Resource;
@@ -89,6 +90,7 @@ public class AppKwpLedgerTradeController {
     public HttpResult purchaseList(@RequestBody @Valid TradeReq tradeReq) {
         return HttpResult.ok(kwpLedgerTradeService.purchaseList(tradeReq));
     }
+
     /**
      * 贸易对账单统计 采购方
      *
@@ -99,6 +101,7 @@ public class AppKwpLedgerTradeController {
     public HttpResult purchaseSum(@RequestBody @Valid TradeReq tradeReq) {
         return HttpResult.ok(kwpLedgerTradeService.purchaseSum(tradeReq));
     }
+
     /**
      * 对账单关联订单
      *
@@ -117,7 +120,7 @@ public class AppKwpLedgerTradeController {
      * @return
      */
     @GetMapping("querySellDetail")
-    public HttpResult querySellDetail(@NotBlank(message = "id不能为空")@RequestParam("id") String id) {
+    public HttpResult querySellDetail(@NotBlank(message = "id不能为空") @RequestParam("id") String id) {
         return HttpResult.ok(kwpLedgerTradeService.queryDetail(Long.valueOf(id), TradeUnitType.PURCHASE));
     }
 
@@ -128,7 +131,7 @@ public class AppKwpLedgerTradeController {
      * @return
      */
     @GetMapping("queryPurchaseDetail")
-    public HttpResult queryPurchaseDetail(@NotBlank(message = "id不能为空")@RequestParam("id") String id) {
+    public HttpResult queryPurchaseDetail(@NotBlank(message = "id不能为空") @RequestParam("id") String id) {
         return HttpResult.ok(kwpLedgerTradeService.queryDetail(Long.valueOf(id), TradeUnitType.SELL));
     }
 
@@ -139,7 +142,7 @@ public class AppKwpLedgerTradeController {
      * @return
      */
     @GetMapping("queryUpdate")
-    public HttpResult queryUpdate(@NotBlank(message = "id不能为空")@RequestParam("id") String id) {
+    public HttpResult queryUpdate(@NotBlank(message = "id不能为空") @RequestParam("id") String id) {
         return HttpResult.ok(kwpLedgerTradeService.queryUpdate(Long.valueOf(id)));
     }
 
@@ -151,8 +154,8 @@ public class AppKwpLedgerTradeController {
      * @return
      */
     @DeleteMapping("delete")
-    public HttpResult delete(@NotBlank(message = "id不能为空") String id) {
-        return HttpResult.ok(kwpLedgerTradeService.remove(Long.valueOf(id)));
+    public HttpResult delete(@RequestBody @Valid Id id) {
+        return HttpResult.ok(kwpLedgerTradeService.remove(id.getIdLong()));
     }
 
     /**

+ 23 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/app/AppKwpSettlementLogisticsController.java

@@ -1,6 +1,7 @@
 package com.sckw.payment.controller.app;
 
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.payment.model.constant.LogisticsUnitType;
 import com.sckw.payment.model.vo.req.SettlementReq;
 import com.sckw.payment.service.KwpSettlementLogisticsService;
 import jakarta.annotation.Resource;
@@ -36,6 +37,17 @@ public class AppKwpSettlementLogisticsController {
         return HttpResult.ok(kwpSettlementLogisticsService.detailCollection(id));
     }
 
+    /**
+     * 承运方 app端
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping("carrierDetail")
+    public HttpResult carrierDetail(@RequestParam("id") String id) {
+        return HttpResult.ok(kwpSettlementLogisticsService.queryDetail(Long.parseLong(id), LogisticsUnitType.SHIPPER));
+    }
+
 
     //   ========= 运费付款 托运方 =========
     @PostMapping(name = "运费付款-物流订单列表", path = "pageListPayment")
@@ -52,4 +64,15 @@ public class AppKwpSettlementLogisticsController {
     public HttpResult detailPayment(@RequestParam("id") Long id) {
         return HttpResult.ok(kwpSettlementLogisticsService.detailPayment(id));
     }
+
+    /**
+     * app端详情
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping("shipperDetail")
+    public HttpResult shipperDetail(@RequestParam("id") String id) {
+        return HttpResult.ok(kwpSettlementLogisticsService.queryDetail(Long.parseLong(id), LogisticsUnitType.CARRIER));
+    }
 }

+ 6 - 10
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/LedgerLogisticsController.java

@@ -4,9 +4,9 @@ import com.sckw.core.model.page.PageRes;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.payment.model.vo.LedgerLogistics;
+import com.sckw.payment.model.vo.excel.LedgerLogisticsExport;
 import com.sckw.payment.model.vo.req.LedgerListReq;
 import com.sckw.payment.model.vo.req.LogisticsReq;
-import com.sckw.payment.model.vo.res.LedgerLogisticsVo;
 import com.sckw.payment.service.operate.LedgerLogisticsService;
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletResponse;
@@ -34,14 +34,12 @@ public class LedgerLogisticsController {
 
 
     /**
-     *
-     *
      * @param logisticsReq 物流订单查询参数
      * @return
      */
     @PostMapping("list")
     public HttpResult list(@RequestBody LogisticsReq logisticsReq) {
-        return HttpResult.ok(ledgerLogisticsService.list(logisticsReq));
+        return HttpResult.ok(ledgerLogisticsService.list(logisticsReq, false));
     }
 
     /**
@@ -68,8 +66,6 @@ public class LedgerLogisticsController {
     }
 
     /**
-     *
-     *
      * @param logisticsReq 物流订单查询参数
      * @return 物流对账单统计数据
      */
@@ -90,7 +86,7 @@ public class LedgerLogisticsController {
     public HttpResult export(HttpServletResponse response, @RequestBody LogisticsReq logisticsReq) {
         List<LedgerLogistics> list;
         if (CollectionUtils.isEmpty(logisticsReq.getIdList())) {
-            PageRes<LedgerLogistics> pageResult = ledgerLogisticsService.list(logisticsReq);
+            PageRes<LedgerLogistics> pageResult = ledgerLogisticsService.list(logisticsReq, true);
             list = pageResult.getList();
         } else {
             list = ledgerLogisticsService.selectList(logisticsReq.getIdList());
@@ -98,13 +94,13 @@ public class LedgerLogisticsController {
         if (CollectionUtils.isEmpty(list)) {
             return HttpResult.error("没有可导出的数据");
         }
-        List<LedgerLogisticsVo> collect = list.stream().map(a -> {
-            LedgerLogisticsVo ledgerLogisticsVo = new LedgerLogisticsVo();
+        List<LedgerLogisticsExport> collect = list.stream().map(a -> {
+            LedgerLogisticsExport ledgerLogisticsVo = new LedgerLogisticsExport();
             BeanUtils.copyProperties(a, ledgerLogisticsVo);
             return ledgerLogisticsVo;
         }).collect(Collectors.toList());
 
-        ExcelUtil.downData(response, LedgerLogisticsVo.class, collect);
+        ExcelUtil.downData(response, LedgerLogisticsExport.class, collect);
         return null;
     }
 }

+ 8 - 13
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/LedgerTradeController.java

@@ -4,9 +4,9 @@ import com.sckw.core.model.page.PageRes;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.payment.model.vo.LedgerSell;
+import com.sckw.payment.model.vo.excel.LedgerTradeExport;
 import com.sckw.payment.model.vo.req.LedgerListReq;
 import com.sckw.payment.model.vo.req.TradeReq;
-import com.sckw.payment.model.vo.res.LedgerTradeVo;
 import com.sckw.payment.service.operate.LedgerTradeService;
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletResponse;
@@ -33,8 +33,6 @@ public class LedgerTradeController {
 
 
     /**
-     *
-     *
      * @param tradeReq
      * @return
      */
@@ -44,7 +42,6 @@ public class LedgerTradeController {
     }
 
     /**
-     *
      * @param ledgerListReq 对账单id
      * @return
      */
@@ -55,7 +52,6 @@ public class LedgerTradeController {
 
 
     /**
-     *
      * @param id 对账单id
      * @return
      */
@@ -70,12 +66,11 @@ public class LedgerTradeController {
      * @return
      */
     @PostMapping("count")
-    public HttpResult count(@RequestBody  TradeReq tradeReq) {
+    public HttpResult count(@RequestBody TradeReq tradeReq) {
         return HttpResult.ok(ledgerTradeService.orderCount(tradeReq));
     }
 
 
-
     /**
      * 导出 todo
      *
@@ -84,8 +79,8 @@ public class LedgerTradeController {
      * @return
      */
     @PostMapping("export")
-    public HttpResult export(HttpServletResponse response, @RequestBody @Valid TradeReq tradeReq) {
-        List<LedgerSell> list = null;
+    public HttpResult export(HttpServletResponse response, @RequestBody TradeReq tradeReq) {
+        List<LedgerSell> list;
 
         if (CollectionUtils.isEmpty(tradeReq.getIdList())) {
             tradeReq.setPage(0);
@@ -93,18 +88,18 @@ public class LedgerTradeController {
             PageRes<LedgerSell> pageResult = ledgerTradeService.list(tradeReq);
             list = pageResult.getList();
         } else {
-//            list = ledgerTradeService.selectSellList(tradeReq.getIdList());
+            list = ledgerTradeService.queryIds(tradeReq.getIdList());
         }
 
         if (CollectionUtils.isEmpty(list)) {
             return HttpResult.error("没有可导出的数据");
         }
-        List<LedgerTradeVo> collect = list.stream().map(a -> {
-            LedgerTradeVo ledgerTradeVo = new LedgerTradeVo();
+        List<LedgerTradeExport> collect = list.stream().map(a -> {
+            LedgerTradeExport ledgerTradeVo = new LedgerTradeExport();
             BeanUtils.copyProperties(a, ledgerTradeVo);
             return ledgerTradeVo;
         }).collect(Collectors.toList());
-        ExcelUtil.downData(response, LedgerTradeVo.class, collect);
+        ExcelUtil.downData(response, LedgerTradeExport.class, collect);
         return null;
     }
 

+ 23 - 3
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementLogisticsController.java

@@ -3,7 +3,7 @@ package com.sckw.payment.controller.operate;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.payment.model.constant.LogisticsUnitType;
-import com.sckw.payment.model.dto.SettlementLogisticsDto;
+import com.sckw.payment.model.vo.SettlementLogistics;
 import com.sckw.payment.model.vo.req.SettlementReq;
 import com.sckw.payment.model.vo.res.SettlementLogisticsVo;
 import com.sckw.payment.service.operate.SettlementLogisticsService;
@@ -34,21 +34,41 @@ public class SettlementLogisticsController {
     @Resource
     private SettlementLogisticsService settlementLogisticsService;
 
+    /**
+     * 结算列表
+     *
+     * @param settlementReq
+     * @return
+     */
     @PostMapping("list")
     public HttpResult list(@RequestBody @Valid SettlementReq settlementReq) {
         return HttpResult.ok(settlementLogisticsService.list(settlementReq));
     }
 
+    /**
+     * 结算统计
+     *
+     * @param settlementReq
+     * @return
+     */
     @PostMapping("count")
     public HttpResult count(@RequestBody @Valid SettlementReq settlementReq) {
         return HttpResult.ok(settlementLogisticsService.count(settlementReq));
     }
 
+    /**
+     * 导出
+     *
+     * @param response
+     * @param settlementReq
+     * @return
+     */
     @PostMapping("export")
     public HttpResult export(HttpServletResponse response, @RequestBody @Valid SettlementReq settlementReq) {
         settlementReq.setUnitType(LogisticsUnitType.SHIPPER);
-        List<SettlementLogisticsDto> list;
-        list = settlementLogisticsService.selectList(settlementReq);
+        settlementReq.setUnitTypeTwo(LogisticsUnitType.CARRIER);
+        List<SettlementLogistics> list;
+        list = settlementLogisticsService.exportList(settlementReq);
         if (CollectionUtils.isEmpty(list)) {
             return HttpResult.error("没有可导出的数据");
         }

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementTradeController.java

@@ -63,7 +63,7 @@ public class SettlementTradeController {
      * @param settlementReq
      * @return
      */
-    @PostMapping(name = "收款-表尾金额结算数据", path = "sum")
+    @PostMapping( "sum")
     public HttpResult sum(@RequestBody @Valid SettlementTradeReq settlementReq) {
         settlementReq.check();
         return HttpResult.ok(settlementTradeService.sumMoney(settlementReq));

+ 4 - 4
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementWalletController.java

@@ -29,8 +29,8 @@ public class SettlementWalletController {
      * @param settlementWalletReq
      * @return
      */
-    @PostMapping(name = "物流-电子钱包付款(货到付款)结算记录-列表", path = "logisticsList")
-    public HttpResult logisticsList(@RequestBody @Valid SettlementWalletReq settlementWalletReq) {
+    @GetMapping("logisticsList")
+    public HttpResult logisticsList(@Valid SettlementWalletReq settlementWalletReq) {
         settlementWalletReq.setPayType(SettlementWalletPayTypeEnum.CASH_ON_DELIVERY.getStatus());
         settlementWalletReq.setOrderType(SettlementOrderTypeEnum.LOGISTICS.getStatus());
         return HttpResult.ok(settlementWalletService.pageList(settlementWalletReq));
@@ -42,7 +42,7 @@ public class SettlementWalletController {
      * @param settlementWalletReq
      * @return
      */
-    @GetMapping(name = "销售-付款记录列表(采购电子钱包结算记录)", path = "tradeList")
+    @GetMapping("tradeList")
     public HttpResult tradeList(@Valid SettlementWalletReq settlementWalletReq) {
         settlementWalletReq.setPayType(SettlementWalletPayTypeEnum.CASH_ON_DELIVERY.getStatus());
         settlementWalletReq.setOrderType(SettlementOrderTypeEnum.TRADE.getStatus());
@@ -56,7 +56,7 @@ public class SettlementWalletController {
      * @param settlementWalletReq
      * @return
      */
-    @GetMapping(name = "销售-收款记录列表-预付款(电子钱包)", path = "tradePreList")
+    @GetMapping( "tradePreList")
     public HttpResult tradePreList(@Valid SettlementWalletReq settlementWalletReq) {
         settlementWalletReq.setPayType(SettlementWalletPayTypeEnum.ADVANCE_PAYMENT.getStatus());
         settlementWalletReq.setOrderType(SettlementOrderTypeEnum.TRADE.getStatus());

+ 7 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpLedgerLogisticsMapper.java

@@ -68,6 +68,13 @@ public interface KwpLedgerLogisticsMapper extends BaseMapper<KwpLedgerLogistics>
 
 
     List<LedgerShipperDto> selectShipperIds(@Param("ids") List<Long> ids);
+
+    /**
+     * 运营端通过ids查询,导出数据
+     *
+     * @param ids
+     * @return
+     */
     List<LedgerLogistics> selectIds(@Param("ids") List<Long> ids);
 
     /**

+ 9 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpLedgerTradeMapper.java

@@ -65,7 +65,7 @@ public interface KwpLedgerTradeMapper extends BaseMapper<KwpLedgerTrade> {
 
     List<LedgerPurchaseDto> selectPurchaseIds(@Param("ids") List<Long> ids);
 
-    LedgerCountSumVo countSum(@Param("tradeReq") TradeReq tradeReq);
+    LedgerCountSumVo countSum(@Param("tradeReq") TradeReq tradeReq, @Param("status") List<Integer> status);
 
     void updatePrice(@Param("id") Long id, @Param("totalPrice") BigDecimal totalPrice);
 
@@ -77,4 +77,12 @@ public interface KwpLedgerTradeMapper extends BaseMapper<KwpLedgerTrade> {
     List<String> selectJoin(@Param("entId") Long entId, @Param("entTarget") Long entTarget);
 
     LedgerSize countSize(@Param("entId") Long entId);
+
+    /**
+     * 运营端通过ids查询,导出数据
+     *
+     * @param ids
+     * @return
+     */
+    List<LedgerSell> selectIds(@Param("ids") List<Long> ids);
 }

+ 24 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementLogisticsMapper.java

@@ -46,6 +46,7 @@ public interface KwpSettlementLogisticsMapper extends BaseMapper<KwpSettlementLo
      * @date 2023-07-24 16:23
      */
     Long getCountList(@Param("settlementReq") SettlementReq settlementReq);
+
     Map<String, Long> count(@Param("settlementReq") SettlementReq settlementReq);
 
     /**
@@ -80,6 +81,15 @@ public interface KwpSettlementLogisticsMapper extends BaseMapper<KwpSettlementLo
      */
     List<SettlementLogisticsDto> selectLogisticsList(@Param("settlementReq") SettlementReq settlementReq, @Param("ids") List<Long> ids);
 
+    /**
+     * 运营端根据条件导出数据
+     *
+     * @param settlementReq
+     * @param ids
+     * @return
+     */
+    List<SettlementLogistics> exportList(@Param("settlementReq") SettlementReq settlementReq, @Param("ids") List<Long> ids);
+
     List<LedgerUnitDto> getListById(@Param("id") Long id);
 
     /**
@@ -99,5 +109,19 @@ public interface KwpSettlementLogisticsMapper extends BaseMapper<KwpSettlementLo
      */
     List<MoneyType> sumMoneyType(@Param("entId") Long entId, @Param("cur") List<LocalDateTime> cur, @Param("pre") List<LocalDateTime> pre, @Param("unitType") Integer unitType);
 
+    /**
+     * 物流结算定时任务归档数据查询
+     *
+     * @return
+     */
     List<KwpSettlementRecord> queryRecord();
+
+    /**
+     * app端详情
+     *
+     * @param id
+     * @param unitType
+     * @return
+     */
+    SettlementLogisticsDto selectDetail(@Param("id") Long id, @Param("unitType") Integer unitType);
 }

+ 9 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementOfflineMapper.java

@@ -3,6 +3,7 @@ package com.sckw.payment.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.payment.model.KwpSettlementOffline;
 import com.sckw.payment.model.dto.SettlementOfflineDto;
+import com.sckw.payment.model.vo.SettlementVo;
 import com.sckw.payment.model.vo.req.SettlementOfflineReq;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -19,10 +20,17 @@ public interface KwpSettlementOfflineMapper extends BaseMapper<KwpSettlementOffl
 
     SettlementOfflineDto detailLogisticsCollection(@Param("id") Long id);
 
-    Integer confirmLogisticsCollection(@Param("id") Long id, @Param("price") Float price);
 
     List<SettlementOfflineDto> pageList(@Param("offlineReq") SettlementOfflineReq settlementOfflineReq);
 
+    /**
+     * app端查询列表
+     *
+     * @param settlementOfflineReq
+     * @return
+     */
+    List<SettlementVo> appList(@Param("offlineReq") SettlementOfflineReq settlementOfflineReq);
+
     /**
      * 运营端查询
      *

+ 5 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementRecordMapper.java

@@ -2,19 +2,19 @@ package com.sckw.payment.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.payment.model.KwpSettlementRecord;
-import com.sckw.payment.model.vo.req.FinanceCount;
+import com.sckw.payment.model.vo.SettlementRecord;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 /**
-* @date 2023-09-13 18:48:30
-* @author xucaiqin
-*/
+ * @author xucaiqin
+ * @date 2023-09-13 18:48:30
+ */
 @Mapper
 public interface KwpSettlementRecordMapper extends BaseMapper<KwpSettlementRecord> {
     void insertBatch(@Param("list") List<KwpSettlementRecord> list);
 
-    void countByDay(FinanceCount financeCount);
+    List<SettlementRecord> countByDay(@Param("time") List<String> time, @Param("entId")Long entId);
 }

+ 9 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementWalletMapper.java

@@ -3,6 +3,7 @@ package com.sckw.payment.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.payment.model.KwpSettlementWallet;
 import com.sckw.payment.model.dto.SettlementWalletDto;
+import com.sckw.payment.model.vo.SettlementVo;
 import com.sckw.payment.model.vo.req.SettlementWalletReq;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -31,6 +32,14 @@ public interface KwpSettlementWalletMapper extends BaseMapper<KwpSettlementWalle
 
     List<SettlementWalletDto> pageList(@Param("walletReq") SettlementWalletReq walletReq);
 
+    /**
+     * app端结算列表
+     *
+     * @param walletReq
+     * @return
+     */
+    List<SettlementVo> appList(@Param("walletReq") SettlementWalletReq walletReq);
+
     /**
      * 运营端查询钱包结算记录
      *

+ 2 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/PayCenterEnum.java

@@ -32,7 +32,9 @@ public enum PayCenterEnum {
     ADVANCE_PAY_APPLY("/v1/wallet/advancepay/apply", "发起预付"),
     ADVANCE_PAY_INDEX("/v1/wallet/advancepay/index", "预付订单清单"),
     ADVANCE_PAY_WALLETS("/v2/advancepay/wallets", "钱包预付列表"),
+    ADVANCE_PAY_PAY_CHANNELS("/v2/advancepay/pay/channels", "钱包预付通道统计"),
     ADVANCE_PAY_RECEIVE("/v2/advancepay/receives", "钱包预收列表"),
+    ADVANCE_PAY_RECEIVE_CHANNELS("/v2/advancepay/receive/channels", "钱包预收通道统计"),
     ADVANCE_PAY_STATUS("/v1/wallet/advancepay/statusCategory", "预付订单状态"),
     INDEX("/v1/index/index", "获取通道清单"),
     MEMBER_PAY_INDEX("/v1/member/pay/index", "订单记录"),

+ 22 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/Id.java

@@ -0,0 +1,22 @@
+package com.sckw.payment.model.dto;
+
+import com.sckw.core.model.base.IdsList;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author xucaiqin
+ * @date 2023-09-18 09:07:24
+ */
+@Getter
+@Setter
+public class Id implements IdsList, Serializable {
+    @Serial
+    private static final long serialVersionUID = -4839563086535950776L;
+    @NotBlank(message = "id不能为空")
+    private String id;
+}

+ 1 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/SettlementLogisticsDto.java

@@ -188,4 +188,5 @@ public class SettlementLogisticsDto implements ISettlement  {
      */
     private String attachmentUrl;
 
+    private String percentage;
 }

+ 23 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/wallet/ChannelStatistics.java

@@ -0,0 +1,23 @@
+package com.sckw.payment.model.dto.wallet;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 渠道统计
+ * @author xucaiqin
+ * @date 2023-09-15 14:26:20
+ */
+@NoArgsConstructor
+@Data
+public class ChannelStatistics {
+    @JSONField(name = "uid")
+    private String uid;
+    @JSONField(name = "channel")
+    private String channel;
+    @JSONField(name = "channel_label")
+    private String channelLabel;
+    @JSONField(name = "count")
+    private Integer count;
+}

+ 2 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/LedgerLogistics.java

@@ -1,6 +1,7 @@
 package com.sckw.payment.model.vo;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import com.sckw.payment.model.dto.ILedger;
 import lombok.Getter;
 import lombok.Setter;
@@ -24,6 +25,7 @@ public class LedgerLogistics implements ILedger {
     /**
      * 物流对账单编号
      */
+    @JsonProperty("lLedgerNo")
     private String lLedgerNo;
 
     /**

+ 22 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/LedgerSell.java

@@ -10,7 +10,7 @@ import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
 /**
- * 对账-贸易订单 销售方
+ * 对账-贸易订单 运营端
  *
  * @author xucaiqin
  * @date 2023-07-10 18:11:24
@@ -79,14 +79,24 @@ public class LedgerSell implements ILedger {
     private BigDecimal actualPrice;
 
     /**
-     * 对账审核人电话
+     * 对账采购财务联系人名称
+     */
+    private String auditUser;
+
+    /**
+     * 对账采购财务联系人电话
      */
     private String auditPhone;
 
     /**
-     * 对账审核人名称
+     * 对账销售财务联系人名称
      */
-    private String auditUser;
+    private String successUser;
+
+    /**
+     * 对账销售财务联系人电话
+     */
+    private String successPhone;
 
     /**
      * 对账清单凭证
@@ -115,7 +125,14 @@ public class LedgerSell implements ILedger {
     private String statusLabel;
     private String contacts;
     private String phone;
-    private String firmName;
+    /**
+     * 采购
+     */
+    private String purchaseFirmName;
+    /**
+     * 销售
+     */
+    private String sellFirmName;
     /**
      * 创建人
      */

+ 3 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/PrePayWalletVo.java

@@ -21,12 +21,15 @@ public class PrePayWalletVo implements Serializable {
      */
     @JSONField(name = "uid")
     private String uid;
+    private String uidName;
+
     /**
      * 预付时,代表收款人
      * 预收时,代表付款人
      */
     @JSONField(name = "filter")
     private String filter;
+    private String filterName;
 
     @JSONField(name = "channel")
     private String channel;

+ 67 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/SettlementRecord.java

@@ -0,0 +1,67 @@
+package com.sckw.payment.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+
+/**
+ * 结算统计
+ *
+ * @author xucaiqin
+ * @date 2023-09-13 18:48:30
+ */
+@Data
+public class SettlementRecord {
+    /**
+     * 企业id
+     */
+    private Long entId;
+
+    /**
+     * 总应收金额
+     */
+    private BigDecimal totalReceiveMoney;
+
+    /**
+     * 待收金额
+     */
+    private BigDecimal exactMoney;
+
+    /**
+     * 已收金额(累加金额)
+     */
+    private BigDecimal receivedMoney;
+
+    /**
+     * 逾期待收金额
+     */
+    private BigDecimal overdueExactMoney;
+
+    /**
+     * 总应付金额
+     */
+    private BigDecimal totalPayMoney;
+
+    /**
+     * 待付金额
+     */
+    private BigDecimal unpaidMoney;
+
+    /**
+     * 已付金额(累加金额)
+     */
+    private BigDecimal paidMoney;
+
+    /**
+     * 逾期待付金额
+     */
+    private BigDecimal overduePaidMoney;
+
+    /**
+     * 创建日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private LocalDate createTime;
+}

+ 109 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/SettlementVo.java

@@ -0,0 +1,109 @@
+package com.sckw.payment.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 结算记录 线下和电子钱包
+ */
+@Getter
+@Setter
+public class SettlementVo {
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 企业类型
+     */
+    private Long entId;
+
+    /**
+     * 结算id(交易订单结算/物流订单结算)
+     */
+    private Long settlementId;
+
+    /**
+     * 1-物流 2-交易
+     */
+    private Integer orderType;
+
+    /**
+     * 线上渠道 1-huifu
+     */
+    private Integer channel;
+
+    /**
+     * 回款时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date payTime;
+
+    /**
+     * 金额
+     */
+    private BigDecimal payPrice;
+
+    /**
+     * 剩余待付金额
+     */
+    private BigDecimal topayPrice;
+
+    /**
+     * 类型(0付款、1退款)
+     */
+    private Integer type;
+    /**
+     * 附件地址
+     */
+    private String url;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 状态(0扣款、1结算、2异常、)
+     */
+    private Integer status;
+
+    /**
+     * 创建人
+     */
+    private Long createBy;
+
+    /**
+     * 创建人名称
+     */
+    private String createByLabel;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 更新人
+     */
+    private Long updateBy;
+
+    /**
+     * 更新人名称
+     */
+    private String updateByLabel;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updateTime;
+
+}

+ 151 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/excel/LedgerLogisticsExport.java

@@ -0,0 +1,151 @@
+package com.sckw.payment.model.vo.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sckw.excel.annotation.ExcelContext;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * 对账-物流订单-运营端
+ *
+ * @author xucaiqin
+ * @date 2023-07-11 15:17:12
+ */
+@Getter
+@Setter
+@ExcelContext(fileName = "物流对账单表", sheetName = "物流对账单表")
+public class LedgerLogisticsExport {
+    /**
+     * 主键
+     */
+    @ExcelProperty(value = "序号")
+    private Long id;
+    /**
+     * 状态(待对账、对账中、已对账、已完成、已取消、已退回)
+     */
+    @ExcelProperty(value = "状态")
+    private String statusLabel;
+    /**
+     * 物流对账单编号
+     */
+    @ExcelProperty(value = "物流对账单编号")
+    private String lLedgerNo;
+
+    /**
+     * 对账单名称
+     */
+    @ExcelProperty(value = "对账单名称")
+    private String name;
+
+    /**
+     * 托运单位
+     */
+    @ExcelProperty(value = "托运单位")
+    private String shipperFirmName;
+
+    /**
+     * 承运单位
+     */
+    @ExcelProperty(value = "承运单位")
+    private String carrierFirmName;
+
+    /**
+     * 订单数量
+     */
+    @ExcelProperty(value = "订单数量")
+    private Integer orderCount;
+//    /**
+//     * 开始日期
+//     */
+//    @ExcelProperty(value = "开始日期")
+//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+//    private LocalDateTime startTime;
+//
+//    /**
+//     * 结束日期
+//     */
+//    @ExcelProperty(value = "结束日期")
+//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+//    private LocalDateTime endTime;
+
+    /**
+     * 付款方式(预付款、货到付款)
+     */
+    @ExcelProperty(value = "付款方式")
+    private String tradingLabel;
+
+    /**
+     * 发票税率(%)
+     */
+    @ExcelProperty(value = "发票税率(%)")
+    private String taxRateLabel;
+
+
+    /**
+     * 总应收/元
+     */
+    @ExcelProperty(value = "总应收/元")
+    private BigDecimal totalPrice;
+
+//    /**
+//     * 实际结算金额
+//     */
+//    @ExcelProperty(value = "实际结算金额")
+//    private BigDecimal settlePrice;
+
+    /**
+     * 已收款/元
+     */
+    @ExcelProperty(value = "已收款/元")
+    private BigDecimal actualPrice;
+
+    /**
+     * 托运方财务联系方式
+     */
+    @ExcelProperty(value = "托运方财务联系方式")
+    private String auditPhone;
+
+    /**
+     * 托运方财务联系人
+     */
+    @ExcelProperty(value = "托运方财务联系人")
+    private String auditUser;
+    /**
+     * 承运方财务联系人
+     */
+    @ExcelProperty(value = "承运方财务联系人")
+    private String successUser;
+    /**
+     * 承运方财务联系方式
+     */
+    @ExcelProperty(value = "承运方财务联系方式")
+    private String successPhone;
+//
+//    /**
+//     * 对账清单凭证
+//     */
+//    @ExcelProperty(value = "对账清单凭证")
+//    private String url;
+    /**
+     * 生成时间
+     */
+    @ExcelProperty(value = "生成时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime generateTime;
+    @ExcelProperty(value = "预计收款日期")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private LocalDateTime receiptTime;
+
+    @ExcelProperty(value = "提交人")
+    private String createByName;
+
+}

+ 147 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/excel/LedgerTradeExport.java

@@ -0,0 +1,147 @@
+package com.sckw.payment.model.vo.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sckw.excel.annotation.ExcelContext;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * 对账-贸易订单 运营端
+ *
+ * @author xucaiqin
+ * @date 2023-07-11 15:17:12
+ */
+@Getter
+@Setter
+@ExcelContext(fileName = "贸易对账单表", sheetName = "贸易对账单表")
+public class LedgerTradeExport {
+    /**
+     * 主键
+     */
+    @ExcelProperty(value = "序号")
+    private Long id;
+    /**
+     * 状态(待对账、对账中、已对账、已完成、已取消、已退回)
+     */
+    @ExcelProperty(value = "状态")
+    private String statusLabel;
+
+    /**
+     * 贸易对账单编号
+     */
+    @ExcelProperty(value = "贸易对账单编号")
+    private String tLedgerNo;
+
+    /**
+     * 对账单名称
+     */
+    @ExcelProperty(value = "对账单名称")
+    private String name;
+
+    /**
+     * 采购单位
+     */
+    @ExcelProperty(value = "采购单位")
+    private String purchaseFirmName;
+    /**
+     * 销售单位
+     */
+    @ExcelProperty(value = "销售单位")
+    private String sellFirmName;
+    /**
+     * 订单数量
+     */
+    @ExcelProperty(value = "订单数量")
+    private Integer orderCount;
+
+
+//    /**
+//     * 开始日期
+//     */
+//    @ExcelProperty(value = "开始日期")
+//    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+//    private LocalDateTime startTime;
+//
+//    /**
+//     * 结束日期
+//     */
+//    @ExcelProperty(value = "结束日期")
+//    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+//    private LocalDateTime endTime;
+    /**
+     * 付款方式(预付款、货到付款)
+     */
+    @ExcelProperty(value = "付款方式")
+    private String tradingLabel;
+
+    /**
+     * 发票税率(%)
+     */
+    @ExcelProperty(value = "发票税率(%)")
+    private String taxRateLabel;
+
+    /**
+     * 总应收/元
+     */
+    @ExcelProperty(value = "总应收/元")
+    private BigDecimal totalPrice;
+
+//    /**
+//     * 实际结算金额
+//     */
+//    @ExcelProperty(value = "实际结算金额")
+//    private BigDecimal settlePrice;
+
+    /**
+     * 已收款/元
+     */
+    @ExcelProperty(value = "已收款/元")
+    private BigDecimal actualPrice;
+
+    /**
+     * 对账采购财务联系人名称
+     */
+    @ExcelProperty(value = "采购财务联系人")
+    private String auditUser;
+
+    /**
+     * 对账采购财务联系人电话
+     */
+    @ExcelProperty(value = "采购财务联系方式")
+    private String auditPhone;
+
+    /**
+     * 对账销售财务联系人名称
+     */
+    @ExcelProperty(value = "销售财务联系人")
+    private String successUser;
+
+    /**
+     * 对账销售财务联系人电话
+     */
+    @ExcelProperty(value = "销售财务联系方式")
+    private String successPhone;
+
+    /**
+     * 预计收款日期
+     */
+    @ExcelProperty(value = "预计收款日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDateTime receiptTime;
+    /**
+     * 提交人
+     */
+    @ExcelProperty(value = "提交人")
+    private String createByName;
+
+    /**
+     * 生成时间
+     */
+    @ExcelProperty(value = "生成时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime generateTime;
+}

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/FinanceCount.java

@@ -18,7 +18,7 @@ import java.util.List;
 @Setter
 public class FinanceCount {
     /**
-     * 周期维度 日、月
+     * 周期维度 1-日、2-周、3- 4-年
      */
     @NotBlank(message = "周期维度不能为空")
     private Integer circle;

+ 4 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/FundVo.java

@@ -41,6 +41,10 @@ public class FundVo implements Serializable {
      * 充值中金额
      */
     private String chargingMoney;
+    /**
+     * 转账中金额
+     */
+    private String transferMoney;
     /**
      * 提现中金额
      */

+ 7 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerTradeService.java

@@ -145,7 +145,8 @@ public class KwpLedgerTradeService extends AbsLedger {
         fillPara(tradeReq);
         tradeReq.setUnitType(TradeUnitType.PURCHASE);
         tradeReq.setUnitTypeTwo(TradeUnitType.SELL);
-        return tradeMapper.countSum(tradeReq);
+        List<Integer> status = new ArrayList<>();
+        return tradeMapper.countSum(tradeReq,status);
     }
 
     /**
@@ -174,7 +175,11 @@ public class KwpLedgerTradeService extends AbsLedger {
         fillPara(tradeReq);
         tradeReq.setUnitType(TradeUnitType.SELL);
         tradeReq.setUnitTypeTwo(TradeUnitType.PURCHASE);
-        return tradeMapper.countSum(tradeReq);
+        List<Integer> status = new ArrayList<>() {{
+            add(LedgerEnum.SAVE.getStatus());
+            add(LedgerEnum.REVOCATION.getStatus());
+        }};
+        return tradeMapper.countSum(tradeReq, status);
     }
 
     private void removeDraft(Long id) {

+ 41 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementLogisticsService.java

@@ -12,9 +12,10 @@ import com.sckw.payment.dao.KwpSettlementLogisticsMapper;
 import com.sckw.payment.model.KwpSettlementLogistics;
 import com.sckw.payment.model.constant.LogisticsUnitType;
 import com.sckw.payment.model.constant.SettlementEnum;
-import com.sckw.payment.model.dto.LedgerUnitDto;
-import com.sckw.payment.model.dto.MoneyType;
-import com.sckw.payment.model.dto.SettlementLogisticsDto;
+import com.sckw.payment.model.constant.SettlementOrderTypeEnum;
+import com.sckw.payment.model.constant.TradingEnum;
+import com.sckw.payment.model.dto.*;
+import com.sckw.payment.model.vo.SettlementVo;
 import com.sckw.payment.model.vo.req.SettlementReq;
 import com.sckw.payment.model.vo.res.SettlementLogisticsStatusCountVo;
 import com.sckw.payment.model.vo.res.SettlementLogisticsSumVo;
@@ -23,6 +24,7 @@ import com.sckw.payment.utils.PageMoreRes;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
 import com.sckw.system.api.model.dto.res.UserCacheResDto;
+import jakarta.annotation.Resource;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -45,7 +47,10 @@ public class KwpSettlementLogisticsService {
     private RemoteSystemService remoteSystemService;
     private final KwpSettlementLogisticsMapper settlementLogisticsMapper;
     private final KwpLedgerLogisticsUnitService logisticsUnitService;
-
+    @Resource
+    private KwpSettlementWalletService kwpSettlementWalletService;
+    @Resource
+    private KwpSettlementOfflineService kwpSettlementOfflineService;
 
     public void save(KwpSettlementLogistics settlementLogistics) {
         settlementLogisticsMapper.insert(settlementLogistics);
@@ -98,7 +103,38 @@ public class KwpSettlementLogisticsService {
         settlementReq.setUnitTypeTwo(LogisticsUnitType.SHIPPER);
         return pageSelect(settlementReq);
     }
-
+    /**
+     * 查询贸易结算详情
+     *
+     * @param id       结算单id
+     * @param unitType 企业类型
+     * @return
+     */
+    public SettlementDetailDto<SettlementLogisticsDto, SettlementVo> queryDetail(Long id, Integer unitType) {
+        SettlementLogisticsDto settlementLogisticsDto = settlementLogisticsMapper.selectDetail(id, unitType);
+        if (Objects.isNull(settlementLogisticsDto)) {
+            throw new BusinessException("结算单不存在");
+        }
+        Map<String, SysDictResDto> dictResDtoMap = remoteSystemService.queryDictMapByType(DictTypeEnum.TRADE_TYPE.getType());
+        String trading = settlementLogisticsDto.getTrading();
+        SysDictResDto sysDictResDto = dictResDtoMap.get(trading);
+        if (Objects.nonNull(sysDictResDto)) {
+            settlementLogisticsDto.setTradingLabel(sysDictResDto.getLabel());
+        }
+        settlementLogisticsDto.setPercentage(settlementLogisticsDto.changePercentage(settlementLogisticsDto.getActualPrice(), settlementLogisticsDto.getTotalPrice()));
+        settlementLogisticsDto.setStatusLabel(SettlementEnum.getStatusDesc(settlementLogisticsDto.getStatus()));
+        Integer payType = TradingEnum.getPrefix(trading);
+        List<SettlementVo> settlementVoList = new ArrayList<>();
+        if (Objects.nonNull(payType)) {
+            if(payType==TradingEnum.OFFLINE_PAY.getStatus()){
+                settlementVoList = kwpSettlementOfflineService.queryList(id, SettlementOrderTypeEnum.LOGISTICS.getStatus(), payType);
+            }else {
+                settlementVoList = kwpSettlementWalletService.queryList(id, SettlementOrderTypeEnum.LOGISTICS.getStatus(), payType);
+            }
+        }
+        List<SettlementVo> settlementWallet = kwpSettlementWalletService.queryList(id, SettlementOrderTypeEnum.LOGISTICS.getStatus(), TradingEnum.getPrefix(trading));
+        return new SettlementDetailDto<>(settlementLogisticsDto, settlementVoList);
+    }
     /**
      * 运费收款-物流订单详情
      *

+ 9 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementOfflineService.java

@@ -21,6 +21,7 @@ import com.sckw.payment.model.constant.*;
 import com.sckw.payment.model.dto.SettlementLogisticsDto;
 import com.sckw.payment.model.dto.SettlementOfflineDto;
 import com.sckw.payment.model.dto.SettlementTradeDto;
+import com.sckw.payment.model.vo.SettlementVo;
 import com.sckw.payment.model.vo.req.OfflinePaymentReq;
 import com.sckw.payment.model.vo.req.SettlementOfflinePayReq;
 import com.sckw.payment.model.vo.req.SettlementOfflineReq;
@@ -416,4 +417,12 @@ public class KwpSettlementOfflineService {
         }
         return "请勿重复提交";
     }
+
+    public List<SettlementVo> queryList(Long id, int status, Integer payType) {
+        SettlementOfflineReq settlementWalletReq = new SettlementOfflineReq();
+        settlementWalletReq.setPayType(payType);
+        settlementWalletReq.setOrderType(status);
+        settlementWalletReq.setId(String.valueOf(id));
+        return settlementOfflineMapper.appList(settlementWalletReq);
+    }
 }

+ 5 - 4
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementRecordService.java

@@ -1,11 +1,13 @@
 package com.sckw.payment.service;
 
 import com.sckw.payment.dao.KwpSettlementRecordMapper;
-import com.sckw.payment.model.vo.req.FinanceCount;
+import com.sckw.payment.model.vo.SettlementRecord;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * 归档记录
  *
@@ -19,8 +21,7 @@ public class KwpSettlementRecordService {
     private final KwpSettlementRecordMapper kwpSettlementRecordMapper;
 
 
-    public String financeCount(FinanceCount financeCount) {
-        kwpSettlementRecordMapper.countByDay(financeCount);
-        return null;
+    public List<SettlementRecord> financeCount(List<String> financeCount, Long entId) {
+        return kwpSettlementRecordMapper.countByDay(financeCount,entId);
     }
 }

+ 17 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementTradeService.java

@@ -16,6 +16,7 @@ import com.sckw.payment.model.constant.SettlementOrderTypeEnum;
 import com.sckw.payment.model.constant.TradeUnitType;
 import com.sckw.payment.model.constant.TradingEnum;
 import com.sckw.payment.model.dto.*;
+import com.sckw.payment.model.vo.SettlementVo;
 import com.sckw.payment.model.vo.req.SettlementTradeReq;
 import com.sckw.payment.model.vo.res.SettlementSumVo;
 import com.sckw.system.api.RemoteSystemService;
@@ -47,6 +48,8 @@ public class KwpSettlementTradeService {
     private final KwpLedgerTradeUnitService tradeUnitService;
     @Resource
     private KwpSettlementWalletService kwpSettlementWalletService;
+    @Resource
+    private KwpSettlementOfflineService kwpSettlementOfflineService;
 
 
     /**
@@ -246,7 +249,7 @@ public class KwpSettlementTradeService {
      * @param unitType 企业类型
      * @return
      */
-    public SettlementDetailDto<SettlementTradeDto, SettlementWalletDto> queryDetail(Long id, Integer unitType) {
+    public SettlementDetailDto<SettlementTradeDto, SettlementVo> queryDetail(Long id, Integer unitType) {
         SettlementTradeDto settlementTradeDto = settlementTradeMapper.selectDetail(id, unitType);
         if (Objects.isNull(settlementTradeDto)) {
             throw new BusinessException("结算单不存在");
@@ -259,14 +262,23 @@ public class KwpSettlementTradeService {
         }
         settlementTradeDto.setPercentage(settlementTradeDto.changePercentage(settlementTradeDto.getActualPrice(), settlementTradeDto.getTotalPrice()));
         settlementTradeDto.setStatusLabel(SettlementEnum.getStatusDesc(settlementTradeDto.getStatus()));
-        List<SettlementWalletDto> settlementWallet = kwpSettlementWalletService.queryList(id, SettlementOrderTypeEnum.TRADE.getStatus(), TradingEnum.getPrefix(trading));
-        return new SettlementDetailDto<>(settlementTradeDto, settlementWallet);
+        Integer payType = TradingEnum.getPrefix(trading);
+        List<SettlementVo> settlementVoList = new ArrayList<>();
+        if (Objects.nonNull(payType)) {
+            if(payType==TradingEnum.OFFLINE_PAY.getStatus()){
+                settlementVoList = kwpSettlementOfflineService.queryList(id, SettlementOrderTypeEnum.TRADE.getStatus(), payType);
+
+            }else {
+                settlementVoList = kwpSettlementWalletService.queryList(id, SettlementOrderTypeEnum.TRADE.getStatus(), payType);
+            }
+        }
+        return new SettlementDetailDto<>(settlementTradeDto, settlementVoList);
     }
 
     /**
      * @param entId    顶级企业id
-     * @param cur       当月/周
-     * @param pre       上月/周
+     * @param cur      当月/周
+     * @param pre      上月/周
      * @param unitType 企业类型 2-销售 1-采购
      */
     public List<MoneyType> moneySum(Long entId, List<LocalDateTime> cur, List<LocalDateTime> pre, Integer unitType) {

+ 5 - 3
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementWalletService.java

@@ -26,6 +26,7 @@ import com.sckw.payment.model.dto.LedgerUnitDto;
 import com.sckw.payment.model.dto.SettlementLogisticsDto;
 import com.sckw.payment.model.dto.SettlementTradeDto;
 import com.sckw.payment.model.dto.SettlementWalletDto;
+import com.sckw.payment.model.vo.SettlementVo;
 import com.sckw.payment.model.vo.req.OfflinePaymentReq;
 import com.sckw.payment.model.vo.req.SettlementWalletReq;
 import com.sckw.payment.model.vo.req.WalletPayReq;
@@ -68,7 +69,8 @@ public class KwpSettlementWalletService {
     private final KwpSettlementLogisticsMapper kwpSettlementLogisticsMapper;
     private final KwpLedgerTradeOrderService tradeOrderService;
     private final KwpSettlementLogisticsService kwpSettlementLogisticsService;
-    private final KwpSettlementTradeService kwpSettlementTradeService;
+    @Resource
+    private KwpSettlementTradeService kwpSettlementTradeService;
     private final PayCenterService payCenterService;
     private final KwpWalletRelationService walletRelationService;
     private final RedisLockUtil redisLockUtil;
@@ -736,12 +738,12 @@ public class KwpSettlementWalletService {
      * @param status  订单类型 1-物流 2-贸易
      * @param payType 支付方式 1-预付款、2-货到付款
      */
-    public List<SettlementWalletDto> queryList(Long id, int status, Integer payType) {
+    public List<SettlementVo> queryList(Long id, int status, Integer payType) {
         SettlementWalletReq settlementWalletReq = new SettlementWalletReq();
         settlementWalletReq.setPayType(payType);
         settlementWalletReq.setOrderType(status);
         settlementWalletReq.setId(String.valueOf(id));
-        return settlementWalletMapper.pageList(settlementWalletReq);
+        return settlementWalletMapper.appList(settlementWalletReq);
     }
 }
 

+ 33 - 3
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/PayCenterService.java

@@ -365,9 +365,9 @@ public class PayCenterService {
         if (Objects.isNull(money)) {
             throw new BusinessException("提现金额不能为空");
         }
-        if (StringUtils.isBlank(remarks)) {
-            throw new BusinessException("备注不能为空");
-        }
+//        if (StringUtils.isBlank(remarks)) {
+//            throw new BusinessException("备注不能为空");
+//        }
         String sync = postHttp(PayCenterEnum.WITHDRAW_TAKE, new HashMap<>() {{
             put("uid", uid);
             put("channel", channel);
@@ -609,6 +609,21 @@ public class PayCenterService {
         });
     }
 
+    /**
+     * 钱包预付通道统计
+     *
+     * @param uid
+     * @param filter
+     * @return
+     */
+    public R<List<ChannelStatistics>> advancePayWalletChannels(String uid, String filter) {
+        String sync = getHttp(PayCenterEnum.ADVANCE_PAY_PAY_CHANNELS, new HashMap<>() {{
+            put("uid", uid);
+            put("filter", filter);
+        }});
+        return parseArray(sync, ChannelStatistics.class);
+    }
+
     /**
      * 钱包预收列表
      *
@@ -631,6 +646,21 @@ public class PayCenterService {
         });
     }
 
+    /**
+     * 钱包预收通道统计
+     *
+     * @param uid
+     * @param filter
+     * @return
+     */
+    public R<List<ChannelStatistics>> advancePayReceiveChannels(String uid, String filter) {
+        String sync = getHttp(PayCenterEnum.ADVANCE_PAY_RECEIVE_CHANNELS, new HashMap<>() {{
+            put("uid", uid);
+            put("filter", filter);
+        }});
+        return parseArray(sync, ChannelStatistics.class);
+    }
+
     /**
      * 预付订单状态
      *

+ 120 - 7
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WalletService.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.sckw.core.common.enums.NumberConstant;
 import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.SuccessBusinessException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.utils.CollectionUtils;
@@ -27,6 +28,7 @@ import com.sckw.payment.model.dto.common.BusinessNo;
 import com.sckw.payment.model.dto.page.CashPage;
 import com.sckw.payment.model.dto.page.PrePayWalletPage;
 import com.sckw.payment.model.dto.wallet.*;
+import com.sckw.payment.model.dto.wallet.ChannelStatistics;
 import com.sckw.payment.model.vo.PrePayWalletVo;
 import com.sckw.payment.model.vo.req.*;
 import com.sckw.payment.model.vo.res.*;
@@ -62,7 +64,7 @@ public class WalletService {
     private final PayCenterService payCenterService;
     private final KwpWalletRelationService walletRelationService;
     private final KwpWalletRefundMapper kwpWalletRefundMapper;
-    private final KwpWalletTransferMapper transferMapper;
+    private final KwpWalletTransferMapper kwpWalletTransferMapper;
     private final RedisLockUtil redisLockUtil;
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private RemoteSystemService remoteSystemService;
@@ -182,6 +184,18 @@ public class WalletService {
         }
     }
 
+    private void transferMoney(FundVo fundVo) {
+        DecimalFormat df = new DecimalFormat("0.00");
+        LambdaQueryWrapper<KwpWalletTransfer> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(KwpWalletTransfer::getUid, fundVo.getUid()).eq(KwpWalletTransfer::getFilter, fundVo.getFilter()).eq(KwpWalletTransfer::getChannel, fundVo.getChannel()).eq(KwpWalletTransfer::getStatus, TransferEnum.TRANSFERRING.getStatus()).last("limit 1");
+        KwpWalletTransfer kwpWalletTransfer = kwpWalletTransferMapper.selectOne(wrapper);
+        if (Objects.nonNull(kwpWalletTransfer)) {
+            fundVo.setTransferMoney(df.format(kwpWalletTransfer.getMoney()));
+        } else {
+            fundVo.setTransferMoney("0.00");
+        }
+    }
+
     /**
      * 按钱包渠道进行统计钱包清单数量
      *
@@ -239,7 +253,8 @@ public class WalletService {
         Long entId = LoginUserHolder.getEntId();
         String uid = walletRelationService.getRelation(entId);
         if (StringUtils.isBlank(uid)) {
-            throw new BusinessException("暂未开通电子钱包");
+            throw new SuccessBusinessException("暂未开通电子钱包");
+//            return new WalletDetail(LoginUserHolder.getEntName(), "-", "-", "-", 0, new ArrayList<>());
         }
         //钱包总览信息
         R<WalletOverview> wallet = payCenterService.general(uid);
@@ -294,8 +309,7 @@ public class WalletService {
                     }
                 }
             }
-            return new WalletDetail(LoginUserHolder.getEntName(), String.valueOf(data.getTotalMoney() / 100D), String.valueOf(data.getChargingMoney()),
-                    String.valueOf(data.getWdingMoney()), data.getChannelTotal(), channelDetails);
+            return new WalletDetail(LoginUserHolder.getEntName(), String.valueOf(data.getTotalMoney() / 100D), String.valueOf(data.getChargingMoney()), String.valueOf(data.getWdingMoney()), data.getChannelTotal(), channelDetails);
         }
         return new WalletDetail(LoginUserHolder.getEntName(), "-", "-", "-", 0, new ArrayList<>());
     }
@@ -409,6 +423,7 @@ public class WalletService {
             fundVo.setChargingMoney(dfMoney(re.getChargingMoney()));
             fundVo.setTotalMoney(dfMoney(re.getTotalMoney()));
             refundMoney2(fundVo);
+            transferMoney(fundVo);
             vo.add(fundVo);
         }
         DecimalFormat df = new DecimalFormat("0.00");
@@ -433,7 +448,7 @@ public class WalletService {
         if (StringUtils.isBlank(filter)) {
             throw new BusinessException("合作单位暂未开通电子钱包");
         }
-        ChannelEnum channelEnum = ChannelEnum.getByChannel(addWalletReq.getChannel());
+        ChannelEnum channelEnum = ChannelEnum.getByValue(addWalletReq.getChannel());
         if (Objects.isNull(channelEnum)) {
             throw new BusinessException("支付通道不存在");
         }
@@ -573,12 +588,12 @@ public class WalletService {
                 if (!businessNoR1.getStatus()) {
                     //转账失败
                     walletTransfer.setStatus(TransferEnum.FAILED.getStatus());
-                    transferMapper.insert(walletTransfer);
+                    kwpWalletTransferMapper.insert(walletTransfer);
                     throw new BusinessException(StringUtils.isNotBlank(businessNoR1.getMsg()) ? businessNoR1.getMsg() : "转账失败");
                 }
                 //转帐中
                 walletTransfer.setStatus(TransferEnum.TRANSFERRING.getStatus());
-                transferMapper.insert(walletTransfer);
+                kwpWalletTransferMapper.insert(walletTransfer);
                 return businessNoR1.getData();
             } finally {
                 redisLockUtil.unlock(key);
@@ -680,6 +695,8 @@ public class WalletService {
                     prePayWalletVo = new PrePayWalletVo();
                     BeanUtils.copyProperties(row, prePayWalletVo);
                     prePayWalletVo.setApMoney(dfMoney(row.getApMoney()));
+                    prePayWalletVo.setUidName(getFirmName(row.getUid()));
+                    prePayWalletVo.setFilterName(getFirmName(row.getFilter()));
                     prePayWalletVo.setUsingApMoney(dfMoney(row.getUsingApMoney()));
                     prePayWalletVo.setSettlingApMoney(dfMoney(row.getSettlingApMoney()));
                     prePayWalletVo.setTotalApMoney(dfMoney(row.getTotalApMoney()));
@@ -697,6 +714,53 @@ public class WalletService {
 
     }
 
+    /**
+     * 预付列表钱包统计
+     *
+     * @param entName
+     * @return
+     */
+    public List<ChannelCount> prePayCount(String entName) {
+        Long entId = LoginUserHolder.getEntId();
+        String uid = walletRelationService.getRelation(entId);
+        if (StringUtils.isBlank(uid)) {
+            throw new BusinessException("暂未开通电子钱包");
+        }
+        List<String> filterList = new ArrayList<>();
+        //筛选指定企业的数据
+        if (StringUtils.isNotBlank(entName)) {
+            filterList = findFilter(entName);
+        }
+        List<ChannelCount> channelDetails = new ArrayList<>();
+        //查询预付订单渠道统计数据
+        R<List<ChannelStatistics>> listR = payCenterService.advancePayWalletChannels(uid, StringUtils.join(filterList, ","));
+        Map<String, Integer> mapCount;
+        if (listR.getStatus()) {
+            List<ChannelStatistics> data = listR.getData();
+            if (!CollectionUtils.isEmpty(data)) {
+                mapCount = data.stream().collect(Collectors.toMap(ChannelStatistics::getChannel, ChannelStatistics::getCount, (k, v) -> k));
+            } else {
+                mapCount = new HashMap<>();
+            }
+            mapCount.compute("all", (k, v) -> {
+                Integer sum = 0;
+                for (Map.Entry<String, Integer> map : mapCount.entrySet()) {
+                    sum += map.getValue();
+                }
+                return sum;
+            });
+        } else {
+            mapCount = new HashMap<>();
+        }
+        ChannelCount channelCount;
+        for (WalletChannelEnum value : WalletChannelEnum.values()) {
+            Integer integer = mapCount.get(value.getChannel());
+            channelCount = new ChannelCount(value.getValue(), value.getDesc(), value.getChannel(), Objects.isNull(integer) ? 0 : integer);
+            channelDetails.add(channelCount);
+        }
+        return channelDetails;
+    }
+
     /**
      * 预收列表
      *
@@ -734,6 +798,8 @@ public class WalletService {
                     prePayWalletVo = new PrePayWalletVo();
                     BeanUtils.copyProperties(row, prePayWalletVo);
                     prePayWalletVo.setApMoney(dfMoney(row.getApMoney()));
+                    prePayWalletVo.setUidName(getFirmName(row.getUid()));
+                    prePayWalletVo.setFilterName(getFirmName(row.getFilter()));
                     prePayWalletVo.setUsingApMoney(dfMoney(row.getUsingApMoney()));
                     prePayWalletVo.setSettlingApMoney(dfMoney(row.getSettlingApMoney()));
                     prePayWalletVo.setTotalApMoney(dfMoney(row.getTotalApMoney()));
@@ -750,6 +816,53 @@ public class WalletService {
         return new PageRes<>(prePayPage.getPage(), prePayPage.getPageSize(), 0, 0, new ArrayList<>());
     }
 
+    /**
+     * 预收列表钱包统计
+     *
+     * @param entName
+     * @return
+     */
+    public List<ChannelCount> preReceiveCount(String entName) {
+        Long entId = LoginUserHolder.getEntId();
+        String uid = walletRelationService.getRelation(entId);
+        if (StringUtils.isBlank(uid)) {
+            throw new BusinessException("暂未开通电子钱包");
+        }
+        List<String> filterList = new ArrayList<>();
+        //筛选指定企业的数据
+        if (StringUtils.isNotBlank(entName)) {
+            filterList = findFilter(entName);
+        }
+        List<ChannelCount> channelDetails = new ArrayList<>();
+        //查询预付订单渠道统计数据
+        R<List<ChannelStatistics>> listR = payCenterService.advancePayReceiveChannels(uid, StringUtils.join(filterList, ","));
+        Map<String, Integer> mapCount;
+        if (listR.getStatus()) {
+            List<ChannelStatistics> data = listR.getData();
+            if (!CollectionUtils.isEmpty(data)) {
+                mapCount = data.stream().collect(Collectors.toMap(ChannelStatistics::getChannel, ChannelStatistics::getCount, (k, v) -> k));
+            } else {
+                mapCount = new HashMap<>();
+            }
+            mapCount.compute("all", (k, v) -> {
+                Integer sum = 0;
+                for (Map.Entry<String, Integer> map : mapCount.entrySet()) {
+                    sum += map.getValue();
+                }
+                return sum;
+            });
+        } else {
+            mapCount = new HashMap<>();
+        }
+        ChannelCount channelCount;
+        for (WalletChannelEnum value : WalletChannelEnum.values()) {
+            Integer integer = mapCount.get(value.getChannel());
+            channelCount = new ChannelCount(value.getValue(), value.getDesc(), value.getChannel(), Objects.isNull(integer) ? 0 : integer);
+            channelDetails.add(channelCount);
+        }
+        return channelDetails;
+    }
+
     /**
      * 预付校验
      *

+ 38 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WorkbenchService.java

@@ -1,10 +1,17 @@
 package com.sckw.payment.service;
 
+import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.payment.model.vo.req.FinanceCount;
+import com.sckw.payment.utils.DateTimeUtil;
+import jakarta.annotation.Resource;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * 工作台
  *
@@ -16,8 +23,37 @@ import org.springframework.stereotype.Service;
 @RequiredArgsConstructor
 public class WorkbenchService {
 
+    @Resource
+    private KwpSettlementRecordService kwpSettlementRecordService;
+
+    public Object financeCount(FinanceCount financeCount) {
+        //周期维度 1-天 2-周 3-月
+        Integer circle = financeCount.getCircle();
+        List<String> time = new ArrayList<>();
 
-    public String financeCount(FinanceCount financeCount) {
-        return null;
+        //时间参数为空,按照默认维度统计
+        if (StringUtils.isBlank(financeCount.getStartTime()) && StringUtils.isBlank(financeCount.getEndTime())) {
+            //按照周期维度生成时间段
+            if (circle == 1) {
+                //从今天倒推15天
+                time.add(DateTimeUtil.getComputeDaysStr(-14));
+                time.add(DateTimeUtil.getComputeDaysStr(0));
+            } else if (circle == 3) {
+                //从当月倒推12月
+                time.add(DateTimeUtil.getComputeMonthStartDayStr(-12));
+                time.add(DateTimeUtil.getComputeMonthEndDayStr(0));
+            }
+        } else {
+            //按照给定的时间参数进行统计
+            if (circle == 1) {
+                time.add(financeCount.getStartTime());
+                time.add(financeCount.getEndTime());
+            } else if (circle == 3) {
+                time.add(DateTimeUtil.getComputeMonthStartDayStr(financeCount.getStartTime()));
+                time.add(DateTimeUtil.getComputeMonthEndDayStr(financeCount.getEndTime()));
+            }
+        }
+        Long entId = LoginUserHolder.getEntId();
+        return kwpSettlementRecordService.financeCount(time,entId);
     }
 }

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio