Explorar el Código

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

czh hace 2 años
padre
commit
18f91bd77a
Se han modificado 59 ficheros con 1865 adiciones y 440 borrados
  1. 17 3
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillEnum.java
  2. 3 3
      sckw-common/sckw-common-log/src/main/java/com/sckw/log/aspect/LogInfoAspect.java
  3. 21 21
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dubbo/RemoteFleetServiceImpl.java
  4. 8 0
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverMapper.xml
  5. 8 0
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckMapper.xml
  6. 2 2
      sckw-modules/sckw-message/src/main/java/com/sckw/message/controller/MessageController.java
  7. 11 18
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpLedgerLogisticsController.java
  8. 14 28
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpLedgerTradeController.java
  9. 16 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpSettlementLogisticsController.java
  10. 37 32
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpSettlementTradeController.java
  11. 7 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/WalletController.java
  12. 5 6
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementLogisticsController.java
  13. 9 16
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementTradeController.java
  14. 10 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpLedgerLogisticsMapper.java
  15. 2 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpLedgerTradeMapper.java
  16. 2 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementTradeMapper.java
  17. 13 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpWalletPrepayMapper.java
  18. 81 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/KwpWalletPrepay.java
  19. 3 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/PayCenterEnum.java
  20. 49 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/PrePayEnum.java
  21. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/ISettlement.java
  22. 3 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/SettlementLogisticsDto.java
  23. 19 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/SettlementTradeDto.java
  24. 52 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/wallet/PrePayIndex2.java
  25. 4 4
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/SettlementTrade.java
  26. 160 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/excel/SettlementLogisticsExport.java
  27. 113 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/excel/SettlementLogisticsExportVo.java
  28. 111 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/excel/SettlementTradeExportVo.java
  29. 16 42
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/LedgerLogisticsVo.java
  30. 6 25
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/LedgerTradeVo.java
  31. 34 83
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/SettlementLogisticsVo.java
  32. 161 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/SettlementTradeVo.java
  33. 8 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerLogisticsService.java
  34. 9 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerTradeService.java
  35. 44 44
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementLogisticsService.java
  36. 4 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementTradeService.java
  37. 57 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpWalletPrepayService.java
  38. 66 4
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/PayCenterService.java
  39. 125 66
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WalletService.java
  40. 25 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementLogisticsService.java
  41. 9 6
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementTradeService.java
  42. 67 0
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpLedgerLogisticsMapper.xml
  43. 72 0
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpLedgerTradeMapper.xml
  44. 28 1
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementLogisticsMapper.xml
  45. 129 0
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementTradeMapper.xml
  46. 23 0
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpWalletPrepayMapper.xml
  47. 1 1
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwTransportService.java
  48. 1 1
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/operationManagement/ManagementLogisticsOrderController.java
  49. 10 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/DriverListVo.java
  50. 5 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/WaybillOrderDriverVo.java
  51. 5 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/WaybillTrackVO.java
  52. 20 4
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/AcceptCarriageOrderService.java
  53. 75 2
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ConsignOrderService.java
  54. 44 16
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtWaybillOrderService.java
  55. 1 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ManagementWaybillOrderService.java
  56. 4 3
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/WaybillManagementService.java
  57. 28 0
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderCirculateMapper.xml
  58. 4 2
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderMapper.xml
  59. 3 2
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderMapper.xml

+ 17 - 3
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillEnum.java

@@ -52,7 +52,7 @@ public enum CarWaybillEnum {
     /**
      * 已撤销
      */
-    REVOKED(11, "revoked", "11", "单趟撤回"),
+    REVOKED(11, "revoked", "11", "撤回"),
     /**
      * 已核单-不通过[审核不通过]
      */
@@ -136,11 +136,11 @@ public enum CarWaybillEnum {
 
     /**
      * @param code 状态码
-     * @desc 是否可以变更司机/车辆
+     * @desc 是否可以变更司机
      * @author zk
      * @date 2023/8/2
      **/
-    public static boolean changeDriverAndTruck(int code) {
+    public static boolean changeDriver(int code) {
         if (code == CarWaybillEnum.COMPLETION_UNLOADING.getCode()
                 || code == CarWaybillEnum.APPROVAL_PASS.getCode()
                 || code == CarWaybillEnum.REJECT_ORDER.getCode()
@@ -151,4 +151,18 @@ public enum CarWaybillEnum {
         }
         return true;
     }
+
+    /**
+     * @param code 状态码
+     * @desc 是否可以变更司机/车辆
+     * @author zk
+     * @date 2023/8/2
+     **/
+    public static boolean changeTruck(int code) {
+        if (code == CarWaybillEnum.PENDING_ORDER.getCode()
+                || code == CarWaybillEnum.PENDING_VEHICLE.getCode()) {
+            return true;
+        }
+        return false;
+    }
 }

+ 3 - 3
sckw-common/sckw-common-log/src/main/java/com/sckw/log/aspect/LogInfoAspect.java

@@ -37,7 +37,7 @@ public class LogInfoAspect {
 
     public static final String TIME_PATTERN = "yyyy-MM-dd HH:mm:ss:SSS";
 
-    @Pointcut("execution(* com.sckw.*.controller.*.*(..))")
+    @Pointcut("execution(* com.sckw.*.controller..*.*(..))")
     public void cutController() {
     }
 
@@ -47,7 +47,7 @@ public class LogInfoAspect {
 
     }
 
-    @Pointcut("execution(* com.sckw.*.dubbo.*.*(..))")
+    @Pointcut("execution(* com.sckw.*.dubbo..*.*(..))")
     public void cutDubbo() {
     }
 
@@ -97,7 +97,7 @@ public class LogInfoAspect {
         return result;
     }
 
-    @Pointcut("execution(* com.sckw.*.service.*.*(..))")
+    @Pointcut("execution(* com.sckw.*.service..*.*(..))")
     public void cutService() {
     }
 

+ 21 - 21
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dubbo/RemoteFleetServiceImpl.java

@@ -46,7 +46,7 @@ public class RemoteFleetServiceImpl implements RemoteFleetService {
     public Map<Long, RDriverVo> findDriver(List<Long> driverIds) {
         /**获取数据**/
         Map<Long, RDriverVo> driverMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
-        List<Map<String, Object>> drivers = driverDao.findList(new HashMap<>(Global.NUMERICAL_SIXTEEN) {{
+        List<KwfDriver> drivers = driverDao.findDriver(new HashMap<>(Global.NUMERICAL_SIXTEEN) {{
             put("ids", driverIds);
         }});
         if (CollectionUtils.isEmpty(drivers)) {
@@ -54,16 +54,16 @@ public class RemoteFleetServiceImpl implements RemoteFleetService {
         }
 
         /**数据处理**/
-        for (Map<String, Object> driver : drivers) {
+        for (KwfDriver driver : drivers) {
             RDriverVo driverVo = new RDriverVo();
-            driverVo.setId(NumberUtils.parseEmptyLong(driver.get("id")));
-            driverVo.setName(StringUtils.objectStr(driver.get("name")));
-            driverVo.setPhone(StringUtils.objectStr(driver.get("phone")));
-            driverVo.setIdcard(StringUtils.objectStr(driver.get("idcard")));
-            driverVo.setTotalComplete(NumberUtils.parseEmptyInteger(driver.get("totalComplete")));
-            driverVo.setTotalTake(NumberUtils.parseEmptyInteger(driver.get("totalTake")));
-            driverVo.setTotalWeight(new BigDecimal(NumberUtils.parseDouble(driver.get("totalWeight"))));
-            driverVo.setBusinessStatus(NumberUtils.parseEmptyInteger(driver.get("businessStatus")));
+            driverVo.setId(driver.getId());
+            driverVo.setName(driver.getName());
+            driverVo.setPhone(driver.getPhone());
+            driverVo.setIdcard(driver.getIdcard());
+            driverVo.setTotalComplete(driver.getTotalComplete());
+            driverVo.setTotalTake(driver.getTotalTake());
+            driverVo.setTotalWeight(driver.getTotalWeight());
+            driverVo.setBusinessStatus(driver.getBusinessStatus());
             driverMap.put(driverVo.getId(), driverVo);
         }
         return driverMap;
@@ -127,23 +127,23 @@ public class RemoteFleetServiceImpl implements RemoteFleetService {
     public Map<String, RTruckVo> findTruck(List<String> truckNos) {
         /**获取数据**/
         Map<String, RTruckVo> truckMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
-        List<Map<String, Object>> trucks = truckDao.findList(new HashMap<>(Global.NUMERICAL_SIXTEEN){{put("truckNos", truckNos);}});
+        List<KwfTruck> trucks = truckDao.findTruck(new HashMap<>(Global.NUMERICAL_SIXTEEN){{put("truckNos", truckNos);}});
         if (CollectionUtils.isEmpty(trucks)) {
             return truckMap;
         }
 
         /**数据处理**/
-        for (Map<String, Object> truck : trucks) {
+        for (KwfTruck truck : trucks) {
             RTruckVo truckVo = new RTruckVo();
-            truckVo.setId(NumberUtils.parseEmptyLong(truck.get("id")));
-            truckVo.setTruckNo(StringUtils.objectStr(truck.get("truckNo")));
-            truckVo.setActualWeight(NumberUtils.parseEmptyDouble(truck.get("actualWeight")));
-            truckVo.setTrailerNo(StringUtils.objectStr(truck.get("trailerNo")));
-            truckVo.setTotalComplete(NumberUtils.parseEmptyInteger(truck.get("totalComplete")));
-            truckVo.setTotalTake(NumberUtils.parseEmptyInteger(truck.get("totalTake")));
-            truckVo.setTotalWeight(new BigDecimal(NumberUtils.parseDouble(truck.get("totalWeight"))));
-            truckVo.setBusinessStatus(NumberUtils.parseEmptyInteger(truck.get("businessStatus")));
-            truckVo.setTruckType(truck.get("truckType") == null ? null : truck.get("truckType").toString());
+            truckVo.setId(truck.getId());
+            truckVo.setTruckNo(truck.getTruckNo());
+            truckVo.setActualWeight(truck.getActualWeight() != null ? truck.getActualWeight().doubleValue() : null );
+            truckVo.setTrailerNo(truck.getTrailerNo());
+            truckVo.setTotalComplete(truck.getTotalComplete());
+            truckVo.setTotalTake(truck.getTotalTake());
+            truckVo.setTotalWeight(truck.getTotalWeight());
+            truckVo.setBusinessStatus(truck.getBusinessStatus());
+            truckVo.setTruckType(StringUtils.objectStr(truck.getType()));
             truckMap.put(truckVo.getTruckNo(), truckVo);
         }
         return truckMap;

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

@@ -291,6 +291,14 @@
         <if test="authStatus != null and authStatus != '' and authStatus != 0">
             and dr.auth_status = #{authStatus, jdbcType=VARCHAR}
         </if>
+        <choose>
+            <when test="ids != null and ids != '' and ids.size() > 0">
+                and dr.id in
+                <foreach collection="ids" item="id" open="(" close=")" separator=",">
+                    #{id,jdbcType=BIGINT}
+                </foreach>
+            </when>
+        </choose>
         ORDER BY create_time desc
     </select>
 

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

@@ -298,6 +298,14 @@
         <if test="authStatus != null and authStatus != '' and authStatus != 0">
             and auth_status = #{authStatus, jdbcType=VARCHAR}
         </if>
+        <choose>
+            <when test="truckNos != null and truckNos != '' and truckNos.size() > 0">
+                and truck_no in
+                <foreach collection="truckNos" item="truckNo" open="(" close=")" separator=",">
+                    #{truckNo,jdbcType=VARCHAR}
+                </foreach>
+            </when>
+        </choose>
         ORDER BY create_time desc
     </select>
 

+ 2 - 2
sckw-modules/sckw-message/src/main/java/com/sckw/message/controller/MessageController.java

@@ -78,7 +78,7 @@ public class MessageController {
      * @date: 2023-06-09 14:21
      */
     @PostMapping(value = "/read", produces = MediaType.APPLICATION_JSON_VALUE)
-    public HttpResult read(@RequestBody ReadMessagesReqVO readMessagesReqVO) {
+    public HttpResult read(@RequestBody @Valid ReadMessagesReqVO readMessagesReqVO) {
         messageService.read(readMessagesReqVO);
         return HttpResult.ok("读取消息成功");
     }
@@ -91,7 +91,7 @@ public class MessageController {
      * @date: 2023-06-09 14:21
      */
     @PostMapping(value = "/delete", produces = MediaType.APPLICATION_JSON_VALUE)
-    public HttpResult delete(@RequestBody DeleteMessagesReqVO deleteMessagesReqVO) {
+    public HttpResult delete(@RequestBody @Valid DeleteMessagesReqVO deleteMessagesReqVO) {
         messageService.delete(deleteMessagesReqVO);
         return HttpResult.ok("删除消息成功");
     }

+ 11 - 18
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpLedgerLogisticsController.java

@@ -1,12 +1,12 @@
 package com.sckw.payment.controller;
 
-import com.sckw.core.model.page.PageRes;
+import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.model.vo.TableTop;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.payment.model.constant.LedgerEnum;
 import com.sckw.payment.model.constant.LogisticsUnitType;
-import com.sckw.payment.model.dto.ILedger;
+import com.sckw.payment.model.dto.LedgerLogisticsDto;
 import com.sckw.payment.model.vo.req.*;
 import com.sckw.payment.model.vo.res.LedgerLogisticsVo;
 import com.sckw.payment.service.KwpLedgerLogisticsService;
@@ -41,6 +41,7 @@ public class KwpLedgerLogisticsController {
      * @param logisticsReq 保存物流对账单参数
      * @return
      */
+    @RepeatSubmit(interval = 3000,message ="两次请求间隔未超过3秒")
     @PostMapping("sendDraft")
     public HttpResult sendDraft(@RequestBody @Valid LogisticsSendReq logisticsReq) {
         return HttpResult.ok(kwpLedgerLogisticsService.sendLedgerDraft(logisticsReq));
@@ -53,6 +54,7 @@ public class KwpLedgerLogisticsController {
      * @return
      */
     @PostMapping("send")
+    @RepeatSubmit(interval = 3000,message ="两次请求间隔未超过3秒")
     public HttpResult send(@RequestBody @Valid LogisticsSendReq logisticsReq) {
         return HttpResult.ok(kwpLedgerLogisticsService.sendLedger(logisticsReq));
     }
@@ -159,7 +161,7 @@ public class KwpLedgerLogisticsController {
      * @return 物流对账单统计数据
      */
     @PostMapping("carrierCount")
-    public HttpResult carrierCount(@RequestBody  LogisticsReq logisticsReq) {
+    public HttpResult carrierCount(@RequestBody LogisticsReq logisticsReq) {
         logisticsReq.setUnitType(LogisticsUnitType.SHIPPER);
         logisticsReq.setUnitTypeTwo(LogisticsUnitType.CARRIER);
         return HttpResult.ok(kwpLedgerLogisticsService.orderCount(logisticsReq));
@@ -244,13 +246,9 @@ public class KwpLedgerLogisticsController {
      */
     @PostMapping("exportShipper")
     public HttpResult exportShipper(HttpServletResponse response, @RequestBody LogisticsReq logisticsReq) {
-        List<ILedger> list;
-        if (CollectionUtils.isEmpty(logisticsReq.getIdList())) {
-            PageRes<ILedger> pageResult = kwpLedgerLogisticsService.shipperList(logisticsReq);
-            list = pageResult.getList();
-        } else {
-            list = kwpLedgerLogisticsService.selectShipperList(logisticsReq.getIdList());
-        }
+        logisticsReq.setUnitType(LogisticsUnitType.CARRIER);
+        logisticsReq.setUnitTypeTwo(LogisticsUnitType.SHIPPER);
+        List<LedgerLogisticsDto> list = kwpLedgerLogisticsService.exportList(logisticsReq, logisticsReq.getIdList());
         if (CollectionUtils.isEmpty(list)) {
             return HttpResult.error("没有可导出的数据");
         }
@@ -273,14 +271,9 @@ public class KwpLedgerLogisticsController {
      */
     @PostMapping("exportCarrier")
     public HttpResult exportCarrier(HttpServletResponse response, @RequestBody LogisticsReq logisticsReq) {
-        List<ILedger> list;
-        if (CollectionUtils.isEmpty(logisticsReq.getIdList())) {
-            PageRes<ILedger> pageResult = kwpLedgerLogisticsService.carrierList(logisticsReq);
-            list = pageResult.getList();
-
-        } else {
-            list = kwpLedgerLogisticsService.selectCarrierList(logisticsReq.getIdList());
-        }
+        logisticsReq.setUnitType(LogisticsUnitType.SHIPPER);
+        logisticsReq.setUnitTypeTwo(LogisticsUnitType.CARRIER);
+        List<LedgerLogisticsDto> list = kwpLedgerLogisticsService.exportList(logisticsReq, logisticsReq.getIdList());
         if (CollectionUtils.isEmpty(list)) {
             return HttpResult.error("没有可导出的数据");
         }

+ 14 - 28
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpLedgerTradeController.java

@@ -1,13 +1,12 @@
 package com.sckw.payment.controller;
 
-import com.sckw.core.model.page.PageRes;
+import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.model.vo.TableTop;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.payment.model.constant.LedgerEnum;
 import com.sckw.payment.model.constant.TradeUnitType;
-import com.sckw.payment.model.dto.LedgerPurchaseDto;
-import com.sckw.payment.model.dto.LedgerSellDto;
+import com.sckw.payment.model.dto.LedgerTradeDto;
 import com.sckw.payment.model.vo.req.*;
 import com.sckw.payment.model.vo.res.LedgerTradeVo;
 import com.sckw.payment.service.KwpLedgerTradeService;
@@ -43,6 +42,7 @@ public class KwpLedgerTradeController {
      * @param tradeSendReq
      * @return
      */
+    @RepeatSubmit(interval = 3000,message ="两次请求间隔未超过3秒")
     @PostMapping("sendDraft")
     public HttpResult sendDraft(@RequestBody @Valid TradeSendReq tradeSendReq) {
         return HttpResult.ok(kwpLedgerTradeService.sendLedgerDraft(tradeSendReq));
@@ -54,6 +54,7 @@ public class KwpLedgerTradeController {
      * @param tradeSendReq
      * @return
      */
+    @RepeatSubmit(interval = 3000,message ="两次请求间隔未超过3秒")
     @PostMapping("send")
     public HttpResult send(@RequestBody @Valid TradeSendReq tradeSendReq) {
         return HttpResult.ok(kwpLedgerTradeService.sendLedger(tradeSendReq));
@@ -142,7 +143,7 @@ public class KwpLedgerTradeController {
      * @return
      */
     @PostMapping("sellCount")
-    public HttpResult sellCount(@RequestBody  TradeReq tradeReq) {
+    public HttpResult sellCount(@RequestBody TradeReq tradeReq) {
         tradeReq.setUnitType(TradeUnitType.PURCHASE);
         tradeReq.setUnitTypeTwo(TradeUnitType.SELL);
         return HttpResult.ok(kwpLedgerTradeService.orderCount(tradeReq));
@@ -154,7 +155,7 @@ public class KwpLedgerTradeController {
      * @return
      */
     @PostMapping("purchaseCount")
-    public HttpResult purchaseCount(@RequestBody  TradeReq tradeReq) {
+    public HttpResult purchaseCount(@RequestBody TradeReq tradeReq) {
         tradeReq.setUnitType(TradeUnitType.SELL);
         tradeReq.setUnitTypeTwo(TradeUnitType.PURCHASE);
         List<TableTop> tableTops = kwpLedgerTradeService.orderCount(tradeReq);
@@ -242,18 +243,10 @@ public class KwpLedgerTradeController {
      * @return
      */
     @PostMapping("sellExport")
-    public HttpResult sellExport(HttpServletResponse response, @RequestBody @Valid TradeReq tradeReq) {
-        List<LedgerSellDto> list;
-
-        if (CollectionUtils.isEmpty(tradeReq.getIdList())) {
-            tradeReq.setPage(0);
-            tradeReq.setPageSize(0);
-            PageRes<LedgerSellDto> pageResult = kwpLedgerTradeService.sellList(tradeReq);
-            list = pageResult.getList();
-        } else {
-            list = kwpLedgerTradeService.selectSellList(tradeReq.getIdList());
-        }
-
+    public HttpResult sellExport(HttpServletResponse response, @RequestBody TradeReq tradeReq) {
+        tradeReq.setUnitType(TradeUnitType.PURCHASE);
+        tradeReq.setUnitTypeTwo(TradeUnitType.SELL);
+        List<LedgerTradeDto> list = kwpLedgerTradeService.exportList(tradeReq, tradeReq.getIdList());
         if (CollectionUtils.isEmpty(list)) {
             return HttpResult.error("没有可导出的数据");
         }
@@ -274,17 +267,10 @@ public class KwpLedgerTradeController {
      * @return
      */
     @PostMapping("purchaseExport")
-    public HttpResult purchaseExport(HttpServletResponse response, @RequestBody @Valid TradeReq tradeReq) {
-        List<LedgerPurchaseDto> list;
-        if (CollectionUtils.isEmpty(tradeReq.getIdList())) {
-            tradeReq.setPage(0);
-            tradeReq.setPageSize(0);
-            PageRes<LedgerPurchaseDto> pageResult = kwpLedgerTradeService.purchaseList(tradeReq);
-            list = pageResult.getList();
-        } else {
-            list = kwpLedgerTradeService.selectPurchaseList(tradeReq.getIdList());
-        }
-
+    public HttpResult purchaseExport(HttpServletResponse response, @RequestBody TradeReq tradeReq) {
+        tradeReq.setUnitType(TradeUnitType.SELL);
+        tradeReq.setUnitTypeTwo(TradeUnitType.PURCHASE);
+        List<LedgerTradeDto> list = kwpLedgerTradeService.exportList(tradeReq, tradeReq.getIdList());
         if (CollectionUtils.isEmpty(list)) {
             return HttpResult.error("没有可导出的数据");
         }

+ 16 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpSettlementLogisticsController.java

@@ -43,9 +43,17 @@ public class KwpSettlementLogisticsController {
         return HttpResult.ok(kwpSettlementLogisticsService.getCountListCollection(settlementReq));
     }
 
+    /**
+     * 承运方导出
+     *
+     * @param response
+     * @param settlementReq
+     * @return
+     */
     @PostMapping(name = "运费收款-根据条件导出物流订单表数据", path = "exportCollection")
     public HttpResult exportCollection(HttpServletResponse response, @RequestBody @Valid SettlementReq settlementReq) {
         settlementReq.setUnitType(LogisticsUnitType.CARRIER);
+        settlementReq.setUnitTypeTwo(LogisticsUnitType.SHIPPER);
         List<SettlementLogisticsDto> list;
         list = kwpSettlementLogisticsService.selectList(settlementReq);
         return this.export(response, list);
@@ -68,9 +76,17 @@ public class KwpSettlementLogisticsController {
         return HttpResult.ok(kwpSettlementLogisticsService.getCountListPayment(settlementReq));
     }
 
+    /**
+     * 托运方导出
+     *
+     * @param response
+     * @param settlementReq
+     * @return
+     */
     @PostMapping(name = "运费付款-根据条件导出物流订单表数据", path = "exportPayment")
     public HttpResult exportPayment(HttpServletResponse response, @RequestBody @Valid SettlementReq settlementReq) {
         settlementReq.setUnitType(LogisticsUnitType.SHIPPER);
+        settlementReq.setUnitTypeTwo(LogisticsUnitType.CARRIER);
         List<SettlementLogisticsDto> list;
         list = kwpSettlementLogisticsService.selectList(settlementReq);
         return this.export(response, list);

+ 37 - 32
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpSettlementTradeController.java

@@ -1,20 +1,22 @@
 package com.sckw.payment.controller;
 
-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.dto.SettlementTradeDto;
 import com.sckw.payment.model.vo.req.SettlementTradeReq;
-import com.sckw.payment.model.vo.res.SettlementLogisticsVo;
+import com.sckw.payment.model.vo.res.SettlementTradeVo;
 import com.sckw.payment.service.KwpSettlementTradeService;
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
 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;
@@ -39,7 +41,7 @@ public class KwpSettlementTradeController {
      * @param settlementReq
      * @return
      */
-    @PostMapping(name = "收款-销售结算单列表", path = "pageSellList")
+    @PostMapping("pageSellList")
     public HttpResult pageListCollection(@RequestBody @Valid SettlementTradeReq settlementReq) {
         settlementReq.setUnitType(TradeUnitType.PURCHASE);
         settlementReq.setUnitTypeTwo(TradeUnitType.SELL);
@@ -53,7 +55,7 @@ public class KwpSettlementTradeController {
      * @param settlementReq
      * @return
      */
-    @PostMapping(name = "收款-表头统计数量", path = "getSellCount")
+    @PostMapping("getSellCount")
     public HttpResult getCount(@RequestBody @Valid SettlementTradeReq settlementReq) {
         settlementReq.setUnitType(TradeUnitType.PURCHASE);
         settlementReq.setUnitTypeTwo(TradeUnitType.SELL);
@@ -68,7 +70,7 @@ public class KwpSettlementTradeController {
      * @param settlementReq
      * @return
      */
-    @PostMapping(name = "收款-表尾金额结算数据", path = "getSellSum")
+    @PostMapping("getSellSum")
     public HttpResult getSellSum(@RequestBody @Valid SettlementTradeReq settlementReq) {
         settlementReq.check();
         settlementReq.setUnitType(TradeUnitType.PURCHASE);
@@ -77,18 +79,19 @@ public class KwpSettlementTradeController {
         return HttpResult.ok(kwpSettlementTradeService.getCountListCollection(settlementReq));
     }
 
-    @PostMapping(name = "收款-根据ids导出销售结算单列表", path = "exportCollection")
+    /**
+     * 导出销售结算单列表
+     *
+     * @param response
+     * @param settlementReq
+     * @return
+     */
+    @PostMapping("exportCollection")
     public HttpResult exportCollection(HttpServletResponse response, @RequestBody @Valid SettlementTradeReq settlementReq) {
         settlementReq.check();
-        List<ISettlement> list;
         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);
-        }
+        List<SettlementTradeDto> list = kwpSettlementTradeService.exportList(settlementReq, settlementReq.getIdList());
         return this.export(response, list);
     }
 
@@ -101,7 +104,7 @@ public class KwpSettlementTradeController {
      * @param settlementReq
      * @return
      */
-    @PostMapping(name = "付款-采购结算单列表", path = "pagePurchaseList")
+    @PostMapping("pagePurchaseList")
     public HttpResult pageListPayment(@RequestBody @Valid SettlementTradeReq settlementReq) {
         settlementReq.check();
         settlementReq.setUnitType(TradeUnitType.SELL);
@@ -115,7 +118,7 @@ public class KwpSettlementTradeController {
      * @param settlementReq
      * @return
      */
-    @PostMapping(name = "收款-表头统计数量", path = "getPurchaseCount")
+    @PostMapping("getPurchaseCount")
     public HttpResult getPurchaseCount(@RequestBody @Valid SettlementTradeReq settlementReq) {
         settlementReq.check();
         settlementReq.setUnitType(TradeUnitType.SELL);
@@ -130,7 +133,7 @@ public class KwpSettlementTradeController {
      * @param settlementReq
      * @return
      */
-    @PostMapping(name = "收款-物流结算订单列表头部汇总数量", path = "getPurchaseSum")
+    @PostMapping("getPurchaseSum")
     public HttpResult getCountListPayment(@RequestBody @Valid SettlementTradeReq settlementReq) {
         settlementReq.check();
         settlementReq.setUnitType(TradeUnitType.SELL);
@@ -139,36 +142,38 @@ public class KwpSettlementTradeController {
         return HttpResult.ok(kwpSettlementTradeService.getCountListCollection(settlementReq));
     }
 
-    @PostMapping(name = "付款-根据ids导出采购结算单列表", path = "exportPayment")
+    /**
+     * 导出采购结算单列表
+     *
+     * @param response
+     * @param settlementReq
+     * @return
+     */
+    @PostMapping("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);
-            list = pageResult.getList();
-        } else {
-            list = kwpSettlementTradeService.selectList(settlementReq.getIdList(), TradeUnitType.SELL);
-        }
+        List<SettlementTradeDto> list = kwpSettlementTradeService.exportList(settlementReq, settlementReq.getIdList());
         return this.export(response, list);
     }
+
     /**
      * 导出
      *
      * @author Aick Spt
      * @date 2023-07-24 15:49
      */
-    private HttpResult export(HttpServletResponse response, List<ISettlement> list) {
+    private HttpResult export(HttpServletResponse response, List<SettlementTradeDto> list) {
         if (CollectionUtils.isEmpty(list)) {
             return HttpResult.error("没有可导出的数据");
         }
-        List<SettlementLogisticsVo> collect = list.stream().map(a -> {
-            SettlementLogisticsVo settlementLogisticsVo = new SettlementLogisticsVo();
-            BeanUtils.copyProperties(a, settlementLogisticsVo);
-            return settlementLogisticsVo;
+        List<SettlementTradeVo> collect = list.stream().map(a -> {
+            SettlementTradeVo settlementTradeVo = new SettlementTradeVo();
+            BeanUtils.copyProperties(a, settlementTradeVo);
+            return settlementTradeVo;
         }).collect(Collectors.toList());
-        ExcelUtil.downData(response, SettlementLogisticsVo.class, collect);
+        ExcelUtil.downData(response, SettlementTradeVo.class, collect);
         return null;
     }
 

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

@@ -9,6 +9,7 @@ import com.sckw.payment.model.vo.req.page.RefundPage;
 import com.sckw.payment.service.WalletService;
 import jakarta.annotation.Resource;
 import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotBlank;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -37,6 +38,12 @@ public class WalletController {
         return HttpResult.ok(walletService.createUser(createUserReq));
     }
 
+    @GetMapping("userInfo")
+    public HttpResult userInfo(@NotBlank(message = "uid不能为空") @RequestParam("uid") String uid,
+                               @NotBlank(message = "channel不能为空")@RequestParam("channel") String channel) {
+        return HttpResult.ok(walletService.userInfo(uid,channel));
+    }
+
     /**
      * 钱包总览信息
      *

+ 5 - 6
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/operate/SettlementLogisticsController.java

@@ -4,8 +4,8 @@ import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.payment.model.constant.LogisticsUnitType;
 import com.sckw.payment.model.vo.SettlementLogistics;
+import com.sckw.payment.model.vo.excel.SettlementLogisticsExportVo;
 import com.sckw.payment.model.vo.req.SettlementReq;
-import com.sckw.payment.model.vo.res.SettlementLogisticsVo;
 import com.sckw.payment.service.operate.SettlementLogisticsService;
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletResponse;
@@ -67,17 +67,16 @@ public class SettlementLogisticsController {
     public HttpResult export(HttpServletResponse response, @RequestBody @Valid SettlementReq settlementReq) {
         settlementReq.setUnitType(LogisticsUnitType.SHIPPER);
         settlementReq.setUnitTypeTwo(LogisticsUnitType.CARRIER);
-        List<SettlementLogistics> list;
-        list = settlementLogisticsService.exportList(settlementReq);
+        List<SettlementLogistics> list = settlementLogisticsService.exportList(settlementReq);
         if (CollectionUtils.isEmpty(list)) {
             return HttpResult.error("没有可导出的数据");
         }
-        List<SettlementLogisticsVo> collect = list.stream().map(a -> {
-            SettlementLogisticsVo settlementLogisticsVo = new SettlementLogisticsVo();
+        List<SettlementLogisticsExportVo> collect = list.stream().map(a -> {
+            SettlementLogisticsExportVo settlementLogisticsVo = new SettlementLogisticsExportVo();
             BeanUtils.copyProperties(a, settlementLogisticsVo);
             return settlementLogisticsVo;
         }).collect(Collectors.toList());
-        ExcelUtil.downData(response, SettlementLogisticsVo.class, collect);
+        ExcelUtil.downData(response, SettlementLogisticsExportVo.class, collect);
         return null;
     }
 

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

@@ -1,12 +1,11 @@
 package com.sckw.payment.controller.operate;
 
-import com.sckw.core.model.page.PageRes;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.payment.model.constant.TradeUnitType;
 import com.sckw.payment.model.vo.SettlementTrade;
+import com.sckw.payment.model.vo.excel.SettlementTradeExportVo;
 import com.sckw.payment.model.vo.req.SettlementTradeReq;
-import com.sckw.payment.model.vo.res.SettlementLogisticsVo;
 import com.sckw.payment.service.operate.SettlementTradeService;
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletResponse;
@@ -72,24 +71,18 @@ public class SettlementTradeController {
     @PostMapping("export")
     public HttpResult exportCollection(HttpServletResponse response, @RequestBody @Valid SettlementTradeReq settlementReq) {
         settlementReq.check();
-        List<SettlementTrade> list = null;
-        settlementReq.setUnitType(TradeUnitType.PURCHASE);
-        settlementReq.setUnitTypeTwo(TradeUnitType.SELL);
-        if (CollectionUtils.isEmpty(settlementReq.getIdList())) {
-            PageRes<SettlementTrade> pageResult = settlementTradeService.list(settlementReq);
-            list = pageResult.getList();
-        } else {
-//            list = settlementTradeService.selectList(settlementReq.getIdList(), TradeUnitType.PURCHASE);
-        }
+        settlementReq.setUnitType(TradeUnitType.SELL);
+        settlementReq.setUnitTypeTwo(TradeUnitType.PURCHASE);
+        List<SettlementTrade> list = settlementTradeService.exportList(settlementReq,settlementReq.getIdList());
         if (CollectionUtils.isEmpty(list)) {
             return HttpResult.error("没有可导出的数据");
         }
-        List<SettlementLogisticsVo> collect = list.stream().map(a -> {
-            SettlementLogisticsVo settlementLogisticsVo = new SettlementLogisticsVo();
-            BeanUtils.copyProperties(a, settlementLogisticsVo);
-            return settlementLogisticsVo;
+        List<SettlementTradeExportVo> collect = list.stream().map(a -> {
+            SettlementTradeExportVo settlementTradeExportVo = new SettlementTradeExportVo();
+            BeanUtils.copyProperties(a, settlementTradeExportVo);
+            return settlementTradeExportVo;
         }).collect(Collectors.toList());
-        ExcelUtil.downData(response, SettlementLogisticsVo.class, collect);
+        ExcelUtil.downData(response, SettlementTradeExportVo.class, collect);
         return null;
     }
 }

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

@@ -93,6 +93,7 @@ public interface KwpLedgerLogisticsMapper extends BaseMapper<KwpLedgerLogistics>
      * @return
      */
     Long countSum(@Param("logisticsReq") LogisticsReq logisticsReq, @Param("status") List<Integer> status);
+
     /**
      * app统计对账金额
      *
@@ -115,4 +116,13 @@ public interface KwpLedgerLogisticsMapper extends BaseMapper<KwpLedgerLogistics>
      * @return
      */
     LedgerSize countSize(@Param("entId") Long entId);
+
+    /**
+     * 列表导出
+     *
+     * @param logisticsReq
+     * @param idList
+     * @return
+     */
+    List<LedgerLogisticsDto> exportList(@Param("logisticsReq") LogisticsReq logisticsReq, @Param("idList") List<Long> idList);
 }

+ 2 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpLedgerTradeMapper.java

@@ -99,4 +99,6 @@ public interface KwpLedgerTradeMapper extends BaseMapper<KwpLedgerTrade> {
      * @return
      */
     List<LedgerSell> selectIds(@Param("ids") List<Long> ids);
+
+    List<LedgerTradeDto> exportList(@Param("tradeReq") TradeReq tradeReq, @Param("idList") List<Long> idList);
 }

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

@@ -78,4 +78,6 @@ public interface KwpSettlementTradeMapper extends BaseMapper<KwpSettlementTrade>
 
     List<KwpSettlementRecord> queryRecord();
 
+    List<SettlementTradeDto> exportList(@Param("settlementReq")SettlementTradeReq settlementReq, @Param("idList")List<Long> idList);
+    List<SettlementTrade> operateExportList(@Param("settlementReq")SettlementTradeReq settlementReq, @Param("idList")List<Long> idList);
 }

+ 13 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpWalletPrepayMapper.java

@@ -0,0 +1,13 @@
+package com.sckw.payment.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sckw.payment.model.KwpWalletPrepay;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @date 2023-09-22 15:49:51
+* @author xucaiqin
+*/
+@Mapper
+public interface KwpWalletPrepayMapper extends BaseMapper<KwpWalletPrepay> {
+}

+ 81 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/KwpWalletPrepay.java

@@ -0,0 +1,81 @@
+package com.sckw.payment.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * @date 2023-09-22 15:49:51
+ * @author xucaiqin
+ */
+
+/**
+ * 预付操作
+ */
+@Data
+@TableName(value = "kwp_wallet_prepay")
+public class KwpWalletPrepay {
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.INPUT)
+    private Long id;
+
+    /**
+     * 中台订单号
+     */
+    @TableField(value = "order_no")
+    private String orderNo;
+
+    /**
+     * 操作 1-新增预付 2-预付追加
+     */
+    @TableField(value = "`action`")
+    private Integer action;
+
+    /**
+     * 备注
+     */
+    @TableField(value = "remark")
+    private String remark;
+
+    /**
+     * 1-已提交 2-预付成功 3-预付失败
+     */
+    @TableField(value = "`status`")
+    private Integer status;
+
+    /**
+     * 创建人
+     */
+    @TableField(value = "create_by")
+    private Long createBy;
+
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    private LocalDateTime createTime;
+
+    /**
+     * 更新人
+     */
+    @TableField(value = "update_by")
+    private Long updateBy;
+
+    /**
+     * 更新时间
+     */
+    @TableField(value = "update_time")
+    private LocalDateTime updateTime;
+
+    /**
+     * 0-正常 1-删除
+     */
+    @TableField(value = "del_flag")
+    private Integer delFlag;
+}

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

@@ -14,6 +14,7 @@ public enum PayCenterEnum {
     MEMBER_WALLET("/v1/member/wallet", "钱包清单"),
     MEMBER_WALLET_V2("/v2/member/wallet", "钱包清单v2"),
     MEMBER_GENERAL("/v2/wallet/general", "总览信息"),
+    USER("/v2/member/user", "会员注册信息"),
     WITHDRAW_DETAIL("/v2/wallet/withdraw/detail", "提现详情"),
     //    WITHDRAW_DETAIL("/v1/wallet/withdraw/detail", "提现详情"), 原接口
     //    WITHDRAW_INDEX("/v1/wallet/withdraw/index", "提现清单"), 原接口
@@ -32,6 +33,7 @@ public enum PayCenterEnum {
     ADVANCE_PAY_DETAIL("/v1/wallet/advancepay/detail", "预付订单详情"),
     ADVANCE_PAY_APPLY("/v1/wallet/advancepay/apply", "发起预付"),
     ADVANCE_PAY_INDEX("/v1/wallet/advancepay/index", "预付订单清单"),
+    ADVANCE_PAY_INDEX2("/v2/wallet/advancepay/index", "预付订单清单"),
     ADVANCE_PAY_WALLETS("/v2/advancepay/wallets", "钱包预付列表"),
     ADVANCE_PAY_PAY_CHANNELS("/v2/advancepay/pay/channels", "钱包预付通道统计"),
     ADVANCE_PAY_RECEIVE("/v2/advancepay/receives", "钱包预收列表"),
@@ -47,6 +49,7 @@ public enum PayCenterEnum {
     PAY_AGENT_PAY("/v1/pay/agent_pay", "清分"),
     PAY_AGENT_PAY_V2("/v2/pay/agent_pay", "清分"),
     AGENT_PAY_QUERY("/v2/pay/status/query", "清分结果查询"),
+    WITHDRAW_TRANSFER("/v2/wallet/withdraw/transfer", "转出加提现"),
     WALLET_INDEX("/v1/wallet/index", "创建钱包");
     private final String addr;
     private final String desc;

+ 49 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/PrePayEnum.java

@@ -0,0 +1,49 @@
+package com.sckw.payment.model.constant;
+
+import java.util.Objects;
+
+/**
+ * 预付操作枚举
+ *
+ * @author xucaiqin
+ * @date 2023-07-11 12:00:52
+ */
+public enum PrePayEnum {
+    ADD(1, "新增预付", "新增预付"),
+    APPEND(2, "预付追加", "预付追加");
+
+    private final int status;
+    private final String desc;
+    private final String label;
+
+    PrePayEnum(int status, String desc, String label) {
+        this.status = status;
+        this.label = label;
+        this.desc = desc;
+    }
+
+    public String getLabel() {
+        return label;
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public static String getByStatus(Integer status) {
+        if (Objects.isNull(status)) {
+            return "";
+        }
+        for (PrePayEnum value : PrePayEnum.values()) {
+            if (value.getStatus() == status) {
+                return value.getDesc();
+            }
+        }
+        return "";
+    }
+
+}

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

@@ -44,6 +44,6 @@ public interface ISettlement {
             pay = new BigDecimal("0.0");
             total = new BigDecimal("1");
         }
-        return df().format(pay.divide(total, 2, RoundingMode.HALF_UP)) + "%";
+        return df().format(pay.divide(total, 6, RoundingMode.HALF_UP).multiply(new BigDecimal("100.0"))) + "%";
     }
 }

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

@@ -86,6 +86,9 @@ public class SettlementLogisticsDto implements ISettlement  {
      * 对账承运方财务联系人电话
      */
     private String successPhone;
+    //导出时的财务联系人
+    private String contacts;
+    private String phone;
 
     /**
      * 状态(1待结算2部分结算3全部结算)

+ 19 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/SettlementTradeDto.java

@@ -72,6 +72,9 @@ public class SettlementTradeDto implements ISettlement {
      * 对账采购财务联系人名称
      */
     private String auditUser;
+    //导出时的财务联系人
+    private String contacts;
+    private String phone;
 
     /**
      * 对账采购财务联系人电话
@@ -131,6 +134,22 @@ public class SettlementTradeDto implements ISettlement {
     //百分比
     private String percentage;
 
+    public String getContacts() {
+        return contacts;
+    }
+
+    public void setContacts(String contacts) {
+        this.contacts = contacts;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
     public String getPercentage() {
         return percentage;
     }

+ 52 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/wallet/PrePayIndex2.java

@@ -0,0 +1,52 @@
+package com.sckw.payment.model.dto.wallet;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Getter
+@Setter
+public class PrePayIndex2 implements Serializable {
+    @Serial
+    private static final long serialVersionUID = -6059595444592551329L;
+
+    @JSONField(name = "order_no")
+    private String orderNo;
+    @JSONField(name = "channel")
+    private String channel;
+    /**
+     * 支付通道名
+     */
+    @JSONField(name = "channel_label")
+    private String channelLabel;
+    /**
+     * 预付金额
+     */
+    @JSONField(name = "money")
+    private BigDecimal money;
+    /**
+     * 预付后余额
+     */
+    @JSONField(name = "ap_balance")
+    private BigDecimal apBalance;
+
+    @JSONField(name = "create_time")
+    private String createTime;
+
+    @JSONField(name = "remarks")
+    private String remarks;
+
+    @JSONField(name = "status_label")
+    private String statusLabel;
+    /**
+     * 订单状态
+     */
+    @JSONField(name = "status")
+    private int status;
+
+
+}

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

@@ -19,6 +19,10 @@ import java.util.Date;
 @Getter
 @Setter
 public class SettlementTrade implements ISettlement {
+    /**
+     * 主键
+     */
+    private Long id;
     /**
      * 对账单id主键
      */
@@ -28,10 +32,6 @@ public class SettlementTrade implements ISettlement {
      */
     @JsonProperty("tLedgerId")
     private Long tLedgerId;
-    /**
-     * 主键
-     */
-    private Long id;
 
     /**
      * 企业id

+ 160 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/excel/SettlementLogisticsExport.java

@@ -0,0 +1,160 @@
+package com.sckw.payment.model.vo.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sckw.excel.annotation.ExcelContext;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author Aick Spt
+ * @date 2023-07-21 15:28
+ */
+@Getter
+@Setter
+@ExcelContext(fileName = "物流结算订单列表", sheetName = "物流结算订单列表")
+public class SettlementLogisticsExport {
+
+    /**
+     * 主键
+     */
+    @ExcelProperty(value = "主键")
+    private Long id;
+
+    /**
+     * 结算单编号
+     */
+    @ExcelProperty(value = "结算单编号")
+    private String slOrderNo;
+
+    /**
+     * 名称
+     */
+    @ExcelProperty(value = "名称")
+    private String name;
+
+    /**
+     * 对账金额
+     */
+    @ExcelProperty(value = "对账金额")
+    private BigDecimal totalPrice;
+
+    /**
+     * 已收账款
+     */
+    @ExcelProperty(value = "已收账款")
+    private BigDecimal actualPrice;
+
+    /**
+     * 预计收款日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @ExcelProperty(value = "预计收款日期")
+    private Date receiptTime;
+
+    /**
+     * 备注
+     */
+    @ExcelProperty(value = "备注")
+    private String remark;
+
+    /**
+     * 对账托运方财务联系人
+     */
+    @ExcelProperty(value = "对账托运方财务联系人")
+    private String auditUser;
+
+    /**
+     * 对账托运方财务联系人电话
+     */
+    @ExcelProperty(value = "对账托运方财务联系人电话")
+    private String auditPhone;
+
+    /**
+     * 对账承运方财务联系人
+     */
+    @ExcelProperty(value = "对账承运方财务联系人")
+    private String successUser;
+
+    /**
+     * 对账承运方财务联系人电话
+     */
+    @ExcelProperty(value = "对账承运方财务联系人电话")
+    private String successPhone;
+
+
+    @ExcelProperty(value = "状态")
+    private String statusText;
+
+    /**
+     * 创建人名称
+     */
+    @ExcelProperty(value = "创建人名称")
+    private String createByText;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ExcelProperty(value = "创建时间")
+    private Date createTime;
+
+
+    /**
+     * 更新人名称
+     */
+    @ExcelProperty(value = "更新人名称")
+    private String updateByText;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ExcelProperty(value = "更新时间")
+    private Date updateTime;
+
+
+    /**
+     * 对账单名称
+     */
+    @ExcelProperty(value = "对账单名称")
+    private String ledgerName;
+
+
+    /**
+     * 交易方式
+     */
+    @ExcelProperty(value = "交易方式")
+    private String trading;
+
+    /**
+     * 对账单编号
+     */
+    @ExcelProperty(value = "对账单编号")
+    private String lLedgerNo;
+
+
+    /**
+     * 客户名称
+     */
+    @ExcelProperty(value = "客户名称")
+    private String firmName;
+
+
+    /**
+     * 实际应收还款
+     */
+    @ExcelProperty(value = "实际应收还款")
+    private BigDecimal ledgerSettlePrice;
+
+    /**
+     * 剩余待还款
+     */
+    @ExcelProperty(value = "剩余待还款")
+    private BigDecimal residuePrice;
+
+
+}

+ 113 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/excel/SettlementLogisticsExportVo.java

@@ -0,0 +1,113 @@
+package com.sckw.payment.model.vo.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.format.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sckw.excel.annotation.ExcelContext;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * @author 运营端导出
+ * @date 2023-07-21 15:28
+ */
+@Getter
+@Setter
+@ExcelContext(fileName = "物流结算订单列表", sheetName = "物流结算订单列表")
+public class SettlementLogisticsExportVo {
+
+    /**
+     * 主键
+     */
+    @ExcelProperty(value = "主键")
+    private Long id;
+
+    @ExcelProperty(value = "状态")
+    private String statusLabel;
+    /**
+     * 结算单编号
+     */
+    @ExcelProperty(value = "结算单编号")
+    private String slOrderNo;
+
+    @JsonProperty("lLedgerNo")
+    @ExcelProperty(value = "对账单编号")
+    private String lLedgerNo;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonProperty("generateTime")
+    @ExcelProperty(value = "生成时间")
+    private LocalDateTime generateTime;
+    /**
+     * 结算单名称
+     */
+    @ExcelProperty(value = "对账表名称")
+    private String name;
+
+    @ExcelProperty(value = "托运单位")
+    private String shipperFirmName;
+    @ExcelProperty(value = "承运单位")
+    private String carrierFirmName;
+
+    @ExcelProperty(value = "支付方式")
+    private String tradingLabel;
+    /**
+     * 总应收/元
+     */
+    @ExcelProperty(value = "实际应收/元")
+    private BigDecimal totalPrice;
+
+    /**
+     * 当前收款/元
+     */
+    @ExcelProperty(value = "当前收款/元")
+    private BigDecimal actualPrice;
+    /**
+     * 剩余待收款/元
+     */
+    @ExcelProperty(value = "剩余待收款/元")
+    private BigDecimal waitPrice;
+
+    /**
+     * 预计收款日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @ExcelProperty(value = "预计收款日期")
+    @DateTimeFormat("yyyy-MM-dd")
+    private Date receiptTime;
+
+
+    /**
+     * 承运方联系人
+     */
+    @ExcelProperty(value = "承运方联系人")
+    private String auditUser;
+
+    /**
+     * 承运方联系电话
+     */
+    @ExcelProperty(value = "承运方联系电话")
+    private String auditPhone;
+
+    /**
+     * 托运方联系人
+     */
+    @ExcelProperty(value = "托运方联系人")
+    private String successUser;
+
+    /**
+     * 托运方联系电话
+     */
+    @ExcelProperty(value = "托运方联系电话")
+    private String successPhone;
+
+    @ExcelProperty(value = "提交人")
+    private String createByLabel;
+
+
+}

+ 111 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/excel/SettlementTradeExportVo.java

@@ -0,0 +1,111 @@
+package com.sckw.payment.model.vo.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.format.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.sckw.excel.annotation.ExcelContext;
+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
+@ExcelContext(fileName = "贸易结算订单列表", sheetName = "贸易结算订单列表")
+public class SettlementTradeExportVo {
+    /**
+     * 主键
+     */
+    @ExcelProperty(value = "主键")
+    private Long id;
+
+    @ExcelProperty(value = "状态")
+    private String statusLabel;
+    /**
+     * 结算单编号
+     */
+    @ExcelProperty(value = "结算单编号")
+    private String stOrderNo;
+
+    @JsonProperty("tLedgerNo")
+    @ExcelProperty(value = "对账单编号")
+    private String tLedgerNo;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonProperty("generateTime")
+    @ExcelProperty(value = "生成时间")
+    private LocalDateTime generateTime;
+    /**
+     * 结算单名称
+     */
+    @ExcelProperty(value = "对账表名称")
+    private String name;
+
+    @ExcelProperty(value = "供应单位")
+    private String sellFirmName;
+    @ExcelProperty(value = "采购单位")
+    private String purchaseFirmName;
+    @ExcelProperty(value = "支付方式")
+    private String tradingLabel;
+    /**
+     * 总应收/元
+     */
+    @ExcelProperty(value = "实际应收/元")
+    private BigDecimal totalPrice;
+
+    /**
+     * 当前收款/元
+     */
+    @ExcelProperty(value = "当前收款/元")
+    private BigDecimal actualPrice;
+    /**
+     * 剩余待收款/元
+     */
+    @ExcelProperty(value = "剩余待收款/元")
+    private BigDecimal waitPrice;
+
+    /**
+     * 预计收款日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @ExcelProperty(value = "预计收款日期")
+    @DateTimeFormat("yyyy-MM-dd")
+    private Date receiptTime;
+
+
+    /**
+     * 对账采购财务联系人名称
+     */
+    @ExcelProperty(value = "供方联系人")
+    private String auditUser;
+
+    /**
+     * 对账采购财务联系人电话
+     */
+    @ExcelProperty(value = "供方联系电话")
+    private String auditPhone;
+
+    /**
+     * 对账销售财务联系人名称
+     */
+    @ExcelProperty(value = "采方联系人")
+    private String successUser;
+
+    /**
+     * 对账销售财务联系人电话
+     */
+    @ExcelProperty(value = "采方联系电话")
+    private String successPhone;
+
+    @ExcelProperty(value = "提交人")
+    private String createByLabel;
+}

+ 16 - 42
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/LedgerLogisticsVo.java

@@ -51,22 +51,7 @@ public class LedgerLogisticsVo {
      * 订单数量
      */
     @ExcelProperty(value = "订单数量")
-    private Long orderCount;
-//    /**
-//     * 开始日期
-//     */
-//    @ExcelProperty(value = "开始日期")
-//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-//    private LocalDateTime startTime;
-//
-//    /**
-//     * 结束日期
-//     */
-//    @ExcelProperty(value = "结束日期")
-//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-//    private LocalDateTime endTime;
+    private Integer orderCount;
 
     /**
      * 付款方式(预付款、货到付款)
@@ -87,11 +72,7 @@ public class LedgerLogisticsVo {
     @ExcelProperty(value = "总应收/元")
     private BigDecimal totalPrice;
 
-//    /**
-//     * 实际结算金额
-//     */
-//    @ExcelProperty(value = "实际结算金额")
-//    private BigDecimal settlePrice;
+
 
     /**
      * 已收款/元
@@ -100,35 +81,28 @@ public class LedgerLogisticsVo {
     private BigDecimal actualPrice;
 
     /**
-     * 客户联系人
+     * 财务联系人
      */
-    @ExcelProperty(value = "客户联系人")
+    @ExcelProperty(value = "财务联系人")
     private String contacts;
     /**
-     * 联系方式
+     * 财务联系方式
      */
-    @ExcelProperty(value = "联系方式")
+    @ExcelProperty(value = "财务联系方式")
     private String phone;
 
-
-
-//    /**
-//     * 对账托运方财务联系人电话
-//     */
-//    @ExcelProperty(value = "对账托运方财务联系人电话")
-//    private String auditPhone;
-
     /**
-     * 对账托运方财务联系人
+     * 预计收款时间
+     */
+    @ExcelProperty(value = "预计收款时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private LocalDateTime receiptTime;
+    /**
+     * 创建人
      */
-    @ExcelProperty(value = "提交人")
-    private String auditUser;
-//
-//    /**
-//     * 对账清单凭证
-//     */
-//    @ExcelProperty(value = "对账清单凭证")
-//    private String url;
+    @ExcelProperty(value = "创建人")
+    private String createByName;
     /**
      * 生成时间
      */

+ 6 - 25
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/LedgerTradeVo.java

@@ -51,22 +51,10 @@ public class LedgerTradeVo {
      * 订单数量
      */
     @ExcelProperty(value = "订单数量")
-    private Long orderCount;
+    private Integer orderCount;
+
 
 
-//    /**
-//     * 开始日期
-//     */
-//    @ExcelProperty(value = "开始日期")
-//    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-//    private LocalDateTime startTime;
-//
-//    /**
-//     * 结束日期
-//     */
-//    @ExcelProperty(value = "结束日期")
-//    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-//    private LocalDateTime endTime;
     /**
      * 付款方式(预付款、货到付款)
      */
@@ -97,20 +85,15 @@ public class LedgerTradeVo {
     @ExcelProperty(value = "已收款/元")
     private BigDecimal actualPrice;
 
-//    /**
-//     * 对账采购财务联系人电话
-//     */
-//    @ExcelProperty(value = "对账采购财务联系人电话")
-//    private String auditPhone;
     /**
      * 客户联系人
      */
-    @ExcelProperty(value = "客户联系人")
+    @ExcelProperty(value = "财务联系人")
     private String contacts;
     /**
      * 联系方式
      */
-    @ExcelProperty(value = "联系方式")
+    @ExcelProperty(value = "财务联系方式")
     private String phone;
 
     /**
@@ -120,12 +103,10 @@ public class LedgerTradeVo {
     @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
     private LocalDateTime receiptTime;
     /**
-     * 对账采购财务联系人名称
+     * 提交人
      */
     @ExcelProperty(value = "提交人")
-    private String auditUser;
-
-
+    private String createByName;
 
     /**
      * 生成时间

+ 34 - 83
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/SettlementLogisticsVo.java

@@ -1,6 +1,7 @@
 package com.sckw.payment.model.vo.res;
 
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.format.DateTimeFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.sckw.excel.annotation.ExcelContext;
 import lombok.Getter;
@@ -24,6 +25,18 @@ public class SettlementLogisticsVo {
     @ExcelProperty(value = "主键")
     private Long id;
 
+    @ExcelProperty(value = "状态")
+    private String statusLabel;
+    /**
+     * 对账单编号
+     */
+    @ExcelProperty(value = "对账单编号")
+    private String lLedgerNo;
+    /**
+     * 对账表名称
+     */
+    @ExcelProperty(value = "对账表名称")
+    private String name;
     /**
      * 结算单编号
      */
@@ -31,30 +44,36 @@ public class SettlementLogisticsVo {
     private String slOrderNo;
 
     /**
-     * 名称
+     * 剩余待还款
      */
-    @ExcelProperty(value = "名称")
-    private String name;
+    @ExcelProperty(value = "剩余待还款")
+    private BigDecimal waitPrice;
 
     /**
-     * 对账金额
+     * 实际应收/元
      */
-    @ExcelProperty(value = "对账金额")
+    @ExcelProperty(value = "实际应收/元")
     private BigDecimal totalPrice;
 
     /**
-     * 已收账款
+     * 当前收款/元
      */
-    @ExcelProperty(value = "已收账款")
+    @ExcelProperty(value = "当前收款/元")
     private BigDecimal actualPrice;
 
     /**
      * 预计收款日期
      */
+    @DateTimeFormat(value = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
     @ExcelProperty(value = "预计收款日期")
     private Date receiptTime;
 
+    @ExcelProperty(value = "联系人")
+    private String contacts;
+
+    @ExcelProperty(value = "联系电话")
+    private String phone;
     /**
      * 备注
      */
@@ -62,99 +81,31 @@ public class SettlementLogisticsVo {
     private String remark;
 
     /**
-     * 对账托运方财务联系人
-     */
-    @ExcelProperty(value = "对账托运方财务联系人")
-    private String auditUser;
-
-    /**
-     * 对账托运方财务联系人电话
-     */
-    @ExcelProperty(value = "对账托运方财务联系人电话")
-    private String auditPhone;
-
-    /**
-     * 对账承运方财务联系人
-     */
-    @ExcelProperty(value = "对账承运方财务联系人")
-    private String successUser;
-
-    /**
-     * 对账承运方财务联系人电话
-     */
-    @ExcelProperty(value = "对账承运方财务联系人电话")
-    private String successPhone;
-
-
-    @ExcelProperty(value = "状态")
-    private String statusText;
-
-    /**
-     * 创建人名称
+     * 变更人
      */
-    @ExcelProperty(value = "创建人名称")
-    private String createByText;
+    @ExcelProperty(value = "变更人")
+    private String updateByLabel;
 
     /**
-     * 创建时间
+     * 生成时间
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ExcelProperty(value = "创建时间")
+    @ExcelProperty(value = "生成时间")
     private Date createTime;
 
 
-    /**
-     * 更新人名称
-     */
-    @ExcelProperty(value = "更新人名称")
-    private String updateByText;
-
-    /**
-     * 更新时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ExcelProperty(value = "更新时间")
-    private Date updateTime;
-
-
-    /**
-     * 对账单名称
-     */
-    @ExcelProperty(value = "对账单名称")
-    private String ledgerName;
-
-
     /**
      * 交易方式
      */
     @ExcelProperty(value = "交易方式")
-    private String trading;
-
-    /**
-     * 对账单编号
-     */
-    @ExcelProperty(value = "对账单编号")
-    private String lLedgerNo;
+    private String tradingLabel;
 
 
     /**
-     * 客户名称
+     * 客户单位
      */
-    @ExcelProperty(value = "客户名称")
+    @ExcelProperty(value = "客户单位")
     private String firmName;
 
 
-    /**
-     * 实际应收还款
-     */
-    @ExcelProperty(value = "实际应收还款")
-    private BigDecimal ledgerSettlePrice;
-
-    /**
-     * 剩余待还款
-     */
-    @ExcelProperty(value = "剩余待还款")
-    private BigDecimal residuePrice;
-
-
 }

+ 161 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/SettlementTradeVo.java

@@ -0,0 +1,161 @@
+package com.sckw.payment.model.vo.res;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sckw.excel.annotation.ExcelContext;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 运营端 贸易结算
+ *
+ * @author 徐才钦
+ * @date 2023-07-20 12:26
+ */
+@Getter
+@Setter
+@ExcelContext(fileName = "贸易结算订单列表", sheetName = "贸易结算订单列表")
+public class SettlementTradeVo {
+    /**
+     * 主键
+     */
+    @ExcelProperty(value = "主键")
+    private Long id;
+
+    /**
+     * 结算单编号
+     */
+    @ExcelProperty(value = "结算单编号")
+    private String stOrderNo;
+
+    /**
+     * 名称
+     */
+    @ExcelProperty(value = "名称")
+    private String name;
+
+    /**
+     * 对账金额
+     */
+    @ExcelProperty(value = "对账金额")
+    private BigDecimal totalPrice;
+
+    /**
+     * 已收账款
+     */
+    @ExcelProperty(value = "已收账款")
+    private BigDecimal actualPrice;
+
+    /**
+     * 预计收款日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @ExcelProperty(value = "预计收款日期")
+    private Date receiptTime;
+
+    /**
+     * 备注
+     */
+    @ExcelProperty(value = "备注")
+    private String remark;
+
+    /**
+     * 对账托运方财务联系人
+     */
+    @ExcelProperty(value = "对账托运方财务联系人")
+    private String auditUser;
+
+    /**
+     * 对账托运方财务联系人电话
+     */
+    @ExcelProperty(value = "对账托运方财务联系人电话")
+    private String auditPhone;
+
+    /**
+     * 对账承运方财务联系人
+     */
+    @ExcelProperty(value = "对账承运方财务联系人")
+    private String successUser;
+
+    /**
+     * 对账承运方财务联系人电话
+     */
+    @ExcelProperty(value = "对账承运方财务联系人电话")
+    private String successPhone;
+
+
+    @ExcelProperty(value = "状态")
+    private String statusLabel;
+
+    /**
+     * 创建人名称
+     */
+    @ExcelProperty(value = "创建人名称")
+    private String createByLabel;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ExcelProperty(value = "创建时间")
+    private Date createTime;
+
+
+    /**
+     * 更新人名称
+     */
+    @ExcelProperty(value = "更新人名称")
+    private String updateByLabel;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ExcelProperty(value = "更新时间")
+    private Date updateTime;
+
+
+    /**
+     * 对账单名称
+     */
+    @ExcelProperty(value = "对账单名称")
+    private String ledgerName;
+
+
+    /**
+     * 交易方式
+     */
+    @ExcelProperty(value = "交易方式")
+    private String trading;
+
+    /**
+     * 对账单编号
+     */
+    @ExcelProperty(value = "对账单编号")
+    private String lLedgerNo;
+
+
+    /**
+     * 客户名称
+     */
+    @ExcelProperty(value = "客户名称")
+    private String firmName;
+
+
+    /**
+     * 实际应收还款
+     */
+    @ExcelProperty(value = "实际应收还款")
+    private BigDecimal ledgerSettlePrice;
+
+    /**
+     * 剩余待还款
+     */
+    @ExcelProperty(value = "剩余待还款")
+    private BigDecimal residuePrice;
+
+
+}

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

@@ -74,7 +74,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private TransportDubboService transportDubboService;
 
-    private void changeDict(List<ILedger> list) {
+    private void changeDict(List<? extends ILedger> list) {
         List<SysDictResDto> taxRateDict = remoteSystemService.queryDictByType(DictTypeEnum.TAX_RATE.getType());
         Map<String, String> taxRateMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
         Map<String, String> tradingMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
@@ -801,4 +801,11 @@ public class KwpLedgerLogisticsService extends AbsLedger {
     public LedgerSize count(Long entId) {
         return logisticsMapper.countSize(entId);
     }
+
+    public List<LedgerLogisticsDto> exportList(LogisticsReq logisticsReq, List<Long> idList) {
+        fillPara(logisticsReq);
+        List<LedgerLogisticsDto> ledgerLogisticsDtos = logisticsMapper.exportList(logisticsReq, idList);
+        changeDict(ledgerLogisticsDtos);
+        return ledgerLogisticsDtos;
+    }
 }

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

@@ -263,9 +263,9 @@ public class KwpLedgerTradeService extends AbsLedger {
             //1x 预付款 2x 货到付款 3x 线下付款
             Integer prefix = TradingEnum.getPrefix(trading);
             //仅预付款需要校验冻结单号
-            if (Objects.nonNull(prefix) && prefix == TradingEnum.PRE_PAY.getStatus() ) {
+            if (Objects.nonNull(prefix) && prefix == TradingEnum.PRE_PAY.getStatus()) {
                 KwpTradeFreeze byTOrderId = kwpTradeFreezeService.getByTOrderId(id);
-                if(Objects.isNull(byTOrderId)){
+                if (Objects.isNull(byTOrderId)) {
                     throw new BusinessException("未找到关联的冻结单");
                 }
                 map.put(id, byTOrderId.getOrderNo());
@@ -909,4 +909,11 @@ public class KwpLedgerTradeService extends AbsLedger {
     public LedgerSize count(Long entId) {
         return tradeMapper.countSize(entId);
     }
+
+    public List<LedgerTradeDto> exportList(TradeReq tradeReq, List<Long> idList) {
+        fillPara(tradeReq);
+        List<LedgerTradeDto> ledgerTradeDtos = tradeMapper.exportList(tradeReq, idList);
+        changeDict(ledgerTradeDtos);
+        return ledgerTradeDtos;
+    }
 }

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

@@ -4,7 +4,6 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 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.vo.TableTop;
 import com.sckw.core.utils.StringTimeUtil;
 import com.sckw.core.web.context.LoginUserHolder;
@@ -33,7 +32,10 @@ import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
 
 /**
  * @author Aick Spt
@@ -52,6 +54,19 @@ public class KwpSettlementLogisticsService {
     @Resource
     private KwpSettlementOfflineService kwpSettlementOfflineService;
 
+    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()));
+        }
+    }
+
     public void save(KwpSettlementLogistics settlementLogistics) {
         settlementLogisticsMapper.insert(settlementLogistics);
     }
@@ -167,7 +182,13 @@ public class KwpSettlementLogisticsService {
      */
     public List<SettlementLogisticsDto> selectList(SettlementReq settlementReq) {
         validSettlementReq(settlementReq);
-        return settlementLogisticsMapper.selectLogisticsList(settlementReq, settlementReq.getIdList());
+        List<SettlementLogisticsDto> settlementLogisticsDtos = settlementLogisticsMapper.selectLogisticsList(settlementReq, settlementReq.getIdList());
+        changeDict(settlementLogisticsDtos);
+        for (SettlementLogisticsDto settlementLogisticsDto : settlementLogisticsDtos) {
+            UserCacheResDto userCacheResDto = remoteSystemService.queryUserCacheById(settlementLogisticsDto.getUpdateBy());
+            settlementLogisticsDto.setUpdateByLabel(Objects.nonNull(userCacheResDto) ? userCacheResDto.getName() : "");
+        }
+        return settlementLogisticsDtos;
     }
 
     /**
@@ -215,22 +236,18 @@ public class KwpSettlementLogisticsService {
         List<SettlementLogisticsDto> kwpLedgerLogisticsList = settlementLogisticsMapper.pageSelect(settlementReq);
         //查询同样条件下的合计
         SettlementLogisticsSumVo settlementLogisticsSum = settlementLogisticsMapper.selectSum(settlementReq);
+        PageInfo<SettlementLogisticsDto> pageInfo = new PageInfo<>(kwpLedgerLogisticsList);
 
-        // 对查询结果进行处理,转换 status 等状态值为对应中文描述
-        return new PageMoreRes<>(getSettlementLogisticsDtoPageRes(kwpLedgerLogisticsList), settlementLogisticsSum);
-    }
-
-    /**
-     * 对查询结果进行处理,转换 status 等状态值为对应中文描述
-     *
-     * @author Aick Spt
-     * @date 2023-08-03 10:44
-     */
-    private PageInfo<SettlementLogisticsDto> getSettlementLogisticsDtoPageRes(List<SettlementLogisticsDto> kwpLedgerLogisticsList) {
+        Map<String, SysDictResDto> dictResDtoMap = remoteSystemService.queryDictMapByType(DictTypeEnum.TRADE_TYPE.getType());
         for (SettlementLogisticsDto entity : kwpLedgerLogisticsList) {
+            SysDictResDto sysDictResDto = dictResDtoMap.get(entity.getTrading());
+            if (Objects.nonNull(sysDictResDto)) {
+                entity.setTradingLabel(sysDictResDto.getLabel());
+            }
             setDetailDesc(entity);
         }
-        return new PageInfo<>(kwpLedgerLogisticsList);
+
+        return new PageMoreRes<>(pageInfo, settlementLogisticsSum);
     }
 
     /**
@@ -291,6 +308,12 @@ public class KwpSettlementLogisticsService {
         if (settlementLogisticsDto == null) {
             throw new BusinessException("查无数据");
         }
+        //
+        Map<String, SysDictResDto> dictResDtoMap = remoteSystemService.queryDictMapByType(DictTypeEnum.TRADE_TYPE.getType());
+        SysDictResDto sysDictResDto = dictResDtoMap.get(settlementLogisticsDto.getTrading());
+        if (Objects.nonNull(sysDictResDto)) {
+            settlementLogisticsDto.setTradingLabel(sysDictResDto.getLabel());
+        }
         setDetailDesc(settlementLogisticsDto);
         return settlementLogisticsDto;
     }
@@ -306,17 +329,6 @@ public class KwpSettlementLogisticsService {
     }
 
 
-    private String changeDict(String trading) {
-        //字典等数据转换
-        String tradingLabel = "";
-        Map<String, SysDictResDto> dictResDtoMap = remoteSystemService.queryDictMapByType(DictTypeEnum.TRADE_TYPE.getType());
-        SysDictResDto sysDictResDto = dictResDtoMap.get(trading);
-        if (Objects.nonNull(sysDictResDto)) {
-            tradingLabel = sysDictResDto.getLabel();
-        }
-        return tradingLabel;
-    }
-
     /**
      * 增加 创建、更新人名称及字段
      *
@@ -324,8 +336,8 @@ public class KwpSettlementLogisticsService {
      * @date 2023-08-07 10:14
      */
     private void setDetailDesc(SettlementLogisticsDto settlementLogisticsDto) {
-        //更改支付方式 TradingEnum
-        settlementLogisticsDto.setTradingLabel(changeDict(settlementLogisticsDto.getTrading()));
+        //结算比例
+        settlementLogisticsDto.setPercentage(settlementLogisticsDto.changePercentage(settlementLogisticsDto.getActualPrice(), settlementLogisticsDto.getTotalPrice()));
 
         //更改创建、更新人名称及字段
         settlementLogisticsDto.setStatusLabel(SettlementEnum.getStatusDesc(settlementLogisticsDto.getStatus()));
@@ -343,28 +355,16 @@ public class KwpSettlementLogisticsService {
         //"更新人名称"
         settlementLogisticsDto.setUpdateByLabel("更新人名称");
 
-        Map<Long, UserCacheResDto> map = new HashMap<>(Global.NUMERICAL_SIXTEEN);
         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);
-        }
+        UserCacheResDto userCacheResDto = remoteSystemService.queryUserCacheById(createBy);
         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)) {
+        UserCacheResDto userCacheResDto2 = remoteSystemService.queryUserCacheById(updateBy);
+        if (Objects.nonNull(userCacheResDto2)) {
             //写入对应数据
-            settlementLogisticsDto.setUpdateByLabel(userCacheResDto.getName());
+            settlementLogisticsDto.setUpdateByLabel(userCacheResDto2.getName());
         }
     }
 

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

@@ -284,4 +284,8 @@ public class KwpSettlementTradeService {
     public List<MoneyType> moneySum(Long entId, List<LocalDateTime> cur, List<LocalDateTime> pre, Integer unitType) {
         return settlementTradeMapper.sumMoneyType(entId, cur, pre, unitType);
     }
+
+    public List<SettlementTradeDto> exportList(SettlementTradeReq settlementReq, List<Long> idList) {
+        return settlementTradeMapper.exportList(settlementReq,idList);
+    }
 }

+ 57 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpWalletPrepayService.java

@@ -0,0 +1,57 @@
+package com.sckw.payment.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.Global;
+import com.sckw.core.utils.IdWorker;
+import com.sckw.core.web.context.LoginUserHolder;
+import com.sckw.payment.dao.KwpWalletPrepayMapper;
+import com.sckw.payment.model.KwpWalletPrepay;
+import com.sckw.payment.model.constant.PrePayEnum;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.util.Objects;
+
+/**
+ * @author xucaiqin
+ * @date 2023-09-22 15:49:51
+ */
+@Service
+@RequiredArgsConstructor
+public class KwpWalletPrepayService {
+
+    private final KwpWalletPrepayMapper kwpWalletPrepayMapper;
+
+    /**
+     * 保存预付订单
+     *
+     * @param orderNo
+     */
+    public void savePrepay(String orderNo, PrePayEnum prePayEnum) {
+        KwpWalletPrepay kwpWalletPrepay = new KwpWalletPrepay();
+        kwpWalletPrepay.setId(new IdWorker(NumberConstant.ONE).nextId());
+        kwpWalletPrepay.setOrderNo(orderNo);
+        kwpWalletPrepay.setAction(prePayEnum.getStatus());
+        kwpWalletPrepay.setRemark(prePayEnum.getDesc());
+        kwpWalletPrepay.setStatus(2);
+        kwpWalletPrepay.setCreateBy(LoginUserHolder.getUserId());
+        kwpWalletPrepay.setCreateTime(LocalDateTime.now());
+        kwpWalletPrepay.setUpdateBy(LoginUserHolder.getUserId());
+        kwpWalletPrepay.setUpdateTime(LocalDateTime.now());
+        kwpWalletPrepay.setDelFlag(Global.UN_DELETED);
+        kwpWalletPrepayMapper.insert(kwpWalletPrepay);
+    }
+
+    public Integer getAction(String orderNo) {
+        LambdaQueryWrapper<KwpWalletPrepay> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(KwpWalletPrepay::getDelFlag, Global.UN_DELETED)
+                .eq(KwpWalletPrepay::getOrderNo, orderNo).last("limit 1");
+        KwpWalletPrepay kwpWalletPrepay = kwpWalletPrepayMapper.selectOne(wrapper);
+        if(Objects.nonNull(kwpWalletPrepay)){
+            return kwpWalletPrepay.getAction();
+        }
+        return null;
+    }
+}

+ 66 - 4
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/PayCenterService.java

@@ -7,14 +7,16 @@ import com.sckw.core.exception.BusinessException;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.OkHttpUtils;
 import com.sckw.payment.api.model.constant.ChannelEnum;
-import com.sckw.payment.api.model.dto.*;
-import com.sckw.payment.model.dto.common.BusinessNo;
+import com.sckw.payment.api.model.dto.MemberDetail;
+import com.sckw.payment.api.model.dto.WalletDto;
 import com.sckw.payment.api.model.dto.common.R;
+import com.sckw.payment.model.constant.PayCenterEnum;
+import com.sckw.payment.model.dto.common.BusinessNo;
+import com.sckw.payment.model.dto.common.Page;
 import com.sckw.payment.model.dto.page.CashPage;
 import com.sckw.payment.model.dto.page.PrePayIndexPage;
 import com.sckw.payment.model.dto.page.PrePayWalletPage;
 import com.sckw.payment.model.dto.page.RecordPage;
-import com.sckw.payment.model.constant.PayCenterEnum;
 import com.sckw.payment.model.dto.wallet.*;
 import jakarta.validation.constraints.NotBlank;
 import jakarta.validation.constraints.NotNull;
@@ -192,6 +194,21 @@ public class PayCenterService {
         });
     }
 
+    /**
+     * 会员注册信息
+     *
+     * @param uid
+     * @return
+     */
+    public R<JSONObject> user(String uid,ChannelEnum channelEnum) {
+        String sync = getHttp(PayCenterEnum.USER, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channelEnum);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
     /**
      * 钱包清单
      *
@@ -585,6 +602,28 @@ public class PayCenterService {
         });
     }
 
+    /**
+     * 预付订单清单
+     *
+     * @param uid
+     * @param channel
+     * @param filter
+     * @param page
+     * @param pageSize
+     * @return
+     */
+    public R<Page<PrePayIndex2>> advancePayIndex2(String uid, ChannelEnum channel, String filter, Integer page, Integer pageSize) {
+        String sync = getHttp(PayCenterEnum.ADVANCE_PAY_INDEX2, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("filter", filter);
+            put("page", page);
+            put("pageSize", pageSize);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
     /**
      * 钱包预付统计列表
      *
@@ -730,7 +769,7 @@ public class PayCenterService {
      * @param pageSize
      * @return
      */
-    public R<RechargePage> rechargeOrder(String uid, String startDate, String endDate, String keyword, Integer page, Integer pageSize) {
+    public R<RechargePage> rechargeOrder(String uid, String filter,ChannelEnum channelEnum,String startDate, String endDate, String keyword, Integer page, Integer pageSize) {
         if (Objects.isNull(page)) {
             page = 1;
         }
@@ -741,6 +780,8 @@ public class PayCenterService {
         Integer finalPageSize = pageSize;
         String sync = getHttp(PayCenterEnum.RECHARGE_ORDER, new HashMap<>() {{
             put("uid", uid);
+            put("filter", filter);
+            put("channel", channelEnum);
             put("keyword", keyword);
             put("startDate", startDate);
             put("endDate", endDate);
@@ -785,6 +826,27 @@ public class PayCenterService {
         });
     }
 
+    /**
+     * 转出,在提现
+     *
+     * @param uid
+     * @param filter
+     * @param channel
+     * @param money
+     * @return
+     */
+    public R<Order> withdrawTransfer(String uid, String filter, ChannelEnum channel, Long money) {
+        String sync = postHttp(PayCenterEnum.WITHDRAW_TRANSFER, new HashMap<>() {{
+            put("uid", uid);
+            put("filter", filter);
+            put("channel", channel);
+            put("money", money);
+        }});
+
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
     /**
      * 冻结资金
      * 中台逻辑:

+ 125 - 66
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WalletService.java

@@ -24,12 +24,14 @@ import com.sckw.payment.job.AsyncPool;
 import com.sckw.payment.model.KwpWalletRefund;
 import com.sckw.payment.model.KwpWalletRelation;
 import com.sckw.payment.model.KwpWalletTransfer;
+import com.sckw.payment.model.constant.PrePayEnum;
 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.WalletInfoDto;
 import com.sckw.payment.model.dto.WalletRelationDto;
 import com.sckw.payment.model.dto.common.BusinessNo;
+import com.sckw.payment.model.dto.common.Page;
 import com.sckw.payment.model.dto.page.CashPage;
 import com.sckw.payment.model.dto.page.PrePayWalletPage;
 import com.sckw.payment.model.dto.wallet.*;
@@ -56,6 +58,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.DecimalFormat;
 import java.time.LocalDateTime;
 import java.util.*;
@@ -72,6 +75,7 @@ import java.util.stream.Collectors;
 @RequiredArgsConstructor
 public class WalletService {
     private final PayCenterService payCenterService;
+    private final KwpWalletPrepayService kwpWalletPrepayService;
     private final KwpWalletRelationService walletRelationService;
     private final WalletOrderService walletOrderService;
     private final KwpWalletRefundMapper kwpWalletRefundMapper;
@@ -238,6 +242,7 @@ public class WalletService {
 
     /**
      * 计算转账中金额
+     *
      * @param fundVo
      */
     private void transferMoney(FundVo fundVo) {
@@ -554,19 +559,11 @@ public class WalletService {
         if (Objects.isNull(byChannel)) {
             throw new BusinessException("支付通道不存在");
         }
-        //余额转出
-        R<Object> transfer = payCenterService.transfer(cashWalletReq.getUid(), cashWalletReq.getFilter(), byChannel, cashWalletReq.bigMoney(cashWalletReq.getMoney()));
-        log.info("提现-余额转出:{}", JSONObject.toJSONString(transfer));
-        if (!transfer.getStatus()) {
-            throw new BusinessException(StringUtils.isNotBlank(transfer.getMsg()) ? transfer.getMsg() : "提现异常");
-        }
-        //申请提现
-        R<Order> orderR = payCenterService.withdrawTake(cashWalletReq.getUid(), byChannel, cashWalletReq.bigMoney(cashWalletReq.getMoney()), cashWalletReq.getRemark());
-        log.info("提现-申请提现:{}", JSONObject.toJSONString(orderR));
-        if (!orderR.getStatus()) {
-            throw new BusinessException(StringUtils.isNotBlank(orderR.getMsg()) ? orderR.getMsg() : "申请提现异常");
+        R<Order> payIndexR = payCenterService.withdrawTransfer(cashWalletReq.getUid(), cashWalletReq.getFilter(), byChannel, cashWalletReq.bigMoney(cashWalletReq.getMoney()));
+        if (!payIndexR.getStatus()) {
+            throw new BusinessException(StringUtils.isNotBlank(payIndexR.getMsg()) ? payIndexR.getMsg() : "申请提现异常");
         }
-        return orderR.getData();
+        return payIndexR.getData();
     }
 
     /**
@@ -649,6 +646,18 @@ public class WalletService {
         return "请勿重复提交!";
     }
 
+    /**
+     * 分转元
+     *
+     * @param big
+     * @return
+     */
+    private BigDecimal smallMoney(BigDecimal big) {
+        if (Objects.isNull(big)) {
+            return new BigDecimal("0.00");
+        }
+        return big.divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP);
+    }
 
     /**
      * 提现记录
@@ -675,8 +684,15 @@ public class WalletService {
             return new MorePageRes<>(cashPageReq.getPage(), cashPageReq.getPageSize(), 0, 0, new ArrayList<>(), "0.00");
         }
         CashPage data = cashPageR.getData();
+        List<CashItem> rows = data.getRows();
+        if (!CollectionUtils.isEmpty(rows)) {
+            for (CashItem row : rows) {
+                row.setBalance(smallMoney(row.getBalance()));
+                row.setMoney(smallMoney(row.getMoney()));
+            }
+        }
         //组装数据
-        return new MorePageRes<>(cashPageReq.getPage(), cashPageReq.getPageSize(), data.getTotal(), (int) (data.getTotal() / cashPageReq.getPageSize() + 1), data.getRows(), String.valueOf(Long.parseLong(data.getTotalWithdrawMoney()) / 100.0D));
+        return new MorePageRes<>(cashPageReq.getPage(), cashPageReq.getPageSize(), data.getTotal(), (int) (data.getTotal() / cashPageReq.getPageSize() + 1), rows, String.valueOf(Long.parseLong(data.getTotalWithdrawMoney()) / 100.0D));
     }
 
     /**
@@ -978,6 +994,9 @@ public class WalletService {
         if (!orderR.getStatus()) {
             throw new BusinessException(StringUtils.isNotBlank(orderR.getMsg()) ? orderR.getMsg() : "预付失败");
         }
+        if (Objects.nonNull(orderR.getData())) {
+            kwpWalletPrepayService.savePrepay(orderR.getData().getOrderNo(), PrePayEnum.ADD);
+        }
         return orderR.getData();
     }
 
@@ -1000,6 +1019,9 @@ public class WalletService {
         if (!orderR.getStatus()) {
             throw new BusinessException(StringUtils.isNotBlank(orderR.getMsg()) ? orderR.getMsg() : "预付失败");
         }
+        if (Objects.nonNull(orderR.getData())) {
+            kwpWalletPrepayService.savePrepay(orderR.getData().getOrderNo(), PrePayEnum.APPEND);
+        }
         return orderR.getData();
     }
 
@@ -1295,8 +1317,7 @@ public class WalletService {
      * @return
      */
     public PageRes<ChargeDetailVo> rechargeList(MoneyPage moneyPage) {
-        fillPara(moneyPage);
-        R<RechargePage> rechargePageR = payCenterService.rechargeOrder(moneyPage.getUid(), moneyPage.getStartCreateTime(), moneyPage.getEndCreateTime(), moneyPage.getKeywords(), moneyPage.getPage(), moneyPage.getPageSize());
+        R<RechargePage> rechargePageR = payCenterService.rechargeOrder(moneyPage.getUid(), moneyPage.getFilter(), ChannelEnum.getByChannel(moneyPage.getChannel()), moneyPage.getStartCreateTime(), moneyPage.getEndCreateTime(), moneyPage.getKeywords(), moneyPage.getPage(), moneyPage.getPageSize());
         if (!rechargePageR.getStatus()) {
             throw new BusinessException(StringUtils.isBlank(rechargePageR.getMsg()) ? "查询失败" : rechargePageR.getMsg());
         }
@@ -1334,7 +1355,6 @@ public class WalletService {
      * @return
      */
     public PageRes<WalletDetailBase> transferOrder(MoneyPage moneyPage) {
-        fillPara(moneyPage);
         PageHelper.startPage(moneyPage.getPage(), moneyPage.getPageSize());
         List<KwpWalletTransfer> kwpWalletTransfers = kwpWalletTransferMapper.pageList(moneyPage);
         PageInfo<KwpWalletTransfer> pageInfo = new PageInfo<>(kwpWalletTransfers);
@@ -1368,12 +1388,6 @@ public class WalletService {
      * @return
      */
     public PageRes<WalletDetailBase> refundOrder(MoneyPage moneyPage) {
-        if (StringUtils.isNotBlank(moneyPage.getStartCreateTime())) {
-            moneyPage.setStartCreateTime(StringTimeUtil.fillStart(moneyPage.getStartCreateTime()));
-        }
-        if (StringUtils.isNotBlank(moneyPage.getEndCreateTime())) {
-            moneyPage.setEndCreateTime(StringTimeUtil.fillEnd(moneyPage.getEndCreateTime()));
-        }
         RefundPage refundPage = new RefundPage();
         BeanUtils.copyProperties(moneyPage, refundPage);
         PageRes<WalletRefundVo> walletRefundVoPageRes = walletOrderService.queryRefundList(refundPage);
@@ -1446,12 +1460,6 @@ public class WalletService {
      * @return
      */
     public PageRes<WalletDetailBase> prePayRefund(MoneyPage moneyPage) {
-        if (StringUtils.isNotBlank(moneyPage.getStartCreateTime())) {
-            moneyPage.setStartCreateTime(StringTimeUtil.fillStart(moneyPage.getStartCreateTime()));
-        }
-        if (StringUtils.isNotBlank(moneyPage.getEndCreateTime())) {
-            moneyPage.setEndCreateTime(StringTimeUtil.fillEnd(moneyPage.getEndCreateTime()));
-        }
         RefundPage refundPage = new RefundPage();
         BeanUtils.copyProperties(moneyPage, refundPage);
         PageRes<WalletRefundVo> walletRefundVoPageRes = walletOrderService.queryRefundList(refundPage);
@@ -1590,25 +1598,41 @@ public class WalletService {
      * @return
      */
     public PageRes<PrePayDetailVo> prePayOrder(MoneyPage moneyPage) {
-        PrePayDetailVo chargeDetailVo = new PrePayDetailVo();
-        chargeDetailVo.setOrderNo("123");
-        chargeDetailVo.setChannel("huifu");
-        chargeDetailVo.setChannelDict("1");
-        chargeDetailVo.setChannelLabel("汇付天下");
-        chargeDetailVo.setUid("kll_001");
-        chargeDetailVo.setUidName("uid名称");
-        chargeDetailVo.setFilter("kll_002");
-        chargeDetailVo.setFilterName("filterName");
-        chargeDetailVo.setStatus(0);
-        chargeDetailVo.setStatusLabel("测试");
-        chargeDetailVo.setMoney(new BigDecimal("12"));
-        chargeDetailVo.setRemark("测试");
-        chargeDetailVo.setCreateTime(DateTimeUtil.format(LocalDateTime.now()));
-        List<PrePayDetailVo> objects = new ArrayList<>() {{
-            add(chargeDetailVo);
-        }};
-        PageInfo<PrePayDetailVo> objectPageInfo = new PageInfo<>();
-        return new PageRes<>(objectPageInfo, objects);
+        ChannelEnum byChannel = ChannelEnum.getByChannel(moneyPage.getChannel());
+        if (Objects.isNull(byChannel)) {
+            throw new BusinessException("支付通道异常");
+        }
+        R<Page<PrePayIndex2>> pageR = payCenterService.advancePayIndex2(moneyPage.getUid(), byChannel, moneyPage.getFilter(), moneyPage.getPage(), moneyPage.getPageSize());
+        if (!pageR.getStatus()) {
+            return new PageRes<>(moneyPage.getPage(), moneyPage.getPageSize(), 0, 0, new ArrayList<>());
+        }
+        Page<PrePayIndex2> data = pageR.getData();
+        if (Objects.nonNull(data)) {
+            List<PrePayIndex2> rows = data.getRows();
+            if (!CollectionUtils.isEmpty(rows)) {
+                List<PrePayDetailVo> collect = rows.stream().map(a -> {
+                    PrePayDetailVo prePayDetailVo = new PrePayDetailVo();
+                    prePayDetailVo.setBalance(prePayDetailVo.smallMoney(a.getApBalance()));
+                    prePayDetailVo.setOrderNo(a.getOrderNo());
+                    prePayDetailVo.setChannel(a.getChannel());
+                    prePayDetailVo.setChannelDict(ChannelEnum.getDict(a.getChannel()));
+                    prePayDetailVo.setChannelLabel(ChannelEnum.getDesc(a.getChannel()));
+                    prePayDetailVo.setUid(moneyPage.getUid());
+                    prePayDetailVo.setUidName(getFirmName(moneyPage.getUid()));
+                    prePayDetailVo.setFilter(moneyPage.getFilter());
+                    prePayDetailVo.setFilterName(getFirmName(moneyPage.getFilter()));
+                    Integer action = kwpWalletPrepayService.getAction(a.getOrderNo());
+                    prePayDetailVo.setStatus(action);
+                    prePayDetailVo.setStatusLabel(PrePayEnum.getByStatus(action));
+                    prePayDetailVo.setMoney(prePayDetailVo.smallMoney(a.getMoney()));
+                    prePayDetailVo.setRemark(a.getRemarks());
+                    prePayDetailVo.setCreateTime(a.getCreateTime());
+                    return prePayDetailVo;
+                }).collect(Collectors.toList());
+                return new PageRes<>(moneyPage.getPage(), moneyPage.getPageSize(), data.getTotal(), (int) (data.getTotal() / data.getPageSize() + 1), collect);
+            }
+        }
+        return new PageRes<>(moneyPage.getPage(), moneyPage.getPageSize(), 0, 0, new ArrayList<>());
     }
 
     /**
@@ -1618,25 +1642,60 @@ public class WalletService {
      * @return
      */
     public PageRes<PrePayDetailVo> preReceiveOrder(MoneyPage moneyPage) {
-        PrePayDetailVo chargeDetailVo = new PrePayDetailVo();
-        chargeDetailVo.setOrderNo("123");
-        chargeDetailVo.setChannel("huifu");
-        chargeDetailVo.setChannelDict("1");
-        chargeDetailVo.setChannelLabel("汇付天下");
-        chargeDetailVo.setUid("kll_001");
-        chargeDetailVo.setUidName("uid名称");
-        chargeDetailVo.setFilter("kll_002");
-        chargeDetailVo.setFilterName("filterName");
-        chargeDetailVo.setStatus(0);
-        chargeDetailVo.setStatusLabel("测试");
-        chargeDetailVo.setMoney(new BigDecimal("12"));
-        chargeDetailVo.setRemark("测试");
-        chargeDetailVo.setCreateTime(DateTimeUtil.format(LocalDateTime.now()));
-        List<PrePayDetailVo> objects = new ArrayList<>() {{
-            add(chargeDetailVo);
-        }};
-        PageInfo<PrePayDetailVo> objectPageInfo = new PageInfo<>();
-        return new PageRes<>(objectPageInfo, objects);
+        ChannelEnum byChannel = ChannelEnum.getByChannel(moneyPage.getChannel());
+        if (Objects.isNull(byChannel)) {
+            throw new BusinessException("支付通道异常");
+        }
+        R<Page<PrePayIndex2>> pageR = payCenterService.advancePayIndex2(moneyPage.getFilter(), byChannel, moneyPage.getUid(), moneyPage.getPage(), moneyPage.getPageSize());
+        if (!pageR.getStatus()) {
+            return new PageRes<>(moneyPage.getPage(), moneyPage.getPageSize(), 0, 0, new ArrayList<>());
+        }
+        Page<PrePayIndex2> data = pageR.getData();
+        if (Objects.nonNull(data)) {
+            List<PrePayIndex2> rows = data.getRows();
+            if (!CollectionUtils.isEmpty(rows)) {
+                List<PrePayDetailVo> collect = rows.stream().map(a -> {
+                    PrePayDetailVo prePayDetailVo = new PrePayDetailVo();
+                    prePayDetailVo.setBalance(prePayDetailVo.smallMoney(a.getApBalance()));
+                    prePayDetailVo.setOrderNo(a.getOrderNo());
+                    prePayDetailVo.setChannel(a.getChannel());
+                    prePayDetailVo.setChannelDict(ChannelEnum.getDict(a.getChannel()));
+                    prePayDetailVo.setChannelLabel(ChannelEnum.getDesc(a.getChannel()));
+                    prePayDetailVo.setUid(moneyPage.getUid());
+                    prePayDetailVo.setUidName(getFirmName(moneyPage.getUid()));
+                    prePayDetailVo.setFilter(moneyPage.getFilter());
+                    prePayDetailVo.setFilterName(getFirmName(moneyPage.getFilter()));
+                    Integer action = kwpWalletPrepayService.getAction(a.getOrderNo());
+                    prePayDetailVo.setStatus(action);
+                    prePayDetailVo.setStatusLabel(PrePayEnum.getByStatus(action));
+                    prePayDetailVo.setMoney(prePayDetailVo.smallMoney(a.getMoney()));
+                    prePayDetailVo.setRemark(a.getRemarks());
+                    prePayDetailVo.setCreateTime(a.getCreateTime());
+                    return prePayDetailVo;
+                }).collect(Collectors.toList());
+                return new PageRes<>(moneyPage.getPage(), moneyPage.getPageSize(), data.getTotal(), (int) (data.getTotal() / data.getPageSize() + 1), collect);
+            }
+        }
+        return new PageRes<>(moneyPage.getPage(), moneyPage.getPageSize(), 0, 0, new ArrayList<>());
+    }
+
+    /**
+     * 会员注册信息
+     *
+     * @param uid
+     * @param channel
+     * @return
+     */
+    public Object userInfo(String uid, String channel) {
+        ChannelEnum channelEnum = ChannelEnum.getByChannel(channel);
+        if (Objects.isNull(channelEnum)) {
+            throw new BusinessException("支付通道异常");
+        }
+        R<JSONObject> user = payCenterService.user(uid, channelEnum);
+        if (!user.getStatus()) {
+            throw new BusinessException(StringUtils.isNotBlank(user.getMsg()) ? user.getMsg() : "会员信息不存在");
+        }
+        return user.getData();
     }
 
     /**

+ 25 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementLogisticsService.java

@@ -9,6 +9,7 @@ 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.ISettlement;
 import com.sckw.payment.model.vo.SettlementLogistics;
 import com.sckw.payment.model.vo.req.SettlementReq;
 import com.sckw.payment.model.vo.res.SettlementLogisticsSumVo;
@@ -35,6 +36,23 @@ public class SettlementLogisticsService {
     private RemoteSystemService remoteSystemService;
     private final KwpSettlementLogisticsMapper settlementLogisticsMapper;
 
+    /**
+     * 字典转换
+     *
+     * @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()));
+        }
+    }
 
     public List<TableTop> count(SettlementReq settlementReq) {
         settlementReq.setUnitType(LogisticsUnitType.SHIPPER);
@@ -78,7 +96,13 @@ public class SettlementLogisticsService {
 
     public List<SettlementLogistics> exportList(SettlementReq settlementReq) {
         validSettlementReq(settlementReq);
-        return settlementLogisticsMapper.exportList(settlementReq, settlementReq.getIdList());
+        List<SettlementLogistics> settlementLogistics = settlementLogisticsMapper.exportList(settlementReq, settlementReq.getIdList());
+        changeDict(settlementLogistics);
+        for (SettlementLogistics tmp : settlementLogistics) {
+            UserCacheResDto userCacheResDto = remoteSystemService.queryUserCacheById(tmp.getCreateBy());
+            tmp.setCreateByLabel(Objects.nonNull(userCacheResDto) ? userCacheResDto.getName() : "");
+        }
+        return settlementLogistics;
     }
 
 

+ 9 - 6
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/operate/SettlementTradeService.java

@@ -5,15 +5,10 @@ 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;
@@ -114,5 +109,13 @@ public class SettlementTradeService {
     }
 
 
-
+    public List<SettlementTrade> exportList(SettlementTradeReq settlementReq, List<Long> idList) {
+        List<SettlementTrade> settlementTradeDtos = settlementTradeMapper.operateExportList(settlementReq, idList);
+        changeDict(settlementTradeDtos);
+        for (SettlementTrade settlementTradeDto : settlementTradeDtos) {
+            UserCacheResDto userCacheResDto = remoteSystemService.queryUserCacheById(settlementTradeDto.getCreateBy());
+            settlementTradeDto.setCreateByLabel(Objects.nonNull(userCacheResDto) ? userCacheResDto.getName() : "");
+        }
+        return settlementTradeDtos;
+    }
 }

+ 67 - 0
sckw-modules/sckw-payment/src/main/resources/mapper/KwpLedgerLogisticsMapper.xml

@@ -504,4 +504,71 @@
               and kllu.top_ent_id = #{entId,jdbcType=BIGINT}
         </where>
     </select>
+
+    <select id="exportList" resultType="com.sckw.payment.model.dto.LedgerLogisticsDto">
+        select kll.id,
+               kll.l_ledger_no                  lLedgerNo,
+               kll.name,
+               kll.start_time                   startTime,
+               kll.end_time                     endTime,
+               kll.tax_rate                     taxRate,
+               kll.trading,
+               kll.total_price                  totalPrice,
+               kll.ex_tax_price                 exTaxPrice,
+               kll.settle_price                 settlePrice,
+               kll.actual_price                 actualPrice,
+               kll.url,
+               kll.generate_time                generateTime,
+               kll.receipt_time                 receiptTime,
+               kll.remark,
+               kll.status,
+               kll.create_by                    createBy,
+               kllu.top_ent_id                  checkEntId,
+               (case
+                    when #{logisticsReq.unitType,jdbcType=INTEGER} = 1 then kll.audit_user
+                    else kll.success_user end) as contacts,
+               (case
+                    when #{logisticsReq.unitType,jdbcType=INTEGER} = 1 then kll.audit_phone
+                    else kll.success_phone end) as phone,
+               kllu.firm_name                   firmName,
+               kll.order_count                  orderCount
+        from kwp_ledger_logistics kll
+                 inner join kwp_ledger_logistics_unit kllu
+                            on kll.id = kllu.l_ledger_id and kllu.del_flag = 0 and
+                               kllu.unit_type = #{logisticsReq.unitType,jdbcType=INTEGER}
+                 inner join kwp_ledger_logistics_unit kllu2
+                            on kll.id = kllu2.l_ledger_id and kllu2.del_flag = 0 and
+                               kllu2.unit_type = #{logisticsReq.unitTypeTwo,jdbcType=INTEGER}
+        <where>
+            kll.del_flag = 0
+            <choose>
+                <when test="idList != null and idList.size() != 0">
+                    and kll.id in
+                    <foreach collection="idList" open="(" separator="," close=")" item="item">
+                        #{item,jdbcType=BIGINT}
+                    </foreach>
+                </when>
+                <otherwise>
+                    and kllu2.top_ent_id = #{logisticsReq.entId,jdbcType=BIGINT}
+                    <if test="logisticsReq.status != null">
+                        and kll.status = #{logisticsReq.status}
+                    </if>
+                    <if test="logisticsReq.trading != null">
+                        and kll.trading = #{logisticsReq.trading,jdbcType=INTEGER}
+                    </if>
+                    <if test="logisticsReq.startCreateTime != null and logisticsReq.startCreateTime != '' and logisticsReq.endCreateTime != null and logisticsReq.endCreateTime != ''">
+                        and kll.generate_time between #{logisticsReq.startCreateTime,jdbcType=TIMESTAMP}
+                            and #{logisticsReq.endCreateTime,jdbcType=TIMESTAMP}
+                    </if>
+                    <if test="logisticsReq.keywords != null and logisticsReq.keywords != ''">
+                        and (
+                                    kll.l_ledger_no like concat('%', #{logisticsReq.keywords,jdbcType=VARCHAR}, '%')
+                                or kllu.firm_name like concat('%', #{logisticsReq.keywords,jdbcType=VARCHAR}, '%')
+                                or kllu.contacts like concat('%', #{logisticsReq.keywords,jdbcType=VARCHAR}, '%')
+                            )
+                    </if>
+                </otherwise>
+            </choose>
+        </where>
+    </select>
 </mapper>

+ 72 - 0
sckw-modules/sckw-payment/src/main/resources/mapper/KwpLedgerTradeMapper.xml

@@ -608,4 +608,76 @@
               and kltu.top_ent_id = #{entId,jdbcType=BIGINT}
         </where>
     </select>
+
+    <select id="exportList" resultType="com.sckw.payment.model.dto.LedgerTradeDto">
+        select klt.id,
+               klt.t_ledger_no                     tLedgerNo,
+               klt.name,
+               klt.start_time                      startTime,
+               klt.end_time                        endTime,
+               klt.tax_rate                        taxRate,
+               klt.trading,
+               klt.total_price                     totalPrice,
+               klt.ex_tax_price                    exTaxPrice,
+               klt.settle_price                    settlePrice,
+               klt.actual_price                    actualPrice,
+               klt.url,
+               klt.generate_time                   generateTime,
+               klt.receipt_time                    receiptTime,
+               klt.remark,
+               klt.status,
+               klt.create_by                       createBy,
+               (case
+                    when #{tradeReq.unitType,jdbcType=INTEGER} = 1 then klt.audit_user
+                    else klt.success_user end)  as contacts,
+               (case
+                    when #{tradeReq.unitType,jdbcType=INTEGER} = 1 then klt.audit_phone
+                    else klt.success_phone end) as phone,
+               kltu.firm_name                      firmName,
+               klt.order_count                     orderCount
+        from kwp_ledger_trade klt
+                 inner join kwp_ledger_trade_unit kltu
+                            on klt.id = kltu.t_ledger_id and kltu.del_flag = 0 and
+                               kltu.unit_type = #{tradeReq.unitType,jdbcType=INTEGER}
+                 inner join kwp_ledger_trade_unit kltu2
+                            on klt.id = kltu2.t_ledger_id and kltu2.del_flag = 0 and kltu2.unit_type =
+                                                                                     #{tradeReq.unitTypeTwo,jdbcType=INTEGER}
+        <where>
+            klt.del_flag = 0
+            <choose>
+                <when test="idList != null and idList.size() != 0">
+                    and klt.id in
+                    <foreach collection="idList" open="(" separator="," close=")" item="item">
+                        #{item,jdbcType=BIGINT}
+                    </foreach>
+                </when>
+                <otherwise>
+                    and kltu2.top_ent_id = #{tradeReq.entId,jdbcType=BIGINT}
+                    <if test="tradeReq.status != null">
+                        and klt.status = #{tradeReq.status}
+                    </if>
+                    <if test="tradeReq.trading != null">
+                        and klt.trading = #{tradeReq.trading,jdbcType=INTEGER}
+                    </if>
+                    <if test="tradeReq.endCreateTime != null and tradeReq.endCreateTime != '' and tradeReq.startCreateTime != null and tradeReq.startCreateTime != ''">
+                        and klt.generate_time between #{tradeReq.startCreateTime,jdbcType=TIMESTAMP}
+                        and #{tradeReq.endCreateTime,jdbcType=TIMESTAMP}
+                    </if>
+                    <if test="tradeReq.keywords != null and tradeReq.keywords != ''">
+                        and (
+                        klt.t_ledger_no like concat('%'
+                        , #{tradeReq.keywords,jdbcType=VARCHAR}
+                        , '%')
+                        or kltu.firm_name like concat('%'
+                        , #{tradeReq.keywords,jdbcType=VARCHAR}
+                        , '%')
+                        or kltu.contacts like concat('%'
+                        , #{tradeReq.keywords,jdbcType=VARCHAR}
+                        , '%')
+                        )
+                    </if>
+                </otherwise>
+            </choose>
+        </where>
+    </select>
 </mapper>

+ 28 - 1
sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementLogisticsMapper.xml

@@ -379,7 +379,34 @@
 
     <!--  根据多个结算运费物流订单id查订单,用于导出   -->
     <select id="selectLogisticsList" resultType="com.sckw.payment.model.dto.SettlementLogisticsDto">
-        <include refid="settlementLogisticsSelect"/>
+        select l.name                           as name,
+               l.l_ledger_no                    as lLedgerNo,
+               l.trading                        as trading,
+               l.settle_price                   as settlePrice,
+               (s.total_price - s.actual_price) as waitPrice,
+               lu2.firm_name                    as firmName,
+               s.id,
+               s.ent_id                         as entId,
+               s.l_ledger_id                    as lLedgerId,
+               s.sl_order_no                    as slOrderNo,
+               s.name,
+               s.total_price                    as totalPrice,
+               s.actual_price                   as actualPrice,
+               s.receipt_time                   as receiptTime,
+               s.remark,
+               (case
+                    when #{settlementReq.unitType,jdbcType=INTEGER} = 2 then s.audit_user
+                    else s.success_user end)    as contacts,
+               (case
+                    when #{settlementReq.unitType,jdbcType=INTEGER} = 2 then s.audit_phone
+                    else s.success_phone end)   as phone,
+               s.status,
+               s.create_by                      as createBy,
+               s.create_time                    as createTime
+        from kwp_settlement_logistics s
+                 inner join kwp_ledger_logistics l on s.l_ledger_id = l.id
+                 inner join kwp_ledger_logistics_unit lu on s.l_ledger_id = lu.l_ledger_id
+                 inner join kwp_ledger_logistics_unit lu2 on s.l_ledger_id = lu2.l_ledger_id
         <where>
             l.del_flag = 0
               and s.del_flag = 0

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

@@ -498,4 +498,133 @@
         WHERE kst.del_flag = 0
         GROUP BY kltu.top_ent_id
     </select>
+
+    <select id="exportList" resultType="com.sckw.payment.model.dto.SettlementTradeDto">
+        select kst.id,
+               kst.status,
+               kst.st_order_no,
+               klt.t_ledger_no                                    tLedgerNo,
+               kst.create_time,
+               kst.receipt_time,
+               cast(kst.actual_price as char)                     actualPrice,
+               cast(kst.total_price as char)                      totalPrice,
+               cast((kst.total_price - kst.actual_price) as char) waitPrice,
+               (case
+                    when #{settlementReq.unitType,jdbcType=INTEGER} = 1 then klt.audit_user
+                    else klt.success_user end)  as                contacts,
+               (case
+                    when #{settlementReq.unitType,jdbcType=INTEGER} = 1 then klt.audit_phone
+                    else klt.success_phone end) as                phone,
+               kst.create_time,
+               kst.t_ledger_id,
+               klt.id                                             ledgerId,
+               klt.name,
+               klt.trading,
+               kltu.firm_name                                     firmName,
+               kst.update_by
+        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 = #{settlementReq.unitType,jdbcType=INTEGER}
+                 inner join kwp_ledger_trade_unit kltu2 on klt.id = kltu2.t_ledger_id and kltu2.del_flag = 0 and
+                                                           kltu2.unit_type =
+                                                           #{settlementReq.unitTypeTwo,jdbcType=INTEGER}
+        <where>
+            kst.del_flag = 0
+            <choose>
+                <when test="idList != null and idList.size() != 0">
+                    and kst.id in
+                    <foreach collection="idList" open="(" separator="," close=")" item="item">
+                        #{item,jdbcType=BIGINT}
+                    </foreach>
+                </when>
+                <otherwise>
+                    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 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>
+                </otherwise>
+            </choose>
+        </where>
+    </select>
+    <select id="operateExportList" 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 = #{settlementReq.unitType,jdbcType=INTEGER}
+                 inner join kwp_ledger_trade_unit kltu2 on klt.id = kltu2.t_ledger_id and kltu2.del_flag = 0 and
+                                                           kltu2.unit_type =
+                                                           #{settlementReq.unitTypeTwo,jdbcType=INTEGER}
+        <where>
+            kst.del_flag = 0
+            <choose>
+                <when test="idList != null and idList.size() != 0">
+                    and kst.id in
+                    <foreach collection="idList" open="(" separator="," close=")" item="item">
+                        #{item,jdbcType=BIGINT}
+                    </foreach>
+                </when>
+                <otherwise>
+                    <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>
+                </otherwise>
+            </choose>
+        </where>
+    </select>
 </mapper>

+ 23 - 0
sckw-modules/sckw-payment/src/main/resources/mapper/KwpWalletPrepayMapper.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sckw.payment.dao.KwpWalletPrepayMapper">
+  <resultMap id="BaseResultMap" type="com.sckw.payment.model.KwpWalletPrepay">
+    <!--@mbg.generated-->
+    <!--@Table kwp_wallet_prepay-->
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
+    <result column="action" jdbcType="BOOLEAN" property="action" />
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="create_by" jdbcType="BIGINT" property="createBy" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    id, order_no, `action`, remark, `status`, create_by, create_time, update_by, update_time, 
+    del_flag
+  </sql>
+</mapper>

+ 1 - 1
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwTransportService.java

@@ -835,7 +835,7 @@ public class KwTransportService {
      * @return
      */
     public List<WaybillOrderListExport> wayBillOrderExport(WaybillOrderQuery query) {
-        Criteria criteria = buildWaybillOrdersQuery(query);
+        Criteria criteria = newBuildWaybillOrdersQuery(query);
         Query queryFormat = new Query(criteria);
         List<Long> wOrderIds = StringUtils.splitStrToList(query.getIds(), ",", Long.class);
         if (CollectionUtils.isNotEmpty(wOrderIds)) {

+ 1 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/operationManagement/ManagementLogisticsOrderController.java

@@ -66,7 +66,7 @@ public class ManagementLogisticsOrderController {
      */
     @RequestMapping(value = "/statistics", method = RequestMethod.POST)
     public HttpResult statisticsLogisticsOrder(@Valid @RequestBody ManagementLogisticsOrderQuery query) {
-        log.error("运营管理端-物流订单-top统计 查询 :{}", JSONObject.toJSONString(query));
+        log.info("运营管理端-物流订单-top统计 查询 :{}", JSONObject.toJSONString(query));
         try {
             HttpResult result = managementLogisticsOrderService.statisticsLogisticsOrder(query);
             return result;

+ 10 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/DriverListVo.java

@@ -43,6 +43,16 @@ public class DriverListVo {
      */
     private String transportStatusLabel;
 
+    /**
+     * 运力状态(0空闲/1任务中)
+     */
+    private Integer status;
+
+    /**
+     * 运力状态(0空闲/1任务中)
+     */
+    private String statusLabel;
+
     /**
      * 运输次数
      */

+ 5 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/WaybillOrderDriverVo.java

@@ -99,6 +99,11 @@ public class WaybillOrderDriverVo {
      */
     private String unit;
 
+    /**
+     * 单位(吨、方、箱、件)
+     */
+    private String unitName;
+
     /**
      * 装货地址名称
      */

+ 5 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/WaybillTrackVO.java

@@ -45,4 +45,9 @@ public class WaybillTrackVO {
      * 记录时间
      */
     private String createTime;
+
+    /**
+     * 操作时间
+     */
+    private String operateTime;
 }

+ 20 - 4
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/AcceptCarriageOrderService.java

@@ -1094,7 +1094,9 @@ public class AcceptCarriageOrderService {
                     truck = fleetService.findTruck(collect);
                 }
             }
+            Map<String, String> dictData = commonService.getDictData(DictTypeEnum.TRUCK_TYPE.getType());
             for (DriverListVo driverListVo : list) {
+                driverListVo.setStatusLabel(CarWaybillEnum.getName(driverListVo.getStatus()));
                 if (!ObjectUtils.isEmpty(truck)) {
                     if (truck.get(driverListVo.getTruckNo()) != null) {
                         driverListVo.setTransportStatus(truck.get(driverListVo.getTruckNo()) == null ? null : truck.get(driverListVo.getTruckNo()).getBusinessStatus());
@@ -1102,8 +1104,11 @@ public class AcceptCarriageOrderService {
                     if (driverListVo.getTransportStatus() != null) {
                         driverListVo.setTransportStatusLabel((driverListVo.getTransportStatus() == 0) ? "空闲" : "任务中");
                     }
-                    driverListVo.setCarType(truck.get(driverListVo.getTruckNo()) == null ? null : truck.get(driverListVo.getTruckNo()).getTruckType());
-//                    driverListVo.setCount(truck.get(driverListVo.getTruckNo()) == null ? null : truck.get(driverListVo.getTruckNo()).getTotalComplete());
+                    String truckType = truck.get(driverListVo.getTruckNo()).getTruckType();
+                    if (StringUtils.isNotBlank(truckType)){
+//                        driverListVo.setCarType(truck.get(driverListVo.getTruckNo()) == null ? null : truck.get(driverListVo.getTruckNo()).getTruckType());
+                        driverListVo.setCarType(dictData.get(truckType));
+                    }
                 }
             }
             result.setData(list);
@@ -1115,7 +1120,12 @@ public class AcceptCarriageOrderService {
                     truck = fleetService.findTruck(collect);
                 }
             }
+            Map<String, String> dictData = commonService.getDictData(DictTypeEnum.TRUCK_TYPE.getType());
             for (DriverListVo driverListVo : list) {
+                if (!driverListVo.getCirculateId().isEmpty()){
+//                    driverListVo.setStatus(1);
+                    driverListVo.setStatusLabel(CarWaybillEnum.PENDING_ORDER.getDestination());
+                }
                 if (!ObjectUtils.isEmpty(truck)) {
 //                    driverListVo.setTransportStatus(truck.get(driverListVo.getTruckNo()) == null ? null : truck.get(driverListVo.getTruckNo()).getBusinessStatus());
                     if (truck.get(driverListVo.getTruckNo()) != null) {
@@ -1124,7 +1134,11 @@ public class AcceptCarriageOrderService {
                     if (driverListVo.getTransportStatus() != null) {
                         driverListVo.setTransportStatusLabel((driverListVo.getTransportStatus() == 0) ? "空闲" : "任务中");
                     }
-                    driverListVo.setCarType(truck.get(driverListVo.getTruckNo()) == null ? null : truck.get(driverListVo.getTruckNo()).getTruckType());
+                    String truckType = truck.get(driverListVo.getTruckNo()).getTruckType();
+                    if (StringUtils.isNotBlank(truckType)){
+//                        driverListVo.setCarType(truck.get(driverListVo.getTruckNo()) == null ? null : truck.get(driverListVo.getTruckNo()).getTruckType());
+                        driverListVo.setCarType(dictData.get(truckType));
+                    }
                 }
             }
             result.setData(list);
@@ -1259,10 +1273,12 @@ public class AcceptCarriageOrderService {
                 );
                 /**更新MongoDB*/
                 SckwWaybillOrder order = new SckwWaybillOrder();
-                order.setStatus(NumberConstant.ONE);
+                order.set_id(circulateId);
+                order.setStatus(CarWaybillEnum.REVOKED.getCode());
                 order.setUpdateTime(new Date());
                 order.setUpdateByName(LoginUserHolder.getUserName());
                 order.setUpdateBy(LoginUserHolder.getUserId());
+                order.setDelFlag(Global.YES);
                 SckwBusSum busSum = new SckwBusSum();
                 busSum.setBusSumType(BusinessTypeEnum.WAYBILL_ORDER_TYPE.getName());
                 busSum.setMethod(NumberConstant.TWO);

+ 75 - 2
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ConsignOrderService.java

@@ -427,9 +427,12 @@ public class ConsignOrderService {
                 }
             }
         }
+        List<Long> lists = StringUtils.splitStrToList(orderDto.getIds(), Long.class);
+        getLogisticsOrderCirculate(lists, returnList);
         List<CarWaybillVO> collect = new ArrayList<>();
         if (CollectionUtils.isNotEmpty(returnList)) {
-            collect = returnList.stream().skip((orderDto.getPage() - 1) * orderDto.getPageSize()).limit(orderDto.getPageSize()).collect(Collectors.toList());
+            collect = returnList.stream().sorted(Comparator.comparing(CarWaybillVO::getLOrderId).reversed()).collect(Collectors.toList());
+            collect = collect.stream().skip((orderDto.getPage() - 1) * orderDto.getPageSize()).limit(orderDto.getPageSize()).collect(Collectors.toList());
         }
         PageResult result = PageResult.build(orderDto.getPage(), orderDto.getPageSize(), returnList.stream().count(), collect);
         return HttpResult.ok(result);
@@ -556,6 +559,10 @@ public class ConsignOrderService {
             }
         }
         for (DriverListVo driverListVo : list) {
+            if (!driverListVo.getCirculateId().isEmpty()) {
+//                driverListVo.setStatus(1);
+                driverListVo.setStatusLabel(CarWaybillEnum.PENDING_ORDER.getDestination());
+            }
             List<String> objects = new ArrayList<>();
             objects.add(driverListVo.getTruckNo());
             if (!ObjectUtils.isEmpty(truck)) {
@@ -610,6 +617,7 @@ public class ConsignOrderService {
 //                .in(KwtLogisticsOrder::getId,list)
 //                .orderByDesc(KwtLogisticsOrder::getId)
 //        );
+        /**趟次数据*/
         for (Long id : list) {
             KwtLogisticsOrder order = kwtLogisticsOrderMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrder>()
                             .eq(StringUtils.isNotBlank(id), KwtLogisticsOrder::getId, id)
@@ -694,14 +702,79 @@ public class ConsignOrderService {
                 }
             }
         }
+        /**循环数据*/
+        getLogisticsOrderCirculate(list, returnList);
         List<CarWaybillVO> collect = new ArrayList<>();
         if (CollectionUtils.isNotEmpty(returnList)) {
-            collect = returnList.stream().skip((orderDto.getPage() - 1) * orderDto.getPageSize()).limit(orderDto.getPageSize()).collect(Collectors.toList());
+            collect = returnList.stream().sorted(Comparator.comparing(CarWaybillVO::getLOrderId).reversed()).collect(Collectors.toList());
+            collect = collect.stream().skip((orderDto.getPage() - 1) * orderDto.getPageSize()).limit(orderDto.getPageSize()).collect(Collectors.toList());
         }
         PageResult result = PageResult.build(orderDto.getPage(), orderDto.getPageSize(), returnList.stream().count(), collect);
         return HttpResult.ok(result);
     }
 
+    private void getLogisticsOrderCirculate(List<Long> list, List<CarWaybillVO> returnList) {
+        for (Long lOrderId : list) {
+            KwtLogisticsOrder order = kwtLogisticsOrderMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrder>()
+                    .eq(StringUtils.isNotBlank(lOrderId), KwtLogisticsOrder::getId, lOrderId)
+            );
+            if (ObjectUtils.isEmpty(order)) {
+                continue;
+            }
+            List<KwtLogisticsOrderCirculate> logisticsOrderCirculates = kwtLogisticsOrderCirculateMapper.selectList(new LambdaQueryWrapper<KwtLogisticsOrderCirculate>()
+                    .in(KwtLogisticsOrderCirculate::getLOrderId, lOrderId)
+                    .eq(KwtLogisticsOrderCirculate::getStatus, 0)
+                    .eq(KwtLogisticsOrderCirculate::getDelFlag, 0)
+                    .isNotNull(KwtLogisticsOrderCirculate::getWOrderId)
+            );
+            if (CollectionUtils.isNotEmpty(logisticsOrderCirculates)) {
+                for (KwtLogisticsOrderCirculate circulate : logisticsOrderCirculates) {
+                    CarWaybillVO carWaybillVo = new CarWaybillVO();
+                    carWaybillVo.setLOrderNo(order.getLOrderNo());
+                    carWaybillVo.setLOrderId(String.valueOf(lOrderId));
+                    carWaybillVo.setWOrderId(circulate.getWOrderId() == null ? null : String.valueOf(circulate.getWOrderId()));
+//                    carWaybillVo.setWOrderNo();
+                    carWaybillVo.setTruckNo(circulate.getTruckNo());
+                    carWaybillVo.setStatus(CarWaybillEnum.PENDING_ORDER.getStatus());
+                    carWaybillVo.setStatusLabel(CarWaybillEnum.PENDING_ORDER.getDestination());
+                    carWaybillVo.setWaybillType(circulate.getType());
+                    carWaybillVo.setDriverName(circulate.getDriverName());
+//                    carWaybillVo.setConsignMotorcade();
+                    DecimalFormat decimalFormat = new DecimalFormat("0.00");
+                    carWaybillVo.setSendCarWeigh(circulate.getEntrustAmount() == null ? null : decimalFormat.format(circulate.getEntrustAmount()));
+                    carWaybillVo.setSendCarDate(circulate.getCreateTime() == null ? null : DateUtil.getDateTime(circulate.getCreateTime()));
+                    KwtWaybillOrderTicket loadTicket = kwtWaybillOrderTicketMapper.selectOne(new LambdaQueryWrapper<KwtWaybillOrderTicket>()
+                            .eq(StringUtils.isNotBlank(circulate.getId()), KwtWaybillOrderTicket::getWOrderId, circulate.getId())
+                            .eq(KwtWaybillOrderTicket::getType, NumberConstant.ONE));
+                    KwtWaybillOrderTicket unloadTicket = kwtWaybillOrderTicketMapper.selectOne(new LambdaQueryWrapper<KwtWaybillOrderTicket>()
+                            .eq(StringUtils.isNotBlank(circulate.getId()), KwtWaybillOrderTicket::getWOrderId, circulate.getId())
+                            .eq(KwtWaybillOrderTicket::getType, NumberConstant.TWO));
+                    if (loadTicket != null) {
+                        carWaybillVo.setLoadAmount(loadTicket.getAmount() == null ? null : String.valueOf(loadTicket.getAmount()));
+                        carWaybillVo.setLoadDateTime(loadTicket.getOperateTime() == null ? null : DateUtil.getDateTime(loadTicket.getOperateTime()));
+                    } else {
+                        carWaybillVo.setLoadAmount(null);
+                        carWaybillVo.setLoadDateTime(null);
+                    }
+                    if (unloadTicket != null) {
+                        carWaybillVo.setUnloadAmount(unloadTicket.getAmount() == null ? null : String.valueOf(unloadTicket.getAmount()));
+                        carWaybillVo.setUnloadDateTime(unloadTicket.getOperateTime() == null ? null : DateUtil.getDateTime(unloadTicket.getOperateTime()));
+                    } else {
+                        carWaybillVo.setUnloadAmount(null);
+                        carWaybillVo.setUnloadDateTime(null);
+                    }
+                    carWaybillVo.setDefectiveWeigh("0.00");
+                    carWaybillVo.setDeduct(new BigDecimal("0.00"));
+                    carWaybillVo.setLoss(order.getLoss());
+                    SysDictResDto sysDictResDto = remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.TAX_RATE_TYPE.getType(), order.getLossUnit());
+                    carWaybillVo.setLossLabel(sysDictResDto == null ? null : sysDictResDto.getLabel());
+                    carWaybillVo.setCreateTime(circulate.getCreateTime());
+                    returnList.add(carWaybillVo);
+                }
+            }
+        }
+    }
+
     /**
      * 托运订单/承运订单-获取车辆信息
      *

+ 44 - 16
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtWaybillOrderService.java

@@ -153,19 +153,24 @@ public class KwtWaybillOrderService {
 
         /**数据配置**/
         List<Long> entIds = new ArrayList<>();
+        List<String> dictKey = new ArrayList<>();
         for (WaybillOrderDriverVo waybillOrder : waybillOrders) {
             entIds.add(waybillOrder.getCarrierEntId());
+            dictKey.add(DictTypeEnum.UNIT_TYPE.getType() + Global.POUND + waybillOrder.getUnit());
         }
         //企业数据集
         entIds = entIds.stream().distinct().collect(Collectors.toList());
         Map<Long, EntCacheResDto> ents = remoteSystemService.queryEntCacheMapByIds(entIds);
+        //数据字典
+        Map<String, SysDictResDto> dicts = this.dict(dictKey);
 
         //数据组装
         for (WaybillOrderDriverVo waybillOrder : waybillOrders) {
             EntCacheResDto ent = ents == null ? null : ents.get(waybillOrder.getCarrierEntId());
-            String value = getDictValue(DictTypeEnum.UNIT_TYPE.getType(), waybillOrder.getUnit());
+            SysDictResDto unit = dicts == null ? null : dicts.get(DictTypeEnum.UNIT_TYPE.getType() + Global.POUND + waybillOrder.getUnit());
+            //String value = getDictValue(DictTypeEnum.UNIT_TYPE.getType(), waybillOrder.getUnit());
             waybillOrder.setCarrierFirmName(ent != null ? ent.getFirmName() : null);
-            waybillOrder.setUnit(value);
+            waybillOrder.setUnitName(unit != null ? unit.getLabel() : null);
         }
         return waybillOrders;
     }
@@ -235,6 +240,11 @@ public class KwtWaybillOrderService {
         if (waybillOrder == null && circulate == null) {
             return HttpResult.error("车辆运单不存在!");
         }
+        if (waybillOrder != null) {
+            if (!CarWaybillEnum.changeDriver(waybillOrder.getStatus())) {
+                return HttpResult.error("车辆运单当前状态不能变更司机!");
+            }
+        }
 
         /**循环派车**/
         if (params.getType() == Global.NUMERICAL_TWO) {
@@ -249,7 +259,7 @@ public class KwtWaybillOrderService {
         }
 
         if (waybillOrder != null) {
-            if (!CarWaybillEnum.changeDriverAndTruck(waybillOrder.getStatus())) {
+            if (!CarWaybillEnum.changeDriver(waybillOrder.getStatus())) {
                 return HttpResult.error("车辆运单当前状态不能变更司机!");
             }
             /**更新车辆运单**/
@@ -282,6 +292,11 @@ public class KwtWaybillOrderService {
         if (waybillOrder == null && circulate == null) {
             return HttpResult.error("车辆运单不存在!");
         }
+        if (waybillOrder != null) {
+            if (!CarWaybillEnum.changeTruck(waybillOrder.getStatus())) {
+                return HttpResult.error("车辆运单当前状态不能变更车辆!");
+            }
+        }
 
         /**循环派车**/
         if (params.getType() == Global.NUMERICAL_TWO) {
@@ -296,9 +311,6 @@ public class KwtWaybillOrderService {
         }
 
         if (waybillOrder != null) {
-            if (!CarWaybillEnum.changeDriverAndTruck(waybillOrder.getStatus())) {
-                return HttpResult.error("车辆运单当前状态不能变更车辆!");
-            }
             /**更新车辆运单**/
             changeWaybillOrder(null, params);
             wOrder.set_id(params.getWOrderId());
@@ -328,7 +340,6 @@ public class KwtWaybillOrderService {
         //循环派车信息
         KwtLogisticsOrderCirculate circulate = new KwtLogisticsOrderCirculate();
         if (driver != null) {
-            circulate.setId(circulateId);
             circulate.setDriverId(driver.getDriverId());
             circulate.setDriverPhone(driver.getDriverPhone());
             circulate.setDriverName(driver.getDriverName());
@@ -338,6 +349,7 @@ public class KwtWaybillOrderService {
             circulate.setTruckId(truck.getTruckId());
             circulate.setTruckNo(truck.getTruckNo());
         }
+        circulate.setId(circulateId);
         logisticsOrderCirculateDao.updateById(circulate);
     }
 
@@ -404,15 +416,7 @@ public class KwtWaybillOrderService {
         /**Mongodb数据存储**/
         //1车辆订单
         for (SckwWaybillOrder waybillOrder : sckwWaybillOrders) {
-            //rabbitMq业务汇总数据发送/消费对象
-            SckwBusSum busSum = new SckwBusSum();
-            //业务汇总类型
-            busSum.setBusSumType(BusinessTypeEnum.WAYBILL_ORDER_TYPE.getName());
-            //操作对象(1新增/2修改/3替换数据)
-            busSum.setMethod(1);
-            //业务汇总数据对象
-            busSum.setObject(waybillOrder);
-            streamBridge.send("sckw-busSum", busSum);
+            editSckwWaybillOrder(waybillOrder, null, Global.NUMERICAL_ONE);
         }
 
         //2承运订单
@@ -521,6 +525,7 @@ public class KwtWaybillOrderService {
                     SckwWaybillOrder mongoOrder = setSckwWaybillOrder(sendCarDto, waybillOrder, logisticsOrder, loadAddress,
                             unloadAddress, checkEnt, carrierEnt, goods);
                     mongoOrder.set_id(circulate.getId());
+                    mongoOrder.setWOrderId(null);
                     mongoOrder.setWOrderNo(null);
                     sckwWaybillOrders.add(mongoOrder);
                 }
@@ -613,7 +618,12 @@ public class KwtWaybillOrderService {
             int count = logisticsOrderCirculateDao.insert(circulate);
             return count > 0 ? circulate : null;
         } else {
+            //更新原循环单ID
+            Long newId = new IdWorker(Global.NUMERICAL_ONE).nextId();
+            logisticsOrderCirculateDao.updateIdByKey(newId, null, circulate.getId(), LoginUserHolder.getUserId(), new Date());
+
             BeanUtils.copyProperties(waybillOrder, circulate);
+            circulate.setId(newId);
             circulate.setWOrderId(null);
             circulate.setStatus(0);
             int count = logisticsOrderCirculateDao.updateById(circulate);
@@ -1096,6 +1106,8 @@ public class KwtWaybillOrderService {
             waybillOrder.setStatus(CarWaybillEnum.REVOKED.getCode());
             waybillOrderDao.updateById(waybillOrder);
 
+            setWaybillOrderTrack(waybillOrder.getId(), waybillOrder.getUpdateTime(), waybillOrder.getStatus(), "完结物流订单时撤回车辆运单!");
+
             //车辆订单-Mongodb数据更新
             SckwWaybillOrder wOrder = new SckwWaybillOrder();
             wOrder.set_id(waybillOrder.getId());
@@ -1106,6 +1118,7 @@ public class KwtWaybillOrderService {
         List<KwtLogisticsOrderCirculate> circulates = logisticsOrderCirculateDao.findCirculateList(lorderId, null, null, 0);
         for (KwtLogisticsOrderCirculate circulate : circulates) {
             circulate.setStatus(Global.NUMERICAL_ONE);
+            circulate.setRemark("完结物流订单时撤回车辆运单!");
             logisticsOrderCirculateDao.updateById(circulate);
 
             //车辆订单-Mongodb数据更新
@@ -1474,6 +1487,7 @@ public class KwtWaybillOrderService {
             KwtLogisticsOrderCirculate circulate = logisticsOrderCirculateDao.findCirculate(waybillOrder.getLOrderId(),
                     waybillOrder.getTruckId(), waybillOrder.getDriverId());
             circulate.setStatus(Global.NUMERICAL_ONE);
+            circulate.setWOrderId(null);
             logisticsOrderCirculateDao.updateById(circulate);
         }
 
@@ -2691,4 +2705,18 @@ public class KwtWaybillOrderService {
         SysDictResDto dict = dicts == null ? null : dicts.get(DictTypeEnum.APPROVED_DRIVING.getType() + Global.POUND + value);
         return dict != null ? dict.getLabel() : null;
     }
+
+    /**
+     * @param dictKey 字典值
+     * @desc 获取数据字典
+     * @author zk
+     * @date 2023/9/11
+     **/
+    public Map<String, SysDictResDto> dict(List<String> dictKey) {
+        if (CollectionUtils.isEmpty(dictKey)) {
+            return Collections.emptyMap();
+        }
+        dictKey = dictKey.stream().distinct().collect(Collectors.toList());
+        return remoteSystemService.queryDictMapByTypeValues(String.join(Global.COMMA, dictKey));
+    }
 }

+ 1 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ManagementWaybillOrderService.java

@@ -275,6 +275,7 @@ public class ManagementWaybillOrderService {
     public List<ManagementWaybillOrderExcelVO> exportWaybillOrder(ManagementWaybillOrderQuery query) {
         Criteria criteria = newBuildWaybillOrdersQuery(query);
         Query queryFormat = new Query(criteria);
+        // in查询
         List<Long> wOrderIds = StringUtils.splitStrToList(query.getIds(), ",", Long.class);
         if (CollectionUtils.isNotEmpty(wOrderIds)) {
             queryFormat.addCriteria(Criteria.where("wOrderId").in(wOrderIds));

+ 4 - 3
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/WaybillManagementService.java

@@ -147,7 +147,7 @@ public class WaybillManagementService {
             if (info.getUnit() != null) {
                 Map<String, SysDictResDto> unitType = remoteSystemService.queryDictMapByType(DictTypeEnum.UNIT_TYPE.getType());
                 SysDictResDto sysDict = unitType.get(info.getUnit());
-                wayBillDetailDTO.setUnitLabel(sysDict.getLabel());
+                wayBillDetailDTO.setUnitLabel(sysDict == null ? null : sysDict.getLabel());
             }
             // 派车人信息
             UserCacheResDto createUser = remoteSystemService.queryUserCacheById(info.getCreateBy());
@@ -246,7 +246,8 @@ public class WaybillManagementService {
                         .setCreateBy(track.getCreateBy())
                         .setCreateByPhone(userPhoneMap.get(track.getCreateBy()))
                         .setCreateByName(userNameMap.get(track.getCreateBy()))
-                        .setCreateTime(DateUtil.getDateTime(track.getCreateTime()));
+                        .setCreateTime(DateUtil.getDateTime(track.getCreateTime()))
+                        .setOperateTime(DateUtil.getDateTime(track.getOperateTime()));
                 waybillTrackVOS.add(waybillTrackVO);
             }
         }
@@ -915,7 +916,7 @@ public class WaybillManagementService {
         }
         criteria.and("lOrderId").in(lOrderIds);
 //        criteria.and("wOrderId").exists(true);
-        Criteria.where("wOrderId").ne("").ne(null);
+        criteria.and("wOrderId").ne("").ne(null);
         // 多条件模糊查询
         List<Criteria> orCriteria = new ArrayList<>();
         if (StringUtils.isNotBlank(query.getKeyword())) {

+ 28 - 0
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderCirculateMapper.xml

@@ -39,6 +39,34 @@
         WHERE id = #{id}
     </update>
 
+    <update id="updateCirculate" parameterType="com.sckw.transport.model.KwtLogisticsOrderCirculate">
+        UPDATE kwt_logistics_order_circulate
+        <set>
+            <if test="null != entId and '' != entId">ent_id = #{entId},</if>
+            <if test="null != lOrderId and '' != lOrderId">l_order_id = #{lOrderId},</if>
+            <if test="null != wOrderId and '' != wOrderId">w_order_id = #{wOrderId},</if>
+            <if test="null != type and '' != type">type = #{type},</if>
+            <if test="null != truckId and '' != truckId">truck_id = #{truckId},</if>
+            <if test="null != truckNo and '' != truckNo">truck_no = #{truckNo},</if>
+            <if test="null != driverId and '' != driverId">driver_id = #{driverId},</if>
+            <if test="null != driverName and '' != driverName">driver_name = #{driverName},</if>
+            <if test="null != driverPhone and '' != driverPhone">driver_phone = #{driverPhone},</if>
+            <if test="null != driverIdcard and '' != driverIdcard">driver_idcard = #{driverIdcard},</if>
+            <if test="null != startTime and '' != startTime">start_time = #{startTime},</if>
+            <if test="null != endTime and '' != endTime">end_time = #{endTime},</if>
+            <if test="null != entrustAmount and '' != entrustAmount">entrust_amount = #{entrustAmount},</if>
+            <if test="null != totalTake and '' != totalTake">total_take = #{totalTake},</if>
+            <if test="null != remark and '' != remark">remark = #{remark},</if>
+            <if test="null != status and '' != status">status = #{status},</if>
+            <if test="null != createBy and '' != createBy">create_by = #{createBy},</if>
+            <if test="null != createTime and '' != createTime">create_time = #{createTime},</if>
+            <if test="null != updateBy and '' != updateBy">update_by = #{updateBy},</if>
+            <if test="null != updateTime and '' != updateTime">update_time = #{updateTime},</if>
+            <if test="null != delFlag and '' != delFlag">del_flag = #{delFlag}</if>
+        </set>
+        WHERE id = #{id}
+    </update>
+
     <select id="selectDriverOrderByStatus" resultType="java.lang.Long">
         SELECT b.w_order_id as wOrderId
         FROM kwt_waybill_order a

+ 4 - 2
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderMapper.xml

@@ -554,7 +554,8 @@
         b.driver_name AS driverName,
         b.driver_phone AS driverPhone,
         b.driver_idcard AS driverIdCard,
-        b.truck_no AS truckNo
+        b.truck_no AS truckNo,
+        b.status AS status
         FROM
         kwt_waybill_order b
         LEFT JOIN kwt_logistics_order a ON b.l_order_id = a.id
@@ -787,7 +788,8 @@
         c.driver_idcard AS driverIdCard,
         c.truck_no AS truckNo,
         c.truck_id AS truckId,
-        c.total_take as count
+        c.total_take as count,
+        c.status as status
         FROM
         kwt_logistics_order_circulate c,
         kwt_logistics_order a

+ 3 - 2
sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderMapper.xml

@@ -434,7 +434,7 @@
             parameterType="java.util.Map">
         SELECT
         wo.id wOrderId, wo.w_order_no wOrderNo, wo.l_order_id lOrderId, lo.l_order_no lOrderNo,
-        lo.unit, lo.loss_unit lossUnit, wo.type,
+        lo.unit, lo.loss, lo.loss_unit lossUnit, wo.type,
         wo.ent_id carrierEntId, 'xxxxx' carrierFirmName, log.goods_name goodsName, wo.start_time startTime,
         wo.end_time endTime, wo.entrust_amount entrustAmount, woa1.name loadName, woa1.city_code loadCityCode,
         woa1.city_name loadCityName, woa1.detail_address loadDetailAddress, woa2.name unloadName, woa2.city_code
@@ -473,7 +473,8 @@
             ORDER BY wo.start_time
         </if>
         <if test="busStatus != null and busStatus == 4">
-            ORDER BY wo.update_time desc
+            ORDER BY CASE WHEN wo.status = 12 THEN  wo.status * -1  ELSE wo.status END ASC,
+            wo.update_time desc
         </if>
     </select>