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

结算-物流运费相关开发完成除对接中台和筛选当前登录者外ok

sptkw 2 лет назад
Родитель
Сommit
605fc530f0

+ 6 - 8
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpSettlementWalletController.java

@@ -1,9 +1,11 @@
 package com.sckw.payment.controller;
 
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.payment.model.vo.req.OfflinePaymentReq;
 import com.sckw.payment.model.vo.req.SettlementWalletReq;
 import com.sckw.payment.service.KwpSettlementWalletService;
 import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
@@ -34,14 +36,12 @@ public class KwpSettlementWalletController {
     }
 
     /**
-     * @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") BigDecimal price) {
-        return HttpResult.ok(kwpSettlementWalletService.confirmLogisticsPayment(id, price));
+    public HttpResult confirmLogisticsPayment(@RequestBody @Valid OfflinePaymentReq offlinePaymentReq) {
+        return HttpResult.ok(kwpSettlementWalletService.confirmLogisticsPayment(offlinePaymentReq));
     }
 
 
@@ -53,14 +53,12 @@ public class KwpSettlementWalletController {
     }
 
     /**
-     * @param id    结算单id
-     * @param price 本次付款金额
      * @author Aick Spt
      * @date 2023-07-25 09:55
      */
     @GetMapping(name = "销售-付款确认-(新增电子钱包记录-采购货到付款)", path = "confirmTradePayment")
-    public HttpResult confirmTradePayment(@RequestParam("id") Long id, @RequestParam("price") BigDecimal price) {
-        return HttpResult.ok(kwpSettlementWalletService.confirmTradePayment(id, price));
+    public HttpResult confirmTradePayment(@RequestBody @Valid OfflinePaymentReq offlinePaymentReq) {
+        return HttpResult.ok(kwpSettlementWalletService.confirmTradePayment(offlinePaymentReq));
     }
 
     @PostMapping(name = "销售-收款记录列表-预付款(电子钱包)", path = "pageListTradeCollection")

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

@@ -21,13 +21,22 @@ public class OfflinePaymentReq extends BasePara {
     @Serial
     private static final long serialVersionUID = -4568239842231210898L;
 
+    /**
+     * 结算单id
+     */
     @NotBlank
     private String id;
 
+    /**
+     * 付款金额
+     */
     @NotNull
     private BigDecimal price;
 
-    @NotBlank
+
+    /**
+     * 附件地址
+     */
     private String url;
 
 

+ 4 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementOfflineService.java

@@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.utils.IdWorker;
+import com.sckw.core.utils.StringUtils;
 import com.sckw.payment.dao.KwpSettlementLogisticsMapper;
 import com.sckw.payment.dao.KwpSettlementOfflineMapper;
 import com.sckw.payment.model.KwpSettlementLogistics;
@@ -102,7 +103,9 @@ public class KwpSettlementOfflineService {
         Long id = offlinePaymentReq.getIdLong();
         BigDecimal price = offlinePaymentReq.getPrice();
         String url = offlinePaymentReq.getUrl();
-
+        if (StringUtils.isBlank(url)) {
+            throw new BusinessException("附件必传");
+        }
         SettlementLogisticsDto settlementLogisticsDto = kwpSettlementLogisticsService.detailPayment(id);
         log.info(String.valueOf(settlementLogisticsDto));
         //检查结算单状态和所差金额

+ 7 - 4
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementWalletService.java

@@ -18,6 +18,7 @@ import com.sckw.payment.model.constant.WalletChannelEnum;
 import com.sckw.payment.model.dto.SettlementLogisticsDto;
 import com.sckw.payment.model.dto.SettlementTradeDto;
 import com.sckw.payment.model.dto.SettlementWalletDto;
+import com.sckw.payment.model.vo.req.OfflinePaymentReq;
 import com.sckw.payment.model.vo.req.SettlementWalletReq;
 import com.sckw.payment.model.vo.res.SettlementWalletVo;
 import lombok.AllArgsConstructor;
@@ -101,8 +102,6 @@ public class KwpSettlementWalletService {
     /**
      * 物流-电子钱包付款(货到付款)结算记录-新增
      *
-     * @param id    结算单id
-     * @param price 付款金额
      * @return InsertId
      * @author Aick Spt
      * @date 2023-07-20 14:23
@@ -110,8 +109,10 @@ public class KwpSettlementWalletService {
      * Transactional// isolation:事务的隔离级别,此处使用后端数据库的默认隔离级别, propagation: 如果当前没有事务,就新建一个事务,如果已经存在一个事务中,加入到这个事务中(常见)。(rollbackFor = Exception.class, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
      */
     @Transactional
-    public Integer confirmLogisticsPayment(Long id, BigDecimal price) {
+    public Integer confirmLogisticsPayment(OfflinePaymentReq offlinePaymentReq) {
         //先查询出结算单情况
+        Long id = offlinePaymentReq.getIdLong();
+        BigDecimal price = offlinePaymentReq.getPrice();
         SettlementLogisticsDto settlementLogisticsDto = kwpSettlementLogisticsService.detailPayment(id);
         log.info(String.valueOf(settlementLogisticsDto));
         //检查结算单状态和所差金额
@@ -210,8 +211,10 @@ public class KwpSettlementWalletService {
      * @author Aick Spt
      * @date 2023-07-27 16:13
      */
-    public Integer confirmTradePayment(Long id, BigDecimal price) {
+    public Integer confirmTradePayment(OfflinePaymentReq offlinePaymentReq) {
         //先查询出结算单情况
+        Long id = offlinePaymentReq.getIdLong();
+        BigDecimal price = offlinePaymentReq.getPrice();
         SettlementTradeDto settlementTradeDto = kwpSettlementTradeService.detailPayment(id);
         log.info(String.valueOf(settlementTradeDto));
         //检查结算单状态和所差金额