Quellcode durchsuchen

Merge remote-tracking branch 'origin/dev' into dev

czh vor 2 Jahren
Ursprung
Commit
8bbd02a197
100 geänderte Dateien mit 4111 neuen und 382 gelöschten Zeilen
  1. 21 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/SourceInitializeException.java
  2. 25 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/TranslateException.java
  3. 18 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/ProjectStatusEnum.java
  4. 18 3
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/Data.java
  5. 44 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/I18nMessage.java
  6. 54 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/Page.java
  7. 72 48
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/Result.java
  8. 1 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/Status.java
  9. 5 0
      sckw-common/sckw-common-excel/pom.xml
  10. 3 3
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/annotation/EasyExcel.java
  11. 42 19
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/config/easyexcel/ExcelConverter.java
  12. 50 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/SourceUtil.java
  13. 20 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/Sources.java
  14. 117 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/Translator.java
  15. 43 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/annotation/Translate.java
  16. 21 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/annotation/Translates.java
  17. 74 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/context/Enums.java
  18. 87 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/context/Organization.java
  19. 48 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/context/Source.java
  20. 50 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/enums/Source.java
  21. 40 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/properties/TranslateProperties.java
  22. 87 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/wrapper/AbstractTranslator.java
  23. 87 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/wrapper/TranslateWrapper.java
  24. 4 4
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/utils/ValidUtil.java
  25. 1 0
      sckw-common/sckw-common-excel/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  26. 2 2
      sckw-modules/sckw-example/src/main/java/com/sckw/example/model/vo/ProjectPageVo.java
  27. 2 2
      sckw-modules/sckw-example/src/main/java/com/sckw/example/service/ExcelExportService.java
  28. 2 2
      sckw-modules/sckw-file/src/main/java/com/sckw/file/controller/FileApiController.java
  29. 2 2
      sckw-modules/sckw-file/src/main/java/com/sckw/file/service/FileService.java
  30. 7 7
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverController.java
  31. 7 5
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfFleetController.java
  32. 5 5
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java
  33. 8 5
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckReportController.java
  34. 1 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfTruckMapper.java
  35. 7 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfDriverVo.java
  36. 7 6
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfFleetVo.java
  37. 7 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckReportVo.java
  38. 7 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckVo.java
  39. 4 4
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverMapper.xml
  40. 5 5
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckMapper.xml
  41. 5 2
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckReportMapper.xml
  42. 6 0
      sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/req/BannerAddReqVo.java
  43. 1 1
      sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/res/BannerQueryResVo.java
  44. 2 2
      sckw-modules/sckw-operation/src/main/resources/bootstrap-dev.yml
  45. 3 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/dto/TransportDemandExport.java
  46. 3 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/dto/WantBuyExport.java
  47. 5 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/WantBuySelectParam.java
  48. 5 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/res/TransportDemandListRes.java
  49. 33 5
      sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTransportDemandService.java
  50. 13 4
      sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwpWantBuyService.java
  51. 4 0
      sckw-modules/sckw-order/src/main/resources/mapper/KwoWantBuyMapper.xml
  52. 43 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/WalletController.java
  53. 16 56
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementLogisticsController.java
  54. 50 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementOfflineController.java
  55. 15 99
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementTradeController.java
  56. 66 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementWalletController.java
  57. 22 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementLogisticsMapper.java
  58. 8 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementOfflineMapper.java
  59. 25 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementTradeMapper.java
  60. 10 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementWalletMapper.java
  61. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/PayCenterEnum.java
  62. 28 9
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/WalletChannelEnum.java
  63. 3 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/wallet/PrePayWallet.java
  64. 180 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/SettlementLogistics.java
  65. 144 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/SettlementTrade.java
  66. 39 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/ChannelCount.java
  67. 39 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/ChannelDetail.java
  68. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/WalletDetail.java
  69. 2 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerLogisticsService.java
  70. 2 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerTradeService.java
  71. 10 7
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementOfflineService.java
  72. 2 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementTradeService.java
  73. 151 16
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WalletService.java
  74. 8 8
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/dubbo/PaymentDubboServiceImpl.java
  75. 3 7
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/LedgerTradeService.java
  76. 155 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementLogisticsService.java
  77. 86 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementOfflineService.java
  78. 118 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementTradeService.java
  79. 96 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementWalletService.java
  80. 0 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/utils/CommonValidator.java
  81. 140 6
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementLogisticsMapper.xml
  82. 14 0
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementOfflineMapper.xml
  83. 125 0
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementTradeMapper.xml
  84. 30 0
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementWalletMapper.xml
  85. 88 0
      sckw-modules/sckw-product/src/main/java/com/sckw/product/controller/operation/GoodsManagerController.java
  86. 97 0
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/OperationGoodsListExport.java
  87. 31 0
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/req/SelectOperationGoodsListParam.java
  88. 24 0
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/res/OperationGoodsDetail.java
  89. 168 0
      sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/res/OperationGoodsList.java
  90. 318 0
      sckw-modules/sckw-product/src/main/java/com/sckw/product/service/operation/GoodsManagerService.java
  91. 87 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/operator/TradeOrderManageController.java
  92. 86 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/model/dto/OperatorTOrderListStsConditionDTO.java
  93. 22 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/model/vo/OperatorTOrderContractParam.java
  94. 35 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/model/vo/OperatorTOrderExportQueryVO.java
  95. 39 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/model/vo/OperatorTOrderListQueryVO.java
  96. 81 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/model/vo/OperatorTOrderStsQueryVO.java
  97. 43 9
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwOrderService.java
  98. 174 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/operator/TradeOrderManageService.java
  99. 0 1
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/param/WaybillOrderListExport.java
  100. 1 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/controller/KwsUserController.java

+ 21 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/SourceInitializeException.java

@@ -0,0 +1,21 @@
+package com.sckw.core.exception;
+
+import lombok.Getter;
+
+/**
+ *
+ * 数据源初始化失败异常
+ *
+ *
+ * @author lfdc
+ * @version v1
+ * @create 2020-11-28 17:13:33
+ * @copyright
+ */
+@Getter
+public class SourceInitializeException extends Exception {
+
+    public SourceInitializeException(String msg) {
+        super(msg);
+    }
+}

+ 25 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/TranslateException.java

@@ -0,0 +1,25 @@
+package com.sckw.core.exception;
+
+import lombok.Getter;
+
+/**
+ *
+ * 翻译失败时的异常
+ *
+ *
+ * @author lfdc
+ * @version v1
+ * @create 2020-12-01 11:53:03
+ * @copyright
+ */
+@Getter
+public class TranslateException extends RuntimeException {
+
+    public TranslateException(String msg) {
+        super(msg);
+    }
+
+    public TranslateException(String msg, Throwable e) {
+        super(msg, e);
+    }
+}

+ 18 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/ProjectStatusEnum.java

@@ -47,4 +47,22 @@ public enum ProjectStatusEnum {
         }
         return null;
     }
+
+    public static  String getDestination(Integer code){
+        for (ProjectStatusEnum logisticsOrderEnum : ProjectStatusEnum.values()) {
+            if (logisticsOrderEnum.getCode().equals(code)) {
+                return logisticsOrderEnum.getName();
+            }
+        }
+        return null;
+    }
+
+    public static  String getName(Integer code){
+        for (ProjectStatusEnum logisticsOrderEnum : ProjectStatusEnum.values()) {
+            if (logisticsOrderEnum.getCode().equals(code)) {
+                return logisticsOrderEnum.getName();
+            }
+        }
+        return null;
+    }
 }

+ 18 - 3
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/Data.java → sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/Data.java

@@ -1,4 +1,4 @@
-package com.sckw.core.web.response;
+package com.sckw.core.web.response.result;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 
@@ -11,6 +11,8 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 public class Data {
     @JsonInclude(JsonInclude.Include.NON_NULL)
     private Object body;
+    @JsonInclude(JsonInclude.Include.NON_NULL)
+    private Page page;
 
     public static Data getData() {
         return new Data();
@@ -22,25 +24,38 @@ public class Data {
         return da;
     }
 
+    public static Data getData(Object data, Page page) {
+        Data da = new Data();
+        da.setBody(data);
+        da.setPage(page);
+        return da;
+    }
 
     public Object getBody() {
         return this.body;
     }
 
+    public Page getPage() {
+        return this.page;
+    }
 
     public void setBody(Object body) {
         this.body = body;
     }
 
+    public void setPage(Page page) {
+        this.page = page;
+    }
 
     public String toString() {
-        return "Data(body=" + this.getBody() + ")";
+        return "Data(body=" + this.getBody() + ", page=" + this.getPage() + ")";
     }
 
     public Data() {
     }
 
-    public Data(Object body) {
+    public Data(Object body, Page page) {
         this.body = body;
+        this.page = page;
     }
 }

+ 44 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/I18nMessage.java

@@ -0,0 +1,44 @@
+package com.sckw.core.web.response.result;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.MessageSource;
+import org.springframework.context.i18n.LocaleContextHolder;
+
+import java.util.Objects;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-09-14 09:09:06
+ */
+public class I18nMessage {
+    private static final Logger log = LoggerFactory.getLogger(I18nMessage.class);
+    private static MessageSource messageSource;
+
+    public I18nMessage() {
+        throw new IllegalArgumentException("MessageSource can't be null");
+    }
+
+    public I18nMessage(MessageSource messageSource) {
+        Objects.requireNonNull(messageSource, "MessageSource can't be null");
+        I18nMessage.messageSource = messageSource;
+    }
+
+    public static String getMessage(String msgCode, Object[] args) {
+        try {
+            return messageSource.getMessage(msgCode, args, LocaleContextHolder.getLocale());
+        } catch (Exception var3) {
+            if (log.isDebugEnabled()) {
+                var3.printStackTrace();
+            }
+
+            log.error("===> 读取国际化消息失败, code:{}, args:{}, ex:{}", new Object[]{msgCode, args, var3.getMessage() == null ? var3.toString() : var3.getMessage()});
+            return "-Unknown-";
+        }
+    }
+
+    public static String getMessage(String msgCode) {
+        return getMessage(msgCode, (Object[])null);
+    }
+}

+ 54 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/Page.java

@@ -0,0 +1,54 @@
+package com.sckw.core.web.response.result;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-09-14 09:09:06
+ */
+public class Page {
+    private static final long serialVersionUID = 7367318386929321066L;
+    private long total;
+    private int page;
+    private int pageSize;
+
+    public static Page getPage(long total, int page, int pageSize) {
+        return new Page(total, page, pageSize);
+    }
+
+    public long getTotal() {
+        return this.total;
+    }
+
+    public int getPage() {
+        return this.page;
+    }
+
+    public int getPageSize() {
+        return this.pageSize;
+    }
+
+    public void setTotal(long total) {
+        this.total = total;
+    }
+
+    public void setPage(int page) {
+        this.page = page;
+    }
+
+    public void setPageSize(int pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public String toString() {
+        return "Page(total=" + this.getTotal() + ", page=" + this.getPage() + ", pageSize=" + this.getPageSize() + ")";
+    }
+
+    public Page() {
+    }
+
+    public Page(long total, int page, int pageSize) {
+        this.total = total;
+        this.page = page;
+        this.pageSize = pageSize;
+    }
+}

+ 72 - 48
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/Result.java → sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/Result.java

@@ -1,6 +1,9 @@
-package com.sckw.core.web.response;
+package com.sckw.core.web.response.result;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.io.Serializable;
 
 /**
  * @description:
@@ -8,16 +11,12 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
  * @copyright
  * @create: 2022-01-27 10:17
  **/
-public class Result {
+public class Result implements Serializable {
     private static final long serialVersionUID = 8295075842951977226L;
     private int status;
     private String msg;
-    //    @JsonProperty
-    private Object data;
-
-
-    public Result() {
-    }
+    @JsonProperty
+    private Data data;
 
     public Result(Status status) {
         this.status = status.getCode();
@@ -27,35 +26,51 @@ public class Result {
 
     public Result(Status status, Object data) {
         this.status = status.getCode();
-        this.data = data;
+        this.msg = status.getMsg();
+        this.data = Data.getData(data);
     }
 
+    public Result(Status status, Object data, Page page) {
+        this.status = status.getCode();
+        this.msg = status.getMsg();
+        this.data = Data.getData(data, page);
+    }
 
     public Result(Status status, String msg) {
         this.status = status.getCode();
         this.msg = msg;
-//        this.data = Data.getData();
+        this.data = Data.getData();
     }
 
     public Result(Status status, int msgCode) {
         this.status = status.getCode();
-        this.msg = String.valueOf(msgCode);
-//        this.data = Data.getData();
+        this.msg = I18nMessage.getMessage(String.valueOf(msgCode));
+        this.data = Data.getData();
     }
 
-
     public Result(Status status, String msg, Object data) {
         this.status = status.getCode();
         this.msg = msg;
-        this.data = data;
+        this.data = Data.getData(data);
     }
 
     public Result(Status status, int msgCode, Object data) {
         this.status = status.getCode();
-        this.msg = String.valueOf(msgCode);
-        this.data = data;
+        this.msg = I18nMessage.getMessage(String.valueOf(msgCode));
+        this.data = Data.getData(data);
+    }
+
+    public Result(Status status, String msg, Object data, Page page) {
+        this.status = status.getCode();
+        this.msg = msg;
+        this.data = Data.getData(data, page);
     }
 
+    public Result(Status status, int msgCode, Object data, Page page) {
+        this.status = status.getCode();
+        this.msg = I18nMessage.getMessage(String.valueOf(msgCode));
+        this.data = Data.getData(data, page);
+    }
 
     @JsonIgnore
     public boolean isSuccess() {
@@ -67,34 +82,66 @@ public class Result {
         return this.status != Status.SUCCESS.getCode();
     }
 
-    public Result success() {
+    public static Result success() {
         return new Result(Status.SUCCESS);
     }
 
-    public Result illegal() {
+    public static Result illegal() {
         return new Result(Status.BAD_REQUEST);
     }
 
-    public Result unauthorized() {
+    public static Result unauthorized() {
         return new Result(Status.UNAUTHORIZED);
     }
 
-    public Result forbidden() {
+    public static Result forbidden() {
         return new Result(Status.FORBIDDEN);
     }
 
-    public Result notFound() {
+    public static Result notFound() {
         return new Result(Status.NOT_FOUND);
     }
 
-    public Result failure() {
+    public static Result failure() {
         return new Result(Status.FAILURE);
     }
 
-    public Result conflict() {
+    public static Result conflict() {
         return new Result(Status.CONFLICT);
     }
 
+    public static Result build(Status status, Object data) {
+        return new Result(status, data);
+    }
+
+    public static Result build(Status status, Object data, Page page) {
+        return new Result(status, data, page);
+    }
+
+    public static Result build(Status status, String msg) {
+        return new Result(status, msg);
+    }
+
+    public static Result build(Status status, int msgCode) {
+        return new Result(status, msgCode);
+    }
+
+    public static Result build(Status status, String msg, Object data) {
+        return new Result(status, msg, data);
+    }
+
+    public static Result build(Status status, int msgCode, Object data) {
+        return new Result(status, msgCode, data);
+    }
+
+    public static Result build(Status status, String msg, Object data, Page page) {
+        return new Result(status, msg, data, page);
+    }
+
+    public static Result build(Status status, int msgCode, Object data, Page page) {
+        return new Result(status, msgCode, data, page);
+    }
+
     public int getStatus() {
         return this.status;
     }
@@ -103,7 +150,7 @@ public class Result {
         return this.msg;
     }
 
-    public Object getData() {
+    public Data getData() {
         return this.data;
     }
 
@@ -123,29 +170,6 @@ public class Result {
         return "Result(status=" + this.getStatus() + ", msg=" + this.getMsg() + ", data=" + this.getData() + ")";
     }
 
-    public static long getSerialVersionUID() {
-        return serialVersionUID;
-    }
-
-    public void setData(Object data) {
-        this.data = data;
-    }
-
-    public Result(int status, String msg, Object data) {
-        this.status = status;
-        this.msg = msg;
-        this.data = data;
-    }
-
-    public static Result build(Status status, Object data) {
-        return new Result(status, data);
-    }
-
-    public static Result build(Status status, String msg, Object data) {
-        return new Result(status, msg, data);
-    }
-
-    public static Result build(Status status, String msg) {
-        return new Result(status, msg);
+    public Result() {
     }
 }

+ 1 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/Status.java → sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/Status.java

@@ -1,4 +1,4 @@
-package com.sckw.core.web.response;
+package com.sckw.core.web.response.result;
 
 /**
  * @description: 状态枚举

+ 5 - 0
sckw-common/sckw-common-excel/pom.xml

@@ -45,5 +45,10 @@
             <groupId>org.springframework</groupId>
             <artifactId>spring-web</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-context</artifactId>
+        </dependency>
     </dependencies>
 </project>

+ 3 - 3
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/annotation/EasyExcel.java

@@ -6,21 +6,21 @@ import java.lang.annotation.*;
  * @author lfdc
  * @version v1
  * @create 2020-11-28 15:37:35
- * @copyright 指定枚举类注解
+ * @copyright 指定枚举类注解进行翻译处理
  */
 @Target({ElementType.FIELD})
 @Retention(RetentionPolicy.RUNTIME)
 @Documented
 public @interface EasyExcel {
     /**
-     * 控件类型
+     * 控件类型-指定枚举类翻译
      *
      * @return
      */
     Class<? extends Enum> type();
 
     /**
-     * 默认翻译字段类型
+     * 默认翻译字段类型-代表字段类型处理 1字符串  2 Integer
      *
      * @return
      */

+ 42 - 19
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/config/easyexcel/ExcelConverter.java

@@ -7,6 +7,7 @@ import com.alibaba.excel.metadata.data.WriteCellData;
 import com.alibaba.excel.metadata.property.ExcelContentProperty;
 import com.sckw.core.common.enums.NumberConstant;
 import com.sckw.excel.annotation.EasyExcel;
+import lombok.extern.slf4j.Slf4j;
 
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
@@ -17,6 +18,7 @@ import java.lang.reflect.Method;
  * @description 状态枚举信息获取(code->value,1代表失败 进行转换)
  * @date 2023-07-28 10:07:51
  */
+@Slf4j
 public class ExcelConverter implements Converter<String> {
     @Override
     public Class supportJavaTypeKey() {
@@ -57,11 +59,15 @@ public class ExcelConverter implements Converter<String> {
             return new WriteCellData(value.toString());
         }
         //将转换的值进行返回
+        if (invoke == null) {
+            return new WriteCellData();
+        }
         return new WriteCellData(invoke.toString());
     }
 
     /**
      * 应对不同枚举处理
+     *
      * @param value
      * @param status
      * @param type
@@ -72,25 +78,42 @@ public class ExcelConverter implements Converter<String> {
      */
     private Object verifyTranslate(String value, int status, Class<? extends Enum> type) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
         Object invoke = null;
-        if (NumberConstant.ONE == status) {
-            //获取枚举类的方法名 【destination】就是自己编写的函数,String.class 指定入参类型
-            Method codeOf = type.getMethod("getDestination", String.class);
-            //反射执行方法,此方法得到的是一个枚举实例(具体得到什么,结合自身项目)
-            invoke = codeOf.invoke(type, value);
-        } else if (NumberConstant.TWO == status) {
-            //获取枚举类的方法名 【destination】就是自己编写的函数,String.class 指定入参类型
-            Method codeOf = type.getMethod("getName", Integer.class);
-            //反射执行方法,此方法得到的是一个枚举实例(具体得到什么,结合自身项目)
-            invoke = codeOf.invoke(type, Integer.getInteger(value));
-        } else {
-            //获取枚举类的方法名 “codeOf”就是自己编写的函数,Integer.class 指定入参类型
-            Method codeOf = type.getMethod("getEntityByCode", Integer.class);
-            //反射执行方法,此方法得到的是一个枚举实例(具体得到什么,结合自身项目)
-            invoke = codeOf.invoke(type, value);
-            //枚举实例调用getname方法,得到name的值
-            Method getName = invoke.getClass().getMethod("getDestination");
-            //将转换的值进行返回
-            invoke = String.valueOf(getName.invoke(invoke));
+        try {
+            if (NumberConstant.ONE == status) {
+                //获取枚举类的方法名 【getDestination】就是自己编写的函数,String.class 指定入参类型
+                Method codeOf = type.getMethod("getDestination", String.class);
+                //反射执行方法,此方法得到的是一个枚举实例(具体得到什么,结合自身项目)
+                invoke = codeOf.invoke(type, value);
+            } else if (NumberConstant.TWO == status) {
+                //获取枚举类的方法名 【getName】就是自己编写的函数,String.class 指定入参类型
+                Method codeOf = type.getMethod("getName", Integer.class);
+                //反射执行方法,此方法得到的是一个枚举实例(具体得到什么,结合自身项目)
+                invoke = codeOf.invoke(type, Integer.valueOf(value));
+            } else {
+                //获取枚举类的方法名 “codeOf”就是自己编写的函数,Integer.class 指定入参类型
+                Method codeOf = type.getMethod("getEntityByCode", Integer.class);
+                //反射执行方法,此方法得到的是一个枚举实例(具体得到什么,结合自身项目)
+                invoke = codeOf.invoke(type, value);
+                //枚举实例调用getname方法,得到name的值
+                Method getName = invoke.getClass().getMethod("getDestination");
+                //将转换的值进行返回
+                invoke = String.valueOf(getName.invoke(invoke));
+            }
+        } catch (NoSuchMethodException e) {
+            log.info("NoSuchMethodException ERROR:{}", e.getMessage(), e);
+            throw new RuntimeException(e);
+        } catch (SecurityException e) {
+            log.info("SecurityException ERROR:{}", e.getMessage(), e);
+            throw new RuntimeException(e);
+        } catch (IllegalAccessException e) {
+            log.info("IllegalAccessException ERROR:{}", e.getMessage(), e);
+            throw new RuntimeException(e);
+        } catch (IllegalArgumentException e) {
+            log.info("IllegalArgumentException ERROR:{}", e.getMessage(), e);
+            throw new RuntimeException(e);
+        } catch (InvocationTargetException e) {
+            log.info("InvocationTargetException ERROR:{}", e.getMessage(), e);
+            throw new RuntimeException(e);
         }
         return invoke;
     }

+ 50 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/SourceUtil.java

@@ -0,0 +1,50 @@
+package com.sckw.excel.translate;
+
+import com.sckw.core.exception.SourceInitializeException;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ * 数据源工具类
+ *
+ *
+ * @author lfdc
+ * @version v1
+ * @create 2020-11-28 16:33:14
+ * @copyright
+ */
+@Slf4j
+//@Component
+//@Configuration
+public class SourceUtil {
+
+    public static Map<com.sckw.excel.translate.enums.Source,
+            com.sckw.excel.translate.context.Source> SOURCES_INSTANCE = new HashMap<>(2);
+
+    public static void put(com.sckw.excel.translate.enums.Source source,
+                           com.sckw.excel.translate.context.Source instance) {
+        SOURCES_INSTANCE.put(source, instance);
+    }
+
+    public static void remove(com.sckw.excel.translate.enums.Source source) {
+        SOURCES_INSTANCE.remove(source);
+    }
+
+    public static void clear() {
+        for (com.sckw.excel.translate.enums.Source source : SOURCES_INSTANCE.keySet()) {
+            SOURCES_INSTANCE.get(source).clear();
+        }
+    }
+
+    static Map<Integer, Object> get(com.sckw.excel.translate.enums.Source source) throws SourceInitializeException {
+        try {
+            return SOURCES_INSTANCE.get(source).get();
+        } catch (Exception e) {
+            log.error("failed to get data source, ex:{}", e.toString());
+            throw e;
+        }
+    }
+}

+ 20 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/Sources.java

@@ -0,0 +1,20 @@
+package com.sckw.excel.translate;
+
+/**
+ *
+ * 数据源常量
+ *
+ *
+ * @author lfdc
+ * @version v1
+ * @create 2020-11-28 16:59:58
+ * @copyright
+ */
+public class Sources {
+
+    public static final String SOURCE_DICTIONARY = "source_dictionary";
+
+    public static final String SOURCE_ORGANIZATION = "source_organization";
+
+    public static final String SOURCE_ENUMERATE = "source_enumerate";
+}

+ 117 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/Translator.java

@@ -0,0 +1,117 @@
+package com.sckw.excel.translate;
+
+
+import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.exception.SourceInitializeException;
+import com.sckw.core.exception.TranslateException;
+import com.sckw.excel.translate.annotation.Translate;
+import com.sckw.excel.translate.annotation.Translates;
+import com.sckw.excel.translate.enums.Source;
+import com.sckw.excel.translate.wrapper.AbstractTranslator;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.lang.Nullable;
+import org.springframework.util.Assert;
+
+import java.util.*;
+
+/**
+ *
+ * 处理翻译字段
+ *
+ *
+ * @author lfdc
+ * @version v1
+ * @create 2020-11-28 15:17:54
+ * @copyright
+ */
+@Slf4j
+public class Translator extends AbstractTranslator {
+
+
+
+    /**
+     * 对某个参数值进行翻译 传入编码或者ID并指定数据源
+     * 如果传入的编码值没有匹配的数据会返回NULL
+     *
+     * @param code 参数编码值
+     * @param source 数据源{@see com.***.g3.common.translate.enums.Source}
+     * @return 翻译后的值
+     * @throws TranslateException 初始化数据源失败时抛出异常
+     */
+    @Nullable
+    public static Object translate(Integer code, Source source) {
+        try {
+            return SourceUtil.get(source).get(code);
+        } catch (Exception e) {
+            throw new TranslateException("translation failed. ex:" + e.toString(), e);
+        }
+    }
+
+    /**
+     * 对多个参数值进行翻译 传入编码或者ID的集合并指定数据源
+     * 如果传入的编码值没有匹配的数据会返回原始值
+     *
+     * @param codes  参数编码值 list
+     * @param source 数据源 {@see com.owinfo.mpw.common.translate.enums.Source}
+     * @return 翻译后的值
+     * @throws TranslateException 初始化数据源失败时抛出异常
+     */
+    @Nullable
+    public static List<Integer> translate(List<Integer> codes, Source source) {
+        try {
+            Map<Integer, Object> sources = SourceUtil.get(source);
+            List<Integer> result = new ArrayList<>(codes.size());
+            for (Integer code : codes) {
+                Object target = sources.get(code);
+                if (target == null) {
+                    log.warn("the target value of the translation is null, fieldValue -> {}", code);
+                    result.add(code);
+                } else {
+//                    result.add(target.toString());
+                    result.add((Integer) target);
+                }
+            }
+            return result;
+        } catch (Exception e) {
+            throw new TranslateException("translation failed. ex:" + e.toString(), e);
+        }
+    }
+
+    /**
+     * 对集合中所有的实体进行翻译
+     * 需要在实体中使用 {@link Translates} 或者 {@link Translate} 指定需要翻译的字段
+     * 指定后当前集合都会按照配置的字段列表进行翻译所有实体
+     *
+     * @param list 需要翻译的源实体 不能为空
+     * @throws TranslateException 初始化数据源失败时抛出异常
+     */
+    public static void translate(List list) {
+        try {
+            Assert.isTrue(list != null && list.size() > NumberConstant.ZERO, "the data source cannot be empty");
+            Translates translates = list.get(0).getClass().getAnnotation(Translates.class);
+            if (translates != null && translates.value().length > NumberConstant.ZERO) {
+                translate(Arrays.asList(translates.value()), list, getSources());
+                return;
+            }
+            Translate translate = list.get(0).getClass().getAnnotation(Translate.class);
+            if (translate != null) {
+                translate(Collections.singletonList(translate), list, getSources());
+                return;
+            }
+            throw new IllegalArgumentException("must specify @Translates or @Translate");
+        } catch (Exception e) {
+            if (e instanceof TranslateException) {
+                throw (TranslateException) e;
+            }
+            throw new TranslateException("translation failed. ex:" + e.toString(), e);
+        }
+    }
+
+    public static Map<Source, Map<Integer, Object>> getSources() throws SourceInitializeException {
+        Map<Source, Map<Integer, Object>> sources = new HashMap<>(2);
+        //sources.put(Source.DICTIONARY, SourceUtil.get(Source.DICTIONARY));
+//        sources.put(Source.ORGANIZATION, SourceUtil.get(Source.ORGANIZATION));
+        sources.put(Source.ENUMS, SourceUtil.get(Source.ENUMS));
+        return sources;
+    }
+}

+ 43 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/annotation/Translate.java

@@ -0,0 +1,43 @@
+package com.sckw.excel.translate.annotation;
+
+
+import java.lang.annotation.*;
+
+/**
+ *
+ * 对某个字段进行翻译
+ *
+ * 可以标注在类和方法上
+ * 1. 标注在类上:适用于对整个实体的指定字段进行翻译
+ * 2. 标注在方法上:适用于对方法的返回值中的data数据实体进行翻译
+ *
+ * 标注在类和方法上时,如果同时存在@Translates和@Translate,则@Translates会生效,@Translate不会生效
+ *
+ * @author lfdc
+ * @version v1
+ * @create 2020-11-28 15:36:35
+ * @copyright
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE, ElementType.METHOD})
+@Repeatable(Translates.class)
+@Documented
+public @interface Translate {
+    /**
+     * 需要翻译的字段
+     */
+    String field();
+    /**
+     * 指定数据源
+     */
+    com.sckw.excel.translate.enums.Source source()
+            default com.sckw.excel.translate.enums.Source.ENUMS;
+    /**
+     * 字段值为字符串
+     */
+    boolean isString() default true;
+    /**
+     * 字段值为数组
+     */
+    boolean isArray() default false;
+}

+ 21 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/annotation/Translates.java

@@ -0,0 +1,21 @@
+package com.sckw.excel.translate.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ *
+ * 组合注解
+ * 用于指定翻译多个字段
+ *
+ * @author lfdc
+ * @version v1
+ * @create 2020-11-28 15:37:35
+ * @copyright
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE, ElementType.METHOD})
+@Documented
+public @interface Translates {
+
+    Translate[] value();
+}

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

@@ -0,0 +1,74 @@
+package com.sckw.excel.translate.context;
+
+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 org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.Ordered;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * @author lfdc
+ * @version v1
+ * @create 2022-01-24 16:23:31
+ * @copyright
+ */
+@Component("enumsSource")
+public class Enums implements Source, Ordered {
+
+    @Autowired
+    private RedisTemplate<String, Object> redisTemplate;
+
+    public Enums() {
+        initial();
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public Map<Integer, Object> get() throws SourceInitializeException {
+        Object values = redisTemplate.opsForValue().get(Sources.SOURCE_ENUMERATE);
+        if (values == null) {
+            return flush();
+        }
+        return (Map<Integer, Object>) values;
+    }
+
+    /**
+     * 该方法获取枚举数据
+     * @return
+     * @throws SourceInitializeException
+     */
+    @Override
+    @SuppressWarnings("unchecked")
+    public Map<Integer, Object> flush() throws SourceInitializeException {
+        try {
+            Map<Integer, Object> source = new HashMap<>(NumberConstant.SIXTEEN);
+//            source.putAll(Stream.of(OrderCancelEnum.values()).collect(Collectors.toMap(OrderCancelEnum::getCode, OrderCancelEnum::getMsg)));
+//            source.putAll(Stream.of(WarehouseCheckEnum.values()).collect(Collectors.toMap(WarehouseCheckEnum::getCode, WarehouseCheckEnum::getMsg)));
+            source.putAll(Stream.of(LogisticsOrderEnum.values()).collect(Collectors.toMap(LogisticsOrderEnum::getCode, LogisticsOrderEnum::getDestination)));
+            redisTemplate.opsForValue().set(Sources.SOURCE_ENUMERATE, source, 1, TimeUnit.DAYS);
+            return source;
+        } catch (Exception e) {
+            throw new SourceInitializeException("failed to get enumerate cache data, ex:" + e.toString());
+        }
+    }
+
+    @Override
+    public void clear() {
+        redisTemplate.delete(Sources.SOURCE_ENUMERATE);
+    }
+
+    @Override
+    public int getOrder() {
+        return Ordered.LOWEST_PRECEDENCE;
+    }
+
+}

+ 87 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/context/Organization.java

@@ -0,0 +1,87 @@
+package com.sckw.excel.translate.context;
+
+import com.alibaba.fastjson.JSON;
+import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.excel.translate.Sources;
+import com.sckw.core.exception.SourceInitializeException;
+import com.sckw.excel.translate.properties.TranslateProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.Ordered;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+import org.springframework.util.Assert;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+/**
+ *
+ * 组织机构信息数据源
+ *
+ *
+ * @author lfdc
+ * @version v1
+ * @create 2020-11-28 14:18:49
+ * @copyright
+ */
+@Component(value = "organizationSource")
+public class Organization implements Source, Ordered {
+
+    @Autowired
+    private RedisTemplate<String, Object> redisTemplate;
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Autowired
+    private TranslateProperties properties;
+
+    public Organization() {
+        initial();
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public Map<Integer, Object> get() throws SourceInitializeException {
+        Object values = redisTemplate.opsForValue().get(Sources.SOURCE_ORGANIZATION);
+        if (values == null) {
+            return flush();
+        }
+        return (Map<Integer, Object>) values;
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public Map<Integer, Object> flush() throws SourceInitializeException {
+        try {
+            String content = restTemplate.postForObject(properties.getOrganizationUrl(), null, String.class);
+            Map<String, Object> result = JSON.parseObject(content, Map.class);
+
+            Object status = result.get("status");
+            Assert.isTrue(status != null && (Integer) status == NumberConstant.TWO_HUNDRED, "The status code returned is failure");
+
+            Object data = result.get("data");
+            if (data != null) {
+                Map<Integer, Object> source = (Map<Integer, Object>) result.get("data");
+                if (!source.isEmpty()) {
+                    redisTemplate.opsForValue().set(Sources.SOURCE_ORGANIZATION, source, properties.getExpireTime(), TimeUnit.MINUTES);
+                    return source;
+                }
+            }
+            throw new SourceInitializeException("the resulting organization cache data is empty");
+        } catch (Exception e) {
+            throw new SourceInitializeException("failed to get organization cache data, ex:" + e.toString());
+        }
+    }
+
+    @Override
+    public void clear() {
+        redisTemplate.delete(Sources.SOURCE_ORGANIZATION);
+    }
+
+    @Override
+    public int getOrder() {
+        return Ordered.LOWEST_PRECEDENCE;
+    }
+}

+ 48 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/context/Source.java

@@ -0,0 +1,48 @@
+package com.sckw.excel.translate.context;
+
+
+import com.sckw.core.exception.SourceInitializeException;
+import com.sckw.excel.translate.SourceUtil;
+
+import java.util.Map;
+
+/**
+ *
+ * 翻译数据的数据源
+ *
+ *
+ * @author lfdc
+ * @version v1
+ * @create 2020-11-28 14:15:00
+ * @copyright
+ */
+public interface Source {
+
+    /**
+     * 获取数据源
+     * @return key value格式的数据
+     * @throws SourceInitializeException 初始化数据源失败时抛出的异常
+     */
+    Map<Integer, Object> get() throws SourceInitializeException;
+
+    /**
+     * 刷新数据源
+     * @return 新的数据源
+     * @throws SourceInitializeException 初始化数据源失败时抛出的异常
+     */
+    Map<Integer, Object> flush() throws SourceInitializeException;
+
+    /**
+     * 清除数据源
+     */
+    void clear();
+
+    /**
+     * 初始化
+     */
+    default void initial() {
+        SourceUtil.put(com.sckw.excel.translate.enums.Source.valueOf(this.getClass()), this);
+    }
+
+
+}

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

@@ -0,0 +1,50 @@
+package com.sckw.excel.translate.enums;
+
+/**
+ *
+ * 数据源枚举
+ *
+ *
+ * @author lfdc
+ * @version v1
+ * @create 2020-12-01 11:18:37
+ * @copyright
+ */
+public enum Source {
+    /**
+     * 字典
+     */
+    DICTIONARY("context.Dictionary"),
+    /**
+     * 人员机构
+     */
+    ORGANIZATION("com.sckw.excel.translate.context.Organization"),
+    /**
+     * 枚举值
+     */
+    ENUMS("com.sckw.core.model.enums");
+
+    private String clazz;
+
+    Source(String clazz) {
+        this.clazz = clazz;
+    }
+
+    public String getClazz() {
+        return clazz;
+    }
+
+    public static <T extends com.sckw.excel.translate.context.Source> Source valueOf(Class<T> clazz) {
+        String clazzName = clazz.getName();
+        if (clazzName.equals(DICTIONARY.getClazz())) {
+            return DICTIONARY;
+        }
+        if (clazzName.equals(ORGANIZATION.getClazz())) {
+            return ORGANIZATION;
+        }
+        if (clazzName.equals(ENUMS.getClazz())) {
+            return ENUMS;
+        }
+        return null;
+    }
+}

+ 40 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/properties/TranslateProperties.java

@@ -0,0 +1,40 @@
+package com.sckw.excel.translate.properties;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cloud.context.config.annotation.RefreshScope;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+import org.springframework.validation.annotation.Validated;
+
+
+/**
+ *
+ * 翻译的参数配置
+ *
+ *
+ * @author lfdc
+ * @version v1
+ * @create 2020-11-30 17:22:34
+ * @copyright
+ */
+@Order(9)
+@Configuration
+@Getter
+@Setter
+@Validated
+@RefreshScope
+public class TranslateProperties {
+
+    /**
+     * 数据源的缓存时间 单位为分钟
+     */
+    @Value("${translate.cache:60}")
+    private long expireTime;
+
+    @Value("${translate.organizationUrl}")
+    @NotBlank(message = "translate.organizationUrl can't be null")
+    private String organizationUrl;
+}

+ 87 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/wrapper/AbstractTranslator.java

@@ -0,0 +1,87 @@
+package com.sckw.excel.translate.wrapper;
+
+
+import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.exception.TranslateException;
+import com.sckw.excel.translate.annotation.Translate;
+import com.sckw.excel.translate.annotation.Translates;
+import com.sckw.excel.translate.enums.Source;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.util.Assert;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ * 翻译器的抽象类
+ *
+ *
+ * @author lfdc
+ * @version v1
+ * @create 2021-03-31 11:28:25
+ * @copyright
+ */
+@Slf4j
+public abstract class AbstractTranslator {
+
+
+    protected static void translate(List<Translate> translates, List list, Map<Source, Map<Integer, Object>> sources) {
+        for (Object obj : list) {
+            translate(translates, obj, sources);
+        }
+    }
+
+    protected static List<Translate> getTranslates(Method method) {
+        Translates translates = method.getAnnotation(Translates.class);
+        if (translates != null && translates.value().length > NumberConstant.ZERO) {
+            return Arrays.asList(translates.value());
+        }
+        return Collections.singletonList(method.getAnnotation(Translate.class));
+    }
+
+    @SuppressWarnings("unchecked")
+    protected static void translate(List<Translate> translates, Object obj, Map<Source, Map<Integer, Object>> sources) {
+        Class<?> clazz = obj.getClass();
+        for (Translate translate : translates) {
+            try {
+                Field field;
+                try {
+                    field = clazz.getDeclaredField(translate.field());
+                } catch (NoSuchFieldException e) {
+                    //try to get from the super class
+                    if (clazz.getSuperclass() != null) {
+                        field = clazz.getSuperclass().getDeclaredField(translate.field());
+                    } else {
+                        throw e;
+                    }
+                }
+
+                Assert.notNull(field, "the field specified by @Translate cannot be matched in the returned entity, field -> " + translate.field());
+                field.setAccessible(true);
+                if (translate.isArray()) {
+                    translate(translates, (List) field.get(obj), sources);
+                } else if (translate.isString()) {
+                    Map<Integer, Object> source = sources.get(translate.source());
+                    Object fieldVal = field.get(obj);
+                    if (fieldVal == null || StringUtils.isEmpty(fieldVal.toString())) {
+                        continue;
+                    }
+                    Object target = source.get(fieldVal);
+                    if (target != null) {
+                        field.set(obj, target);
+                    } else {
+                        log.warn("the target value of the translation is null, fieldValue -> {}", fieldVal);
+                    }
+                }
+            } catch (Exception e) {
+                throw new TranslateException("translation failed. Processing error, " + e.toString());
+            }
+        }
+    }
+}

+ 87 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/wrapper/TranslateWrapper.java

@@ -0,0 +1,87 @@
+package com.sckw.excel.translate.wrapper;
+
+
+import com.sckw.core.web.response.result.Result;
+import com.sckw.excel.translate.Translator;
+import com.sckw.excel.translate.annotation.Translate;
+import com.sckw.excel.translate.enums.Source;
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.core.Ordered;
+import org.springframework.stereotype.Component;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ * translate aop
+ *
+ *
+ * @author lfdc
+ * @version v1
+ * @create 2020-11-28 15:48:35
+ * @copyright
+ */
+@Component
+@Aspect
+@Slf4j
+public class TranslateWrapper implements Ordered {
+
+    public TranslateWrapper() {
+        log.info("The translator is loading complete. source -> {}", Arrays.toString(Source.values()));
+    }
+
+    @Pointcut("@annotation(com.sckw.excel.translate.annotation.Translates) || @annotation(com.sckw.excel.translate.annotation.Translate)")
+    public void annotationWrapper(){}
+
+    @Around(value = "annotationWrapper()")
+    @SuppressWarnings("unchecked")
+    public Object annotationHandler(ProceedingJoinPoint joinPoint) throws Throwable {
+
+        Object obj = joinPoint.proceed();
+        if(obj == null) {
+            log.warn("translate failed, method return value is null");
+            throw new IllegalArgumentException("method return value is null");
+        }
+
+        Result result = (Result) obj;
+        if (result.nonSuccess() || result.getData() == null || result.getData().getBody() == null) {
+            return obj;
+        }
+
+        Map<Source, Map<Integer, Object>> sources = Translator.getSources();
+
+        Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
+        List<Translate> translates = Translator.getTranslates(method);
+
+        Object body = result.getData().getBody();
+        if(body instanceof List) {
+            Translator.translate(translates, (List) body, sources);
+        } else if(body instanceof Map) {
+            Map<String, Object> results = (Map<String, Object>) body;
+            results.values().forEach(value -> {
+                if(value instanceof List) {
+                    Translator.translate(translates, (List) value, sources);
+                } else {
+                    Translator.translate(translates, value, sources);
+                }
+            });
+        } else {
+            Translator.translate(translates, body, sources);
+        }
+
+        return obj;
+    }
+
+    @Override
+    public int getOrder() {
+        return Ordered.LOWEST_PRECEDENCE;
+    }
+}

+ 4 - 4
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/utils/ValidUtil.java

@@ -12,7 +12,7 @@ import java.util.List;
 import java.util.Set;
 
 /**
- * @author JiangPan
+ * @author
  * @version 1.0.0
  * @ClassName ValidUtil.java
  * @Description 参数校验工具类
@@ -36,7 +36,7 @@ public class ValidUtil {
      * @param object 待校验参数
      * @methodName: serviceValid
      * @return: com.alibaba.fastjson.JSONObject
-     * @Author: JiangPan
+     * @Author:
      * @date: 2021/10/20 14:51
      */
     public static HttpResult serviceValid(Object object) {
@@ -67,8 +67,8 @@ public class ValidUtil {
      * @param object        待校验参数
      * @param validateGroup 校验规则分组
      * @methodName: serviceValid
-     * @return: com.owinfo.config.result.Result
-     * @Author: JiangPan
+     * @return:
+     * @Author:
      * @date: 2021/12/22 10:47
      */
     public static HttpResult serviceValid(Object object, Class... validateGroup) {

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

@@ -0,0 +1 @@
+com.sckw.excel.translate.SourceUtil

+ 2 - 2
sckw-modules/sckw-example/src/main/java/com/sckw/example/model/vo/ProjectPageVo.java

@@ -20,8 +20,8 @@ public class ProjectPageVo {
      * 项目状态 ,index = 0
      */
     @ExcelProperty(value = "项目状态", converter = ExcelConverter.class)
-    @EasyExcel(type = ProjectStatusEnum.class, status = NumberConstant.ONE)
-    private Integer status;
+    @EasyExcel(type = ProjectStatusEnum.class, status = NumberConstant.TWO)
+    private String status;
 
     /**
      * 项目备注,index = 0

+ 2 - 2
sckw-modules/sckw-example/src/main/java/com/sckw/example/service/ExcelExportService.java

@@ -213,10 +213,10 @@ public class ExcelExportService {
 
     public List<ProjectPageVo> easyExcelDemo() {
         ProjectPageVo projectPageVo = new ProjectPageVo();
-        projectPageVo.setStatus(0);
+        projectPageVo.setStatus("0");
         projectPageVo.setRemark("0");
         ProjectPageVo projectPageVo1 = new ProjectPageVo();
-        projectPageVo1.setStatus(1);
+        projectPageVo1.setStatus("1");
         projectPageVo1.setRemark("0");
         List<ProjectPageVo> list = new ArrayList<>();
         list.add(projectPageVo);

+ 2 - 2
sckw-modules/sckw-file/src/main/java/com/sckw/file/controller/FileApiController.java

@@ -3,8 +3,8 @@ package com.sckw.file.controller;
 import com.sckw.core.model.file.FileInfo;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
-import com.sckw.core.web.response.Result;
-import com.sckw.core.web.response.Status;
+import com.sckw.core.web.response.result.Result;
+import com.sckw.core.web.response.result.Status;
 import com.sckw.file.api.dto.FileInfoDTO;
 import com.sckw.file.service.FileService;
 import com.sckw.file.service.dubbo.FileDubboApiServiceImpl;

+ 2 - 2
sckw-modules/sckw-file/src/main/java/com/sckw/file/service/FileService.java

@@ -13,8 +13,8 @@ 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.core.web.response.Result;
-import com.sckw.core.web.response.Status;
+import com.sckw.core.web.response.result.Result;
+import com.sckw.core.web.response.result.Status;
 import com.sckw.file.api.dto.FileInfoDTO;
 import com.sckw.file.config.FileListConfig;
 import com.sckw.file.dao.KwsFileInfoDao;

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

@@ -4,13 +4,12 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 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 +17,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 +127,15 @@ 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) throws IOException {
         /**分页数据**/
         List<KwfDriverVo> drivers = driverService.findPage(params);
 
         if (!CollectionUtils.isEmpty(drivers)) {
-            HttpServletResponse response = RequestHolder.getResponse();
             ExcelUtil.downData(response, KwfDriverVo.class, drivers);
-            //return null;
         }
-        //return HttpResult.error("无数据!");
+        ResponseUtil.writer(response, HttpResult.error("没有您想导出的数据!"));
     }
 
     /**

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

@@ -8,6 +8,7 @@ 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 +17,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 +82,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) throws IOException {
         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;
         }
-        return HttpResult.error("无数据!");
+        ResponseUtil.writer(response, HttpResult.error("没有您想导出的数据!"));
     }
 
     /**

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

@@ -14,6 +14,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 +28,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 +138,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) throws IOException {
         /**查询数据**/
         List<KwfTruckVo> trucks = truckService.findPage(params);
 
         if (!CollectionUtils.isEmpty(trucks)) {
-            HttpServletResponse response = RequestHolder.getResponse();
             ExcelUtil.downData(response, KwfTruckVo.class, trucks);
-            return null;
         }
-        return HttpResult.error("无数据!");
+        ResponseUtil.writer(response, HttpResult.error("没有您想导出的数据!"));
     }
 
     /**

+ 8 - 5
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckReportController.java

@@ -6,8 +6,10 @@ 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 +20,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 +76,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) throws IOException {
         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;
         }
-        return HttpResult.error("无数据!");
+        ResponseUtil.writer(response, HttpResult.error("没有您想导出的数据!"));
     }
 
     /**

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

@@ -69,7 +69,7 @@ public interface KwfTruckMapper extends BaseMapper<KwfTruck> {
      * @param capacityAmountMax 最大合计载重
      * @return
      */
-    List<Map<String, Object>> capacityStatistics(@Param("entIds") List entIds,
+    List<Map<String, Object>> capacityStatistics(@Param("entIds") List<Long> entIds,
                                                  @Param("capacityAmountMin") Integer capacityAmountMin,
                                                  @Param("capacityAmountMax") Integer capacityAmountMax);
 

+ 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 - 6
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfFleetVo.java

@@ -2,13 +2,11 @@ package com.sckw.fleet.model.vo;
 
 import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.sckw.core.model.base.BaseModel;
 import com.sckw.excel.annotation.ExcelContext;
-import com.sckw.fleet.model.KwfFleet;
 import lombok.Data;
-
-import java.util.Date;
+import lombok.experimental.Accessors;
+import java.io.Serial;
+import java.io.Serializable;
 
 /**
  * @author zk
@@ -16,8 +14,11 @@ import java.util.Date;
  * @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 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckReportVo.java

@@ -4,7 +4,9 @@ import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.sckw.excel.annotation.ExcelContext;
 import lombok.Data;
-import java.util.Date;
+import lombok.experimental.Accessors;
+import java.io.Serial;
+import java.io.Serializable;
 
 /**
  * @desc 车辆上报
@@ -12,8 +14,11 @@ import java.util.Date;
  * @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

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

@@ -121,7 +121,7 @@
         <if test="status != null and status != ''">
             and dr.status = #{status, jdbcType=VARCHAR}
         </if>
-        <if test="authStatus != null and status != ''">
+        <if test="authStatus != null and authStatus != '' and authStatus != 0">
             and dr.auth_status = #{authStatus, jdbcType=VARCHAR}
         </if>
         <if test="startTime != null and startTime != '' " >
@@ -185,7 +185,7 @@
         <if test="status != null and status != ''">
             and dr.status = #{status, jdbcType=VARCHAR}
         </if>
-        <if test="authStatus != null and status != ''">
+        <if test="authStatus != null and authStatus != '' and authStatus != 0">
             and dr.auth_status = #{authStatus, jdbcType=VARCHAR}
         </if>
         <if test="startTime != null and startTime != '' " >
@@ -241,7 +241,7 @@
         <if test="status != null and status != ''">
             and dr.status = #{status, jdbcType=VARCHAR}
         </if>
-        <if test="authStatus != null and status != ''">
+        <if test="authStatus != null and authStatus != '' and authStatus != 0">
             and dr.auth_status = #{authStatus, jdbcType=VARCHAR}
         </if>
         <if test="noReport != null and noReport != ''">
@@ -288,7 +288,7 @@
         <if test="status != null and status != ''">
             and status = #{status, jdbcType=VARCHAR}
         </if>
-        <if test="authStatus != null and status != ''">
+        <if test="authStatus != null and authStatus != '' and authStatus != 0">
             and dr.auth_status = #{authStatus, jdbcType=VARCHAR}
         </if>
         ORDER BY create_time desc

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

@@ -121,7 +121,7 @@
         <if test="status != null and status != ''">
             and tr.status = #{status, jdbcType=VARCHAR}
         </if>
-        <if test="authStatus != null and status != ''">
+        <if test="authStatus != null and authStatus != '' and authStatus != 0">
             and tr.auth_status = #{authStatus, jdbcType=VARCHAR}
         </if>
         <if test="startTime != null and startTime != '' " >
@@ -187,7 +187,7 @@
         <if test="status != null and status != ''">
             and tr.status = #{status, jdbcType=VARCHAR}
         </if>
-        <if test="authStatus != null and status != ''">
+        <if test="authStatus != null and authStatus != '' and authStatus != 0">
             and tr.auth_status = #{authStatus, jdbcType=VARCHAR}
         </if>
         <if test="startTime != null and startTime != '' " >
@@ -243,7 +243,7 @@
         <if test="status != null and status != ''">
             and tr.status = #{status, jdbcType=VARCHAR}
         </if>
-        <if test="authStatus != null and status != ''">
+        <if test="authStatus != null and authStatus != '' and authStatus != 0">
             and tr.auth_status = #{authStatus, jdbcType=VARCHAR}
         </if>
         <if test="startTime != null and startTime != '' " >
@@ -294,7 +294,7 @@
         <if test="status != null and status != ''">
             and status = #{status, jdbcType=VARCHAR}
         </if>
-        <if test="authStatus != null and status != ''">
+        <if test="authStatus != null and authStatus != '' and authStatus != 0">
             and auth_status = #{authStatus, jdbcType=VARCHAR}
         </if>
         ORDER BY create_time desc
@@ -320,7 +320,7 @@
         from kwf_truck
         where del_flag = 0
         <choose>
-            <when test="truckNos != null and truckNos != '' and truckNos.size() > 0">
+            <when test="entIds != null and entIds != '' and entIds.size() > 0">
                 and ent_id in
                 <foreach collection="entIds" item="item" open="(" close=")" separator=",">
                     #{item,jdbcType=BIGINT}

+ 5 - 2
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckReportMapper.xml

@@ -77,9 +77,12 @@
         <if test="status != null and status != ''">
             and tr.status = #{status, jdbcType=VARCHAR}
         </if>
-        <if test="truckAuthStatus != null and truckAuthStatus != ''">
+        <if test="truckAuthStatus != null and truckAuthStatus != '' and truckAuthStatus != 0">
             and tr.auth_status = #{truckAuthStatus, jdbcType=VARCHAR}
         </if>
+        <if test="authStatus != null and authStatus != '' and authStatus != 0">
+            and tr.auth_status = #{authStatus, jdbcType=VARCHAR}
+        </if>
         <if test="startTime != null and startTime != '' " >
             and DATE( trr.create_time) <![CDATA[ >= ]]> #{startTime,jdbcType=TIMESTAMP}
         </if>
@@ -132,7 +135,7 @@
         <if test="businessStatus != null and businessStatus != ''">
             and tr.business_status = #{businessStatus, jdbcType=VARCHAR}
         </if>
-        <if test="authStatus != null and status != ''">
+        <if test="authStatus != null and authStatus != '' and authStatus != 0">
             and tr.auth_status = #{authStatus, jdbcType=VARCHAR}
         </if>
         <if test="status != null and status != ''">

+ 6 - 0
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/req/BannerAddReqVo.java

@@ -67,6 +67,12 @@ public class BannerAddReqVo extends PageRequest implements Serializable {
 
     private Integer sort;
 
+    /**
+     * 排序
+     */
+
+    private String clientType;
+
 
     /**
      * 备注

+ 1 - 1
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/res/BannerQueryResVo.java

@@ -58,7 +58,7 @@ public class BannerQueryResVo implements Serializable {
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date entTime;
+    private Date endTime;
 
     /**
      * 顺序

+ 2 - 2
sckw-modules/sckw-operation/src/main/resources/bootstrap-dev.yml

@@ -5,7 +5,7 @@ spring:
         # 服务注册地址
         server-addr: 10.10.10.230:8848
         # 命名空间
-        namespace: sckw_zk
+        namespace: sckw-service-platform-dev
         # 共享配置
         group: sckw-service-platform
       config:
@@ -14,7 +14,7 @@ spring:
         # 配置文件格式
         file-extension: yaml
         # 命名空间
-        namespace: sckw_zk
+        namespace: sckw-service-platform-dev
         # 共享配置
         group: sckw-service-platform
         #可以读多个配置文件  需要在同一个命名空间下面可以是不同的组

+ 3 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/dto/TransportDemandExport.java

@@ -26,6 +26,9 @@ public class TransportDemandExport implements Serializable {
     @ExcelProperty(value = "状态")
     private String statusLabel;
 
+    @ExcelProperty(value = "企业名称")
+    private String entName;
+
     @ExcelProperty(value = "商品名称")
     private String name;
 

+ 3 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/dto/WantBuyExport.java

@@ -27,6 +27,9 @@ public class WantBuyExport implements Serializable {
     @ExcelProperty(value = "状态")
     private String statusLabel;
 
+    @ExcelProperty(value = "企业名称")
+    private String entName;
+
     @ExcelProperty(value = "商品名称")
     private String name;
 

+ 5 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/WantBuySelectParam.java

@@ -80,4 +80,9 @@ public class WantBuySelectParam extends PageRequest {
 
     private List<Long> wantBuyIds;
 
+    /**
+     * 系统类型
+     */
+    private Integer systemType;
+
 }

+ 5 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/res/TransportDemandListRes.java

@@ -120,5 +120,10 @@ public class TransportDemandListRes implements Serializable {
      */
     private String remark;
 
+    /**
+     * 企业名称
+     */
+    private String entName;
+
 
 }

+ 33 - 5
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTransportDemandService.java

@@ -186,6 +186,13 @@ public class KwoTransportDemandService {
         if (CollectionUtils.isEmpty(list)) {
             return PageResult.build(param.getPage(), param.getPageSize(), demandPage.getTotal(), Collections.emptyList());
         }
+
+        // 获取供应企业信息
+        List<Long> supplyEntIds = list.stream().map(KwoTransportDemand::getEntId).collect(Collectors.toList());
+        // 通过企业id查询企业信息
+        List<EntCacheResDto> entList = remoteSystemService.queryEntCacheByIds(supplyEntIds);
+        Map<Long, String> entMap = entList.stream().collect(Collectors.toMap(EntCacheResDto::getId, EntCacheResDto::getFirmName, (k1, k2) -> k1));
+
         List<TransportDemandListRes> result = Lists.newArrayList();
         list.forEach(e -> {
             TransportDemandListRes demand = BeanUtils.copyProperties(e, TransportDemandListRes.class);
@@ -197,7 +204,8 @@ public class KwoTransportDemandService {
                     .setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), e.getTrading()))
                     .setStatusLabel(DictEnum.getLabel(DictTypeEnum.TRANSPORT_DEMAND_STATUS.getType(), String.valueOf(e.getStatus())))
                     .setLoadAddress(loadAreaName + loadDetailAddress)
-                    .setUnloadAddress(unloadAreaName + unloadDetailAddress);
+                    .setUnloadAddress(unloadAreaName + unloadDetailAddress)
+                    .setEntName(entMap.get(e.getEntId()));
             result.add(demand);
         });
         return PageResult.build(param.getPage(), param.getPageSize(), demandPage.getTotal(), result);
@@ -211,9 +219,13 @@ public class KwoTransportDemandService {
      * @return: com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<com.sckw.order.model.KwoTransportDemand>
      */
     private LambdaQueryWrapper<KwoTransportDemand> buildWrapper(ExportTransportDemandParam param) {
-        Long entId = LoginUserHolder.getSystemType() != SystemTypeEnum.MANAGE.getCode() ? LoginUserHolder.getEntId() : null;
         LambdaQueryWrapper<KwoTransportDemand> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(KwoTransportDemand::getEntId, entId).eq(KwoTransportDemand::getDelFlag, Global.NO);
+        wrapper.eq(KwoTransportDemand::getDelFlag, Global.NO);
+        if (!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode())) {
+            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);
             wrapper.in(KwoTransportDemand::getId, ids).orderByDesc(KwoTransportDemand::getCreateTime);
@@ -260,19 +272,27 @@ public class KwoTransportDemandService {
         LambdaQueryWrapper<KwoTransportDemand> wrapper = buildWrapper(BeanUtils.copyProperties(param, ExportTransportDemandParam.class));
         List<KwoTransportDemand> demands = kwoTransportDemandMapper.selectList(wrapper);
         Map<Integer, List<KwoTransportDemand>> map = demands.stream().collect(Collectors.groupingBy(KwoTransportDemand::getStatus));
+
         List<TableTop> tableTops = new ArrayList<>();
         TableTop all = new TableTop();
         all.setName("全部").setTotal(CollectionUtils.isEmpty(demands) ? 0 : demands.size());
         tableTops.add(all);
+
         List<DictEnum> enums = DictEnum.getEnumsByType(DictTypeEnum.TRANSPORT_DEMAND_STATUS.getType());
         enums.forEach(e -> {
             Integer value = Integer.valueOf(e.getValue());
+            Integer systemType = LoginUserHolder.getSystemType();
+            if (Objects.equals(systemType, SystemTypeEnum.MANAGE.getCode()) && Objects.equals(value, Global.NO)) {
+                return;
+            }
             List<KwoTransportDemand> list = map.get(value);
             int total = CollectionUtils.isEmpty(list) ? 0 : list.size();
             TableTop tableTop = new TableTop();
             tableTop.setName(e.getLabel()).setValue(value).setTotal(total);
             tableTops.add(tableTop);
+
         });
+
         TableBottom tableBottom = new TableBottom();
         tableBottom.setTotal(CollectionUtils.isEmpty(demands) ? 0 : demands.size());
         res.setTableTops(tableTops).setTableBottom(tableBottom);
@@ -292,6 +312,13 @@ public class KwoTransportDemandService {
         if (CollectionUtils.isEmpty(demands)) {
             return Collections.emptyList();
         }
+
+        // 获取供应企业信息
+        List<Long> supplyEntIds = demands.stream().map(KwoTransportDemand::getEntId).collect(Collectors.toList());
+        // 通过企业id查询企业信息
+        List<EntCacheResDto> entList = remoteSystemService.queryEntCacheByIds(supplyEntIds);
+        Map<Long, String> entMap = entList.stream().collect(Collectors.toMap(EntCacheResDto::getId, EntCacheResDto::getFirmName, (k1, k2) -> k1));
+
         List<TransportDemandExport> result = Lists.newArrayList();
         AtomicInteger i = new AtomicInteger(1);
         demands.forEach(e -> {
@@ -302,7 +329,8 @@ public class KwoTransportDemandService {
                     .setUnloadAddress(e.getUnloadAreaName() + e.getUnloadDetailAddress())
                     .setDeadline(Objects.isNull(e.getDeadline()) ? null : DateUtil.dateToStr(e.getDeadline()))
                     .setCreateTime(Objects.isNull(e.getCreateTime()) ? null : DateUtil.getDateTime(e.getCreateTime()))
-                    .setUpdateTime(Objects.isNull(e.getUpdateTime()) ? null : DateUtil.getDateTime(e.getUpdateTime()));
+                    .setUpdateTime(Objects.isNull(e.getUpdateTime()) ? null : DateUtil.getDateTime(e.getUpdateTime()))
+                    .setEntName(entMap != null ? entMap.get(e.getEntId()) : null);
             result.add(export);
         });
         return result;
@@ -402,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)));

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

@@ -136,13 +136,14 @@ public class KwpWantBuyService {
             List<String> longList = stringToLongList(wantBuySelectParam.getTrading());
             wantBuySelectParam.setTradings(longList);
         }
-
         //商品分类筛选处理
         if (StringUtils.isNotBlank(wantBuySelectParam.getGoodsType()) && StringUtils.isNotBlank(wantBuySelectParam.getGoodsTypeValue())) {
             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());
         List<WantBuySelectRes> wantBuyDto = kwpWantBuyMapper.pageSelect(wantBuySelectParam);
         if (CollectionUtils.isEmpty(wantBuyDto)) {
@@ -444,7 +445,9 @@ public class KwpWantBuyService {
             List<String> goodsTypes = goodsTypeHandle(params);
             params.setGoodsTypeValueSearch(goodsTypes);
         }
-        params.setEntId(LoginUserHolder.getSystemType() != SystemTypeEnum.MANAGE.getCode() ? LoginUserHolder.getEntId() : null);
+        params.setEntId(!Objects.equals(LoginUserHolder.getSystemType(), SystemTypeEnum.MANAGE.getCode()) ? LoginUserHolder.getEntId() : null);
+        params.setSystemType(LoginUserHolder.getSystemType());
+
         List<WantBuySelectRes> result = kwpWantBuyMapper.pageSelect(params);
         Map<Integer, List<WantBuySelectRes>> map = result.stream().collect(Collectors.groupingBy(WantBuySelectRes::getStatus));
         List<TableTop> tableTops = new ArrayList<>();
@@ -454,6 +457,10 @@ public class KwpWantBuyService {
         List<DictEnum> enums = DictEnum.getEnumsByType(DictTypeEnum.WANT_BUY_STATUS.getType());
         enums.forEach(e -> {
             Integer value = Integer.valueOf(e.getValue());
+            Integer systemType = LoginUserHolder.getSystemType();
+            if (Objects.equals(systemType, SystemTypeEnum.MANAGE.getCode()) && Objects.equals(value, Global.NO)) {
+                return;
+            }
             List<WantBuySelectRes> list = map.get(value);
             int total = CollectionUtils.isEmpty(list) ? 0 : list.size();
             TableTop tableTop = new TableTop();
@@ -483,7 +490,9 @@ 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);
         if (CollectionUtils.isEmpty(wantBuyDto)) {
             return Collections.emptyList();

+ 4 - 0
sckw-modules/sckw-order/src/main/resources/mapper/KwoWantBuyMapper.xml

@@ -90,6 +90,10 @@
         <if test="wantBuyReq.cityCode != null and wantBuyReq.cityCode != ''">
             and (kba.`city_code` like concat(#{wantBuyReq.cityCode,jdbcType=VARCHAR}, '%'))
         </if>
+        <if test="wantBuyReq.systemType != null and wantBuyReq.systemType == 1">
+            and kb.status in (1,2)
+        </if>
+
     </sql>
 
     <select id="pageSelect" resultMap="wangBuyResultMap" resultType="com.sckw.order.model.vo.res.WantBuySelectRes">

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

@@ -22,14 +22,25 @@ import org.springframework.web.bind.annotation.*;
 public class WalletController {
     @Resource
     private WalletService walletService;
+
     /**
      * 钱包总览信息
      *
      * @return
      */
     @GetMapping("overview")
-    public HttpResult overview() {
-        return HttpResult.ok(walletService.walletOverview());
+    public HttpResult overview(boolean queryChannel) {
+        return HttpResult.ok(walletService.walletOverview(queryChannel));
+    }
+
+    /**
+     * 渠道开通情况
+     *
+     * @return
+     */
+    @GetMapping("channel")
+    public HttpResult channel() {
+        return HttpResult.ok(walletService.channel());
     }
 
     /**
@@ -42,6 +53,16 @@ public class WalletController {
         return HttpResult.ok(walletService.walletDetail(walletDetailReq));
     }
 
+    /**
+     * 查询资金明细-按渠道统计数量
+     *
+     * @return
+     */
+    @GetMapping("detailCount")
+    public HttpResult count(String entName) {
+        return HttpResult.ok(walletService.walletCount(entName));
+    }
+
     /**
      * 新增账目
      *
@@ -130,6 +151,16 @@ public class WalletController {
         return HttpResult.ok(walletService.prePayList(prePayPage));
     }
 
+    /**
+     * 预付列表-按渠道统计数量
+     *
+     * @return
+     */
+    @GetMapping("prePayCount")
+    public HttpResult prePayCount(String entName) {
+        return HttpResult.ok(walletService.walletCount(entName));
+    }
+
     /**
      * 预收列表
      *
@@ -141,6 +172,16 @@ public class WalletController {
         return HttpResult.ok(walletService.preReceiveList(prePayPage));
     }
 
+    /**
+     * 预收列表-按渠道统计数量
+     *
+     * @return
+     */
+    @GetMapping("preReceiveCount")
+    public HttpResult preReceiveCount(String entName) {
+        return HttpResult.ok(walletService.walletCount(entName));
+    }
+
     /**
      * 预付校验
      *

+ 16 - 56
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementLogisticsController.java

@@ -6,14 +6,17 @@ import com.sckw.payment.model.constant.LogisticsUnitType;
 import com.sckw.payment.model.dto.SettlementLogisticsDto;
 import com.sckw.payment.model.vo.req.SettlementReq;
 import com.sckw.payment.model.vo.res.SettlementLogisticsVo;
-import com.sckw.payment.service.KwpSettlementLogisticsService;
+import com.sckw.payment.service.operate.SettlementLogisticsService;
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
 import java.util.stream.Collectors;
@@ -26,68 +29,26 @@ import java.util.stream.Collectors;
  */
 @RestController
 @Slf4j
-@RequestMapping( "/settlementLogistics")
+@RequestMapping("/settlementLogistics")
 public class SettlementLogisticsController {
-
     @Resource
-    private KwpSettlementLogisticsService kwpSettlementLogisticsService;
-
-    //   ========= 运费收款 承运方 =========
-    @PostMapping(name = "运费收款-物流订单列表", path = "pageListCollection")
-    public HttpResult pageSelectCollection(@RequestBody @Valid SettlementReq settlementReq) {
-        return HttpResult.ok(kwpSettlementLogisticsService.pageSelectCollection(settlementReq));
-    }
-
-    @PostMapping(name = "运费收款-物流订单各状态列表总数", path = "getCountListCollection")
-    public HttpResult getCountListCollection(@RequestBody @Valid SettlementReq settlementReq) {
-        return HttpResult.ok(kwpSettlementLogisticsService.getCountListCollection(settlementReq));
-    }
-
-    @PostMapping(name = "运费收款-根据条件导出物流订单表数据", path = "exportCollection")
-    public HttpResult exportCollection(HttpServletResponse response, @RequestBody @Valid SettlementReq settlementReq) {
-        settlementReq.setUnitType(LogisticsUnitType.CARRIER);
-        List<SettlementLogisticsDto> list;
-        list = kwpSettlementLogisticsService.selectList(settlementReq);
-        return this.export(response, list);
-    }
+    private SettlementLogisticsService settlementLogisticsService;
 
-    @GetMapping(name = "运费收款-物流订单详情", path = "detailCollection")
-    public HttpResult detailCollection(@RequestParam("id") Long id) {
-        return HttpResult.ok(kwpSettlementLogisticsService.detailCollection(id));
+    @PostMapping("list")
+    public HttpResult list(@RequestBody @Valid SettlementReq settlementReq) {
+        return HttpResult.ok(settlementLogisticsService.list(settlementReq));
     }
 
-
-    //   ========= 运费付款 托运方 =========
-    @PostMapping(name = "运费付款-物流订单列表", path = "pageListPayment")
-    public HttpResult pageSelectPayment(@RequestBody @Valid SettlementReq settlementReq) {
-        return HttpResult.ok(kwpSettlementLogisticsService.pageSelectPayment(settlementReq));
-    }
-
-    @PostMapping(name = "运费付款-物流订单各状态列表总数", path = "getCountListPayment")
-    public HttpResult getCountListPayment(@RequestBody @Valid SettlementReq settlementReq) {
-        return HttpResult.ok(kwpSettlementLogisticsService.getCountListPayment(settlementReq));
+    @PostMapping("count")
+    public HttpResult count(@RequestBody @Valid SettlementReq settlementReq) {
+        return HttpResult.ok(settlementLogisticsService.count(settlementReq));
     }
 
-    @PostMapping(name = "运费付款-根据条件导出物流订单表数据", path = "exportPayment")
-    public HttpResult exportPayment(HttpServletResponse response, @RequestBody @Valid SettlementReq settlementReq) {
+    @PostMapping("export")
+    public HttpResult export(HttpServletResponse response, @RequestBody @Valid SettlementReq settlementReq) {
         settlementReq.setUnitType(LogisticsUnitType.SHIPPER);
         List<SettlementLogisticsDto> list;
-        list = kwpSettlementLogisticsService.selectList(settlementReq);
-        return this.export(response, list);
-    }
-
-    @GetMapping(name = "物流订单详情", path = "detailPayment")
-    public HttpResult detailPayment(@RequestParam("id") Long id) {
-        return HttpResult.ok(kwpSettlementLogisticsService.detailPayment(id));
-    }
-
-    /**
-     * 导出
-     *
-     * @author Aick Spt
-     * @date 2023-07-24 15:49
-     */
-    private HttpResult export(HttpServletResponse response, List<SettlementLogisticsDto> list) {
+        list = settlementLogisticsService.selectList(settlementReq);
         if (CollectionUtils.isEmpty(list)) {
             return HttpResult.error("没有可导出的数据");
         }
@@ -100,5 +61,4 @@ public class SettlementLogisticsController {
         return null;
     }
 
-
 }

+ 50 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementOfflineController.java

@@ -0,0 +1,50 @@
+package com.sckw.payment.controller.operate;
+
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.payment.model.constant.SettlementOrderTypeEnum;
+import com.sckw.payment.model.vo.req.SettlementOfflineReq;
+import com.sckw.payment.service.operate.SettlementOfflineService;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 结算-线下记录(交易订单结算/物流订单结算)
+ *
+ * @author xucaiqin
+ * @date 2023-07-20 11:42
+ */
+@RestController
+@RequestMapping("/settlementOffline")
+public class SettlementOfflineController {
+
+    @Resource
+    private SettlementOfflineService settlementOfflineService;
+
+    /**
+     * 贸易-线下付款记录
+     *
+     * @param settlementOfflineReq
+     * @return
+     */
+    @GetMapping("tradeList")
+    public HttpResult list(@Valid SettlementOfflineReq settlementOfflineReq) {
+        settlementOfflineReq.setOrderType(SettlementOrderTypeEnum.TRADE.getStatus());
+        return HttpResult.ok(settlementOfflineService.list(settlementOfflineReq));
+    }
+
+    /**
+     * 物流线下结算记录
+     *
+     * @param settlementOfflineReq
+     * @return
+     */
+    @GetMapping("logisticsList")
+    public HttpResult logisticsList(@Valid SettlementOfflineReq settlementOfflineReq) {
+        settlementOfflineReq.setOrderType(SettlementOrderTypeEnum.LOGISTICS.getStatus());
+        return HttpResult.ok(settlementOfflineService.list(settlementOfflineReq));
+    }
+
+}

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

@@ -1,14 +1,13 @@
 package com.sckw.payment.controller.operate;
 
 import com.sckw.core.model.page.PageRes;
-import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.payment.model.constant.TradeUnitType;
-import com.sckw.payment.model.dto.ISettlement;
+import com.sckw.payment.model.vo.SettlementTrade;
 import com.sckw.payment.model.vo.req.SettlementTradeReq;
 import com.sckw.payment.model.vo.res.SettlementLogisticsVo;
-import com.sckw.payment.service.KwpSettlementTradeService;
+import com.sckw.payment.service.operate.SettlementTradeService;
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
@@ -32,9 +31,7 @@ import java.util.stream.Collectors;
 public class SettlementTradeController {
 
     @Resource
-    private KwpSettlementTradeService kwpSettlementTradeService;
-
-    //   ========= 收款 销售 =========
+    private SettlementTradeService settlementTradeService;
 
     /**
      * 销售分页列表
@@ -42,12 +39,10 @@ public class SettlementTradeController {
      * @param settlementReq
      * @return
      */
-    @PostMapping(name = "收款-销售结算单列表", path = "pageSellList")
-    public HttpResult pageListCollection(@RequestBody @Valid SettlementTradeReq settlementReq) {
-        settlementReq.setUnitType(TradeUnitType.PURCHASE);
-        settlementReq.setUnitTypeTwo(TradeUnitType.SELL);
+    @PostMapping( "list")
+    public HttpResult list(@RequestBody @Valid SettlementTradeReq settlementReq) {
         settlementReq.check();
-        return HttpResult.ok(kwpSettlementTradeService.pageListCollection(settlementReq));
+        return HttpResult.ok(settlementTradeService.list(settlementReq));
     }
 
     /**
@@ -56,13 +51,10 @@ public class SettlementTradeController {
      * @param settlementReq
      * @return
      */
-    @PostMapping(name = "收款-表头统计数量", path = "getSellCount")
+    @PostMapping( "count")
     public HttpResult getCount(@RequestBody @Valid SettlementTradeReq settlementReq) {
-        settlementReq.setUnitType(TradeUnitType.PURCHASE);
-        settlementReq.setUnitTypeTwo(TradeUnitType.SELL);
-        settlementReq.setEntId(LoginUserHolder.getEntId());
         settlementReq.check();
-        return HttpResult.ok(kwpSettlementTradeService.getCount(settlementReq));
+        return HttpResult.ok(settlementTradeService.getCount(settlementReq));
     }
 
     /**
@@ -71,98 +63,24 @@ public class SettlementTradeController {
      * @param settlementReq
      * @return
      */
-    @PostMapping(name = "收款-表尾金额结算数据", path = "getSellSum")
-    public HttpResult getSellSum(@RequestBody @Valid SettlementTradeReq settlementReq) {
+    @PostMapping(name = "收款-表尾金额结算数据", path = "sum")
+    public HttpResult sum(@RequestBody @Valid SettlementTradeReq settlementReq) {
         settlementReq.check();
-        settlementReq.setUnitType(TradeUnitType.PURCHASE);
-        settlementReq.setUnitTypeTwo(TradeUnitType.SELL);
-        settlementReq.setEntId(LoginUserHolder.getEntId());
-        return HttpResult.ok(kwpSettlementTradeService.getCountListCollection(settlementReq));
+        return HttpResult.ok(settlementTradeService.sumMoney(settlementReq));
     }
 
-    @PostMapping(name = "收款-根据ids导出销售结算单列表", path = "exportCollection")
+    @PostMapping("export")
     public HttpResult exportCollection(HttpServletResponse response, @RequestBody @Valid SettlementTradeReq settlementReq) {
         settlementReq.check();
-        List<ISettlement> list;
+        List<SettlementTrade> list = null;
         settlementReq.setUnitType(TradeUnitType.PURCHASE);
         settlementReq.setUnitTypeTwo(TradeUnitType.SELL);
         if (CollectionUtils.isEmpty(settlementReq.getIdList())) {
-            PageRes<ISettlement> pageResult = kwpSettlementTradeService.pageListCollection(settlementReq);
-            list = pageResult.getList();
-        } else {
-            list = kwpSettlementTradeService.selectList(settlementReq.getIdList(), TradeUnitType.PURCHASE);
-        }
-        return this.export(response, list);
-    }
-
-
-    //   ========= 付款 采购 =========
-
-    /**
-     * 采购分页列表
-     *
-     * @param settlementReq
-     * @return
-     */
-    @PostMapping(name = "付款-采购结算单列表", path = "pagePurchaseList")
-    public HttpResult pageListPayment(@RequestBody @Valid SettlementTradeReq settlementReq) {
-        settlementReq.check();
-        settlementReq.setUnitType(TradeUnitType.SELL);
-        settlementReq.setUnitTypeTwo(TradeUnitType.PURCHASE);
-        return HttpResult.ok(kwpSettlementTradeService.pageListCollection(settlementReq));
-    }
-
-    /**
-     * 待结算、部分结算、全部结算
-     *
-     * @param settlementReq
-     * @return
-     */
-    @PostMapping(name = "收款-表头统计数量", path = "getPurchaseCount")
-    public HttpResult getPurchaseCount(@RequestBody @Valid SettlementTradeReq settlementReq) {
-        settlementReq.check();
-        settlementReq.setUnitType(TradeUnitType.SELL);
-        settlementReq.setUnitTypeTwo(TradeUnitType.PURCHASE);
-        settlementReq.setEntId(LoginUserHolder.getEntId());
-        return HttpResult.ok(kwpSettlementTradeService.getCount(settlementReq));
-    }
-
-    /**
-     * 表尾金额结算数据
-     *
-     * @param settlementReq
-     * @return
-     */
-    @PostMapping(name = "收款-物流结算订单列表头部汇总数量", path = "getPurchaseSum")
-    public HttpResult getCountListPayment(@RequestBody @Valid SettlementTradeReq settlementReq) {
-        settlementReq.check();
-        settlementReq.setUnitType(TradeUnitType.SELL);
-        settlementReq.setUnitTypeTwo(TradeUnitType.PURCHASE);
-        settlementReq.setEntId(LoginUserHolder.getEntId());
-        return HttpResult.ok(kwpSettlementTradeService.getCountListCollection(settlementReq));
-    }
-
-    @PostMapping(name = "付款-根据ids导出采购结算单列表", path = "exportPayment")
-    public HttpResult exportPayment(HttpServletResponse response, @RequestBody @Valid SettlementTradeReq settlementReq) {
-        settlementReq.check();
-        List<ISettlement> list;
-        settlementReq.setUnitType(TradeUnitType.SELL);
-        settlementReq.setUnitTypeTwo(TradeUnitType.PURCHASE);
-        if (CollectionUtils.isEmpty(settlementReq.getIdList())) {
-            PageRes<ISettlement> pageResult = kwpSettlementTradeService.pageListCollection(settlementReq);
+            PageRes<SettlementTrade> pageResult = settlementTradeService.list(settlementReq);
             list = pageResult.getList();
         } else {
-            list = kwpSettlementTradeService.selectList(settlementReq.getIdList(), TradeUnitType.SELL);
+//            list = settlementTradeService.selectList(settlementReq.getIdList(), TradeUnitType.PURCHASE);
         }
-        return this.export(response, list);
-    }
-    /**
-     * 导出
-     *
-     * @author Aick Spt
-     * @date 2023-07-24 15:49
-     */
-    private HttpResult export(HttpServletResponse response, List<ISettlement> list) {
         if (CollectionUtils.isEmpty(list)) {
             return HttpResult.error("没有可导出的数据");
         }
@@ -174,6 +92,4 @@ public class SettlementTradeController {
         ExcelUtil.downData(response, SettlementLogisticsVo.class, collect);
         return null;
     }
-
-
 }

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

@@ -0,0 +1,66 @@
+package com.sckw.payment.controller.operate;
+
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.payment.model.constant.SettlementOrderTypeEnum;
+import com.sckw.payment.model.constant.SettlementWalletPayTypeEnum;
+import com.sckw.payment.model.vo.req.SettlementWalletReq;
+import com.sckw.payment.service.operate.SettlementWalletService;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 结算-电子钱包结算记录(交易订单结算/物流订单结算)
+ *
+ * @author xucaiqin
+ * @date 2023-07-20 14:42
+ */
+@Validated
+@RestController
+@RequestMapping("/settlementWallet")
+public class SettlementWalletController {
+    @Resource
+    private SettlementWalletService settlementWalletService;
+
+    /**
+     * 货到付款-物流
+     *
+     * @param settlementWalletReq
+     * @return
+     */
+    @PostMapping(name = "物流-电子钱包付款(货到付款)结算记录-列表", path = "logisticsList")
+    public HttpResult logisticsList(@RequestBody @Valid SettlementWalletReq settlementWalletReq) {
+        settlementWalletReq.setPayType(SettlementWalletPayTypeEnum.CASH_ON_DELIVERY.getStatus());
+        settlementWalletReq.setOrderType(SettlementOrderTypeEnum.LOGISTICS.getStatus());
+        return HttpResult.ok(settlementWalletService.pageList(settlementWalletReq));
+    }
+
+    /**
+     * 货到付款-贸易
+     *
+     * @param settlementWalletReq
+     * @return
+     */
+    @GetMapping(name = "销售-付款记录列表(采购电子钱包结算记录)", path = "tradeList")
+    public HttpResult tradeList(@Valid SettlementWalletReq settlementWalletReq) {
+        settlementWalletReq.setPayType(SettlementWalletPayTypeEnum.CASH_ON_DELIVERY.getStatus());
+        settlementWalletReq.setOrderType(SettlementOrderTypeEnum.TRADE.getStatus());
+        return HttpResult.ok(settlementWalletService.pageList(settlementWalletReq));
+    }
+
+    /**
+     * 预付款-贸易
+     * 没有预付款-物流这种情况
+     *
+     * @param settlementWalletReq
+     * @return
+     */
+    @GetMapping(name = "销售-收款记录列表-预付款(电子钱包)", path = "tradePreList")
+    public HttpResult tradePreList(@Valid SettlementWalletReq settlementWalletReq) {
+        settlementWalletReq.setPayType(SettlementWalletPayTypeEnum.ADVANCE_PAYMENT.getStatus());
+        settlementWalletReq.setOrderType(SettlementOrderTypeEnum.TRADE.getStatus());
+        return HttpResult.ok(settlementWalletService.pageList(settlementWalletReq));
+    }
+
+}

+ 22 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementLogisticsMapper.java

@@ -6,6 +6,7 @@ import com.sckw.payment.model.KwpSettlementRecord;
 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.vo.SettlementLogistics;
 import com.sckw.payment.model.vo.req.SettlementReq;
 import com.sckw.payment.model.vo.res.SettlementLogisticsSumVo;
 import org.apache.ibatis.annotations.Mapper;
@@ -13,6 +14,7 @@ import org.apache.ibatis.annotations.Param;
 
 import java.time.LocalDateTime;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author Aick Spt
@@ -29,6 +31,14 @@ public interface KwpSettlementLogisticsMapper extends BaseMapper<KwpSettlementLo
      */
     List<SettlementLogisticsDto> pageSelect(@Param("settlementReq") SettlementReq settlementReq);
 
+    /**
+     * 运营端查询物流结算列表
+     *
+     * @param settlementReq
+     * @return
+     */
+    List<SettlementLogistics> list(@Param("settlementReq") SettlementReq settlementReq);
+
     /**
      * 运费-物流订单各状态列表总数
      *
@@ -36,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);
 
     /**
      * 运费-物流订单列表查询合计
@@ -45,6 +56,14 @@ public interface KwpSettlementLogisticsMapper extends BaseMapper<KwpSettlementLo
      */
     SettlementLogisticsSumVo selectSum(@Param("settlementReq") SettlementReq settlementReq);
 
+    /**
+     * 运营端接口
+     *
+     * @param settlementReq
+     * @return
+     */
+    SettlementLogisticsSumVo sum(@Param("settlementReq") SettlementReq settlementReq);
+
     /**
      * 运费-物流订单详情
      *
@@ -71,10 +90,11 @@ public interface KwpSettlementLogisticsMapper extends BaseMapper<KwpSettlementLo
      * @return
      */
     List<String> selectJoin(@Param("entId") Long entId, @Param("entTarget") Long entTarget);
+
     /**
      * @param entId    顶级企业id
-     * @param cur       当月/周
-     * @param pre       上月/周
+     * @param cur      当月/周
+     * @param pre      上月/周
      * @param unitType 企业类型
      */
     List<MoneyType> sumMoneyType(@Param("entId") Long entId, @Param("cur") List<LocalDateTime> cur, @Param("pre") List<LocalDateTime> pre, @Param("unitType") Integer unitType);

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

@@ -10,7 +10,6 @@ import org.apache.ibatis.annotations.Param;
 import java.util.List;
 
 /**
- *
  * @author Aick Spt
  * @date 2023-07-25 10:44
  */
@@ -23,4 +22,12 @@ public interface KwpSettlementOfflineMapper extends BaseMapper<KwpSettlementOffl
     Integer confirmLogisticsCollection(@Param("id") Long id, @Param("price") Float price);
 
     List<SettlementOfflineDto> pageList(@Param("offlineReq") SettlementOfflineReq settlementOfflineReq);
+
+    /**
+     * 运营端查询
+     *
+     * @param settlementOfflineReq
+     * @return
+     */
+    List<SettlementOfflineDto> list(@Param("offlineReq") SettlementOfflineReq settlementOfflineReq);
 }

+ 25 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementTradeMapper.java

@@ -6,6 +6,7 @@ import com.sckw.payment.model.KwpSettlementTrade;
 import com.sckw.payment.model.dto.LedgerUnitDto;
 import com.sckw.payment.model.dto.MoneyType;
 import com.sckw.payment.model.dto.SettlementTradeDto;
+import com.sckw.payment.model.vo.SettlementTrade;
 import com.sckw.payment.model.vo.req.SettlementTradeReq;
 import com.sckw.payment.model.vo.res.SettlementSumVo;
 import org.apache.ibatis.annotations.Mapper;
@@ -24,10 +25,32 @@ import java.util.Map;
 public interface KwpSettlementTradeMapper extends BaseMapper<KwpSettlementTrade> {
     List<SettlementTradeDto> pageSelect(@Param("settlementReq") SettlementTradeReq settlementReq);
 
+    /**
+     * 运营端列表查询
+     *
+     * @param settlementReq
+     * @return
+     */
+    List<SettlementTrade> list(@Param("settlementReq") SettlementTradeReq settlementReq);
+
     SettlementSumVo sumMoney(@Param("settlementReq") SettlementTradeReq settlementReq);
 
+    /**
+     * 运营端统计
+     * @param settlementReq
+     * @return
+     */
+    SettlementSumVo sumMoney2(@Param("settlementReq") SettlementTradeReq settlementReq);
+
     Map<String, Long> countOrder(@Param("settlementReq") SettlementTradeReq settlementReq);
 
+    /**
+     * 运营端统计结算单数量
+     * @param settlementReq
+     * @return
+     */
+    Map<String, Long> count(@Param("settlementReq") SettlementTradeReq settlementReq);
+
     List<SettlementTradeDto> selectByIds(@Param("ids") List<Long> ids, @Param("unitType") Integer unitType);
 
     SettlementTradeDto getById(@Param("id") Long id, @Param("unitType") Integer unitType);
@@ -47,8 +70,8 @@ public interface KwpSettlementTradeMapper extends BaseMapper<KwpSettlementTrade>
 
     /**
      * @param entId    顶级企业id
-     * @param cur       当月/周
-     * @param pre       上月/周
+     * @param cur      当月/周
+     * @param pre      上月/周
      * @param unitType 企业类型
      */
     List<MoneyType> sumMoneyType(@Param("entId") Long entId, @Param("cur") List<LocalDateTime> cur, @Param("pre") List<LocalDateTime> pre, @Param("unitType") Integer unitType);

+ 10 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementWalletMapper.java

@@ -15,7 +15,7 @@ import java.util.List;
  */
 
 @Mapper
-public interface KwpSettlementWalletMapper  extends BaseMapper<KwpSettlementWallet> {
+public interface KwpSettlementWalletMapper extends BaseMapper<KwpSettlementWallet> {
 
     /**
      * 运费付款-物流订单列表
@@ -29,5 +29,13 @@ public interface KwpSettlementWalletMapper  extends BaseMapper<KwpSettlementWall
 
     Integer confirmLogisticsPayment(@Param("id") Long id, @Param("price") Float price);
 
-    List<SettlementWalletDto> pageList(@Param("walletReq")SettlementWalletReq walletReq);
+    List<SettlementWalletDto> pageList(@Param("walletReq") SettlementWalletReq walletReq);
+
+    /**
+     * 运营端查询钱包结算记录
+     *
+     * @param walletReq
+     * @return
+     */
+    List<SettlementWalletDto> list(@Param("walletReq") SettlementWalletReq walletReq);
 }

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

@@ -12,7 +12,7 @@ import lombok.Getter;
 public enum PayCenterEnum {
     MEMBER_DETAIL("/v1/member/detail", "会员详情"),
     MEMBER_WALLET("/v1/member/wallet", "钱包清单"),
-    MEMBER_WALLET_V2("/v2/member/wallet", "钱包清单"),
+    MEMBER_WALLET_V2("/v2/member/wallet", "钱包清单v2"),
     MEMBER_GENERAL("/v2/wallet/general", "总览信息"),
     WITHDRAW_DETAIL("/v1/wallet/withdraw/detail", "提现详情"),
     //    WITHDRAW_INDEX("/v1/wallet/withdraw/index", "提现清单"), 原接口

+ 28 - 9
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/WalletChannelEnum.java

@@ -2,25 +2,32 @@ package com.sckw.payment.model.constant;
 
 import org.apache.commons.lang3.StringUtils;
 
+import java.util.Arrays;
+import java.util.List;
+
 /**
  * @author Aick Spt
  * @date 2023-07-27 12:54
  */
 public enum WalletChannelEnum {
+    ALL(0, "0", "all", "全部"),
+
     //汇付
-    HF(1, "1", "huifu"),
+    HF(1, "1", "huifu", "汇付天下"),
     //新生
-    XS(2, "2", "xinsheng"),
+    XS(2, "2", "newpay", "新生"),
     //中信
-    ZX(3, "3", "zhongxin");
+    ZX(3, "3", "citic", "中信银行");
 
     private final int status;
     private final String value;
+    private final String channel;
     private final String desc;
 
-    WalletChannelEnum(int status, String value, String desc) {
+    WalletChannelEnum(int status, String value, String channel, String desc) {
         this.status = status;
         this.value = value;
+        this.channel = channel;
         this.desc = desc;
     }
 
@@ -32,19 +39,21 @@ public enum WalletChannelEnum {
         return desc;
     }
 
+    public String getChannel() {
+        return channel;
+    }
+
     public String getValue() {
         return value;
     }
 
-    // 添加静态方法,根据 status 获取对应的 desc
-    public static String getStatusDesc(int status) {
+    public static String getDesc(String channel) {
         for (WalletChannelEnum walletChannelEnum : values()) {
-            if (walletChannelEnum.getStatus() == status) {
+            if (StringUtils.equals(walletChannelEnum.getChannel(), channel)) {
                 return walletChannelEnum.getDesc();
             }
         }
-        // 可根据实际需求返回默认值或其他处理
-        return null;
+        return "";
     }
 
     /**
@@ -67,4 +76,14 @@ public enum WalletChannelEnum {
         return null;
     }
 
+    /**
+     * 去除全部的渠道
+     *
+     * @return
+     */
+    public static List<WalletChannelEnum> channelEnumList() {
+        return Arrays.stream(values()).filter(a -> !(WalletChannelEnum.ALL.getStatus() == a.getStatus())).toList();
+    }
+
+
 }

+ 3 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/wallet/PrePayWallet.java

@@ -12,7 +12,9 @@ import java.io.Serializable;
 public class PrePayWallet implements Serializable {
     @Serial
     private static final long serialVersionUID = 7340075510663637767L;
-
+    /**
+     * 预付时,uid代表付款方 预收时,uid代表预收方
+     */
     @JSONField(name = "uid")
     private String uid;
     @JSONField(name = "filter")

+ 180 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/SettlementLogistics.java

@@ -0,0 +1,180 @@
+package com.sckw.payment.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sckw.payment.model.dto.ISettlement;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * @author Aick Spt
+ * @date 2023-07-18 17:33
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class SettlementLogistics implements ISettlement {
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 企业id
+     */
+    private Long entId;
+
+    /**
+     * 物流订单对账id
+     */
+    @JsonProperty("lLedgerId")
+    private Long lLedgerId;
+
+    /**
+     * 结算单编号
+     */
+    private String slOrderNo;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 对账金额
+     */
+    private BigDecimal totalPrice;
+
+    /**
+     * 已收账款
+     */
+    private BigDecimal actualPrice;
+
+    /**
+     * 预计收款日期
+     */
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date receiptTime;
+    /**
+     * 生成时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime generateTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 对账托运方财务联系人
+     */
+    private String auditUser;
+
+    /**
+     * 对账托运方财务联系人电话
+     */
+    private String auditPhone;
+
+    /**
+     * 对账承运方财务联系人
+     */
+    private String successUser;
+
+    /**
+     * 对账承运方财务联系人电话
+     */
+    private String successPhone;
+
+    /**
+     * 状态(1待结算2部分结算3全部结算)
+     */
+    private Integer status;
+
+    private String statusLabel;
+
+    /**
+     * 创建人
+     */
+    private Long createBy;
+
+    /**
+     * 创建人名称
+     */
+    private String createByLabel;
+
+    /**
+     * 创建时间
+     */
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /**
+     * 更新人
+     */
+    private Long updateBy;
+
+    /**
+     * 更新人名称
+     */
+    private String updateByLabel;
+
+    /**
+     * 更新时间
+     */
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+
+    /**
+     * 交易方式
+     */
+    private String trading;
+
+    /**
+     * 交易方式文字
+     */
+    private String tradingLabel;
+
+    /**
+     * 对账单编号
+     */
+    @JsonProperty("lLedgerNo")
+    private String lLedgerNo;
+
+    /**
+     * 托运方
+     */
+    private String shipperFirmName;
+    /**
+     * 承运方
+     */
+    private String carrierFirmName;
+
+
+    /**
+     * 实际应收还款
+     */
+    private BigDecimal settlePrice;
+
+    /**
+     * 剩余待还款
+     */
+    private BigDecimal waitPrice;
+
+    /**
+     * 附件
+     */
+    private String url;
+
+}

+ 144 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/SettlementTrade.java

@@ -0,0 +1,144 @@
+package com.sckw.payment.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sckw.payment.model.dto.ISettlement;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * 运营端 贸易结算
+ *
+ * @author 徐才钦
+ * @date 2023-07-20 12:26
+ */
+@Getter
+@Setter
+public class SettlementTrade implements ISettlement {
+    /**
+     * 对账单id主键
+     */
+    private Long ledgerId;
+    /**
+     * 交易订单对账id
+     */
+    @JsonProperty("tLedgerId")
+    private Long tLedgerId;
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 企业id
+     */
+    private Long entId;
+
+    /**
+     * 结算单编号
+     */
+    private String stOrderNo;
+    @JsonProperty("tLedgerNo")
+    private String tLedgerNo;
+
+    /**
+     * 结算单名称
+     */
+    private String name;
+
+    /**
+     * 总应收/元
+     */
+    private BigDecimal totalPrice;
+
+    /**
+     * 已收款/元
+     */
+    private BigDecimal actualPrice;
+    /**
+     * 带回款金额(扩展的计算字段)
+     */
+    private BigDecimal waitPrice;
+    private String trading;
+    private String tradingLabel;
+
+    /**
+     * 预计收款日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date receiptTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime generateTime;
+
+    /**
+     * 对账采购财务联系人名称
+     */
+    private String auditUser;
+
+    /**
+     * 对账采购财务联系人电话
+     */
+    private String auditPhone;
+
+    /**
+     * 对账销售财务联系人名称
+     */
+    private String successUser;
+
+    /**
+     * 对账销售财务联系人电话
+     */
+    private String successPhone;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 状态(待回款、部分回款、全部回款、回退)
+     */
+    private Integer status;
+    private String statusLabel;
+    //销售企业
+    private String sellFirmName;
+    private String purchaseFirmName;
+
+    /**
+     * 创建人
+     */
+    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;
+
+    /**
+     * 是否删除(0未删除,1删除)
+     */
+    private Integer delFlag;
+
+    //百分比
+    private String percentage;
+
+
+}

+ 39 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/ChannelCount.java

@@ -0,0 +1,39 @@
+package com.sckw.payment.model.vo.res;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author xucaiqin
+ * @date 2023-09-14 11:44:34
+ */
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+public class ChannelCount implements Serializable {
+    @Serial
+    private static final long serialVersionUID = -1612413476552292266L;
+    /**
+     * 字典值
+     */
+    private String value;
+    /**
+     * 描述 中信
+     */
+    private String label;
+    /**
+     * 渠道 huifu
+     */
+    private String channel;
+    /**
+     * 数量
+     */
+    private Integer count;
+
+}

+ 39 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/ChannelDetail.java

@@ -0,0 +1,39 @@
+package com.sckw.payment.model.vo.res;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author xucaiqin
+ * @date 2023-09-14 11:44:34
+ */
+@Getter
+@Setter
+public class ChannelDetail implements Serializable {
+    @Serial
+    private static final long serialVersionUID = -1612413476552292266L;
+    /**
+     * 渠道
+     */
+    private String channel;
+    /**
+     * 渠道名称
+     */
+    private String name;
+
+    /**
+     * 可用金额统计
+     */
+    private String money;
+    /**
+     * 总金额统计
+     */
+    private String totalMoney;
+    /**
+     * 渠道开通状态
+     */
+    private Boolean openFlag = false;
+}

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/WalletDetail.java

@@ -8,5 +8,5 @@ import java.util.List;
  * @author xucaiqin
  * @date 2023-08-28 15:43:49
  */
-public record WalletDetail(String entName, String money, String chargingMoney,String wdingMoney ,int channel, List<String> channels) {
+public record WalletDetail(String entName, String money, String chargingMoney,String wdingMoney ,int channel, List<ChannelDetail> channels) {
 }

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

@@ -59,7 +59,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
     @Resource
     private KwpLedgerLogisticsTrackService logisticsTrackService;
     @Resource
-    private KwpSettlementLogisticsService settlementLogisticsService;
+    private KwpSettlementLogisticsService kwpSettlementLogisticsService;
     @Resource
     private KwpLedgerLogisticsUnitService logisticsUnitService;
     @Resource
@@ -594,7 +594,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         kwpSettlementLogistics.setUpdateTime(LocalDateTime.now());
         kwpSettlementLogistics.setDelFlag(Global.UN_DELETED);
 
-        settlementLogisticsService.save(kwpSettlementLogistics);
+        kwpSettlementLogisticsService.save(kwpSettlementLogistics);
 
         logisticsTrackService.saveTrack(ledgerReq.getIdLong(), Global.EMPTY_STRING, LedgerEnum.SUCCESS);
 

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

@@ -61,7 +61,7 @@ public class KwpLedgerTradeService extends AbsLedger {
     private final KwpLedgerTradeUnitService tradeUnitService;
     private final MessageSender messageSender;
     @Resource
-    private KwpSettlementTradeService settlementTradeService;
+    private KwpSettlementTradeService kwpSettlementTradeService;
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private RemoteSystemService remoteSystemService;
     @DubboReference(version = "1.0.0", group = "design", check = false)
@@ -600,7 +600,7 @@ public class KwpLedgerTradeService extends AbsLedger {
         kwpSettlementTrade.setUpdateBy(LoginUserHolder.getUserId());
         kwpSettlementTrade.setUpdateTime(LocalDateTime.now());
         kwpSettlementTrade.setDelFlag(Global.UN_DELETED);
-        settlementTradeService.save(kwpSettlementTrade);
+        kwpSettlementTradeService.save(kwpSettlementTrade);
 
         //更新贸易订单状态
         List<Long> list = kwpLedgerTradeOrders.stream().map(KwpLedgerTradeOrder::getTOrderId).toList();

+ 10 - 7
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementOfflineService.java

@@ -58,8 +58,8 @@ import java.util.stream.Collectors;
 public class KwpSettlementOfflineService {
     private final KwpLedgerLogisticsMapper kwpLedgerLogisticsMapper;
     private final KwpSettlementOfflineMapper settlementOfflineMapper;
-    private final KwpSettlementTradeService settlementTradeService;
-    private final KwpLedgerTradeOrderService tradeOrderService;
+    private final KwpSettlementTradeService kwpSettlementTradeService;
+    private final KwpLedgerTradeOrderService kwpLedgerTradeOrderService;
     private final KwpSettlementTradeTrackService settlementTradeTrackService;
     private final KwpLedgerTradeService kwpLedgerTradeService;
     private final MessageSender messageSender;
@@ -88,6 +88,8 @@ public class KwpSettlementOfflineService {
         if (CollectionUtils.isEmpty(settlementOfflineLogisticsList)) {
             return new PageRes<>(new PageInfo<>());
         }
+        PageInfo<SettlementOfflineDto> pageInfo = new PageInfo<>(settlementOfflineLogisticsList);
+
         //增加对应创建人和更新人名称
         for (SettlementOfflineDto entity : settlementOfflineLogisticsList) {
             entity.setCreateByText("创建人名称");
@@ -123,7 +125,7 @@ public class KwpSettlementOfflineService {
             return settlementOfflineVo;
         }).collect(Collectors.toList());
 
-        return new PageRes<>(new PageInfo<>(collect));
+        return PageRes.build(pageInfo, collect);
     }
 
 
@@ -271,6 +273,7 @@ public class KwpSettlementOfflineService {
         }
         Map<Long, UserCacheResDto> map = new HashMap<>(Global.NUMERICAL_SIXTEEN);
         DecimalFormat df = new DecimalFormat("0.00");
+        PageInfo<SettlementOfflineDto> pageInfo = new PageInfo<>(settlementOfflineDto);
         //指定返回值
         List<SettlementOfflineVo> collect = settlementOfflineDto.stream().map(a -> {
             SettlementOfflineVo settlementOfflineVo = new SettlementOfflineVo();
@@ -299,7 +302,7 @@ public class KwpSettlementOfflineService {
             settlementOfflineVo.setTopayPrice(df.format(Objects.isNull(a.getTopayPrice()) ? new BigDecimal("0.0") : a.getTopayPrice()));
             return settlementOfflineVo;
         }).collect(Collectors.toList());
-        return new PageRes<>(new PageInfo<>(collect));
+        return PageRes.build(pageInfo, collect);
     }
 
     /**
@@ -314,7 +317,7 @@ public class KwpSettlementOfflineService {
         String key = String.format(RedisConstant.SETTLEMENT_KEY, payReq.getId());
         if (redisLockUtil.tryLock(key)) {
             try {
-                SettlementTradeDto byId = settlementTradeService.getById(payReq.getIdLong(), TradeUnitType.PURCHASE);
+                SettlementTradeDto byId = kwpSettlementTradeService.getById(payReq.getIdLong(), TradeUnitType.PURCHASE);
                 if (Objects.isNull(byId)) {
                     throw new BusinessException("结算单不存在");
                 }
@@ -348,7 +351,7 @@ public class KwpSettlementOfflineService {
                 if (subtract1.compareTo(new BigDecimal("0.0")) == NumberConstant.ZERO) {
                     status = SettlementEnum.ALL_PAYMENT.getStatus();
                     //查询对账单关联的订单
-                    List<KwpLedgerTradeOrder> kwpLedgerTradeOrders = tradeOrderService.queryList(byId.getLedgerId());
+                    List<KwpLedgerTradeOrder> kwpLedgerTradeOrders = kwpLedgerTradeOrderService.queryList(byId.getLedgerId());
                     if (CollectionUtils.isEmpty(kwpLedgerTradeOrders)) {
                         throw new BusinessException("未找到关联的贸易订单");
                     }
@@ -367,7 +370,7 @@ public class KwpSettlementOfflineService {
                 kwpSettlementTrade.setStatus(status);
                 kwpSettlementTrade.setUpdateBy(LoginUserHolder.getUserId());
                 kwpSettlementTrade.setUpdateTime(LocalDateTime.now());
-                settlementTradeService.updateById(kwpSettlementTrade);
+                kwpSettlementTradeService.updateById(kwpSettlementTrade);
                 //新增线下结算记录
                 KwpSettlementOffline kwpSettlementOffline = new KwpSettlementOffline();
                 kwpSettlementOffline.setId(new IdWorker(NumberConstant.ONE).nextId());

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

@@ -46,7 +46,7 @@ public class KwpSettlementTradeService {
     private RemoteSystemService remoteSystemService;
     private final KwpLedgerTradeUnitService tradeUnitService;
     @Resource
-    private KwpSettlementWalletService settlementWalletService;
+    private KwpSettlementWalletService kwpSettlementWalletService;
 
 
     /**
@@ -259,7 +259,7 @@ public class KwpSettlementTradeService {
         }
         settlementTradeDto.setPercentage(settlementTradeDto.changePercentage(settlementTradeDto.getActualPrice(), settlementTradeDto.getTotalPrice()));
         settlementTradeDto.setStatusLabel(SettlementEnum.getStatusDesc(settlementTradeDto.getStatus()));
-        List<SettlementWalletDto> settlementWallet = settlementWalletService.queryList(id, SettlementOrderTypeEnum.TRADE.getStatus(), TradingEnum.getPrefix(trading));
+        List<SettlementWalletDto> settlementWallet = kwpSettlementWalletService.queryList(id, SettlementOrderTypeEnum.TRADE.getStatus(), TradingEnum.getPrefix(trading));
         return new SettlementDetailDto<>(settlementTradeDto, settlementWallet);
     }
 

+ 151 - 16
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WalletService.java

@@ -22,16 +22,14 @@ import com.sckw.payment.model.KwpWalletRefund;
 import com.sckw.payment.model.KwpWalletTransfer;
 import com.sckw.payment.model.constant.RefundEnum;
 import com.sckw.payment.model.constant.TransferEnum;
+import com.sckw.payment.model.constant.WalletChannelEnum;
 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.vo.PrePayWalletVo;
 import com.sckw.payment.model.vo.req.*;
-import com.sckw.payment.model.vo.res.ApPageRes;
-import com.sckw.payment.model.vo.res.FundVo;
-import com.sckw.payment.model.vo.res.MorePageRes;
-import com.sckw.payment.model.vo.res.WalletDetail;
+import com.sckw.payment.model.vo.res.*;
 import com.sckw.redis.config.RedisLockUtil;
 import com.sckw.redis.constant.RedisLockKey;
 import com.sckw.system.api.RemoteSystemService;
@@ -48,9 +46,7 @@ import org.springframework.stereotype.Service;
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -186,25 +182,164 @@ public class WalletService {
         }
     }
 
+    /**
+     * 按钱包渠道进行统计钱包清单数量
+     *
+     * @param entName
+     * @return
+     */
+    public List<ChannelCount> walletCount(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);
+        } else {
+            //筛选所有的
+            filterList.add("");
+        }
+        List<ChannelCount> channelDetails = new ArrayList<>();
+        HashMap<String, Integer> mapCount = new HashMap<>();
+        int all = 0;
+        for (String filter : filterList) {
+            R<List<WalletDto>> wallet = payCenterService.wallet(uid, null, filter);
+            if (wallet.getStatus()) {
+                List<WalletDto> data = wallet.getData();
+                if (!CollectionUtils.isEmpty(data)) {
+                    all += data.size();
+                    Map<String, List<WalletDto>> map = data.stream().collect(Collectors.groupingBy(WalletDto::getChannel));
+                    for (Map.Entry<String, List<WalletDto>> one : map.entrySet()) {
+                        List<WalletDto> value = one.getValue();
+                        Integer size = CollectionUtils.isEmpty(value) ? 0 : value.size();
+                        mapCount.compute(one.getKey(), (k, v) -> Objects.isNull(v) ? size : size + v);
+                    }
+                }
+            }
+        }
+        //所有的
+        mapCount.put(WalletChannelEnum.ALL.getChannel(), all);
+        ChannelCount channelCount;
+        for (WalletChannelEnum value : WalletChannelEnum.values()) {
+            channelCount = new ChannelCount(value.getValue(), value.getDesc(), value.getChannel(), Objects.isNull(mapCount.get(value.getChannel())) ? 0 : mapCount.get(value.getChannel()));
+            channelDetails.add(channelCount);
+        }
+        return channelDetails;
+    }
+
     /**
      * 钱包总览信息
      *
      * @return
      */
-    public WalletDetail walletOverview() {
+    public WalletDetail walletOverview(boolean queryChannel) {
         Long entId = LoginUserHolder.getEntId();
-        String relation = walletRelationService.getRelation(entId);
-        if (StringUtils.isBlank(relation)) {
+        String uid = walletRelationService.getRelation(entId);
+        if (StringUtils.isBlank(uid)) {
             throw new BusinessException("暂未开通电子钱包");
         }
-        R<WalletOverview> wallet = payCenterService.general(relation);
+        //钱包总览信息
+        R<WalletOverview> wallet = payCenterService.general(uid);
         if (wallet.getStatus()) {
             WalletOverview data = wallet.getData();
-            return new WalletDetail(LoginUserHolder.getEntName(), String.valueOf(data.getTotalMoney() / 100D), String.valueOf(data.getChargingMoney()), String.valueOf(data.getWdingMoney()), data.getChannelTotal(), data.getChannels());
+            List<ChannelDetail> channelDetails = new ArrayList<>();
+            //是否查询渠道详情 适配app端
+            if (queryChannel) {
+                //查询钱包清单,统计个渠道金额数量等
+                R<List<WalletDto>> wallet1 = payCenterService.wallet(uid, null, "");
+                if (wallet1.getStatus()) {
+                    List<WalletDto> data1 = wallet1.getData();
+                    if (!CollectionUtils.isEmpty(data1)) {
+                        // 渠道,渠道下的钱包作为的map
+                        Map<String, List<WalletDto>> map = data1.stream().collect(Collectors.groupingBy(WalletDto::getChannel));
+                        ChannelDetail channelDetail;
+                        for (Map.Entry<String, List<WalletDto>> one : map.entrySet()) {
+                            //channel
+                            String key = one.getKey();
+                            //channel下的钱包
+                            List<WalletDto> value = one.getValue();
+                            Long money = 0L;
+                            Long totalMoney = 0L;
+                            if (!CollectionUtils.isEmpty(value)) {
+                                for (WalletDto walletDto : value) {
+                                    money += walletDto.getMoney();
+                                    totalMoney += walletDto.getTotalMoney();
+                                }
+                            }
+                            channelDetail = new ChannelDetail();
+                            channelDetail.setChannel(key);
+                            channelDetail.setName(WalletChannelEnum.getDesc(key));
+                            channelDetail.setMoney(String.valueOf(money / 100D));
+                            channelDetail.setTotalMoney(String.valueOf(totalMoney / 100D));
+                            channelDetail.setOpenFlag(true);
+                            channelDetails.add(channelDetail);
+                        }
+                    }
+                }
+            } else {
+                List<String> channels = data.getChannels();
+                if (!CollectionUtils.isEmpty(channels)) {
+                    ChannelDetail channelDetail;
+                    for (String channel : channels) {
+                        channelDetail = new ChannelDetail();
+                        channelDetail.setChannel(channel);
+                        channelDetail.setName(WalletChannelEnum.getDesc(channel));
+                        channelDetail.setMoney("-");
+                        channelDetail.setTotalMoney("-");
+                        channelDetail.setOpenFlag(true);
+                        channelDetails.add(channelDetail);
+                    }
+                }
+            }
+            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<>());
     }
 
+    /**
+     * 渠道开通情况
+     *
+     * @return
+     */
+    public Object channel() {
+        Long entId = LoginUserHolder.getEntId();
+        String uid = walletRelationService.getRelation(entId);
+        if (StringUtils.isBlank(uid)) {
+            throw new BusinessException("暂未开通电子钱包");
+        }
+        R<WalletOverview> wallet = payCenterService.general(uid);
+        if (wallet.getStatus()) {
+            WalletOverview data = wallet.getData();
+            //已开通的渠道
+            List<String> channels = data.getChannels();
+
+            List<ChannelDetail> res = new ArrayList<>();
+            for (WalletChannelEnum value : WalletChannelEnum.channelEnumList()) {
+                ChannelDetail channelDetail = new ChannelDetail();
+                channelDetail.setChannel(value.getChannel());
+                channelDetail.setName(value.getDesc());
+                channelDetail.setMoney("-");
+                channelDetail.setTotalMoney("-");
+                channelDetail.setOpenFlag(channels.contains(value.getChannel()));
+                res.add(channelDetail);
+            }
+            return res;
+        }
+        return WalletChannelEnum.channelEnumList().stream().map(a -> {
+            ChannelDetail channelDetail = new ChannelDetail();
+            channelDetail.setChannel(a.getChannel());
+            channelDetail.setName(a.getDesc());
+            channelDetail.setMoney("-");
+            channelDetail.setTotalMoney("-");
+            channelDetail.setOpenFlag(false);
+            return channelDetail;
+        }).collect(Collectors.toList());
+    }
+
     /**
      * 查询资金明细
      *
@@ -214,8 +349,8 @@ public class WalletService {
         log.info("查询资金明细:{}", JSONObject.toJSONString(walletDetailReq));
         Long entId = LoginUserHolder.getEntId();
         //查询我方企业开通的渠道
-        String relation = walletRelationService.getRelation(entId);
-        if (StringUtils.isBlank(relation)) {
+        String uid = walletRelationService.getRelation(entId);
+        if (StringUtils.isBlank(uid)) {
             return PageRes.handPage(walletDetailReq.getPage(), walletDetailReq.getPageSize(), new ArrayList<>());
         }
         ChannelEnum channelEnum = null;
@@ -236,7 +371,7 @@ public class WalletService {
                 return PageRes.handPage(walletDetailReq.getPage(), walletDetailReq.getPageSize(), new ArrayList<>());
             }
             for (String filter : filterList) {
-                R<Wallet> walletR = payCenterService.walletSum(relation, channelEnum, filter);
+                R<Wallet> walletR = payCenterService.walletSum(uid, channelEnum, filter);
                 if (walletR.getStatus()) {
                     Wallet data = walletR.getData();
                     sum += data.getTotalMoney();
@@ -249,7 +384,7 @@ public class WalletService {
             }
         } else {
             //不搜索往来单位
-            R<Wallet> wallet = payCenterService.walletSum(relation, channelEnum, "");
+            R<Wallet> wallet = payCenterService.walletSum(uid, channelEnum, "");
             if (wallet.getStatus()) {
                 Wallet data = wallet.getData();
                 sum += data.getTotalMoney();

+ 8 - 8
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/dubbo/PaymentDubboServiceImpl.java

@@ -36,8 +36,8 @@ import java.util.*;
 public class PaymentDubboServiceImpl implements PaymentDubboService {
     private final KwpLedgerLogisticsService ledgerLogisticsService;
     private final KwpLedgerTradeService kwpLedgerTradeService;
-    private final KwpSettlementLogisticsService settlementLogisticsService;
-    private final KwpSettlementTradeService settlementTradeService;
+    private final KwpSettlementLogisticsService kwpSettlementLogisticsService;
+    private final KwpSettlementTradeService kwpSettlementTradeService;
 
 
     private SettlementMoney change(List<MoneyType> moneyType) {
@@ -74,8 +74,8 @@ public class PaymentDubboServiceImpl implements PaymentDubboService {
         if (Objects.isNull(entId) || Objects.isNull(entTarget)) {
             throw new BusinessException("企业id不能为空");
         }
-        List<String> logistics = settlementLogisticsService.checkOrder(entId, entTarget);
-        List<String> trade = settlementTradeService.checkOrder(entId, entTarget);
+        List<String> logistics = kwpSettlementLogisticsService.checkOrder(entId, entTarget);
+        List<String> trade = kwpSettlementTradeService.checkOrder(entId, entTarget);
         Map<OrderEnum, List<String>> res = new HashMap<>(2);
         res.put(OrderEnum.LOGISTICS, logistics);
         res.put(OrderEnum.TRADE, trade);
@@ -110,7 +110,7 @@ public class PaymentDubboServiceImpl implements PaymentDubboService {
             pre.add(DateTimeUtil.getComputeMonthStart(-2, 1));
             pre.add(DateTimeUtil.getComputeMonthEnd(-1, 0));
         }
-        List<MoneyType> moneyType = settlementTradeService.moneySum(entId, cur, pre, TradeUnitType.SELL);
+        List<MoneyType> moneyType = kwpSettlementTradeService.moneySum(entId, cur, pre, TradeUnitType.SELL);
         return change(moneyType);
     }
 
@@ -134,7 +134,7 @@ public class PaymentDubboServiceImpl implements PaymentDubboService {
             pre.add(DateTimeUtil.getComputeMonthStart(-2, 1));
             pre.add(DateTimeUtil.getComputeMonthEnd(-1, 0));
         }
-        List<MoneyType> moneyType = settlementTradeService.moneySum(entId, cur, pre, TradeUnitType.PURCHASE);
+        List<MoneyType> moneyType = kwpSettlementTradeService.moneySum(entId, cur, pre, TradeUnitType.PURCHASE);
         return change(moneyType);
     }
 
@@ -159,7 +159,7 @@ public class PaymentDubboServiceImpl implements PaymentDubboService {
             pre.add(DateTimeUtil.getComputeMonthStart(-2, 1));
             pre.add(DateTimeUtil.getComputeMonthEnd(-1, 0));
         }
-        List<MoneyType> moneyType = settlementLogisticsService.moneySum(entId, cur, pre, LogisticsUnitType.CARRIER);
+        List<MoneyType> moneyType = kwpSettlementLogisticsService.moneySum(entId, cur, pre, LogisticsUnitType.CARRIER);
         return change(moneyType);
 
     }
@@ -184,7 +184,7 @@ public class PaymentDubboServiceImpl implements PaymentDubboService {
             pre.add(DateTimeUtil.getComputeMonthStart(-2, 1));
             pre.add(DateTimeUtil.getComputeMonthEnd(-1, 0));
         }
-        List<MoneyType> moneyType = settlementLogisticsService.moneySum(entId, cur, pre, LogisticsUnitType.SHIPPER);
+        List<MoneyType> moneyType = kwpSettlementLogisticsService.moneySum(entId, cur, pre, LogisticsUnitType.SHIPPER);
         return change(moneyType);
     }
 }

+ 3 - 7
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/LedgerTradeService.java

@@ -25,11 +25,11 @@ import com.sckw.payment.model.vo.LedgerSell;
 import com.sckw.payment.model.vo.req.LedgerListReq;
 import com.sckw.payment.model.vo.req.TradeReq;
 import com.sckw.payment.model.vo.res.LedgerTradeDetailVo;
-import com.sckw.payment.service.*;
+import com.sckw.payment.service.AbsLedger;
+import com.sckw.payment.service.KwpLedgerTradeOrderService;
 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;
@@ -49,12 +49,8 @@ import java.util.stream.Collectors;
 @RequiredArgsConstructor
 public class LedgerTradeService extends AbsLedger {
     private final KwpLedgerTradeMapper tradeMapper;
-    private final KwpLedgerTradeTrackService tradeTrackService;
     private final KwpLedgerTradeOrderService tradeOrderService;
-    private final KwpLedgerTradeUnitService tradeUnitService;
-    private final MessageSender messageSender;
-    @Resource
-    private KwpSettlementTradeService settlementTradeService;
+
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private RemoteSystemService remoteSystemService;
     @DubboReference(version = "1.0.0", group = "design", check = false)

+ 155 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementLogisticsService.java

@@ -0,0 +1,155 @@
+package com.sckw.payment.service.operate;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.sckw.core.common.enums.enums.DictTypeEnum;
+import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.vo.TableTop;
+import com.sckw.core.utils.StringTimeUtil;
+import com.sckw.payment.dao.KwpSettlementLogisticsMapper;
+import com.sckw.payment.model.constant.LogisticsUnitType;
+import com.sckw.payment.model.constant.SettlementEnum;
+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.SettlementLogisticsSumVo;
+import com.sckw.payment.utils.CommonValidator;
+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 lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.*;
+
+
+@RequiredArgsConstructor
+@Service
+@Slf4j
+public class SettlementLogisticsService {
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
+    private final KwpSettlementLogisticsMapper settlementLogisticsMapper;
+
+
+    public List<TableTop> count(SettlementReq settlementReq) {
+        settlementReq.setUnitType(LogisticsUnitType.SHIPPER);
+        settlementReq.setUnitTypeTwo(LogisticsUnitType.CARRIER);
+        validSettlementReq(settlementReq);
+
+        Map<String, Long> count = settlementLogisticsMapper.count(settlementReq);
+        List<TableTop> res = new ArrayList<>(4);
+        for (SettlementEnum value : SettlementEnum.values()) {
+            TableTop tableTop = new TableTop();
+            tableTop.setName(value.getDesc());
+            tableTop.setValue(value.getStatus());
+            tableTop.setTotal(Math.toIntExact(count.get(value.getLabel())));
+            res.add(tableTop);
+        }
+        return res;
+    }
+
+    /**
+     * 列表分页查询
+     *
+     * @param settlementReq
+     * @return
+     */
+    public PageMoreRes<SettlementLogistics> list(SettlementReq settlementReq) {
+        settlementReq.setUnitType(LogisticsUnitType.SHIPPER);
+        settlementReq.setUnitTypeTwo(LogisticsUnitType.CARRIER);
+        //验证相关参数
+        validSettlementReq(settlementReq);
+        //添加默认分页数据
+        PageHelper.startPage(settlementReq.getPage(), settlementReq.getPageSize());
+        //查询分页数据
+        List<SettlementLogistics> kwpLedgerLogisticsList = settlementLogisticsMapper.list(settlementReq);
+        //查询同样条件下的合计
+        SettlementLogisticsSumVo settlementLogisticsSum = settlementLogisticsMapper.sum(settlementReq);
+
+        // 对查询结果进行处理,转换 status 等状态值为对应中文描述
+        return new PageMoreRes<>(getSettlementLogisticsDtoPageRes(kwpLedgerLogisticsList), settlementLogisticsSum);
+    }
+
+
+    public List<SettlementLogisticsDto> selectList(SettlementReq settlementReq) {
+        validSettlementReq(settlementReq);
+        return settlementLogisticsMapper.selectLogisticsList(settlementReq, settlementReq.getIdList());
+    }
+
+
+    private void validSettlementReq(SettlementReq settlementReq) {
+        //判断时间是否成对
+        CommonValidator.isValidCoexisting(settlementReq.getStartCreateTime(), settlementReq.getEndCreateTime(), "");
+        CommonValidator.isValidCoexisting(settlementReq.getStartReceiptTime(), settlementReq.getEndReceiptTime(), "预计付款开始和结束时间");
+        //补全时间信息
+        if (StringUtils.isNotBlank(settlementReq.getStartCreateTime())) {
+            settlementReq.setStartCreateTime(StringTimeUtil.fillStart(settlementReq.getStartCreateTime()));
+        }
+        if (StringUtils.isNotBlank(settlementReq.getEndCreateTime())) {
+            settlementReq.setEndCreateTime(StringTimeUtil.fillEnd(settlementReq.getEndCreateTime()));
+        }
+        if (StringUtils.isNotBlank(settlementReq.getStartReceiptTime())) {
+            settlementReq.setStartCreateTime(StringTimeUtil.fillStart(settlementReq.getStartReceiptTime()));
+        }
+        if (StringUtils.isNotBlank(settlementReq.getEndReceiptTime())) {
+            settlementReq.setEndCreateTime(StringTimeUtil.fillEnd(settlementReq.getEndReceiptTime()));
+        }
+    }
+
+    private PageInfo<SettlementLogistics> getSettlementLogisticsDtoPageRes(List<SettlementLogistics> kwpLedgerLogisticsList) {
+        Map<String, SysDictResDto> dictResDtoMap = remoteSystemService.queryDictMapByType(DictTypeEnum.TRADE_TYPE.getType());
+        Map<Long, UserCacheResDto> map = new HashMap<>(Global.NUMERICAL_SIXTEEN);
+
+        for (SettlementLogistics settlementLogisticsDto : kwpLedgerLogisticsList) {
+            SysDictResDto sysDictResDto = dictResDtoMap.get(settlementLogisticsDto.getTrading());
+            if (Objects.nonNull(sysDictResDto)) {
+                settlementLogisticsDto.setTradingLabel(sysDictResDto.getLabel());
+            }
+            //更改创建、更新人名称及字段
+            settlementLogisticsDto.setStatusLabel(SettlementEnum.getStatusDesc(settlementLogisticsDto.getStatus()));
+            if (settlementLogisticsDto.getTotalPrice() != null) {
+                if (settlementLogisticsDto.getActualPrice() != null) {
+                    settlementLogisticsDto.setWaitPrice(settlementLogisticsDto.getTotalPrice().subtract(settlementLogisticsDto.getActualPrice()));
+                } else {
+                    settlementLogisticsDto.setWaitPrice(settlementLogisticsDto.getTotalPrice());
+                }
+            } else {
+                settlementLogisticsDto.setWaitPrice(new BigDecimal(0));
+            }
+            //"创建人名称"
+            settlementLogisticsDto.setCreateByLabel("创建人名称");
+            //"更新人名称"
+            settlementLogisticsDto.setUpdateByLabel("更新人名称");
+
+            Long createBy = settlementLogisticsDto.getCreateBy();
+            Long updateBy = settlementLogisticsDto.getUpdateBy();
+            UserCacheResDto userCacheResDto = map.get(createBy);
+            if (Objects.isNull(userCacheResDto)) {
+                //通过缓存拿对应数据
+                userCacheResDto = remoteSystemService.queryUserCacheById(createBy);
+                map.put(createBy, userCacheResDto);
+            }
+            if (Objects.nonNull(userCacheResDto)) {
+                //写入对应数据
+                settlementLogisticsDto.setCreateByLabel(userCacheResDto.getName());
+            }
+            userCacheResDto = map.get(updateBy);
+            if (Objects.isNull(userCacheResDto)) {
+                //通过缓存拿对应数据
+                userCacheResDto = remoteSystemService.queryUserCacheById(updateBy);
+                map.put(updateBy, userCacheResDto);
+            }
+            if (Objects.nonNull(userCacheResDto)) {
+                //写入对应数据
+                settlementLogisticsDto.setUpdateByLabel(userCacheResDto.getName());
+            }
+        }
+        return new PageInfo<>(kwpLedgerLogisticsList);
+    }
+}

+ 86 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementOfflineService.java

@@ -0,0 +1,86 @@
+package com.sckw.payment.service.operate;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.page.PageRes;
+import com.sckw.payment.dao.KwpSettlementOfflineMapper;
+import com.sckw.payment.model.dto.SettlementOfflineDto;
+import com.sckw.payment.model.vo.req.SettlementOfflineReq;
+import com.sckw.payment.model.vo.res.SettlementOfflineVo;
+import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.model.dto.res.UserCacheResDto;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * @author xucaiqin
+ * @date 2023-07-10 16:38:36
+ */
+@Service
+@Slf4j
+@RequiredArgsConstructor
+public class SettlementOfflineService {
+    private final KwpSettlementOfflineMapper settlementOfflineMapper;
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
+
+    /**
+     * 分页查询线下结算记录
+     *
+     * @param settlementOfflineReq
+     * @return
+     */
+    public PageRes<SettlementOfflineVo> list(SettlementOfflineReq settlementOfflineReq) {
+        PageHelper.startPage(settlementOfflineReq.getPage(), settlementOfflineReq.getPageSize());
+        List<SettlementOfflineDto> settlementOfflineDto = settlementOfflineMapper.list(settlementOfflineReq);
+        if (CollectionUtils.isEmpty(settlementOfflineDto)) {
+            return new PageRes<>();
+        }
+        Map<Long, UserCacheResDto> map = new HashMap<>(Global.NUMERICAL_SIXTEEN);
+        DecimalFormat df = new DecimalFormat("0.00");
+        PageInfo<SettlementOfflineDto> pageInfo = new PageInfo<>(settlementOfflineDto);
+        //指定返回值
+        List<SettlementOfflineVo> collect = settlementOfflineDto.stream().map(a -> {
+            SettlementOfflineVo settlementOfflineVo = new SettlementOfflineVo();
+            BeanUtils.copyProperties(a, settlementOfflineVo);
+
+            Long createBy = a.getCreateBy();
+            Long updateBy = a.getUpdateBy();
+            //创建人赋值
+            UserCacheResDto userCacheResDto = map.get(createBy);
+            if (Objects.isNull(userCacheResDto)) {
+                userCacheResDto = remoteSystemService.queryUserCacheById(createBy);
+                map.put(createBy, userCacheResDto);
+            }
+            if (Objects.nonNull(userCacheResDto)) {
+                settlementOfflineVo.setCreateByText(userCacheResDto.getName());
+            }
+            userCacheResDto = map.get(updateBy);
+            if (Objects.isNull(userCacheResDto)) {
+                userCacheResDto = remoteSystemService.queryUserCacheById(updateBy);
+                map.put(updateBy, userCacheResDto);
+            }
+            if (Objects.nonNull(userCacheResDto)) {
+                settlementOfflineVo.setUpdateByText(userCacheResDto.getName());
+            }
+            settlementOfflineVo.setPayPrice(df.format(Objects.isNull(a.getPayPrice()) ? new BigDecimal("0.0") : a.getPayPrice()));
+            settlementOfflineVo.setTopayPrice(df.format(Objects.isNull(a.getTopayPrice()) ? new BigDecimal("0.0") : a.getTopayPrice()));
+            return settlementOfflineVo;
+        }).collect(Collectors.toList());
+        return PageRes.build(pageInfo, collect);
+    }
+
+}

+ 118 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementTradeService.java

@@ -0,0 +1,118 @@
+package com.sckw.payment.service.operate;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.sckw.core.common.enums.enums.DictTypeEnum;
+import com.sckw.core.model.page.PageRes;
+import com.sckw.core.model.vo.TableTop;
+import com.sckw.core.utils.BeanUtils;
+import com.sckw.core.utils.CollectionUtils;
+import com.sckw.payment.dao.KwpSettlementTradeMapper;
+import com.sckw.payment.model.constant.SettlementEnum;
+import com.sckw.payment.model.constant.TradeUnitType;
+import com.sckw.payment.model.dto.ISettlement;
+import com.sckw.payment.model.dto.SettlementPurchaseDto;
+import com.sckw.payment.model.dto.SettlementSellDto;
+import com.sckw.payment.model.dto.SettlementTradeDto;
+import com.sckw.payment.model.vo.SettlementTrade;
+import com.sckw.payment.model.vo.req.SettlementTradeReq;
+import com.sckw.payment.model.vo.res.SettlementSumVo;
+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 lombok.RequiredArgsConstructor;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * 贸易结算
+ *
+ * @author xucaiqin
+ * @date 2023-07-10 16:38:36
+ */
+@Service
+@RequiredArgsConstructor
+public class SettlementTradeService {
+    private final KwpSettlementTradeMapper settlementTradeMapper;
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
+
+    /**
+     * 字典转换
+     *
+     * @param list 结算单列表数据
+     */
+    private void changeDict(List<? extends ISettlement> list) {
+        //字典等数据转换
+        Map<String, SysDictResDto> dictResDtoMap = remoteSystemService.queryDictMapByType(DictTypeEnum.TRADE_TYPE.getType());
+        for (ISettlement iSettlement : list) {
+            String trading = iSettlement.getTrading();
+            SysDictResDto sysDictResDto = dictResDtoMap.get(trading);
+            if (Objects.nonNull(sysDictResDto)) {
+                iSettlement.setTradingLabel(sysDictResDto.getLabel());
+            }
+            iSettlement.setStatusLabel(SettlementEnum.getStatusDesc(iSettlement.getStatus()));
+        }
+    }
+
+    /**
+     * 分页查询结算单数据
+     *
+     * @param settlementReq 结算单查询参数
+     * @return
+     */
+    public PageRes<SettlementTrade> list(SettlementTradeReq settlementReq) {
+        PageHelper.startPage(settlementReq.getPage(), settlementReq.getPageSize());
+        List<SettlementTrade> kwpLedgerLogisticsList = settlementTradeMapper.list(settlementReq);
+        PageInfo<SettlementTrade> settlementPageInfo = new PageInfo<>(kwpLedgerLogisticsList);
+        if (!CollectionUtils.isEmpty(kwpLedgerLogisticsList)) {
+            //根据企业类型转换对应的数据
+            for (SettlementTrade settlementTradeDto : kwpLedgerLogisticsList) {
+                UserCacheResDto userCacheResDto = remoteSystemService.queryUserCacheById(settlementTradeDto.getUpdateBy());
+                settlementTradeDto.setUpdateByLabel(Objects.nonNull(userCacheResDto) ? userCacheResDto.getName() : "");
+                UserCacheResDto userCacheResDto2 = remoteSystemService.queryUserCacheById(settlementTradeDto.getCreateBy());
+                settlementTradeDto.setUpdateByLabel(Objects.nonNull(userCacheResDto2) ? userCacheResDto2.getName() : "");
+            }
+            changeDict(kwpLedgerLogisticsList);
+            return new PageRes<>(settlementPageInfo, kwpLedgerLogisticsList);
+        }
+        return new PageRes<>(settlementPageInfo);
+    }
+
+    /**
+     * 统计列表的表头数据
+     *
+     * @param settlementReq 结算单查询参数
+     * @return
+     */
+    public List<TableTop> getCount(SettlementTradeReq settlementReq) {
+        Map<String, Long> stringIntegerMap = settlementTradeMapper.count(settlementReq);
+        List<TableTop> res = new ArrayList<>(4);
+        for (SettlementEnum value : SettlementEnum.values()) {
+            TableTop tableTop = new TableTop();
+            tableTop.setName(value.getDesc());
+            tableTop.setValue(value.getStatus());
+            tableTop.setTotal(Math.toIntExact(stringIntegerMap.get(value.getLabel())));
+            res.add(tableTop);
+        }
+        return res;
+    }
+
+    /**
+     * 表尾统计数据
+     *
+     * @param settlementReq 结算单查询参数
+     * @return
+     */
+    public SettlementSumVo sumMoney(SettlementTradeReq settlementReq) {
+        return settlementTradeMapper.sumMoney2(settlementReq);
+    }
+
+
+
+}

+ 96 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementWalletService.java

@@ -0,0 +1,96 @@
+package com.sckw.payment.service.operate;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.page.PageRes;
+import com.sckw.order.api.dubbo.TradeOrderInfoService;
+import com.sckw.payment.dao.KwpSettlementLogisticsTrackMapper;
+import com.sckw.payment.dao.KwpSettlementWalletMapper;
+import com.sckw.payment.model.dto.SettlementWalletDto;
+import com.sckw.payment.model.vo.req.SettlementWalletReq;
+import com.sckw.payment.model.vo.res.SettlementWalletVo;
+import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.model.dto.res.UserCacheResDto;
+import com.sckw.transport.api.dubbo.TransportDubboService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * @author Aick Spt
+ * @date 2023-07-20 14:55
+ */
+@Service
+@Slf4j
+@RequiredArgsConstructor
+public class SettlementWalletService {
+    private final KwpSettlementWalletMapper settlementWalletMapper;
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private TradeOrderInfoService tradeOrderInfoService;
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private TransportDubboService transportDubboService;
+    private final KwpSettlementLogisticsTrackMapper kwpSettlementLogisticsTrackMapper;
+
+
+    /**
+     * 预付款、货到付款记录
+     * 前端接口分开
+     *
+     * @param settlementWalletReq 请求参数
+     * @return
+     */
+    public PageRes<SettlementWalletVo> pageList(SettlementWalletReq settlementWalletReq) {
+        PageHelper.startPage(settlementWalletReq.getPage(), settlementWalletReq.getPageSize());
+        List<SettlementWalletDto> settlementWalletDto = settlementWalletMapper.list(settlementWalletReq);
+
+        if (CollectionUtils.isEmpty(settlementWalletDto)) {
+            return new PageRes<>();
+        }
+        //增加对应创建人和更新人名称
+        Map<Long, UserCacheResDto> map = new HashMap<>(Global.NUMERICAL_SIXTEEN);
+        PageInfo<SettlementWalletDto> pageInfo = new PageInfo<>(settlementWalletDto);
+        DecimalFormat df = new DecimalFormat("0.00");
+        //指定返回值
+        List<SettlementWalletVo> collect = settlementWalletDto.stream().map(a -> {
+            SettlementWalletVo settlementWalletVo = new SettlementWalletVo();
+            BeanUtils.copyProperties(a, settlementWalletVo);
+            Long createBy = a.getCreateBy();
+            Long updateBy = a.getUpdateBy();
+            UserCacheResDto userCacheResDto = map.get(createBy);
+            if (Objects.isNull(userCacheResDto)) {
+                userCacheResDto = remoteSystemService.queryUserCacheById(createBy);
+                map.put(createBy, userCacheResDto);
+            }
+            if (Objects.nonNull(userCacheResDto)) {
+                settlementWalletVo.setCreateByText(userCacheResDto.getName());
+            }
+            userCacheResDto = map.get(updateBy);
+            if (Objects.isNull(userCacheResDto)) {
+                userCacheResDto = remoteSystemService.queryUserCacheById(updateBy);
+                map.put(updateBy, userCacheResDto);
+            }
+            if (Objects.nonNull(userCacheResDto)) {
+                settlementWalletVo.setUpdateByText(userCacheResDto.getName());
+            }
+            settlementWalletVo.setPayPrice(df.format(Objects.isNull(a.getPayPrice()) ? new BigDecimal("0.0") : a.getPayPrice()));
+            settlementWalletVo.setTopayPrice(df.format(Objects.isNull(a.getTopayPrice()) ? new BigDecimal("0.0") : a.getTopayPrice()));
+            return settlementWalletVo;
+        }).collect(Collectors.toList());
+        return PageRes.build(pageInfo, collect);
+    }
+}
+

+ 0 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/utils/CommonValidator.java

@@ -16,8 +16,6 @@ public class CommonValidator {
 
     // 时间格式的正则表达式
     private static final String TIME_PATTERN = "\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}";
-    @DubboReference(version = "1.0.0", group = "design", check = false)
-    private RemoteSystemService remoteSystemService;
 
     /**
      * 判断时间段的开始时间和结束时间是否同时存在或同时不存在,且格式为 yyyy-MM-dd HH:mm:ss

+ 140 - 6
sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementLogisticsMapper.xml

@@ -150,6 +150,63 @@
         </where>
         order by s.update_time desc
     </select>
+    <select id="list" resultType="com.sckw.payment.model.vo.SettlementLogistics">
+        select s.id,
+               s.ent_id        as entId,
+               s.l_ledger_id   as lLedgerId,
+               s.sl_order_no   as slOrderNo,
+               s.total_price   as totalPrice,
+               s.actual_price  as actualPrice,
+               s.receipt_time  as receiptTime,
+               s.remark,
+               s.audit_user    as auditUser,
+               s.audit_phone   as auditPhone,
+               s.success_user  as successUser,
+               s.success_phone as successPhone,
+               s.status,
+               s.create_by     as createBy,
+               s.create_time   as createTime,
+               s.update_by     as updateBy,
+               s.update_time   as updateTime,
+               l.name,
+               l.generate_time as generateTime,
+               l.l_ledger_no   as lLedgerNo,
+               l.trading       as trading,
+               l.settle_price  as settlePrice,
+               l.url           as url,
+               lu.firm_name    as shipperFirmName,
+               lu2.firm_name   as carrierFirmName
+        from kwp_settlement_logistics s
+                 inner join kwp_ledger_logistics l on s.l_ledger_id = l.id and l.del_flag = 0
+                 inner join kwp_ledger_logistics_unit lu on s.l_ledger_id = lu.l_ledger_id and lu.del_flag = 0 and
+                                                            lu.unit_type = #{settlementReq.unitType,jdbcType=INTEGER}
+                 inner join kwp_ledger_logistics_unit lu2
+                            on s.l_ledger_id = lu2.l_ledger_id and lu2.del_flag = 0
+                                and lu2.unit_type = #{settlementReq.unitTypeTwo,jdbcType=INTEGER}
+        <where>
+            s.del_flag = 0
+            <if test="settlementReq.status != null and settlementReq.status != 0">
+                and s.status = #{settlementReq.status}
+            </if>
+            <if test="settlementReq.trading != null and settlementReq.trading != ''">
+                and l.trading = #{settlementReq.trading,jdbcType=VARCHAR}
+            </if>
+            <if test="settlementReq.startCreateTime != null and settlementReq.startCreateTime != ''  and settlementReq.endCreateTime != null  and settlementReq.endCreateTime != ''">
+                and s.create_time between #{settlementReq.startCreateTime,jdbcType=TIMESTAMP} and #{settlementReq.endCreateTime,jdbcType=TIMESTAMP}
+            </if>
+            <if test="settlementReq.startReceiptTime != null and settlementReq.endReceiptTime != null">
+                and s.receipt_time between #{settlementReq.startReceiptTime,jdbcType=TIMESTAMP} and #{settlementReq.endReceiptTime,jdbcType=TIMESTAMP}
+            </if>
+            <if test="settlementReq.keywords != null and settlementReq.keywords != ''">
+                and (l.name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                    or lu.firm_name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                    or lu2.firm_name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                    or s.sl_order_no like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                    )
+            </if>
+        </where>
+        order by s.update_time desc
+    </select>
 
     <!--  结算运费-物流订单列表合计  -->
     <select id="selectSum" resultType="com.sckw.payment.model.vo.res.SettlementLogisticsSumVo">
@@ -164,6 +221,42 @@
         </where>
         ) a
     </select>
+    <select id="sum" resultType="com.sckw.payment.model.vo.res.SettlementLogisticsSumVo">
+        select a.*, (a.actualReceivable - a.currentReceipt) AS remainingReceivables From (
+        select count(l.id)            total,
+               sum(l.settle_price) as actualReceivable,
+               sum(s.actual_price) as currentReceipt
+        from kwp_settlement_logistics s
+                 inner join kwp_ledger_logistics l on s.l_ledger_id = l.id and l.del_flag = 0
+                 inner join kwp_ledger_logistics_unit lu on s.l_ledger_id = lu.l_ledger_id and lu.del_flag = 0 and
+                                                            lu.unit_type = #{settlementReq.unitType,jdbcType=INTEGER}
+                 inner join kwp_ledger_logistics_unit lu2
+                            on s.l_ledger_id = lu2.l_ledger_id and lu2.del_flag = 0
+                                and lu2.unit_type = #{settlementReq.unitTypeTwo,jdbcType=INTEGER}
+        <where>
+            s.del_flag = 0
+            <if test="settlementReq.status != null and settlementReq.status != 0">
+                and s.status = #{settlementReq.status}
+            </if>
+            <if test="settlementReq.trading != null and settlementReq.trading != ''">
+                and l.trading = #{settlementReq.trading,jdbcType=VARCHAR}
+            </if>
+            <if test="settlementReq.startCreateTime != null and settlementReq.startCreateTime != ''  and settlementReq.endCreateTime != null  and settlementReq.endCreateTime != ''">
+                and s.create_time between #{settlementReq.startCreateTime,jdbcType=TIMESTAMP} and #{settlementReq.endCreateTime,jdbcType=TIMESTAMP}
+            </if>
+            <if test="settlementReq.startReceiptTime != null and settlementReq.endReceiptTime != null">
+                and s.receipt_time between #{settlementReq.startReceiptTime,jdbcType=TIMESTAMP} and #{settlementReq.endReceiptTime,jdbcType=TIMESTAMP}
+            </if>
+            <if test="settlementReq.keywords != null and settlementReq.keywords != ''">
+                and (l.name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                or lu.firm_name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                or lu2.firm_name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                or s.sl_order_no like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                )
+            </if>
+        </where>
+        ) a
+    </select>
 
     <!-- 结算运费-物流订单列表头部汇总数  -->
     <select id="getCountList" resultType="java.lang.Long">
@@ -180,7 +273,48 @@
             <include refid="settlementLogisticsSelectWhere"/>
         </where>
     </select>
-
+    <select id="count" resultType="java.util.Map">
+        select count(1)                           "0",
+               count(if(ksl.status = 3, 1, null)) "3",
+               count(if(ksl.status = 2, 1, null)) "2",
+               count(if(ksl.status = 1, 1, null)) "1"
+        from kwp_settlement_logistics ksl
+                 inner join kwp_ledger_logistics l on ksl.l_ledger_id = l.id and l.del_flag = 0
+                 inner join kwp_ledger_logistics_unit lu on ksl.l_ledger_id = lu.l_ledger_id and lu.del_flag = 0
+        and lu.unit_type = #{settlementReq.unitType,jdbcType=INTEGER}
+                 inner join kwp_ledger_logistics_unit lu2 on ksl.l_ledger_id = lu2.l_ledger_id and lu2.del_flag = 0
+        and lu2.unit_type = #{settlementReq.unitTypeTwo,jdbcType=INTEGER}
+        <where>
+            ksl.del_flag = 0
+            <if test="settlementReq.status != null and settlementReq.status != 0">
+                and ksl.status = #{settlementReq.status}
+            </if>
+            <if test="settlementReq.trading != null and settlementReq.trading != ''">
+                and l.trading = #{settlementReq.trading,jdbcType=VARCHAR}
+            </if>
+            <if test="settlementReq.startCreateTime != null and settlementReq.startCreateTime != ''  and settlementReq.endCreateTime != null  and settlementReq.endCreateTime != ''">
+                and ksl.create_time between #{settlementReq.startCreateTime,jdbcType=TIMESTAMP} and #{settlementReq.endCreateTime,jdbcType=TIMESTAMP}
+            </if>
+            <if test="settlementReq.startReceiptTime != null and settlementReq.endReceiptTime != null">
+                and ksl.receipt_time between #{settlementReq.startReceiptTime,jdbcType=TIMESTAMP} and #{settlementReq.endReceiptTime,jdbcType=TIMESTAMP}
+            </if>
+            <if test="settlementReq.keywords != null and settlementReq.keywords != ''">
+                and (l.name like concat('%'
+                    , #{settlementReq.keywords,jdbcType=VARCHAR}
+                    , '%')
+                    or lu.firm_name like concat('%'
+                        , #{settlementReq.keywords,jdbcType=VARCHAR}
+                        , '%')
+                    or lu2.firm_name like concat('%'
+                        , #{settlementReq.keywords,jdbcType=VARCHAR}
+                        , '%')
+                    or ksl.sl_order_no like concat('%'
+                        , #{settlementReq.keywords,jdbcType=VARCHAR}
+                        , '%')
+                    )
+            </if>
+        </where>
+    </select>
     <!-- 根据结算物流订单id查详情   -->
     <select id="detail" parameterType="java.lang.Long"
             resultType="com.sckw.payment.model.dto.SettlementLogisticsDto">
@@ -227,14 +361,14 @@
 
     <select id="getListById" resultType="com.sckw.payment.model.dto.LedgerUnitDto">
         select kltu.top_ent_id,
-        kltu.ent_id,
-        kltu.unit_type
+               kltu.ent_id,
+               kltu.unit_type
         from kwp_settlement_logistics kst
-        inner join kwp_ledger_logistics klt on kst.l_ledger_id = klt.id and klt.del_flag = 0
-        inner join kwp_ledger_logistics_unit kltu on klt.id = kltu.l_ledger_id and kltu.del_flag = 0
+                 inner join kwp_ledger_logistics klt on kst.l_ledger_id = klt.id and klt.del_flag = 0
+                 inner join kwp_ledger_logistics_unit kltu on klt.id = kltu.l_ledger_id and kltu.del_flag = 0
         <where>
             kst.del_flag = 0
-            and kst.id = #{id,jdbcType=BIGINT}
+              and kst.id = #{id,jdbcType=BIGINT}
         </where>
     </select>
 

+ 14 - 0
sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementOfflineMapper.xml

@@ -81,4 +81,18 @@
             </if>
         </where>
     </select>
+    <select id="list" resultType="com.sckw.payment.model.dto.SettlementOfflineDto">
+        select
+        <include refid="Base_Column_List"/>
+        FROM kwp_settlement_offline
+        <where>
+            del_flag = 0
+            <if test="offlineReq.orderType != null">
+                and order_type = #{offlineReq.orderType,jdbcType=INTEGER}
+            </if>
+            <if test="offlineReq.id != null and offlineReq.id != ''">
+                and settlement_id = #{offlineReq.id,jdbcType=INTEGER}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 125 - 0
sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementTradeMapper.xml

@@ -123,6 +123,60 @@
         </where>
         order by kst.create_time desc
     </select>
+    <select id="list" resultType="com.sckw.payment.model.vo.SettlementTrade">
+        select kst.id,
+               kst.status,
+               kst.st_order_no                                    stOrderNo,
+               kst.receipt_time                                   receiptTime,
+               cast(kst.actual_price as char)                     actualPrice,
+               cast(kst.total_price as char)                      totalPrice,
+               cast((kst.total_price - kst.actual_price) as char) waitPrice,
+               kst.audit_user                                     auditUser,
+               kst.audit_phone                                    auditPhone,
+               kst.success_user                                   successUser,
+               kst.success_phone                                  successPhone,
+               kst.create_by                                      createBy,
+               kst.create_time                                    createTime,
+               kst.t_ledger_id                                    tLedgerId,
+               klt.id                                             ledgerId,
+               klt.name,
+               klt.trading,
+               klt.t_ledger_no                                    tLedgerNo,
+               klt.generate_time                                  generateTime,
+               kltu.firm_name                                     sellFirmName,
+               kltu2.firm_name                                    purchaseFirmName,
+               kst.update_by                                      updateBy
+        from kwp_settlement_trade kst
+                 inner join kwp_ledger_trade klt on kst.t_ledger_id = klt.id and klt.del_flag = 0
+                 inner join kwp_ledger_trade_unit kltu on klt.id = kltu.t_ledger_id and kltu.del_flag = 0 and
+                                                          kltu.unit_type = 2
+                 inner join kwp_ledger_trade_unit kltu2 on klt.id = kltu2.t_ledger_id and kltu2.del_flag = 0 and
+                                                           kltu2.unit_type = 1
+        <where>
+            kst.del_flag = 0
+            <if test="settlementReq.keywords != null and settlementReq.keywords != ''">
+                and (
+                            klt.name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                        or kltu.firm_name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                        or kltu2.firm_name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                        or kst.st_order_no like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                    )
+            </if>
+            <if test="settlementReq.trading != null and settlementReq.trading != ''">
+                and klt.trading = #{settlementReq.trading,jdbcType=VARCHAR}
+            </if>
+            <if test="settlementReq.status != null">
+                and kst.status = #{settlementReq.status,jdbcType=INTEGER}
+            </if>
+            <if test="settlementReq.startCreateTime != null and settlementReq.startCreateTime != '' and settlementReq.endCreateTime != null and settlementReq.endCreateTime != ''">
+                and kst.create_time between #{settlementReq.startCreateTime,jdbcType=TIMESTAMP} and #{settlementReq.endCreateTime,jdbcType=TIMESTAMP}
+            </if>
+            <if test="settlementReq.startReceiptTime != null and settlementReq.startReceiptTime != '' and settlementReq.endReceiptTime != null and settlementReq.endReceiptTime != ''">
+                and kst.receipt_time between #{settlementReq.startReceiptTime,jdbcType=TIMESTAMP} and #{settlementReq.endReceiptTime,jdbcType=TIMESTAMP}
+            </if>
+        </where>
+        order by kst.create_time desc
+    </select>
 
     <select id="sumMoney" resultType="com.sckw.payment.model.vo.res.SettlementSumVo">
         select count(1)                                                allCount,
@@ -160,6 +214,41 @@
             </if>
         </where>
     </select>
+    <select id="sumMoney2" resultType="com.sckw.payment.model.vo.res.SettlementSumVo">
+        select count(1)                                                allCount,
+               IFNULL(sum(kst.total_price), 0)                         receiveAll,
+               IFNULL(sum(kst.actual_price), 0)                        alreadyReceive,
+               IFNULL(sum(kst.total_price) - sum(kst.actual_price), 0) waitReceive
+        from kwp_settlement_trade kst
+                 inner join kwp_ledger_trade klt on kst.t_ledger_id = klt.id and klt.del_flag = 0
+                 inner join kwp_ledger_trade_unit kltu on klt.id = kltu.t_ledger_id and kltu.del_flag = 0 and
+                                                          kltu.unit_type = 2
+                 inner join kwp_ledger_trade_unit kltu2 on klt.id = kltu2.t_ledger_id and kltu2.del_flag = 0 and
+                                                           kltu2.unit_type = 1
+        <where>
+            kst.del_flag = 0
+            <if test="settlementReq.keywords != null and settlementReq.keywords != ''">
+                and (
+                            klt.name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                        or kltu.firm_name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                        or kltu2.firm_name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                        or kst.st_order_no like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                    )
+            </if>
+            <if test="settlementReq.status != null">
+                and kst.status = #{settlementReq.status,jdbcType=INTEGER}
+            </if>
+            <if test="settlementReq.trading != null and settlementReq.trading != ''">
+                and klt.trading = #{settlementReq.trading,jdbcType=VARCHAR}
+            </if>
+            <if test="settlementReq.startCreateTime != null and settlementReq.startCreateTime != '' and settlementReq.endCreateTime != null and settlementReq.endCreateTime != ''">
+                and kst.create_time between #{settlementReq.startCreateTime,jdbcType=TIMESTAMP} and #{settlementReq.endCreateTime,jdbcType=TIMESTAMP}
+            </if>
+            <if test="settlementReq.startReceiptTime != null and settlementReq.startReceiptTime != '' and settlementReq.endReceiptTime != null and settlementReq.endReceiptTime != ''">
+                and kst.receipt_time between #{settlementReq.startReceiptTime,jdbcType=TIMESTAMP} and #{settlementReq.endReceiptTime,jdbcType=TIMESTAMP}
+            </if>
+        </where>
+    </select>
     <select id="countOrder" resultType="java.util.Map">
         select count(1)                           "0",
                count(if(kst.status = 3, 1, null)) "3",
@@ -196,6 +285,42 @@
             </if>
         </where>
     </select>
+    <select id="count" resultType="java.util.Map">
+        select count(1)                           "0",
+               count(if(kst.status = 3, 1, null)) "3",
+               count(if(kst.status = 2, 1, null)) "2",
+               count(if(kst.status = 1, 1, null)) "1"
+        from kwp_settlement_trade kst
+                 inner join kwp_ledger_trade klt on kst.t_ledger_id = klt.id and klt.del_flag = 0
+                 inner join kwp_ledger_trade_unit kltu on klt.id = kltu.t_ledger_id and kltu.del_flag = 0 and
+                                                          kltu.unit_type = 2
+                 inner join kwp_ledger_trade_unit kltu2 on klt.id = kltu2.t_ledger_id and kltu2.del_flag = 0 and
+                                                           kltu2.unit_type = 1
+        <where>
+            kst.del_flag = 0
+              and kltu2.top_ent_id = #{settlementReq.entId,jdbcType=INTEGER}
+            <if test="settlementReq.keywords != null and settlementReq.keywords != ''">
+                and (
+                            klt.name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                        or kltu.firm_name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                        or kltu2.firm_name like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                        or kst.st_order_no like concat('%', #{settlementReq.keywords,jdbcType=VARCHAR}, '%')
+                    )
+            </if>
+            <if test="settlementReq.trading != null and settlementReq.trading != ''">
+                and klt.trading = #{settlementReq.trading,jdbcType=VARCHAR}
+            </if>
+            <if test="settlementReq.status != null">
+                and kst.status = #{settlementReq.status,jdbcType=INTEGER}
+            </if>
+            <if test="settlementReq.startCreateTime != null and settlementReq.startCreateTime != '' and settlementReq.endCreateTime != null and settlementReq.endCreateTime != ''">
+                and kst.create_time between #{settlementReq.startCreateTime,jdbcType=TIMESTAMP} and #{settlementReq.endCreateTime,jdbcType=TIMESTAMP}
+            </if>
+            <if test="settlementReq.startReceiptTime != null and settlementReq.startReceiptTime != '' and settlementReq.endReceiptTime != null and settlementReq.endReceiptTime != ''">
+                and kst.receipt_time between #{settlementReq.startReceiptTime,jdbcType=TIMESTAMP} and #{settlementReq.endReceiptTime,jdbcType=TIMESTAMP}
+            </if>
+        </where>
+    </select>
 
     <select id="selectByIds" resultType="com.sckw.payment.model.dto.SettlementTradeDto">
         select kst.id,

+ 30 - 0
sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementWalletMapper.xml

@@ -121,4 +121,34 @@
             </if>
         </where>
     </select>
+    <select id="list" resultType="com.sckw.payment.model.dto.SettlementWalletDto">
+        select ksw.id,
+               ksw.ent_id,
+               ksw.settlement_id,
+               ksw.order_type,
+               ksw.channel,
+               ksw.order_type,
+               ksw.pay_time,
+               ksw.pay_price,
+               ksw.topay_price,
+               ksw.type,
+               ksw.remark,
+               ksw.create_by,
+               ksw.create_time,
+               ksw.update_by,
+               ksw.update_time
+        from kwp_settlement_wallet ksw
+        <where>
+            ksw.del_flag = 0
+            <if test="walletReq.id != null and walletReq.id != ''">
+                and ksw.settlement_id = #{walletReq.id,jdbcType=INTEGER}
+            </if>
+            <if test="walletReq.orderType != null">
+                and ksw.order_type = #{walletReq.orderType,jdbcType=INTEGER}
+            </if>
+            <if test="walletReq.payType != null">
+                and ksw.type = #{walletReq.payType,jdbcType=INTEGER}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 88 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/controller/operation/GoodsManagerController.java

@@ -0,0 +1,88 @@
+package com.sckw.product.controller.operation;
+
+import com.sckw.core.exception.BusinessException;
+import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.excel.utils.ExcelUtil;
+import com.sckw.product.model.GoodsListExport;
+import com.sckw.product.model.OperationGoodsListExport;
+import com.sckw.product.model.vo.req.ExportStatisticGoodsListParam;
+import com.sckw.product.model.vo.req.SelectGoodsListParam;
+import com.sckw.product.model.vo.req.SelectOperationGoodsListParam;
+import com.sckw.product.model.vo.req.StatisticGoodsListParam;
+import com.sckw.product.service.KwpGoodsService;
+import com.sckw.product.service.operation.GoodsManagerService;
+import com.sckw.product.service.KwpGoodsService;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @desc: TODO
+ * @author: yzc
+ * @date: 2023-09-14 9:13
+ */
+
+@RestController
+@RequestMapping(value = "/goodsManager")
+@RequiredArgsConstructor
+public class GoodsManagerController {
+
+    private final GoodsManagerService goodsManagerService;
+    private final KwpGoodsService kwpGoodsService;
+
+    /**
+     * @desc: 运营端分页查询商品
+     * @author: lt
+     * @date: 2023-09-14 09:43
+     * @Param param:
+     * @return: com.sckw.core.web.response.HttpResult
+     */
+    @PostMapping(value = "/select", produces = MediaType.APPLICATION_JSON_VALUE)
+    public HttpResult select(@RequestBody SelectOperationGoodsListParam params) {
+        return HttpResult.ok(goodsManagerService.select(params));
+    }
+
+    /**
+     * @desc: 运营端商品详情
+     * @author: lt
+     * @date: 2023-09-14 09:43
+     * @Param param:
+     * @return: com.sckw.core.web.response.HttpResult
+     */
+    @GetMapping("/detail")
+    public HttpResult detail(@RequestParam Long id) {
+        return HttpResult.ok(goodsManagerService.getDetail(id));
+    }
+
+    /**
+     * @desc: 运营端商品数量统计
+     * @author: lt
+     * @date: 2023-09-14 09:43
+     * @Param param:
+     * @return: com.sckw.core.web.response.HttpResult
+     */
+    @PostMapping(value = "/statistic", produces = MediaType.APPLICATION_JSON_VALUE)
+    public HttpResult statistic(@RequestBody SelectOperationGoodsListParam params) {
+        return HttpResult.ok(goodsManagerService.statistic(params));
+    }
+
+    /**
+     * @desc: 导出
+     * @author: lt
+     * @date: 2023-09-14 15:00
+     * @Param params:
+     * @return: com.sckw.core.web.response.HttpResult
+     */
+    @PostMapping(value = "/export", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void export(@RequestBody ExportStatisticGoodsListParam params, HttpServletResponse response) {
+        List<OperationGoodsListExport> list = goodsManagerService.export(params);
+        if (CollectionUtils.isEmpty(list)) {
+            throw new BusinessException("导出数据为空!");
+        }
+        ExcelUtil.downData(response, OperationGoodsListExport.class, list);
+    }
+}

+ 97 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/OperationGoodsListExport.java

@@ -0,0 +1,97 @@
+package com.sckw.product.model;
+
+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: 商品列表导出对象
+ * @author: yzc
+ * @date: 2023-07-06 9:15
+ */
+@Data
+@Accessors(chain = true)
+@ExcelContext(fileName = "商品列表信息", sheetName = "商品列表信息")
+public class OperationGoodsListExport{
+
+    @Serial
+    private static final long serialVersionUID = 6833195135537265912L;
+
+    @ExcelProperty(value = "序号" )
+    private String serialNumber;
+
+    @ExcelProperty(value = "上架状态")
+    private String statusLabel;
+
+    @ExcelProperty(value = "商品编号")
+    private String code;
+
+    @ExcelProperty(value = "商品名称")
+    private String name;
+
+    @ExcelProperty(value = "商品类别")
+    private String goodsTypeLabel;
+
+    @ExcelProperty(value = "计量单位")
+    private String unitLabel;
+
+    @ExcelProperty(value = "规格尺寸")
+    private String spec;
+
+    @ExcelProperty(value = "发票税率")
+    private String taxRateLabel;
+
+    @ExcelProperty(value = "库存数量")
+    private String amount;
+
+    @ExcelProperty(value = "是否预付限额")
+    private String prepaidLimitLabel;
+
+    @ExcelProperty(value = "预付款最低限额")
+    private String advancePrice;
+
+    @ExcelProperty(value = "最低单价")
+    private String highestPrice;
+
+    @ExcelProperty(value = "最高单价")
+    private String lowestPrice;
+
+    @ExcelProperty(value = "仓储地址")
+    private String address;
+
+    @ExcelProperty(value = "客户经理")
+    private String manageName;
+
+    @ExcelProperty(value = "联系电话")
+    private String phone;
+
+    @ExcelProperty(value = "上架时间")
+    private String addedTime;
+
+    @ExcelProperty(value = "下架时间")
+    private String shelfTime;
+
+    @ExcelProperty(value = "供应企业")
+    private String supplyEnt;
+
+    @ExcelProperty(value = "创建人")
+    private String createByName;
+
+    @ExcelProperty(value = "创建时间")
+    private String createTime;
+
+    @ExcelProperty(value = "备注")
+    private String remark;
+
+
+
+
+
+
+
+
+}

+ 31 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/req/SelectOperationGoodsListParam.java

@@ -0,0 +1,31 @@
+package com.sckw.product.model.vo.req;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+/**
+ * @desc: 分页查询运营端商品列表请求参数
+ * @author: lt
+ * @date: 2023-09-14 14:01
+ */
+@Getter
+@Setter
+@ToString
+public class SelectOperationGoodsListParam extends StatisticGoodsListParam {
+
+    /**
+     * 当前页码
+     */
+    private int page = 1;
+    /**
+     * 每页数量
+     */
+    private int pageSize = 10;
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+}

+ 24 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/res/OperationGoodsDetail.java

@@ -0,0 +1,24 @@
+package com.sckw.product.model.vo.res;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @desc: 商品详情响应
+ * @author: yzc
+ * @date: 2023-07-05 11:49
+ */
+@Getter
+@Setter
+@ToString
+@Accessors(chain = true)
+public class OperationGoodsDetail extends GoodsDetail{
+
+}

+ 168 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/res/OperationGoodsList.java

@@ -0,0 +1,168 @@
+package com.sckw.product.model.vo.res;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @desc: 运营端商品列表
+ * @author: lt
+ * @date: 2023-09-14 11:54
+ */
+@Getter
+@Setter
+@ToString
+@Accessors(chain = true)
+public class OperationGoodsList{
+
+    /**
+     * 商品id
+     */
+    private Long id;
+
+    /**
+     * 商品编号
+     */
+    private Long code;
+
+
+    /**
+     * 状态:0草稿/1上架/2下架
+     */
+    private Integer status;
+
+    /**
+     * 状态label
+     */
+    private String statusLabel;
+
+    /**
+     * 商品名称
+     */
+    private String name;
+
+    /**
+     * 商品缩略图
+     */
+    private String thumb;
+
+    /**
+     * 商品类型
+     */
+    private String goodsType;
+
+    /**
+     * 商品类型Label
+     */
+    private String goodsTypeLabel;
+
+    /**
+     * 计量单位(吨、方、件、箱、其他)
+     */
+    private String unit;
+
+    /**
+     * 计量单位lab
+     */
+    private String unitLabel;
+
+    /**
+     * 尺寸大小
+     */
+    private String spec;
+
+    /**
+     * 发票税率(%)
+     */
+    private String taxRate;
+
+    /**
+     * 发票税率label
+     */
+    private String taxRateLabel;
+
+    /**
+     * 库存数量
+     */
+    private BigDecimal amount;
+
+    /**
+     * 是否设置预付限额0否1是
+     */
+    private Integer prepaidLimit;
+
+    /**
+     * 是否设置预付限额label
+     */
+    private String prepaidLimitLabel;
+
+    /**
+     * 预付款最低限额
+     */
+    private BigDecimal advancePrice;
+
+    /**
+     * 最高单价
+     */
+    private BigDecimal highestPrice;
+
+    /**
+     * 最低单价
+     */
+    private BigDecimal lowestPrice;
+
+    /**
+     * 仓储地址
+     */
+    private String address;
+
+    /**
+     * 客户经理
+     */
+    private String manageName;
+
+    /**
+     * 联系电话
+     */
+    private String phone;
+
+    /**
+     * 上架时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date addedTime;
+
+    /**
+     * 下架时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date shelfTime;
+
+    /**
+     * 供应企业
+     */
+    private String supplyEnt;
+
+    /**
+     * 创建人
+     */
+    private String createByName;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+}

+ 318 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/service/operation/GoodsManagerService.java

@@ -0,0 +1,318 @@
+package com.sckw.product.service.operation;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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.model.page.PageResult;
+import com.sckw.core.model.vo.TableBottom;
+import com.sckw.core.model.vo.TableStatisticRes;
+import com.sckw.core.model.vo.TableTop;
+import com.sckw.core.utils.*;
+import com.sckw.excel.utils.DateUtil;
+import com.sckw.payment.api.dubbo.PayCenterDubboService;
+import com.sckw.product.dao.KwpGoodsMapper;
+import com.sckw.product.enums.GoodsStatusEnum;
+import com.sckw.product.model.*;
+import com.sckw.product.model.vo.req.*;
+import com.sckw.product.model.vo.res.*;
+import com.sckw.product.service.*;
+import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.RemoteUserService;
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
+import com.sckw.system.api.model.dto.res.KwsUserResDto;
+import com.sckw.system.api.model.dto.res.SysDictResDto;
+import com.sckw.system.api.model.dto.res.UserCacheResDto;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cloud.stream.function.StreamBridge;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+
+/**
+ * @desc: 商品service
+ * @author: yzc
+ * @date: 2023-06-25 14:47
+ */
+@Service
+@Slf4j
+@RequiredArgsConstructor
+public class GoodsManagerService {
+
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
+
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteUserService remoteUserService;
+
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private PayCenterDubboService payCenterDubboService;
+
+    private final KwpGoodsMapper kwpGoodsMapper;
+    private final KwpGoodsAddressService kwpGoodsAddressService;
+    private final KwpGoodsAttributeService kwpGoodsAttributeService;
+    private final KwpGoodsImageService kwpGoodsImageService;
+    private final KwpGoodsPriceRangeService kwpGoodsPriceRangeService;
+    private final StreamBridge streamBridge;
+
+    @Value("${goods.url.list}")
+    private String goodsListUrl;
+
+
+    public PageResult select(SelectOperationGoodsListParam params) {
+        LambdaQueryWrapper<KwpGoods> wrapper = buildWrapper(BeanUtils.copyProperties(params, ExportStatisticGoodsListParam.class));
+        Page<KwpGoods> page = new Page<>(params.getPage(), params.getPageSize());
+        IPage<KwpGoods> goodsIpage = kwpGoodsMapper.selectPage(page, wrapper);
+        List<KwpGoods> list = goodsIpage.getRecords();
+        if (CollectionUtils.isEmpty(list)) {
+            return PageResult.build(params.getPage(), params.getPageSize(), goodsIpage.getTotal(), Collections.emptyList());
+        }
+        List<OperationGoodsList> result = buildGoodLists(list);
+        return PageResult.build(params.getPage(), params.getPageSize(), goodsIpage.getTotal(), result);
+    }
+
+
+    /**
+     * @desc: 构建查询条件
+     * @author: lt
+     * @date: 2023-09-14 10:14
+     * @Param list:
+     * @return: java.util.List<com.sckw.product.model.vo.res.GoodsList>
+     */
+    private LambdaQueryWrapper<KwpGoods> buildWrapper(ExportStatisticGoodsListParam params) {
+        LambdaQueryWrapper<KwpGoods> wrapper = new LambdaQueryWrapper<>();
+        if (StringUtils.isNotBlank(params.getIds())) {
+            List<Long> ids = StringUtils.splitStrToList(params.getIds(), ",", Long.class);
+            wrapper.in(KwpGoods::getId, ids);
+        } else {
+            if (Objects.nonNull(params.getEndCreateTime())) {
+                wrapper.ge(KwpGoods::getCreateTime, params.getStartCreateTime());
+            }
+            if (Objects.nonNull(params.getEndCreateTime())) {
+                wrapper.le(KwpGoods::getCreateTime, params.getEndCreateTime());
+            }
+            //运营端不需要显示草稿数据
+            wrapper.ne(KwpGoods::getStatus, 0);
+            wrapper.eq(Objects.nonNull(params.getSupplyEntId()), KwpGoods::getSupplyEntId, params.getSupplyEntId())
+                    .eq(Objects.nonNull(params.getPrepaidLimit()), KwpGoods::getPrepaidLimit, params.getPrepaidLimit())
+                    .eq(Objects.nonNull(params.getStatus()), KwpGoods::getStatus, params.getStatus());
+            if (StringUtils.isNotBlank(params.getGoodsType()) && StringUtils.isNotBlank(params.getGoodsTypeValue())) {
+                List<SysDictResDto> goodsTypeList = remoteSystemService.queryDictBottom(params.getGoodsType(), params.getGoodsTypeValue());
+                if (CollectionUtils.isNotEmpty(goodsTypeList)) {
+                    List<String> goodsTypes = goodsTypeList.stream().map(SysDictResDto::getValue).toList();
+                    wrapper.in(KwpGoods::getGoodsType, goodsTypes);
+                }
+            }
+            String keywords = params.getKeywords();
+            if (StringUtils.isNotBlank(keywords)) {
+                //模糊匹配商品名称、仓储地址、客户经理
+                List<KwsUserResDto> managers = remoteUserService.getUserByName(keywords);
+                if (CollectionUtils.isEmpty(managers)) {
+                    wrapper.and(e -> e.like(KwpGoods::getName, keywords).or().like(KwpGoods::getAddressName, keywords));
+                } else {
+                    List<Long> managerIds = managers.stream().map(KwsUserResDto::getId).toList();
+                    wrapper.and(e -> e.like(KwpGoods::getName, keywords).or().like(KwpGoods::getAddressName, keywords)
+                            .or().in(KwpGoods::getManager, managerIds));
+                }
+            }
+        }
+        wrapper.eq(KwpGoods::getDelFlag, Global.NO).orderByDesc(KwpGoods::getCreateTime);
+        return wrapper;
+    }
+
+    /**
+     * @desc: 构建商品列表
+     * @author: lt
+     * @date: 2023-09-14 10:14
+     * @Param list:
+     * @return: java.util.List<com.sckw.product.model.vo.res.GoodsList>
+     */
+    private List<OperationGoodsList> buildGoodLists(List<KwpGoods> list) {
+        List<OperationGoodsList> result = new ArrayList<>(list.size());
+        List<Long> goodsIds = new ArrayList<>(list.size());
+        List<Long> supplyEntIds = new ArrayList<>(list.size());
+        List<Long> userIds = new ArrayList<>();
+        list.forEach(e -> {
+            goodsIds.add(e.getId());
+            if (Objects.nonNull(e.getSupplyEntId())) {
+                supplyEntIds.add(e.getSupplyEntId());
+            }
+            if (Objects.nonNull(e.getManager())) {
+                userIds.add(e.getManager());
+            }
+            if (Objects.nonNull(e.getCreateBy())) {
+                userIds.add(e.getCreateBy());
+            }
+        });
+        //地址信息
+        Map<Long, String> addressMap = kwpGoodsAddressService.getByGoodsIds(goodsIds).stream()
+                .collect(Collectors.toMap(KwpGoodsAddress::getGoodsId, KwpGoodsAddress::getName, (k1, k2) -> k1));
+        //价格梯度信息
+        Map<Long, List<KwpGoodsPriceRange>> priceRangeMap = kwpGoodsPriceRangeService.getByGoodsIds(goodsIds).stream()
+                .collect(Collectors.groupingBy(KwpGoodsPriceRange::getGoodsId));
+        //用户信息
+        Map<Long, UserCacheResDto> userMap = remoteSystemService.queryUserCacheMapByIds(userIds);
+        //供应企业信息
+        List<EntCacheResDto> entList = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(supplyEntIds)) {
+            entList = remoteSystemService.queryEntCacheByIds(supplyEntIds);
+        }
+        Map<Long, String> entMap = entList.stream().collect(Collectors.toMap(EntCacheResDto::getId, EntCacheResDto::getFirmName, (k1, k2) -> k1));
+        list.forEach(e -> {
+            Long id = e.getId();
+            OperationGoodsList operationGoodsList = BeanUtils.copyProperties(e, OperationGoodsList.class);
+            UserCacheResDto manager = userMap.get(e.getManager());
+            UserCacheResDto createUser = userMap.get(e.getCreateBy());
+            operationGoodsList.setStatusLabel(DictEnum.getLabel(DictTypeEnum.GOODS_STATUS.getType(), String.valueOf(operationGoodsList.getStatus())))
+                    .setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), operationGoodsList.getGoodsType()))
+                    .setUnitLabel(DictEnum.getLabel(DictTypeEnum.UNIT_TYPE.getType(), operationGoodsList.getUnit()))
+                    .setTaxRateLabel(DictEnum.getLabel(DictTypeEnum.TAX_RATE.getType(), operationGoodsList.getTaxRate()))
+                    .setPrepaidLimitLabel(Objects.equals(e.getPrepaidLimit(), 1) ? "是" : "否")
+                    .setAddress(addressMap.get(id)).setSupplyEnt(entMap.get(e.getSupplyEntId()))
+                    .setManageName(Objects.nonNull(manager) ? manager.getName() : null)
+                    .setPhone(Objects.nonNull(manager) ? manager.getPhone() : null)
+                    .setCreateByName(Objects.nonNull(createUser) ? createUser.getName() : null);
+            List<KwpGoodsPriceRange> priceRanges = priceRangeMap.get(id);
+            if (CollectionUtils.isNotEmpty(priceRanges)) {
+                operationGoodsList.setHighestPrice(priceRanges.get(priceRanges.size() - 1).getPrice()).setLowestPrice(priceRanges.get(0).getPrice());
+            }
+            result.add(operationGoodsList);
+        });
+        return result;
+    }
+
+    /**
+     * @desc: 获取商品详情
+     * @author: lt
+     * @date: 2023-09-14 14:20
+     * @Param id:
+     * @return: com.sckw.product.model.vo.res.GoodsDetail
+     */
+    public OperationGoodsDetail getDetail(Long id) {
+        KwpGoods goods = kwpGoodsMapper.selectById(id);
+        if (Objects.isNull(goods)) {
+            throw new BusinessException("当前商品不存在!");
+        }
+        OperationGoodsDetail detail = BeanUtils.copyProperties(goods, OperationGoodsDetail.class);
+        Map<Long, EntCacheResDto> entMap = remoteSystemService.queryEntCacheMapByIds(Arrays.asList(detail.getEntId(), detail.getSupplyEntId()));
+        EntCacheResDto ent = entMap.get(detail.getEntId());
+        if (Objects.nonNull(ent)) {
+            detail.setEnt(ent.getFirmName()).setEntHead(ent.getHead())
+                    .setEntBusiness(ent.getBusiness()).setEntAddress(ent.getCityName());
+        }
+        EntCacheResDto supplyEnt = entMap.get(detail.getSupplyEntId());
+        if (Objects.nonNull(supplyEnt)) {
+            detail.setSupplyEnt(supplyEnt.getFirmName());
+        }
+        UserCacheResDto managerInfo = remoteSystemService.queryUserCacheById(detail.getManager());
+        if (Objects.nonNull(managerInfo)) {
+            detail.setManagerName(managerInfo.getName()).setManagerPhone(managerInfo.getPhone());
+        }
+        detail.setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), detail.getGoodsType()))
+                .setUnitLabel(DictEnum.getLabel(DictTypeEnum.UNIT_TYPE.getType(), detail.getUnit()))
+                .setTaxRateLabel(DictEnum.getLabel(DictTypeEnum.TAX_RATE.getType(), detail.getTaxRate()))
+                .setStatusLabel(DictEnum.getLabel(DictTypeEnum.GOODS_STATUS.getType(), String.valueOf(detail.getStatus())))
+                .setPrepaidLimitLabel(Objects.equals(detail.getPrepaidLimit(), 1) ? "是" : "否");
+        //商品图片信息
+        List<KwpGoodsImage> goodsImages = kwpGoodsImageService.getByGoodsId(id);
+        List<GoodsImagesDetail> images = BeanUtils.copyToList(goodsImages, GoodsImagesDetail.class);
+        //商品价格段信息
+        List<KwpGoodsPriceRange> priceRanges = kwpGoodsPriceRangeService.getByGoodsId(id);
+        List<GoodsPriceRangesDetail> ranges = BeanUtils.copyToList(priceRanges, GoodsPriceRangesDetail.class);
+        ranges.stream().filter(r -> r.getEndAmount().compareTo(new BigDecimal("-1.00")) == 0)
+                .forEach(r -> {
+                    r.setEndAmountLabel("不限");
+                });
+        //商品属性信息
+        List<KwpGoodsAttribute> attributesList = kwpGoodsAttributeService.getByGoodsId(id);
+        List<GoodsAttributesDetail> attributes = BeanUtils.copyToList(attributesList, GoodsAttributesDetail.class);
+        //商品地址信息
+        KwpGoodsAddress goodsAddress = kwpGoodsAddressService.getByGoodsId(id);
+        AddressInfoDetail addressInfo = BeanUtils.copyProperties(goodsAddress, AddressInfoDetail.class);
+        if (Objects.nonNull(addressInfo)) {
+            addressInfo.setTypeName(DictEnum.getLabel(DictTypeEnum.ADDRESS_TYPE.getType(), addressInfo.getType()));
+        }
+        detail.setImages(images).setPriceRanges(ranges).setAttributes(attributes).setAddressInfo(addressInfo);
+
+        return detail;
+    }
+
+    /**
+     * @desc: 统计查询
+     * @author: lt
+     * @date: 2023-09-14 14:44
+     * @Param params:
+     * @return: com.sckw.core.model.vo.TableStatisticRes
+     */
+    public TableStatisticRes statistic(SelectOperationGoodsListParam params) {
+        TableStatisticRes res = new TableStatisticRes();
+        LambdaQueryWrapper<KwpGoods> wrapper = buildWrapper(BeanUtils.copyProperties(params, ExportStatisticGoodsListParam.class));
+        List<KwpGoods> goodsList = kwpGoodsMapper.selectList(wrapper);
+        Map<Integer, List<KwpGoods>> map = goodsList.stream().collect(Collectors.groupingBy(KwpGoods::getStatus));
+        List<TableTop> tableTops = new ArrayList<>();
+        TableTop all = new TableTop();
+        all.setName("全部").setTotal(CollectionUtils.isEmpty(goodsList) ? 0 : goodsList.size());
+        tableTops.add(all);
+        GoodsStatusEnum.getSortList().forEach(e -> {
+            List<KwpGoods> list = map.get(e.getCode());
+            int total = CollectionUtils.isEmpty(list) ? 0 : list.size();
+            TableTop tableTop = new TableTop();
+            tableTop.setName(e.getMsg()).setValue(e.getCode()).setTotal(total);
+            tableTops.add(tableTop);
+        });
+        TableBottom tableBottom = new TableBottom();
+        tableBottom.setTotal(CollectionUtils.isEmpty(goodsList) ? 0 : goodsList.size());
+        List<TableTop> filteredTableTops = tableTops.stream()
+                .filter(tableTop -> !tableTop.getName().equals("已保存"))
+                .collect(Collectors.toList());
+        res.setTableTops(filteredTableTops).setTableBottom(tableBottom);
+        return res;
+    }
+
+    /**
+     * @desc: 导出
+     * @author: lt
+     * @date: 2023-09-14 17:56
+     * @Param params:
+     * @return: void
+     */
+    public List<OperationGoodsListExport> export(ExportStatisticGoodsListParam params) {
+        LambdaQueryWrapper<KwpGoods> wrapper = buildWrapper(params);
+        List<KwpGoods> list = kwpGoodsMapper.selectList(wrapper);
+        List<OperationGoodsList> goodsLists = buildGoodLists(list);
+        if (CollectionUtils.isEmpty(goodsLists)) {
+            return Collections.emptyList();
+        }
+        List<OperationGoodsListExport> result = new ArrayList<>();
+        AtomicInteger i = new AtomicInteger(1);
+        goodsLists.forEach(e -> {
+            OperationGoodsListExport export = BeanUtils.copyProperties(e, OperationGoodsListExport.class);
+            export.setSerialNumber(String.valueOf(i.getAndIncrement()))
+                    .setAmount(Objects.isNull(e.getAmount()) ? null : String.valueOf(e.getAmount()))
+                    .setHighestPrice(Objects.isNull(e.getHighestPrice()) ? null : String.valueOf(e.getHighestPrice()))
+                    .setLowestPrice(Objects.isNull(e.getLowestPrice()) ? null : String.valueOf(e.getLowestPrice()))
+                    .setAddedTime(Objects.isNull(e.getAddedTime()) ? null : DateUtil.getDateTime(e.getAddedTime()))
+                    .setShelfTime(Objects.isNull(e.getShelfTime()) ? null : DateUtil.getDateTime(e.getShelfTime()))
+                    .setCreateTime(Objects.isNull(e.getCreateTime()) ? null : DateUtil.getDateTime(e.getCreateTime()));
+            result.add(export);
+        });
+        return result;
+    }
+
+
+
+
+
+
+
+
+}

+ 87 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/operator/TradeOrderManageController.java

@@ -0,0 +1,87 @@
+package com.sckw.report.controller.operator;
+
+import com.sckw.core.exception.BusinessException;
+import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.excel.utils.ExcelUtil;
+import com.sckw.report.model.vo.OperatorTOrderContractParam;
+import com.sckw.report.model.vo.OperatorTOrderExportQueryVO;
+import com.sckw.report.model.vo.OperatorTOrderListQueryVO;
+import com.sckw.report.model.vo.OperatorTOrderStsQueryVO;
+import com.sckw.report.service.operator.TradeOrderManageService;
+import com.sckw.report.service.param.TradeOrderListExport;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.AllArgsConstructor;
+import org.springframework.http.MediaType;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @desc: 运营端贸易订单管理相关接口
+ * @author: yzc
+ * @date: 2023-09-14 11:21
+ */
+@AllArgsConstructor
+@RestController
+@RequestMapping("/kwOrderManage")
+public class TradeOrderManageController {
+
+    private final TradeOrderManageService tradeOrderManageService;
+
+
+    /**
+     * @desc: 贸易订单列表分页查询
+     * @author: yzc
+     * @date: 2023-07-17 10:29
+     * @Param params:
+     * @return: com.sckw.core.web.response.HttpResult
+     */
+    @PostMapping(value = "/listPaging", produces = MediaType.APPLICATION_JSON_VALUE)
+    public HttpResult listPaging(@RequestBody @Validated OperatorTOrderListQueryVO params) {
+        return HttpResult.ok(tradeOrderManageService.listPaging(params));
+    }
+
+    /**
+     * @desc: 贸易订单列表统计查询
+     * @author: yzc
+     * @date: 2023-07-17 10:29
+     * @Param params:
+     * @return: com.sckw.core.web.response.HttpResult
+     */
+    @PostMapping(value = "/listStatistic", produces = MediaType.APPLICATION_JSON_VALUE)
+    public HttpResult listStatistic(@RequestBody @Validated OperatorTOrderStsQueryVO params) {
+        return HttpResult.ok(tradeOrderManageService.listStatistic(params));
+    }
+
+    /**
+     * @desc: 贸易订单列表导出
+     * @author: yzc
+     * @date: 2023-09-14 14:40
+     * @Param params:
+     * @Param response:
+     * @return: void
+     */
+    @PostMapping(value = "/listExport", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void listExport(@RequestBody @Validated OperatorTOrderExportQueryVO params, HttpServletResponse response) {
+        List<TradeOrderListExport> list = tradeOrderManageService.export(params);
+        if (CollectionUtils.isEmpty(list)) {
+            throw new BusinessException("导出数据为空!");
+        }
+        ExcelUtil.downData(response, TradeOrderListExport.class, list);
+    }
+
+    /**
+     * @desc: 合同关联订单列表
+     * @author: yzc
+     * @date: 2023-09-14 14:51
+     * @Param params:
+     * @return: com.sckw.core.web.response.HttpResult
+     */
+    @PostMapping(value = "/contractAssociationList", produces = MediaType.APPLICATION_JSON_VALUE)
+    public HttpResult contractAssociationList(@RequestBody @Validated OperatorTOrderContractParam params) {
+        return HttpResult.ok(tradeOrderManageService.contractAssociationList(params));
+    }
+
+}

+ 86 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/model/dto/OperatorTOrderListStsConditionDTO.java

@@ -0,0 +1,86 @@
+package com.sckw.report.model.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @desc: 运营端贸易订单列表统计查询条件dto
+ * @author: yzc
+ * @date: 2023-09-14 11:33
+ */
+@Getter
+@Setter
+@ToString
+public class OperatorTOrderListStsConditionDTO implements Serializable {
+    @Serial
+    private static final long serialVersionUID = 1352493248166762988L;
+
+
+    /**
+     * 订单编号、单位、商品名称(模糊匹配共用)
+     */
+    private String keywords;
+    /**
+     * 创建时间开始(yyyy-MM-dd HH:mm:ss)
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date startCreateTime;
+
+    /**
+     * 创建时间结束(yyyy-MM-dd HH:mm:ss)
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endCreateTime;
+
+    /**
+     * 装货地址code
+     */
+    private String shippingAddressCode;
+
+    /**
+     * 装货地址等级
+     */
+    private Integer shippingAddressLevel;
+
+    /**
+     * 装货地址code
+     */
+    private String unloadingAddressCode;
+
+    /**
+     * 卸货地址等级
+     */
+    private Integer unloadingAddressLevel;
+
+    /**
+     * 交易方式(预付款、货到付款)
+     */
+    private String trading;
+
+    /**
+     * 提货方式(采方自提、供应配送)
+     */
+    private String pickupType;
+
+    /**
+     * 交付类型(签发交付、签收交付)
+     */
+    private String deliveryType;
+
+    /**
+     * 下单方式(1采购下单/2代客下单)
+     */
+    private String source;
+
+    /**
+     * 订单状态
+     */
+    private Integer status;
+
+}

+ 22 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/model/vo/OperatorTOrderContractParam.java

@@ -0,0 +1,22 @@
+package com.sckw.report.model.vo;
+
+import com.sckw.core.model.page.PageRequest;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+/**
+ * @desc: 合同关联订单列表请求参数
+ * @author: yzc
+ * @date: 2023-07-27 16:48
+ */
+@Getter
+@Setter
+@ToString
+public class OperatorTOrderContractParam extends PageRequest {
+
+    @NotBlank(message = "合同ids不能为空")
+    private String contractIds;
+
+}

+ 35 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/model/vo/OperatorTOrderExportQueryVO.java

@@ -0,0 +1,35 @@
+package com.sckw.report.model.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.hibernate.validator.constraints.Range;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @desc: 运营端贸易订单列表导出查询参数vo
+ * @author: yzc
+ * @date: 2023-09-14 11:33
+ */
+@Getter
+@Setter
+@ToString
+public class OperatorTOrderExportQueryVO extends OperatorTOrderStsQueryVO implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 3904961009951552659L;
+
+    /**
+     * 订单状态
+     */
+    @Range(min = 1, max = 7, message = "非法订单状态")
+    private Integer status;
+
+    /**
+     * 订单ids
+     */
+    private String ids;
+
+}

+ 39 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/model/vo/OperatorTOrderListQueryVO.java

@@ -0,0 +1,39 @@
+package com.sckw.report.model.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.hibernate.validator.constraints.Range;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @desc: 运营端贸易订单列表分页查询参数vo
+ * @author: yzc
+ * @date: 2023-09-14 11:33
+ */
+@Getter
+@Setter
+@ToString
+public class OperatorTOrderListQueryVO extends OperatorTOrderStsQueryVO implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 3904961009951552659L;
+
+    /**
+     * 当前页码
+     */
+    private int page = 1;
+    /**
+     * 每页数量
+     */
+    private int pageSize = 10;
+
+    /**
+     * 订单状态
+     */
+    @Range(min = 1, max = 7, message = "非法订单状态")
+    private Integer status;
+
+}

+ 81 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/model/vo/OperatorTOrderStsQueryVO.java

@@ -0,0 +1,81 @@
+package com.sckw.report.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @desc: 运营端贸易订单统计查询参数vo
+ * @author: yzc
+ * @date: 2023-09-14 11:33
+ */
+@Getter
+@Setter
+@ToString
+public class OperatorTOrderStsQueryVO implements Serializable {
+    @Serial
+    private static final long serialVersionUID = 1352493248166762988L;
+
+
+    /**
+     * 订单编号、单位、商品名称(模糊匹配共用)
+     */
+    private String keywords;
+    /**
+     * 创建时间开始(yyyy-MM-dd HH:mm:ss)
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date startCreateTime;
+
+    /**
+     * 创建时间结束(yyyy-MM-dd HH:mm:ss)
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endCreateTime;
+
+    /**
+     * 装货地址code
+     */
+    private String shippingAddressCode;
+
+    /**
+     * 装货地址等级
+     */
+    private Integer shippingAddressLevel;
+
+    /**
+     * 装货地址code
+     */
+    private String unloadingAddressCode;
+
+    /**
+     * 卸货地址等级
+     */
+    private Integer unloadingAddressLevel;
+
+    /**
+     * 交易方式(预付款、货到付款)
+     */
+    private String trading;
+
+    /**
+     * 提货方式(采方自提、供应配送)
+     */
+    private String pickupType;
+
+    /**
+     * 交付类型(签发交付、签收交付)
+     */
+    private String deliveryType;
+
+    /**
+     * 下单方式(1采购下单/2代客下单)
+     */
+    private String source;
+
+}

+ 43 - 9
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwOrderService.java

@@ -81,7 +81,7 @@ public class KwOrderService {
      * @Param pageSize:
      * @return: com.sckw.core.model.page.PageResult
      */
-    private PageResult getResult(Criteria criteria, int page, int pageSize) {
+    public PageResult getResult(Criteria criteria, Integer page, Integer pageSize) {
         Query query = new Query();
         query.addCriteria(criteria);
         long count = mongoTemplate.count(query, SckwTradeOrder.class);
@@ -254,8 +254,20 @@ public class KwOrderService {
      * @return: com.sckw.core.model.vo.TableStatisticRes
      */
     public TableStatisticRes tradeOrderStatistic(TradeOrderListStatisticParam params) {
-        TableStatisticRes res = new TableStatisticRes();
         Criteria criteria = buildCriteria(params, true);
+        return getTableStatistic(criteria, DictEnum.getEnumsByType(DictTypeEnum.TORDER_STATUS.getType()));
+    }
+
+    /**
+     * @desc: 列表统计
+     * @author: yzc
+     * @date: 2023-09-14 14:18
+     * @Param criteria:
+     * @Param enums:
+     * @return: com.sckw.core.model.vo.TableStatisticRes
+     */
+    public TableStatisticRes getTableStatistic(Criteria criteria, List<DictEnum> enums) {
+        TableStatisticRes res = new TableStatisticRes();
         Aggregation aggregation = Aggregation.newAggregation(
                 Aggregation.match(criteria),
                 Aggregation.group("status").count().as("total"),
@@ -270,9 +282,8 @@ public class KwOrderService {
                     (TableTop::getValue, TableTop::getTotal, (k1, k2) -> k2));
         }
         List<TableTop> list = new ArrayList<>();
-        List<DictEnum> tOrderStatusEnums = DictEnum.getEnumsByType(DictTypeEnum.TORDER_STATUS.getType());
         int count = 0;
-        for (DictEnum e : tOrderStatusEnums) {
+        for (DictEnum e : enums) {
             Integer value = Integer.valueOf(e.getValue());
             int total = Objects.isNull(map.get(value)) ? 0 : map.get(value);
             TableTop tableTop = new TableTop();
@@ -282,7 +293,7 @@ public class KwOrderService {
         }
         TableTop all = new TableTop();
         all.setName("全部").setTotal(count);
-        list.add(all);
+        list.add(0, all);
         TableBottom tableBottom = new TableBottom();
         tableBottom.setTotal(count);
         res.setTableTops(list).setTableBottom(tableBottom);
@@ -334,7 +345,6 @@ public class KwOrderService {
      * @Param params:
      * @return: java.util.List<com.sckw.report.service.param.TradeOrderListExport>
      */
-
     public List<TradeOrderListExport> export(TradeOrderListExportParam params) {
         Query query = new Query();
         if (StringUtils.isNotBlank(params.getIds())) {
@@ -348,6 +358,17 @@ public class KwOrderService {
             query.addCriteria(buildCriteria(params, false));
         }
         query.with(Sort.by(Sort.Order.desc("createTime")));
+        return getExportResult(query);
+    }
+
+    /**
+     * @desc: 获取导出结果
+     * @author: yzc
+     * @date: 2023-09-14 14:41
+     * @Param query:
+     * @return: java.util.List<com.sckw.report.service.param.TradeOrderListExport>
+     */
+    public List<TradeOrderListExport> getExportResult(Query query) {
         List<SckwTradeOrder> orders = mongoTemplate.find(query, SckwTradeOrder.class);
         if (CollectionUtils.isEmpty(orders)) {
             return Collections.emptyList();
@@ -438,15 +459,28 @@ public class KwOrderService {
      */
     public PageResult tradeOrderContractList(TradeOrderContractParam params) {
         Long entId = LoginUserHolder.getEntId();
-        Query query = new Query();
         Criteria criteria = new Criteria();
         String topEnt = Objects.equals(params.getOrderType(), 1) ? "procureTopEntId" : "supplyTopEntId";
         List<Long> ids = StringUtils.splitStrToList(params.getContractIds(), ",", Long.class);
         criteria.and("contractId").in(ids).and(topEnt).is(entId).and("delFlag").is(0);
+        return getContractResult(criteria, params.getPage(), params.getPageSize());
+    }
+
+    /**
+     * @desc: 获取关联合同结果
+     * @author: yzc
+     * @date: 2023-09-14 14:58
+     * @Param criteria:
+     * @Param page:
+     * @Param pageSize:
+     * @return: com.sckw.core.model.page.PageResult
+     */
+    public PageResult getContractResult(Criteria criteria, Integer page, Integer pageSize) {
+        Query query = new Query();
         query.addCriteria(criteria);
         long count = mongoTemplate.count(query, SckwTradeOrder.class);
         Sort sort = Sort.by(Sort.Direction.DESC, "contractId", "createTime");
-        SpringDataPageAble pageAble = new SpringDataPageAble(params.getPage(), params.getPageSize(), sort);
+        SpringDataPageAble pageAble = new SpringDataPageAble(page, pageSize, sort);
         query.with(pageAble);
         List<SckwTradeOrder> list = mongoTemplate.find(query, SckwTradeOrder.class);
         List<OrderListRes> result = new ArrayList<>();
@@ -469,6 +503,6 @@ public class KwOrderService {
                     .setSourceLabel(DictEnum.getLabel(DictTypeEnum.TORDER_SOURCE.getType(), e.getSource()));
             result.add(order);
         });
-        return PageResult.build(params.getPage(), params.getPageSize(), count, result);
+        return PageResult.build(page, pageSize, count, result);
     }
 }

+ 174 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/operator/TradeOrderManageService.java

@@ -0,0 +1,174 @@
+package com.sckw.report.service.operator;
+
+import com.sckw.core.common.enums.enums.DictEnum;
+import com.sckw.core.common.enums.enums.DictTypeEnum;
+import com.sckw.core.model.page.PageResult;
+import com.sckw.core.model.vo.TableStatisticRes;
+import com.sckw.core.utils.BeanUtils;
+import com.sckw.core.utils.StringUtils;
+import com.sckw.report.model.dto.OperatorTOrderListStsConditionDTO;
+import com.sckw.report.model.vo.OperatorTOrderContractParam;
+import com.sckw.report.model.vo.OperatorTOrderExportQueryVO;
+import com.sckw.report.model.vo.OperatorTOrderListQueryVO;
+import com.sckw.report.model.vo.OperatorTOrderStsQueryVO;
+import com.sckw.report.service.KwOrderService;
+import com.sckw.report.service.param.TradeOrderListExport;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.mongodb.core.query.Criteria;
+import org.springframework.data.mongodb.core.query.Query;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.regex.Pattern;
+
+/**
+ * @desc: 运营端贸易订单管理相关service
+ * @author: yzc
+ * @date: 2023-09-14 11:23
+ */
+@Service
+@Slf4j
+@AllArgsConstructor
+public class TradeOrderManageService {
+
+    private final KwOrderService kwOrderService;
+
+
+    /**
+     * @desc: 贸易订单列表分页查询
+     * @author: yzc
+     * @date: 2023-09-14 14:24
+     * @Param params:
+     * @return: com.sckw.core.model.page.PageResult
+     */
+    public PageResult listPaging(OperatorTOrderListQueryVO params) {
+        Criteria criteria = buildCriteria(BeanUtils.copyProperties(params, OperatorTOrderListStsConditionDTO.class), false);
+        return kwOrderService.getResult(criteria, params.getPage(), params.getPageSize());
+    }
+
+    /**
+     * @desc: 贸易订单列表统计查询
+     * @author: yzc
+     * @date: 2023-09-14 14:22
+     * @Param params:
+     * @return: com.sckw.core.model.vo.TableStatisticRes
+     */
+    public TableStatisticRes listStatistic(OperatorTOrderStsQueryVO params) {
+        Criteria criteria = buildCriteria(BeanUtils.copyProperties(params, OperatorTOrderListStsConditionDTO.class), true);
+        List<DictEnum> enums = DictEnum.getEnumsByType(DictTypeEnum.TORDER_STATUS.getType());
+        enums.remove(0);
+        return kwOrderService.getTableStatistic(criteria, enums);
+    }
+
+    /**
+     * @desc: 贸易订单列表导出
+     * @author: yzc
+     * @date: 2023-09-14 14:40
+     * @Param params:
+     * @return: java.util.List<com.sckw.report.service.param.TradeOrderListExport>
+     */
+    public List<TradeOrderListExport> export(OperatorTOrderExportQueryVO params) {
+        Query query = new Query();
+        if (StringUtils.isNotBlank(params.getIds())) {
+            List<Long> ids = StringUtils.splitStrToList(params.getIds(), ",", Long.class);
+            Criteria criteria = new Criteria();
+            criteria.and("_id").in(ids).and("delFlag").is(0);
+            query.addCriteria(criteria);
+        } else {
+            query.addCriteria(buildCriteria(BeanUtils.copyProperties(params, OperatorTOrderListStsConditionDTO.class), false));
+        }
+        query.with(Sort.by(Sort.Order.desc("createTime")));
+        return kwOrderService.getExportResult(query);
+    }
+
+    /**
+     * @desc: 构建Criteria
+     * @author: yzc
+     * @date: 2023-09-14 14:25
+     * @Param params:
+     * @Param isStatistic:
+     * @return: org.springframework.data.mongodb.core.query.Criteria
+     */
+    private Criteria buildCriteria(OperatorTOrderListStsConditionDTO params, boolean isStatistic) {
+        Criteria condition = new Criteria();
+        condition.and("delFlag").is(0);
+        //状态
+        if (!isStatistic && Objects.nonNull(params.getStatus())) {
+            condition.and("status").is(params.getStatus());
+        } else {
+            condition.and("status").ne(0);
+        }
+        //装货地址
+        String loadCode = params.getShippingAddressCode();
+        if (StringUtils.isNotBlank(loadCode)) {
+            switch (params.getShippingAddressLevel()) {
+                case 1 -> condition.and("loadCityCode")
+                        .regex(Pattern.compile("^" + loadCode.substring(0, 2) + ".*$", Pattern.CASE_INSENSITIVE));
+                case 2 -> condition.and("loadCityCode")
+                        .regex(Pattern.compile("^" + loadCode.substring(0, 4) + ".*$", Pattern.CASE_INSENSITIVE));
+                case 3 -> condition.and("loadCityCode").is(loadCode);
+            }
+        }
+        //卸货地址
+        String unloadCode = params.getUnloadingAddressCode();
+        if (StringUtils.isNotBlank(unloadCode)) {
+            switch (params.getUnloadingAddressLevel()) {
+                case 1 -> condition.and("unloadCityCode")
+                        .regex(Pattern.compile("^" + unloadCode.substring(0, 2) + ".*$", Pattern.CASE_INSENSITIVE));
+                case 2 -> condition.and("unloadCityCode")
+                        .regex(Pattern.compile("^" + unloadCode.substring(0, 4) + ".*$", Pattern.CASE_INSENSITIVE));
+                case 3 -> condition.and("unloadCityCode").is(unloadCode);
+            }
+        }
+        //提货方式
+        if (StringUtils.isNotBlank(params.getPickupType())) {
+            condition.and("pickupType").is(params.getPickupType());
+        }
+        //交易方式
+        if (StringUtils.isNotBlank(params.getTrading())) {
+            condition.and("trading").is(params.getTrading());
+        }
+        //交付类型
+        if (StringUtils.isNotBlank(params.getDeliveryType())) {
+            condition.and("deliveryType").is(params.getDeliveryType());
+        }
+        //下单方式
+        if (StringUtils.isNotBlank(params.getSource())) {
+            condition.and("source").is(params.getSource());
+        }
+        //日期范围
+        if (Objects.nonNull(params.getStartCreateTime()) && Objects.nonNull(params.getEndCreateTime())) {
+            condition.and("createTime").gte(params.getStartCreateTime()).lte(params.getEndCreateTime());
+        } else if (Objects.nonNull(params.getStartCreateTime())) {
+            condition.and("createTime").gte(params.getStartCreateTime());
+        } else if (Objects.nonNull(params.getEndCreateTime())) {
+            condition.and("createTime").lte(params.getEndCreateTime());
+        }
+        //关键字模糊匹配
+        if (StringUtils.isNotBlank(params.getKeywords())) {
+            Pattern pattern = Pattern.compile("^.*" + params.getKeywords() + ".*$", Pattern.CASE_INSENSITIVE);
+            Criteria keywordsMatch = new Criteria().orOperator(
+                    Criteria.where("tOrderNo").regex(pattern), Criteria.where("procureFirmName").regex(pattern),
+                    Criteria.where("supplyFirmName").regex(pattern), Criteria.where("goodsName").regex(pattern));
+            condition.andOperator(keywordsMatch);
+        }
+        return condition;
+    }
+
+    /**
+     * @desc: 合同关联订单列表
+     * @author: yzc
+     * @date: 2023-09-14 14:52
+     * @Param params:
+     * @return: com.sckw.core.model.page.PageResult
+     */
+    public PageResult contractAssociationList(OperatorTOrderContractParam params) {
+        Criteria criteria = new Criteria();
+        List<Long> ids = StringUtils.splitStrToList(params.getContractIds(), ",", Long.class);
+        criteria.and("contractId").in(ids).and("delFlag").is(0);
+        return kwOrderService.getContractResult(criteria, params.getPage(), params.getPageSize());
+    }
+}

+ 0 - 1
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/param/WaybillOrderListExport.java

@@ -1,7 +1,6 @@
 package com.sckw.report.service.param;
 
 import com.alibaba.excel.annotation.ExcelProperty;
-import com.sckw.core.model.page.PageRequest;
 import com.sckw.excel.annotation.ExcelContext;
 import lombok.Data;
 import lombok.experimental.Accessors;

+ 1 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/controller/KwsUserController.java

@@ -89,6 +89,7 @@ public class KwsUserController {
      * @date: 2023/6/14
      */
     @PostMapping("/add")
+    @RepeatSubmit(interval = 3000,message ="两次请求间隔未超过3秒")
     public HttpResult add(@Valid @RequestBody UserAddReqVo reqVo) {
         kwsUserService.add(reqVo);
         return HttpResult.ok(HttpStatus.MSG_003);

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.