Просмотр исходного кода

结算-物流相关接口init定义

sptkw 2 лет назад
Родитель
Сommit
065d5a76cb
19 измененных файлов с 829 добавлено и 226 удалено
  1. 48 27
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpSettlementLogisticsController.java
  2. 36 36
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpSettlementOfflineController.java
  3. 19 29
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpSettlementWalletController.java
  4. 53 11
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementLogisticsMapper.java
  5. 13 3
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementOfflineMapper.java
  6. 20 3
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementWalletMapper.java
  7. 56 4
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/KwpSettlementWallet.java
  8. 3 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/SettlementOfflineDto.java
  9. 10 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/SettlementWalletDto.java
  10. 12 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/SettlementOfflineReq.java
  11. 12 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/SettlementWalletReq.java
  12. 102 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/SettlementOfflineVo.java
  13. 83 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/SettlementWalletVo.java
  14. 112 26
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementLogisticsService.java
  15. 53 19
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementOfflineService.java
  16. 61 16
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementWalletService.java
  17. 98 41
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementLogisticsMapper.xml
  18. 11 3
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementOfflineMapper.xml
  19. 27 8
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementWalletMapper.xml

+ 48 - 27
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpSettlementLogisticsController.java

@@ -1,24 +1,17 @@
 package com.sckw.payment.controller;
 
-import com.alibaba.excel.util.IntUtils;
 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.dto.LedgerTradeDto;
 import com.sckw.payment.model.dto.SettlementLogisticsDto;
-import com.sckw.payment.model.vo.req.LogisticsReq;
 import com.sckw.payment.model.vo.req.SettlementReq;
-import com.sckw.payment.model.vo.req.TradeReq;
-import com.sckw.payment.model.vo.res.LedgerTradeVo;
 import com.sckw.payment.model.vo.res.SettlementLogisticsVo;
-import com.sckw.payment.service.KwpLedgerLogisticsService;
 import com.sckw.payment.service.KwpSettlementLogisticsService;
 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.validation.BindingResult;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
@@ -31,45 +24,76 @@ import java.util.stream.Collectors;
  * @date 2023-07-18 16:34
  */
 @RestController
-@RequestMapping(name = "结算-物流订单", path = "/kwpSettlementLogistics")
+@RequestMapping(name = "结算-物流运费订单", path = "/kwpSettlementLogistics")
 public class KwpSettlementLogisticsController {
 
     @Resource
     private KwpSettlementLogisticsService kwpSettlementLogisticsService;
 
-    @GetMapping(name = "运费收款-物流订单各状态列表总数", path = "getCountList")
-    public HttpResult getCountList() {
-        return HttpResult.ok(kwpSettlementLogisticsService.getCountList());
+    //   ========= 运费收款 承运方 =========
+    @PostMapping(name = "运费收款-物流订单列表", path = "pageListCollection")
+    public HttpResult pageSelectCollection(@RequestBody @Valid SettlementReq settlementReq) {
+        return HttpResult.ok(kwpSettlementLogisticsService.pageSelectCollection(settlementReq));
     }
 
-    @PostMapping(name = "运费收款-物流订单列表", path = "pageList")
-    public HttpResult pageList(@RequestBody @Valid SettlementReq settlementReq) {
-        return HttpResult.ok(kwpSettlementLogisticsService.pageList(settlementReq));
+    @GetMapping(name = "运费收款-物流订单各状态列表总数", path = "getCountListCollection")
+    public HttpResult getCountListCollection(@RequestBody @Valid SettlementReq settlementReq) {
+        return HttpResult.ok(kwpSettlementLogisticsService.getCountListCollection(settlementReq));
     }
 
+    @PostMapping(name = "运费收款-根据条件导出物流订单表数据", path = "exportCollection")
+    public HttpResult exportCollection(HttpServletResponse response, @RequestBody @Valid SettlementReq settlementReq) {
+        List<SettlementLogisticsDto> list;
+        if (CollectionUtils.isEmpty(settlementReq.getIds())) {
+            PageRes<SettlementLogisticsDto> pageResult = kwpSettlementLogisticsService.pageSelectCollection(settlementReq);
+            list = pageResult.getList();
+        } else {
+            list = kwpSettlementLogisticsService.selectList(settlementReq.getIds());
+        }
+        return this.export(response, list);
+    }
 
+    @GetMapping(name = "运费收款-物流订单详情", path = "detailCollection")
+    public HttpResult detailCollection(@RequestParam("id") Long id) {
+        return HttpResult.ok(kwpSettlementLogisticsService.detailCollection(id));
+    }
 
 
+    //   ========= 运费付款 托运方 =========
+    @PostMapping(name = "运费付款-物流订单列表", path = "pageListPayment")
+    public HttpResult pageSelectPayment(@RequestBody @Valid SettlementReq settlementReq) {
+        return HttpResult.ok(kwpSettlementLogisticsService.pageSelectPayment(settlementReq));
+    }
 
-
-
-
-
-    @GetMapping(name = "物流订单详情", path = "detail")
-    public HttpResult detail(@RequestParam("id") Long id) {
-        return HttpResult.ok(kwpSettlementLogisticsService.detail(id));
+    @GetMapping(name = "运费付款-物流订单各状态列表总数", path = "getCountListPayment")
+    public HttpResult getCountListPayment(@RequestBody @Valid SettlementReq settlementReq) {
+        return HttpResult.ok(kwpSettlementLogisticsService.getCountListPayment(settlementReq));
     }
 
-    @PostMapping(name = "根据条件导出物流订单表数据", path = "export")
-    public HttpResult export(HttpServletResponse response, @RequestBody @Valid SettlementReq settlementReq) {
+    @PostMapping(name = "运费付款-根据条件导出物流订单表数据", path = "exportPayment")
+    public HttpResult exportPayment(HttpServletResponse response, @RequestBody @Valid SettlementReq settlementReq) {
         List<SettlementLogisticsDto> list;
         if (CollectionUtils.isEmpty(settlementReq.getIds())) {
-            PageRes<SettlementLogisticsDto> pageResult = kwpSettlementLogisticsService.pageList(settlementReq);
+            PageRes<SettlementLogisticsDto> pageResult = kwpSettlementLogisticsService.pageSelectPayment(settlementReq);
             list = pageResult.getList();
         } else {
             list = kwpSettlementLogisticsService.selectList(settlementReq.getIds());
         }
+        return this.export(response, list);
+    }
 
+    @GetMapping(name = "物流订单详情", path = "detailPayment")
+    public HttpResult detailPayment(@RequestParam("id") Long id) {
+        return HttpResult.ok(kwpSettlementLogisticsService.detailPayment(id));
+    }
+
+    /**
+     * 导出
+     *
+     * @author Aick Spt
+     * @date 2023-07-24 15:49
+     */
+    private HttpResult export(HttpServletResponse response, List<SettlementLogisticsDto> list) {
         if (CollectionUtils.isEmpty(list)) {
             return HttpResult.error("没有可导出的数据");
         }
@@ -83,7 +107,4 @@ public class KwpSettlementLogisticsController {
     }
 
 
-
-
-
 }

+ 36 - 36
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpSettlementOfflineController.java

@@ -1,6 +1,7 @@
 package com.sckw.payment.controller;
 
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.payment.model.vo.req.SettlementOfflineReq;
 import com.sckw.payment.model.vo.req.SettlementReq;
 import com.sckw.payment.service.KwpSettlementOfflineService;
 import jakarta.annotation.Resource;
@@ -8,59 +9,58 @@ import jakarta.validation.Valid;
 import org.springframework.web.bind.annotation.*;
 
 /**
- * 结算-线下付款记录(交易订单结算/物流订单结算)
+ * 结算-线下记录(交易订单结算/物流订单结算)
+ *
  * @author Aick Spt
  * @date 2023-07-20 11:42
  */
 @RestController
-@RequestMapping(name = "结算-线下付款记录", path = "/kwpSettlementOffline")
+@RequestMapping(name = "结算-线下记录", path = "/kwpSettlementOffline")
 public class KwpSettlementOfflineController {
 
     @Resource
     private KwpSettlementOfflineService kwpSettlementOfflineService;
 
-    @PostMapping(name = "物流-线下付款记录列表", path = "pageList")
-    public HttpResult pageList(@RequestBody @Valid SettlementReq settlementReq) {
-        return HttpResult.ok(kwpSettlementOfflineService.pageList(settlementReq));
-    }
+    //  =========  运费收款  =========
 
-    @GetMapping(name = "物流-线下付款记录详情",path = "detail")
-    public HttpResult detail(@RequestParam("id") Long id){
-        return HttpResult.ok(kwpSettlementOfflineService.detail(id));
+    @PostMapping(name = "物流-线下付款(运费收款)记录-列表", path = "pageListLogisticsCollection")
+    public HttpResult pageListLogisticsCollection(@RequestBody @Valid SettlementOfflineReq settlementOfflineReq) {
+        return HttpResult.ok(kwpSettlementOfflineService.pageListLogisticsCollection(settlementOfflineReq));
     }
 
-    @GetMapping(name = "物流-新增线下付款记录",path = "confirm")
-    public HttpResult confirm(@RequestParam("id") Long id,@RequestParam("price") Float price){
-        return HttpResult.ok(kwpSettlementOfflineService.confirm(id,price));
+    @GetMapping(name = "物流-线下付款(运费收款)记录-详情", path = "detailLogisticsCollection")
+    public HttpResult detailLogisticsCollection(@RequestParam("id") Long id) {
+        return HttpResult.ok(kwpSettlementOfflineService.detailLogisticsCollection(id));
     }
 
-
-
-    @PostMapping(name = "交易-线下付款记录列表", path = "tradeOfflinePageList")
-    public HttpResult tradeOfflinePageList(@RequestBody @Valid SettlementReq settlementReq) {
-        return HttpResult.ok(kwpSettlementOfflineService.pageList(settlementReq));
+    @GetMapping(name = "物流-线下付款(运费收款)记录-新增", path = "confirmLogisticsCollection")
+    public HttpResult confirmLogisticsCollection(@RequestParam("id") Long id, @RequestParam("price") Float price) {
+        return HttpResult.ok(kwpSettlementOfflineService.confirmLogisticsCollection(id, price));
     }
 
-    @GetMapping(name = "交易-新增线下付款记录",path = "tradeOfflineConfirm")
-    public HttpResult tradeOfflineConfirm(@RequestParam("id") Long id,@RequestParam("price") Float price){
-        return HttpResult.ok(kwpSettlementOfflineService.confirm(id,price));
-    }
-
-
-
-    @PostMapping(name = "交易-预付款记录列表", path = "tradePageList")
-    public HttpResult tradePageList(@RequestBody @Valid SettlementReq settlementReq) {
-        return HttpResult.ok(kwpSettlementOfflineService.pageList(settlementReq));
-    }
-
-    @GetMapping(name = "交易-新增预付款记录",path = "tradeConfirm")
-    public HttpResult tradeConfirm(@RequestParam("id") Long id,@RequestParam("price") Float price){
-        return HttpResult.ok(kwpSettlementOfflineService.confirm(id,price));
-    }
-
-
-
 
+    //  =========  销售收款  =========
+//
+//    @PostMapping(name = "交易-线下付款(销售收款)记录-列表", path = "pageListTradeCollection")
+//    public HttpResult pageListTradeCollection(@RequestBody @Valid SettlementReq settlementReq) {
+//        return HttpResult.ok(kwpSettlementOfflineService.pageList(settlementReq));
+//    }
+//
+//    @GetMapping(name = "交易-线下付款(销售收款)记录-新增",path = "tradeOfflineConfirm")
+//    public HttpResult tradeOfflineConfirm(@RequestParam("id") Long id,@RequestParam("price") Float price){
+//        return HttpResult.ok(kwpSettlementOfflineService.confirm(id,price));
+//    }
+
+
+//    @PostMapping(name = "交易-预付款记录列表", path = "tradePageList")
+//    public HttpResult tradePageList(@RequestBody @Valid SettlementReq settlementReq) {
+//        return HttpResult.ok(kwpSettlementOfflineService.pageList(settlementReq));
+//    }
+//
+//    @GetMapping(name = "交易-新增预付款记录",path = "tradeConfirm")
+//    public HttpResult tradeConfirm(@RequestParam("id") Long id,@RequestParam("price") Float price){
+//        return HttpResult.ok(kwpSettlementOfflineService.confirm(id,price));
+//    }
 
 
 }

+ 19 - 29
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpSettlementWalletController.java

@@ -1,6 +1,8 @@
 package com.sckw.payment.controller;
+
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.payment.model.vo.req.SettlementReq;
+import com.sckw.payment.model.vo.req.SettlementWalletReq;
 import com.sckw.payment.service.KwpSettlementWalletService;
 import jakarta.annotation.Resource;
 import jakarta.validation.Valid;
@@ -8,48 +10,36 @@ import org.springframework.web.bind.annotation.*;
 
 /**
  * 结算-电子钱包结算记录(交易订单结算/物流订单结算)
+ *
  * @author Aick Spt
  * @date 2023-07-20 14:42
  */
 @RestController
-@RequestMapping(name = "结算-电子钱包结算记录列表", path = "/kwpSettlementWallet")
+@RequestMapping(name = "结算-电子钱包结算记录", path = "/kwpSettlementWallet")
 public class KwpSettlementWalletController {
 
     @Resource
     private KwpSettlementWalletService kwpSettlementWalletService;
 
-    @PostMapping(name = "物流-电子钱包结算记录列表", path = "pageList")
-    public HttpResult pageList(@RequestBody @Valid SettlementReq settlementReq) {
-        return HttpResult.ok(kwpSettlementWalletService.pageList(settlementReq));
-    }
-
-    @GetMapping(name = "物流-电子钱包结算记录详情",path = "detail")
-    public HttpResult detail(@RequestParam("id") Long id){
-        return HttpResult.ok(kwpSettlementWalletService.detail(id));
+    @PostMapping(name = "物流-电子钱包付款(货到付款)结算记录-列表", path = "pageListLogisticsPayment")
+    public HttpResult pageListLogisticsPayment(SettlementWalletReq settlementWalletReq) {
+        return HttpResult.ok(kwpSettlementWalletService.pageListLogisticsPayment(settlementWalletReq));
     }
 
-    @GetMapping(name = "物流-新增电子钱包结算记录",path = "confirm")
-    public HttpResult confirm(@RequestParam("id") Long id,@RequestParam("price") Float price){
-        return HttpResult.ok(kwpSettlementWalletService.confirm(id,price));
+    @GetMapping(name = "物流-电子钱包付款(货到付款)结算记录-详情", path = "detailLogisticsPayment")
+    public HttpResult detailLogisticsPayment(@RequestParam("id") Long id) {
+        return HttpResult.ok(kwpSettlementWalletService.detailLogisticsPayment(id));
     }
 
-
-    @PostMapping(name = "交易-电子钱包结算记录列表", path = "tradePageList")
-    public HttpResult tradePageList(@RequestBody @Valid SettlementReq settlementReq) {
-        return HttpResult.ok(kwpSettlementWalletService.pageList(settlementReq));
+    /**
+     * @param id    结算单id
+     * @param price 本次付款金额
+     * @author Aick Spt
+     * @date 2023-07-25 09:55
+     */
+    @GetMapping(name = "物流-电子钱包付款(货到付款)结算记录-新增", path = "confirmLogisticsPayment")
+    public HttpResult confirmLogisticsPayment(@RequestParam("id") Long id, @RequestParam("price") Float price) {
+        return HttpResult.ok(kwpSettlementWalletService.confirmLogisticsPayment(id, price));
     }
 
-    @GetMapping(name = "交易-新增电子钱包结算记录",path = "tradeConfirm")
-    public HttpResult tradeConfirm(@RequestParam("id") Long id,@RequestParam("price") Float price){
-        return HttpResult.ok(kwpSettlementWalletService.confirm(id,price));
-    }
-
-
-
-
-
-
-
-
-
 }

+ 53 - 11
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementLogisticsMapper.java

@@ -1,13 +1,8 @@
 package com.sckw.payment.dao;
 
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.sckw.payment.model.KwpLedgerLogistics;
 import com.sckw.payment.model.KwpSettlementLogistics;
-import com.sckw.payment.model.dto.LedgerLogisticsDto;
-import com.sckw.payment.model.dto.LedgerTradeDto;
 import com.sckw.payment.model.dto.SettlementLogisticsDto;
-import com.sckw.payment.model.vo.req.LogisticsReq;
 import com.sckw.payment.model.vo.req.SettlementReq;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -15,19 +10,66 @@ import org.apache.ibatis.annotations.Param;
 import java.util.List;
 
 /**
- * @author xucaiqin
- * @date 2023-07-10 16:42:20
+ * @author Aick Spt
+ * @date 2023-07-24 14:55
  */
-
 @Mapper
 public interface KwpSettlementLogisticsMapper extends BaseMapper<KwpSettlementLogistics> {
 
     /**
-     * @param settlementReq 过滤参数
+     * 运费收款-物流订单列表
+     *
+     * @author Aick Spt
+     * @date 2023-07-24 16:21
+     */
+    List<SettlementLogisticsDto> pageSelectCollection(@Param("settlementReq") SettlementReq settlementReq);
+
+    /**
+     * 运费收款-物流订单各状态列表总数
+     *
+     * @author Aick Spt
+     * @date 2023-07-24 16:21
+     */
+    Long getCountListCollection(@Param("settlementReq") SettlementReq settlementReq);
+
+    /**
+     * 运费收款-物流订单详情
+     *
+     * @author Aick Spt
+     * @date 2023-07-24 16:22
+     */
+    SettlementLogisticsDto detailCollection(@Param("id") Long id);
+
+
+    /**
+     * 运费付款-物流订单列表
+     *
+     * @author Aick Spt
+     * @date 2023-07-24 16:23
      */
-    List<SettlementLogisticsDto> pageSelect(@Param("settlementReq") SettlementReq settlementReq);
+    List<SettlementLogisticsDto> pageSelectPayment(@Param("settlementReq") SettlementReq settlementReq);
 
-    SettlementLogisticsDto detail(@Param("id") Long id);
+    /**
+     * 运费付款-物流订单各状态列表总数
+     *
+     * @author Aick Spt
+     * @date 2023-07-24 16:23
+     */
+    Long getCountListPayment(@Param("settlementReq") SettlementReq settlementReq);
 
+    /**
+     * 运费付款-物流订单详情
+     *
+     * @author Aick Spt
+     * @date 2023-07-24 16:24
+     */
+    SettlementLogisticsDto detailPayment(@Param("id") Long id);
+
+    /**
+     * 根据id查物流结算订单
+     *
+     * @author Aick Spt
+     * @date 2023-07-24 16:24
+     */
     List<SettlementLogisticsDto> selectIds(@Param("ids") List<Long> ids);
 }

+ 13 - 3
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementOfflineMapper.java

@@ -2,13 +2,23 @@ package com.sckw.payment.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.payment.model.KwpSettlementOffline;
+import com.sckw.payment.model.dto.SettlementOfflineDto;
+import com.sckw.payment.model.vo.req.SettlementOfflineReq;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
- * @author xucaiqin
- * @date 2023-07-10 16:42:19
+ *
+ * @author Aick Spt
+ * @date 2023-07-25 10:44
  */
-
 @Mapper
 public interface KwpSettlementOfflineMapper extends BaseMapper<KwpSettlementOffline> {
+    List<SettlementOfflineDto> pageListLogisticsCollection(SettlementOfflineReq settlementOfflineReq);
+
+    SettlementOfflineDto detailLogisticsCollection(@Param("id") Long id);
+
+    Integer confirmLogisticsCollection(@Param("id") Long id,@Param("price") Float price);
 }

+ 20 - 3
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementWalletMapper.java

@@ -1,14 +1,31 @@
 package com.sckw.payment.dao;
 
+import java.util.List;
+
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.payment.model.KwpSettlementWallet;
+import com.sckw.payment.model.dto.SettlementWalletDto;
+import com.sckw.payment.model.vo.req.SettlementWalletReq;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
- * @author xucaiqin
- * @date 2023-07-10 16:42:20
+ * @author Aick Spt
+ * @date 2023-07-25 11:01
  */
 
 @Mapper
-public interface KwpSettlementWalletMapper extends BaseMapper<KwpSettlementWallet> {
+public interface KwpSettlementWalletMapper  extends BaseMapper<KwpSettlementWallet> {
+
+    /**
+     * 运费付款-物流订单列表
+     *
+     * @author Aick Spt
+     * @date 2023-07-24 16:23
+     */
+    List<SettlementWalletDto> pageListLogisticsPayment(@Param("settlementWalletReq") SettlementWalletReq settlementWalletReq);
+
+    SettlementWalletDto detailLogisticsPayment(@Param("id") Long id);
+
+    Integer confirmLogisticsPayment(@Param("id") Long id, @Param("price") Float price);
 }

+ 56 - 4
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/KwpSettlementWallet.java

@@ -11,13 +11,11 @@ import lombok.Setter;
 import lombok.ToString;
 
 /**
+ * 电子钱包结算记录(交易订单结算/物流订单结算)
+ *
  * @author xucaiqin
  * @date 2023-07-10 16:42:20
  */
-
-/**
- * 电子钱包结算记录(交易订单结算/物流订单结算)
- */
 @Getter
 @Setter
 @ToString
@@ -88,4 +86,58 @@ public class KwpSettlementWallet {
      */
     @TableField(value = "del_flag")
     private Integer delFlag;
+    private String settlementId;
+    private String orderType;
+    private String channel;
+    private String payTime;
+    private String payPrice;
+    private String topayPrice;
+
+    public String getTopayPrice() {
+        return topayPrice;
+    }
+
+    public void setTopayPrice(String topayPrice) {
+        this.topayPrice = topayPrice;
+    }
+
+    public String getPayPrice() {
+        return payPrice;
+    }
+
+    public void setPayPrice(String payPrice) {
+        this.payPrice = payPrice;
+    }
+
+    public String getPayTime() {
+        return payTime;
+    }
+
+    public void setPayTime(String payTime) {
+        this.payTime = payTime;
+    }
+
+    public String getChannel() {
+        return channel;
+    }
+
+    public void setChannel(String channel) {
+        this.channel = channel;
+    }
+
+    public String getOrderType() {
+        return orderType;
+    }
+
+    public void setOrderType(String orderType) {
+        this.orderType = orderType;
+    }
+
+    public String getSettlementId() {
+        return settlementId;
+    }
+
+    public void setSettlementId(String settlementId) {
+        this.settlementId = settlementId;
+    }
 }

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

@@ -70,6 +70,7 @@ public class SettlementOfflineDto {
      * 创建人
      */
     private Long createBy;
+    private String createByText;
 
     /**
      * 创建时间
@@ -81,6 +82,7 @@ public class SettlementOfflineDto {
      * 更新人
      */
     private Long updateBy;
+    private String updateByText;
 
     /**
      * 更新时间
@@ -115,5 +117,6 @@ public class SettlementOfflineDto {
                 ", delFlag=" + delFlag +
                 '}';
     }
+
 }
 

+ 10 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/SettlementWalletDto.java

@@ -75,6 +75,11 @@ public class SettlementWalletDto {
      */
     private Long createBy;
 
+    /**
+     * 创建人名称
+     */
+    private String createByText;
+
     /**
      * 创建时间
      */
@@ -86,6 +91,11 @@ public class SettlementWalletDto {
      */
     private Long updateBy;
 
+    /**
+     * 更新人名称
+     */
+    private String updateByText;
+
     /**
      * 更新时间
      */

+ 12 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/SettlementOfflineReq.java

@@ -0,0 +1,12 @@
+package com.sckw.payment.model.vo.req;
+
+import com.sckw.core.model.vo.BasePara;
+
+/**
+ * @author Aick Spt
+ * @date 2023-07-24 16:52
+ */
+public class SettlementOfflineReq extends BasePara {
+
+
+}

+ 12 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/SettlementWalletReq.java

@@ -0,0 +1,12 @@
+package com.sckw.payment.model.vo.req;
+
+import com.sckw.core.model.vo.BasePara;
+
+/**
+ * @author Aick Spt
+ * @date 2023-07-24 16:52
+ */
+public class SettlementWalletReq  extends BasePara {
+
+
+}

+ 102 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/SettlementOfflineVo.java

@@ -0,0 +1,102 @@
+package com.sckw.payment.model.vo.res;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author Aick Spt
+ * @date 2023-07-24 16:45
+ */
+@Getter
+@Setter
+public class SettlementOfflineVo {
+
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 企业类型
+     */
+    private Long entId;
+
+    /**
+     * 结算id(交易订单结算/物流订单结算)
+     */
+    private Long settlementId;
+
+    /**
+     * 结算单类型 1-物流 2-贸易
+     */
+    private Byte orderType;
+
+    /**
+     * 付款日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date payTime;
+
+    /**
+     * 付款金额
+     */
+    private BigDecimal payPrice;
+
+    /**
+     * 待付金额
+     */
+    private BigDecimal topayPrice;
+
+    /**
+     * 付款附件
+     */
+    private String url;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 状态:0正常/1锁定
+     */
+    private Integer status;
+
+    /**
+     * 创建人
+     */
+    private Long createBy;
+    private String createByText;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 更新人
+     */
+    private Long updateBy;
+    private String updateByText;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updateTime;
+
+    /**
+     * 删除标识(0正常/1删除)
+     */
+    private Integer delFlag;
+
+    // 添加构造函数,getter和setter方法,以及其他业务逻辑方法(根据需要)
+
+
+}

+ 83 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/SettlementWalletVo.java

@@ -0,0 +1,83 @@
+package com.sckw.payment.model.vo.res;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @author Aick Spt
+ * @date 2023-07-24 16:45
+ */
+@Getter
+@Setter
+public class SettlementWalletVo {
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+
+    /**
+     * 线上渠道 1-huifu
+     */
+    private Integer channel;
+
+    /**
+     * 回款时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date payTime;
+
+    /**
+     * 金额
+     */
+    private Double payPrice;
+
+    /**
+     * 剩余待付金额
+     */
+    private Double topayPrice;
+
+    /**
+     * 类型(0付款、1退款)
+     */
+    private Integer type;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+    /**
+     * 创建人名称
+     */
+    private Long createByText;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 更新人名称
+     */
+    private Long updateByText;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updateTime;
+
+    /**
+     * 是否删除(0未删除,1删除)
+     */
+    private Integer delFlag;
+
+
+}

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

@@ -14,8 +14,8 @@ import com.sckw.payment.model.dto.SettlementLogisticsDto;
 import com.sckw.payment.model.vo.req.SettlementReq;
 import com.sckw.payment.model.vo.res.SettlementLogisticsStatusCountVo;
 import com.sckw.payment.utils.CommonValidator;
-import jakarta.validation.constraints.NotNull;
 import lombok.AllArgsConstructor;
+import org.jetbrains.annotations.NotNull;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -30,34 +30,113 @@ import java.util.Objects;
 public class KwpSettlementLogisticsService {
     private final KwpSettlementLogisticsMapper settlementLogisticsMapper;
 
-    public SettlementLogisticsStatusCountVo getCountList() {
+//    public SettlementLogisticsStatusCountVo getCountList() {
+//        SettlementLogisticsStatusCountVo settlementLogisticsStatusCountVos = new SettlementLogisticsStatusCountVo();
+//        LambdaQueryWrapper<KwpSettlementLogistics> wrapper = new LambdaQueryWrapper<>();
+//
+//        settlementLogisticsStatusCountVos.setAllCount(settlementLogisticsMapper.selectCount(wrapper));
+//
+//        wrapper.eq(KwpSettlementLogistics::getStatus, SettlementEnum.WAITING_PAYMENT.getStatus());//待结算
+//        settlementLogisticsStatusCountVos.setWaitingPaymentCount(settlementLogisticsMapper.selectCount(wrapper));
+//
+//        wrapper.clear();
+//        wrapper.eq(KwpSettlementLogistics::getStatus, SettlementEnum.PARTIAL_PAYMENT.getStatus());//部分结算
+//        settlementLogisticsStatusCountVos.setPartialPaymentCount(settlementLogisticsMapper.selectCount(wrapper));
+//
+//        wrapper.clear();
+//        wrapper.eq(KwpSettlementLogistics::getStatus, SettlementEnum.ALL_PAYMENT.getStatus());//全部结算
+//        settlementLogisticsStatusCountVos.setAllPaymentCount(settlementLogisticsMapper.selectCount(wrapper));
+//
+//        return settlementLogisticsStatusCountVos;
+//    }
+
+    /**
+     * 运费收款-物流订单各状态列表总数
+     * @author Aick Spt
+     * @date 2023-07-24 16:21
+     */
+    public SettlementLogisticsStatusCountVo getCountListCollection(SettlementReq settlementReq) {
         SettlementLogisticsStatusCountVo settlementLogisticsStatusCountVos = new SettlementLogisticsStatusCountVo();
-        LambdaQueryWrapper<KwpSettlementLogistics> wrapper = new LambdaQueryWrapper<>();
+        //总
+        settlementReq.setStatus(null);
+        settlementLogisticsStatusCountVos.setAllCount(settlementLogisticsMapper.getCountListCollection(settlementReq));
 
-        settlementLogisticsStatusCountVos.setAllCount(settlementLogisticsMapper.selectCount(wrapper));
+        //待结算
+        settlementReq.setStatus(SettlementEnum.WAITING_PAYMENT.getStatus());
+        settlementLogisticsStatusCountVos.setWaitingPaymentCount(settlementLogisticsMapper.getCountListCollection(settlementReq));
 
-        wrapper.eq(KwpSettlementLogistics::getStatus, SettlementEnum.WAITING_PAYMENT.getStatus());//待结算
-        settlementLogisticsStatusCountVos.setWaitingPaymentCount(settlementLogisticsMapper.selectCount(wrapper));
+        //部分结算
+        settlementReq.setStatus(SettlementEnum.PARTIAL_PAYMENT.getStatus());
+        settlementLogisticsStatusCountVos.setPartialPaymentCount(settlementLogisticsMapper.getCountListCollection(settlementReq));
+
+        //全部结算
+        settlementReq.setStatus(SettlementEnum.ALL_PAYMENT.getStatus());
+        settlementLogisticsStatusCountVos.setAllPaymentCount(settlementLogisticsMapper.getCountListCollection(settlementReq));
+
+        return settlementLogisticsStatusCountVos;
+    }
+
+    /**
+     * 运费付款-物流订单各状态列表总数
+     * @author Aick Spt
+     * @date 2023-07-24 16:23
+     */
+    public SettlementLogisticsStatusCountVo getCountListPayment(SettlementReq settlementReq) {
+        SettlementLogisticsStatusCountVo settlementLogisticsStatusCountVos = new SettlementLogisticsStatusCountVo();
+        //总
+        settlementReq.setStatus(null);
+        settlementLogisticsStatusCountVos.setAllCount(settlementLogisticsMapper.getCountListPayment(settlementReq));
 
-        wrapper.clear();
-        wrapper.eq(KwpSettlementLogistics::getStatus, SettlementEnum.PARTIAL_PAYMENT.getStatus());//部分结算
-        settlementLogisticsStatusCountVos.setPartialPaymentCount(settlementLogisticsMapper.selectCount(wrapper));
+        //待结算
+        settlementReq.setStatus(SettlementEnum.WAITING_PAYMENT.getStatus());
+        settlementLogisticsStatusCountVos.setWaitingPaymentCount(settlementLogisticsMapper.getCountListPayment(settlementReq));
 
-        wrapper.clear();
-        wrapper.eq(KwpSettlementLogistics::getStatus, SettlementEnum.ALL_PAYMENT.getStatus());//全部结算
-        settlementLogisticsStatusCountVos.setAllPaymentCount(settlementLogisticsMapper.selectCount(wrapper));
+        //部分结算
+        settlementReq.setStatus(SettlementEnum.PARTIAL_PAYMENT.getStatus());
+        settlementLogisticsStatusCountVos.setPartialPaymentCount(settlementLogisticsMapper.getCountListPayment(settlementReq));
+
+        //全部结算
+        settlementReq.setStatus(SettlementEnum.ALL_PAYMENT.getStatus());
+        settlementLogisticsStatusCountVos.setAllPaymentCount(settlementLogisticsMapper.getCountListPayment(settlementReq));
 
         return settlementLogisticsStatusCountVos;
     }
 
-    public PageRes<SettlementLogisticsDto> pageList(SettlementReq settlementReq) {
+    /**
+     * 运费收款-物流订单列表
+     * @author Aick Spt
+     * @date 2023-07-24 16:21
+     */
+    public PageRes<SettlementLogisticsDto> pageSelectCollection(SettlementReq settlementReq) {
         CommonValidator.isValidCoexisting(settlementReq.getStartCreateTime(), settlementReq.getEndCreateTime(), "");
         CommonValidator.isValidCoexisting(settlementReq.getStartReceiptTime(), settlementReq.getEndReceiptTime(), "预计收款开始和结束时间");
 
         PageHelper.startPage(settlementReq.getPage(), settlementReq.getPageSize());
-        List<SettlementLogisticsDto> kwpLedgerLogisticsList = settlementLogisticsMapper.pageSelect(settlementReq);
+        List<SettlementLogisticsDto> kwpLedgerLogisticsList = settlementLogisticsMapper.pageSelectCollection(settlementReq);
 
         // 对查询结果进行处理,转换 status 到 desc
+        return getSettlementLogisticsDtoPageRes(kwpLedgerLogisticsList);
+    }
+
+
+    /**
+     * 运费付款-物流订单列表
+     * @author Aick Spt
+     * @date 2023-07-24 16:23
+     */
+    public PageRes<SettlementLogisticsDto> pageSelectPayment(SettlementReq settlementReq) {
+        CommonValidator.isValidCoexisting(settlementReq.getStartCreateTime(), settlementReq.getEndCreateTime(), "");
+        CommonValidator.isValidCoexisting(settlementReq.getStartReceiptTime(), settlementReq.getEndReceiptTime(), "预计收款开始和结束时间");
+
+        PageHelper.startPage(settlementReq.getPage(), settlementReq.getPageSize());
+        List<SettlementLogisticsDto> kwpLedgerLogisticsList = settlementLogisticsMapper.pageSelectPayment(settlementReq);
+
+        // 对查询结果进行处理,转换 status 到 desc
+        return getSettlementLogisticsDtoPageRes(kwpLedgerLogisticsList);
+    }
+
+    @NotNull
+    private PageRes<SettlementLogisticsDto> getSettlementLogisticsDtoPageRes(List<SettlementLogisticsDto> kwpLedgerLogisticsList) {
         for (SettlementLogisticsDto entity : kwpLedgerLogisticsList) {
             entity.setStatusText(SettlementEnum.getStatusDesc(entity.getStatus()));
             entity.setResiduePrice(entity.getLedgerSettlePrice().subtract(entity.getActualPrice()));
@@ -65,31 +144,38 @@ public class KwpSettlementLogisticsService {
             entity.setUpdateByText("更新人名称");
         }
         return new PageRes<>(new PageInfo<>(kwpLedgerLogisticsList));
-
     }
 
 
     /**
-     * 根据id查物流结算订单
-     *
-     * @param ids 物流结算订单集合List<Long>
+     * 运费收款-物流订单详情
      * @author Aick Spt
-     * @date 2023-07-21 16:16
+     * @date 2023-07-24 16:22
      */
-    public List<SettlementLogisticsDto> selectList(List<Long> ids) {
-        return settlementLogisticsMapper.selectIds(ids);
+    public SettlementLogisticsDto detailCollection(Long id) {
+        return settlementLogisticsMapper.detailCollection(id);
+    }
+
+    /**
+     * 运费付款-物流订单详情
+     * @author Aick Spt
+     * @date 2023-07-24 16:24
+     */
+    public SettlementLogisticsDto detailPayment(Long id) {
+        return settlementLogisticsMapper.detailPayment(id);
     }
 
 
+
     /**
-     * 结算-物流订单详情
+     * 根据id查物流结算订单
      *
-     * @param id 结算物流订单id
+     * @param ids 物流结算订单集合List<Long>
      * @author Aick Spt
-     * @date 2023-07-19 09:11
+     * @date 2023-07-21 16:16
      */
-    public SettlementLogisticsDto detail(Long id) {
-        return settlementLogisticsMapper.detail(id);
+    public List<SettlementLogisticsDto> selectList(List<Long> ids) {
+        return settlementLogisticsMapper.selectIds(ids);
     }
 
 }

+ 53 - 19
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementOfflineService.java

@@ -3,16 +3,20 @@ package com.sckw.payment.service;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.model.page.PageRes;
-import com.sckw.payment.dao.KwpSettlementLogisticsMapper;
+import com.sckw.core.utils.IdWorker;
 import com.sckw.payment.dao.KwpSettlementOfflineMapper;
-import com.sckw.payment.model.dto.SettlementLogisticsDto;
-import com.sckw.payment.model.vo.req.SettlementReq;
+import com.sckw.payment.model.KwpSettlementOffline;
+import com.sckw.payment.model.dto.SettlementOfflineDto;
+import com.sckw.payment.model.vo.req.SettlementOfflineReq;
+import com.sckw.payment.model.vo.res.SettlementOfflineVo;
 import lombok.AllArgsConstructor;
-import org.apache.commons.lang3.StringUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
-import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.util.CollectionUtils;
 
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @author xucaiqin
@@ -20,48 +24,78 @@ import java.util.List;
  */
 @AllArgsConstructor
 @Service
+@Slf4j
 public class KwpSettlementOfflineService {
 
     private final KwpSettlementOfflineMapper settlementOfflineMapper;
 
-    public PageRes<SettlementLogisticsDto> pageList(SettlementReq settlementReq) {
+    public PageRes<SettlementOfflineVo> pageListLogisticsCollection(SettlementOfflineReq settlementOfflineReq) {
 //        //todo 查询缓存,获取客户企业id
 //        String keywords = settlementReq.getKeywords();
 //        if (StringUtils.isNotBlank(keywords)) {
 //            System.out.println("关键之:" + keywords);
 //        }
-//        PageHelper.startPage(settlementReq.getPage(), settlementReq.getPageSize());
-//
-//        List<SettlementLogisticsDto> kwpLedgerLogisticsList = settlementOfflineMapper.pageSelect(settlementReq);
-//
-//        return new PageRes<>(new PageInfo<>(kwpLedgerLogisticsList));
-        return new PageRes<>(new PageInfo<>());
+        PageHelper.startPage(settlementOfflineReq.getPage(), settlementOfflineReq.getPageSize());
+
+        List<SettlementOfflineDto> settlementOfflineLogisticsList = settlementOfflineMapper.pageListLogisticsCollection(settlementOfflineReq);
+        for (SettlementOfflineDto entity : settlementOfflineLogisticsList) {
+            entity.setCreateByText("创建人名称");
+            entity.setUpdateByText("更新人名称");
+        }
+
+        if (CollectionUtils.isEmpty(settlementOfflineLogisticsList)) {
+            return new PageRes<>(new PageInfo<>());
+        }
+
+        //指定返回值
+        List<SettlementOfflineVo> collect = settlementOfflineLogisticsList.stream().map(a -> {
+            SettlementOfflineVo settlementOfflineVo = new SettlementOfflineVo();
+            BeanUtils.copyProperties(a, settlementOfflineVo);
+            return settlementOfflineVo;
+        }).collect(Collectors.toList());
+
+        return new PageRes<>(new PageInfo<>(collect));
     }
 
 
     /**
-     * 结算-物流订单详情
+     * 结算-物流-线下付款(运费收款)记录-详情
      *
      * @param id 结算物流订单id
      * @author Aick Spt
      * @date 2023-07-19 09:11
      */
-    public SettlementLogisticsDto detail(Long id) {
-//        return settlementOfflineMapper.detail(id);
-        return new SettlementLogisticsDto();
+    public SettlementOfflineDto detailLogisticsCollection(Long id) {
+        return settlementOfflineMapper.detailLogisticsCollection(id);
     }
 
     /**
-     * 收款确认
+     * 物流-线下付款(运费收款)记录-新增
      *
+     * @param id    结算单id
      * @param price 付款金额
      * @return InsertId
      * @author Aick Spt
      * @date 2023-07-20 14:23
      */
-    public Integer confirm(Long id, Float price) {
+    public Integer confirmLogisticsCollection(Long id, Float price) {
+        log.info("接收到数据,开始物流-物流-线下付款(运费收款)记录-新增,待完善");
+        //todo 待完善
+        //先查询出结算单情况
+
+        //检查结算单状态和所差金额
+
+        //对比金额
+
+        //累加入库结算单
+
+        //新增电子钱包结算记录
+        KwpSettlementOffline kwpSettlementOffline = new KwpSettlementOffline();
+        kwpSettlementOffline.setId(new IdWorker(1).nextId());
 
-        return 1;
+        //todo 待完善
+        settlementOfflineMapper.insert(kwpSettlementOffline);
+        return settlementOfflineMapper.confirmLogisticsCollection(id, price);
     }
 
 }

+ 61 - 16
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementWalletService.java

@@ -1,35 +1,62 @@
 package com.sckw.payment.service;
 
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.model.page.PageRes;
+import com.sckw.core.utils.IdWorker;
 import com.sckw.payment.dao.KwpSettlementWalletMapper;
+import com.sckw.payment.model.KwpSettlementWallet;
 import com.sckw.payment.model.dto.SettlementLogisticsDto;
 import com.sckw.payment.model.dto.SettlementWalletDto;
-import com.sckw.payment.model.vo.req.SettlementReq;
+import com.sckw.payment.model.vo.req.SettlementWalletReq;
+import com.sckw.payment.model.vo.res.SettlementWalletVo;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
 
 /**
- *
  * @author Aick Spt
  * @date 2023-07-20 14:55
  */
+@AllArgsConstructor
 @Service
+@Slf4j
 public class KwpSettlementWalletService {
 
-//    private final KwpSettlementWalletMapper settlementWalletMapper;
+    private final KwpSettlementWalletMapper settlementWalletMapper;
 
-    public PageRes<SettlementWalletDto> pageList(SettlementReq settlementReq) {
+    public PageRes<SettlementWalletVo> pageListLogisticsPayment(SettlementWalletReq settlementWalletReq) {
 //        //todo 查询缓存,获取客户企业id
 //        String keywords = settlementReq.getKeywords();
 //        if (StringUtils.isNotBlank(keywords)) {
 //            System.out.println("关键之:" + keywords);
 //        }
-//        PageHelper.startPage(settlementReq.getPage(), settlementReq.getPageSize());
-//
-//        List<SettlementLogisticsDto> kwpLedgerLogisticsList = settlementOfflineMapper.pageSelect(settlementReq);
-//
-//        return new PageRes<>(new PageInfo<>(kwpLedgerLogisticsList));
-        return new PageRes<>(new PageInfo<>());
+        PageHelper.startPage(settlementWalletReq.getPage(), settlementWalletReq.getPageSize());
+
+        List<SettlementWalletDto> settlementWalletLogisticsList = settlementWalletMapper.pageListLogisticsPayment(settlementWalletReq);
+        for (SettlementWalletDto entity : settlementWalletLogisticsList) {
+            entity.setCreateByText("创建人名称");
+            entity.setUpdateByText("更新人名称");
+        }
+
+        if (CollectionUtils.isEmpty(settlementWalletLogisticsList)) {
+            return new PageRes<>(new PageInfo<>());
+        }
+
+        //指定返回值
+        List<SettlementWalletVo> collect = settlementWalletLogisticsList.stream().map(a -> {
+            SettlementWalletVo settlementWalletVo = new SettlementWalletVo();
+            BeanUtils.copyProperties(a, settlementWalletVo);
+            return settlementWalletVo;
+        }).collect(Collectors.toList());
+
+        return new PageRes<>(new PageInfo<>(collect));
     }
 
 
@@ -40,21 +67,39 @@ public class KwpSettlementWalletService {
      * @author Aick Spt
      * @date 2023-07-19 09:11
      */
-    public SettlementLogisticsDto detail(Long id) {
-//        return settlementOfflineMapper.detail(id);
-        return new SettlementLogisticsDto();
+    public SettlementWalletDto detailLogisticsPayment(Long id) {
+        return settlementWalletMapper.detailLogisticsPayment(id);
     }
 
     /**
-     * 收款确认
+     * 物流-电子钱包付款(货到付款)结算记录-新增
      *
+     * @param id    结算单id
      * @param price 付款金额
      * @return InsertId
      * @author Aick Spt
      * @date 2023-07-20 14:23
      */
-    public Integer confirm(Long id, Float price) {
+    public Integer confirmLogisticsPayment(Long id, Float price) {
+        log.info("接收到数据,开始物流-电子钱包付款(货到付款)结算记录-新增,待完善");
+        //todo 待完善
+        //先查询出结算单情况
+
+        //检查结算单状态和所差金额
 
-        return 1;
+        //对比金额
+
+        //累加入库结算单
+
+        //扣费电子钱包
+
+        //新增电子钱包结算记录
+        KwpSettlementWallet kwpSettlementWallet = new KwpSettlementWallet();
+        kwpSettlementWallet.setId(new IdWorker(1).nextId());
+        //todo 待完善
+        settlementWalletMapper.insert(kwpSettlementWallet);
+        return settlementWalletMapper.confirmLogisticsPayment(id, price);
     }
+
 }
+

+ 98 - 41
sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementLogisticsMapper.xml

@@ -26,7 +26,6 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        <!--@mbg.generated-->
         id,
         ent_id,
         l_ledger_id,
@@ -47,7 +46,8 @@
         update_time,
         del_flag
     </sql>
-    <sql id="Join_Column_List" lang="com.sckw.payment.model.dto.SettlementLogisticsDto">
+
+    <sql id="Join_Column_List">
         s.id,
         s.ent_id        as entId,
         s.l_ledger_id   as lLedgerId,
@@ -78,7 +78,8 @@
         where id = #{id,jdbcType=BIGINT}
     </select>
 
-    <select id="pageSelect" resultType="com.sckw.payment.model.dto.SettlementLogisticsDto">
+    <!--  连表筛选准备  -->
+    <sql id="settlementLogisticsSelect">
         select l.`name`       as ledgerName,
                l.l_ledger_no  as lLedgerNo,
                l.trading      as ledgerTrading,
@@ -89,60 +90,116 @@
 
         <include refid="Join_Column_List"/>
         from kwp_settlement_logistics s
-                 left join kwp_ledger_logistics l
-                           on s.l_ledger_id = l.id
-                 left join kwp_ledger_logistics_unit lu
-                           on s.l_ledger_id = lu.l_ledger_id
+                 left join kwp_ledger_logistics l on s.l_ledger_id = l.id
+                 left join kwp_ledger_logistics_unit lu on s.l_ledger_id = lu.l_ledger_id
+    </sql>
+
+    <!--  根据连表,查询条件准备  -->
+    <sql id="settlementLogisticsSelectWhere">
+        <if test="settlementReq.status != null">
+            and s.status = #{settlementReq.status}
+        </if>
+
+        <if test="settlementReq.startCreateTime != null and settlementReq.endCreateTime != null">
+            and s.create_time between #{settlementReq.startCreateTime,jdbcType=TIMESTAMP} and #{settlementReq.endCreateTime,jdbcType=TIMESTAMP}
+        </if>
+        <if test="settlementReq.startReceiptTime != null and settlementReq.endReceiptTime != null">
+            and s.receipt_time between #{settlementReq.startReceiptTime,jdbcType=TIMESTAMP} and #{settlementReq.endReceiptTime,jdbcType=TIMESTAMP}
+        </if>
+
+        <if test="settlementReq.keywords != null and settlementReq.keywords != ''">
+            and ( l.l_ledger_no like concat('%'
+                 , #{settlementReq.keywords}
+                 , '%')
+                )
+        </if>
+    </sql>
+
+
+    <!-- 结算运费收款(承运方)-物流订单列表  -->
+    <select id="pageSelectCollection" resultType="com.sckw.payment.model.dto.SettlementLogisticsDto">
+        <include refid="settlementLogisticsSelect"/>
         <where>
-            l.del_flag = 0
-            <if test="settlementReq.status != null">
-                and s.status = #{settlementReq.status}
-            </if>
-
-            <if test="settlementReq.startCreateTime != null and settlementReq.endCreateTime != null">
-                and s.create_time between #{settlementReq.startCreateTime,jdbcType=TIMESTAMP}
-                    and #{settlementReq.endCreateTime,jdbcType=TIMESTAMP}
-            </if>
-            <if test="settlementReq.startReceiptTime != null and settlementReq.endReceiptTime != null">
-                and s.receipt_time between #{settlementReq.startReceiptTime,jdbcType=TIMESTAMP}
-                    and #{settlementReq.endReceiptTime,jdbcType=TIMESTAMP}
-            </if>
-
-            <if test="settlementReq.keywords != null and settlementReq.keywords != ''">
-                and (
-                        l.l_ledger_no like concat('%'
-                        , #{settlementReq.keywords}
-                        , '%')
-                    )
-            </if>
+            lu.unit_type = 1
+              and l.del_flag = 0
+              and s.del_flag = 0
+              and lu.del_flag = 0
+            <include refid="settlementLogisticsSelectWhere"/>
         </where>
         order by s.update_time desc
     </select>
 
-    <select id="detail"  parameterType="java.lang.Long"  resultType="com.sckw.payment.model.dto.SettlementLogisticsDto">
+    <!-- 结算运费收款(承运方)-物流订单列表头部汇总数  -->
+    <select id="getCountListCollection" resultType="java.lang.Long">
+        select count(s.id) as num
+        from kwp_settlement_logistics s
+                 left join kwp_ledger_logistics l on s.l_ledger_id = l.id
+                 left join kwp_ledger_logistics_unit lu on s.l_ledger_id = lu.l_ledger_id
+        <where>
+            lu.unit_type = 1
+              and l.del_flag = 0
+              and s.del_flag = 0
+              and lu.del_flag = 0
+            <include refid="settlementLogisticsSelectWhere"/>
+        </where>
+    </select>
+
+    <!--  根据结算(承运方)物流订单id查详情   -->
+    <select id="detailCollection" parameterType="java.lang.Long" resultType="com.sckw.payment.model.dto.SettlementLogisticsDto">
         select
         <include refid="Join_Column_List"/>
         from kwp_settlement_logistics s
         left join kwp_ledger_logistics l on s.l_ledger_id = l.id
-        left join kwp_ledger_logistics_unit u on l.id = u.l_ledger_id
+        left join kwp_ledger_logistics_unit lu on s.l_ledger_id = lu.l_ledger_id
         where s.id = #{id,jdbcType=BIGINT}
+        and lu.unit_type = 1
     </select>
 
-    <select id="selectIds" resultType="com.sckw.payment.model.dto.SettlementLogisticsDto">
-        select l.`name`       as ledgerName,
-               l.l_ledger_no  as lLedgerNo,
-               l.trading      as ledgerTrading,
-               l.settle_price as ledgerSettlePrice,
 
-               lu.unit_type   as unitType,
-               lu.firm_name   as CustomerName,
 
+    <!-- 结算运费付款(托运方)-物流订单列表  -->
+    <select id="pageSelectPayment" resultType="com.sckw.payment.model.dto.SettlementLogisticsDto">
+        <include refid="settlementLogisticsSelect"/>
+        <where>
+            lu.unit_type = 2
+              and l.del_flag = 0
+              and s.del_flag = 0
+              and lu.del_flag = 0
+            <include refid="settlementLogisticsSelectWhere"/>
+        </where>
+        order by s.update_time desc
+    </select>
+
+    <!-- 结算运费付款(托运方)-物流订单列表头部汇总数  -->
+    <select id="getCountListPayment" resultType="java.lang.Long">
+        select count(s.id) as num
+        from kwp_settlement_logistics s
+                 left join kwp_ledger_logistics l on s.l_ledger_id = l.id
+                 left join kwp_ledger_logistics_unit lu on s.l_ledger_id = lu.l_ledger_id
+        <where>
+            lu.unit_type = 2
+              and l.del_flag = 0
+              and s.del_flag = 0
+              and lu.del_flag = 0
+            <include refid="settlementLogisticsSelectWhere"/>
+        </where>
+    </select>
+
+    <!-- 根据结算(托运方)物流订单id查详情   -->
+    <select id="detailPayment" parameterType="java.lang.Long" resultType="com.sckw.payment.model.dto.SettlementLogisticsDto">
+        select
         <include refid="Join_Column_List"/>
         from kwp_settlement_logistics s
-                 left join kwp_ledger_logistics l
-                           on s.l_ledger_id = l.id
-                 left join kwp_ledger_logistics_unit lu
-                           on s.l_ledger_id = lu.l_ledger_id
+        left join kwp_ledger_logistics l on s.l_ledger_id = l.id
+        left join kwp_ledger_logistics_unit lu on s.l_ledger_id = lu.l_ledger_id
+        where s.id = #{id,jdbcType=BIGINT}
+        and lu.unit_type = 2
+    </select>
+
+
+    <!--  根据多个结算运费收款(线下收款)物流订单id查订单,用于导出   -->
+    <select id="selectIds" resultType="com.sckw.payment.model.dto.SettlementLogisticsDto">
+        <include refid="settlementLogisticsSelect"/>
         <where>
             s.del_flag = 0
               and s.id in

+ 11 - 3
sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementOfflineMapper.xml

@@ -27,10 +27,18 @@
     <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, ent_id, settlement_id, coll_ent_id, coll_firm_name, coll_price, coll_time, coll_user_id, 
-    coll_urls, pay_ent_id, pay_firm_name, pay_price, pay_time, pay_user_id, pay_urls, 
-    remark, `status`, create_by, create_time, update_by, update_time, del_flag
+    id,ent_id,settlement_id,order_type,pay_time,pay_price,topay_price,url,remark,`status`,create_by,create_time,update_by,update_time,del_flag
   </sql>
+
+  <select id="pageListLogisticsCollection" resultType="com.sckw.payment.model.dto.SettlementOfflineDto">
+  </select>
+
+  <select id="detailLogisticsCollection" resultType="com.sckw.payment.model.dto.SettlementOfflineDto">
+  </select>
+
+  <select id="confirmLogisticsCollection" resultType="java.lang.Integer">
+  </select>
 </mapper>

+ 27 - 8
sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementWalletMapper.xml

@@ -6,9 +6,12 @@
     <!--@Table kwp_settlement_wallet-->
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="ent_id" jdbcType="BIGINT" property="entId" />
-    <result column="order_id" jdbcType="BIGINT" property="orderId" />
-    <result column="wallet_id" jdbcType="BIGINT" property="walletId" />
-    <result column="price" jdbcType="DECIMAL" property="price" />
+    <result column="settlement_id" jdbcType="BIGINT" property="settlementId" />
+    <result column="order_type" jdbcType="INTEGER" property="orderType" />
+    <result column="channel" jdbcType="BOOLEAN" property="channel" />
+    <result column="pay_time" jdbcType="TIMESTAMP" property="payTime" />
+    <result column="pay_price" jdbcType="DECIMAL" property="payPrice" />
+    <result column="topay_price" jdbcType="DECIMAL" property="topayPrice" />
     <result column="type" jdbcType="INTEGER" property="type" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
     <result column="status" jdbcType="INTEGER" property="status" />
@@ -18,9 +21,25 @@
     <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, ent_id, order_id, wallet_id, price, `type`, remark, `status`, create_by, create_time, 
-    update_by, update_time, del_flag
-  </sql>
+
+ <sql id="Base_Column_List">
+   id,ent_id,settlement_id,order_type,channel,pay_time,pay_price,topay_price,`type`,remark,`status`,create_by,create_time,update_by,update_time,del_flag
+ </sql>
+
+  <select id="pageListLogisticsPayment" resultType="com.sckw.payment.model.dto.SettlementWalletDto">
+      select
+      <include refid="Base_Column_List" />
+      from kwp_settlement_wallet
+  </select>
+
+  <select id="detailLogisticsPayment" resultType="com.sckw.payment.model.dto.SettlementWalletDto">
+      select
+      <include refid="Base_Column_List" />
+      from kwp_settlement_wallet
+      where id = #{id,jdbcType=BIGINT}
+  </select>
+
+  <select id="confirmLogisticsPayment" resultType="java.lang.Integer">
+      insert into kwp_settlement_wallet ( <include refid="Base_Column_List" />) value ();
+    </select>
 </mapper>