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

结算-物流运费相关除新增确认接口init开发完成

sptkw 2 лет назад
Родитель
Сommit
3da4a53ad6
15 измененных файлов с 402 добавлено и 116 удалено
  1. 16 4
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpSettlementLogisticsController.java
  2. 6 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/dao/KwpSettlementLogisticsMapper.java
  3. 19 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/KwpSettlementOffline.java
  4. 4 4
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/SettlementWalletPayTypeEnum.java
  5. 6 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/SettlementLogisticsDto.java
  6. 15 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/SettlementWalletReq.java
  7. 35 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/SettlementLogisticsSumVo.java
  8. 3 3
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/SettlementWalletVo.java
  9. 23 7
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementLogisticsService.java
  10. 11 4
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementOfflineService.java
  11. 27 6
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementWalletService.java
  12. 39 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/utils/PageMoreRes.java
  13. 66 14
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementLogisticsMapper.xml
  14. 57 36
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementOfflineMapper.xml
  15. 75 36
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementWalletMapper.xml

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

@@ -1,8 +1,10 @@
 package com.sckw.payment.controller;
 
+import com.sckw.core.exception.BusinessException;
 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.LogisticsUnitType;
 import com.sckw.payment.model.dto.SettlementLogisticsDto;
 import com.sckw.payment.model.vo.req.SettlementReq;
 import com.sckw.payment.model.vo.res.SettlementLogisticsVo;
@@ -36,7 +38,7 @@ public class KwpSettlementLogisticsController {
         return HttpResult.ok(kwpSettlementLogisticsService.pageSelectCollection(settlementReq));
     }
 
-    @GetMapping(name = "运费收款-物流订单各状态列表总数", path = "getCountListCollection")
+    @PostMapping(name = "运费收款-物流订单各状态列表总数", path = "getCountListCollection")
     public HttpResult getCountListCollection(@RequestBody @Valid SettlementReq settlementReq) {
         return HttpResult.ok(kwpSettlementLogisticsService.getCountListCollection(settlementReq));
     }
@@ -44,10 +46,15 @@ public class KwpSettlementLogisticsController {
     @PostMapping(name = "运费收款-根据条件导出物流订单表数据", path = "exportCollection")
     public HttpResult exportCollection(HttpServletResponse response, @RequestBody @Valid SettlementReq settlementReq) {
         List<SettlementLogisticsDto> list;
-        if (CollectionUtils.isEmpty(settlementReq.getIds())) {
+        if (CollectionUtils.isEmpty(settlementReq.getIds()) && settlementReq.getPage() != 0 && settlementReq.getPageSize() != 0) {
+            //有page、pageSize,无ids
             PageRes<SettlementLogisticsDto> pageResult = kwpSettlementLogisticsService.pageSelectCollection(settlementReq);
             list = pageResult.getList();
+        } else if (CollectionUtils.isEmpty(settlementReq.getIds())) {
+            //无page、pageSize,无ids
+            list = kwpSettlementLogisticsService.selectList(LogisticsUnitType.CARRIER);
         } else {
+            //有ids
             list = kwpSettlementLogisticsService.selectList(settlementReq.getIds());
         }
         return this.export(response, list);
@@ -65,7 +72,7 @@ public class KwpSettlementLogisticsController {
         return HttpResult.ok(kwpSettlementLogisticsService.pageSelectPayment(settlementReq));
     }
 
-    @GetMapping(name = "运费付款-物流订单各状态列表总数", path = "getCountListPayment")
+    @PostMapping(name = "运费付款-物流订单各状态列表总数", path = "getCountListPayment")
     public HttpResult getCountListPayment(@RequestBody @Valid SettlementReq settlementReq) {
         return HttpResult.ok(kwpSettlementLogisticsService.getCountListPayment(settlementReq));
     }
@@ -73,10 +80,15 @@ public class KwpSettlementLogisticsController {
     @PostMapping(name = "运费付款-根据条件导出物流订单表数据", path = "exportPayment")
     public HttpResult exportPayment(HttpServletResponse response, @RequestBody @Valid SettlementReq settlementReq) {
         List<SettlementLogisticsDto> list;
-        if (CollectionUtils.isEmpty(settlementReq.getIds())) {
+        if (CollectionUtils.isEmpty(settlementReq.getIds()) && settlementReq.getPage() != 0 && settlementReq.getPageSize() != 0) {
+            //有page、pageSize,无ids
             PageRes<SettlementLogisticsDto> pageResult = kwpSettlementLogisticsService.pageSelectPayment(settlementReq);
             list = pageResult.getList();
+        } else if (CollectionUtils.isEmpty(settlementReq.getIds())) {
+            //无page、pageSize,无ids
+            list = kwpSettlementLogisticsService.selectList(LogisticsUnitType.SHIPPER);
         } else {
+            //有ids
             list = kwpSettlementLogisticsService.selectList(settlementReq.getIds());
         }
         return this.export(response, list);

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.payment.model.KwpSettlementLogistics;
 import com.sckw.payment.model.dto.SettlementLogisticsDto;
 import com.sckw.payment.model.vo.req.SettlementReq;
+import com.sckw.payment.model.vo.res.SettlementLogisticsSumVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -24,6 +25,10 @@ public interface KwpSettlementLogisticsMapper extends BaseMapper<KwpSettlementLo
      */
     List<SettlementLogisticsDto> pageSelectCollection(@Param("settlementReq") SettlementReq settlementReq);
 
+
+    SettlementLogisticsSumVo selectCollectionSum(@Param("settlementReq") SettlementReq settlementReq);
+
+
     /**
      * 运费收款-物流订单各状态列表总数
      *
@@ -72,4 +77,5 @@ public interface KwpSettlementLogisticsMapper extends BaseMapper<KwpSettlementLo
      * @date 2023-07-24 16:24
      */
     List<SettlementLogisticsDto> selectIds(@Param("ids") List<Long> ids);
+    List<SettlementLogisticsDto> selectList(@Param("unitType") Integer unitType);
 }

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

@@ -148,4 +148,23 @@ public class KwpSettlementOffline {
      */
     @TableField(value = "del_flag")
     private Integer delFlag;
+
+    /**
+     * 结算单类型 1-物流 2-贸易
+     */
+    @TableField(value = "order_type")
+    private Integer orderType;
+
+    /**
+     * 待付金额
+     */
+    @TableField(value = "topay_price")
+    private BigDecimal topayPrice;
+
+    /**
+     * 付款附件
+     */
+    @TableField(value = "url")
+    private String url;
+
 }

+ 4 - 4
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/PayTypeEnum.java → sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/constant/SettlementWalletPayTypeEnum.java

@@ -5,15 +5,15 @@ package com.sckw.payment.model.constant;
  * @author Aick Spt
  * @date 2023-07-20 08:35
  */
-public enum PayTypeEnum {
+public enum SettlementWalletPayTypeEnum {
     ADVANCE_PAYMENT(1, "预付款"),
-    CASH_ON_DELIVERY(2, "货到付款"),
-    OFFLINE_PAYMENT(3, "线下付款");
+    CASH_ON_DELIVERY(2, "货到付款");
+//    OFFLINE_PAYMENT(3, "线下付款");
 
     private int status;
     private String desc;
 
-    PayTypeEnum(int status, String desc) {
+    SettlementWalletPayTypeEnum(int status, String desc) {
         this.status = status;
         this.desc = desc;
     }

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

@@ -82,7 +82,7 @@ public class SettlementLogisticsDto {
     private String successPhone;
 
     /**
-     * 状态(待回款、部分回款、全部回款、回退
+     * 状态(1待结算2部分结算3全部结算
      */
     private Integer status;
 
@@ -166,4 +166,9 @@ public class SettlementLogisticsDto {
      */
     private BigDecimal residuePrice;
 
+    /**
+     * 附件
+     */
+    private String attachmentUrl;
+
 }

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

@@ -1,12 +1,26 @@
 package com.sckw.payment.model.vo.req;
 
 import com.sckw.core.model.vo.BasePara;
+import lombok.Getter;
+import lombok.Setter;
 
 /**
  * @author Aick Spt
  * @date 2023-07-24 16:52
  */
-public class SettlementWalletReq  extends BasePara {
+@Getter
+@Setter
+public class SettlementWalletReq extends BasePara {
+
+    /**
+     * 交易方式
+     */
+    private Integer trading;
+
+    /**
+     * 支付方式
+     */
+    private Integer payType;
 
 
 }

+ 35 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/SettlementLogisticsSumVo.java

@@ -0,0 +1,35 @@
+package com.sckw.payment.model.vo.res;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author Aick Spt
+ * @date 2023-07-26 08:52
+ */
+@Getter
+@Setter
+public class SettlementLogisticsSumVo {
+
+    /**
+     * 实际应收
+     */
+    public double actualReceivable;
+
+    /**
+     * 当前收款
+     */
+    public double currentReceipt;
+
+    /**
+     * 剩余待收款
+     */
+    public double remainingReceivables;
+
+
+    /**
+     * 合计
+     */
+    public Long total;
+
+}

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

@@ -42,7 +42,7 @@ public class SettlementWalletVo {
     private Double topayPrice;
 
     /**
-     * 类型(0付款、1退款)
+     * 类型(1预付款、2货到付款)
      */
     private Integer type;
 
@@ -55,7 +55,7 @@ public class SettlementWalletVo {
     /**
      * 创建人名称
      */
-    private Long createByText;
+    private String createByText;
 
     /**
      * 创建时间
@@ -66,7 +66,7 @@ public class SettlementWalletVo {
     /**
      * 更新人名称
      */
-    private Long updateByText;
+    private String updateByText;
 
     /**
      * 更新时间

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

@@ -13,11 +13,17 @@ import com.sckw.payment.model.dto.LedgerTradeDto;
 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.model.vo.res.SettlementLogisticsSumVo;
 import com.sckw.payment.utils.CommonValidator;
+import com.sckw.payment.utils.PageMoreRes;
 import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.ss.formula.functions.T;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
 import java.util.List;
 import java.util.Objects;
 
@@ -27,6 +33,7 @@ import java.util.Objects;
  */
 @AllArgsConstructor
 @Service
+@Slf4j
 public class KwpSettlementLogisticsService {
     private final KwpSettlementLogisticsMapper settlementLogisticsMapper;
 
@@ -52,6 +59,7 @@ public class KwpSettlementLogisticsService {
 
     /**
      * 运费收款-物流订单各状态列表总数
+     *
      * @author Aick Spt
      * @date 2023-07-24 16:21
      */
@@ -78,6 +86,7 @@ public class KwpSettlementLogisticsService {
 
     /**
      * 运费付款-物流订单各状态列表总数
+     *
      * @author Aick Spt
      * @date 2023-07-24 16:23
      */
@@ -104,51 +113,55 @@ public class KwpSettlementLogisticsService {
 
     /**
      * 运费收款-物流订单列表
+     *
      * @author Aick Spt
      * @date 2023-07-24 16:21
      */
-    public PageRes<SettlementLogisticsDto> pageSelectCollection(SettlementReq settlementReq) {
+    public PageMoreRes<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.pageSelectCollection(settlementReq);
+        SettlementLogisticsSumVo settlementLogisticsSum = settlementLogisticsMapper.selectCollectionSum(settlementReq);
 
         // 对查询结果进行处理,转换 status 到 desc
-        return getSettlementLogisticsDtoPageRes(kwpLedgerLogisticsList);
+        return new PageMoreRes<>(getSettlementLogisticsDtoPageRes(kwpLedgerLogisticsList), settlementLogisticsSum);
     }
 
 
     /**
      * 运费付款-物流订单列表
+     *
      * @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(), "预计款开始和结束时间");
+        CommonValidator.isValidCoexisting(settlementReq.getStartReceiptTime(), settlementReq.getEndReceiptTime(), "预计款开始和结束时间");
 
         PageHelper.startPage(settlementReq.getPage(), settlementReq.getPageSize());
         List<SettlementLogisticsDto> kwpLedgerLogisticsList = settlementLogisticsMapper.pageSelectPayment(settlementReq);
 
         // 对查询结果进行处理,转换 status 到 desc
-        return getSettlementLogisticsDtoPageRes(kwpLedgerLogisticsList);
+        return new PageRes<>(getSettlementLogisticsDtoPageRes(kwpLedgerLogisticsList));
     }
 
     @NotNull
-    private PageRes<SettlementLogisticsDto> getSettlementLogisticsDtoPageRes(List<SettlementLogisticsDto> kwpLedgerLogisticsList) {
+    private PageInfo<SettlementLogisticsDto> getSettlementLogisticsDtoPageRes(List<SettlementLogisticsDto> kwpLedgerLogisticsList) {
         for (SettlementLogisticsDto entity : kwpLedgerLogisticsList) {
             entity.setStatusText(SettlementEnum.getStatusDesc(entity.getStatus()));
             entity.setResiduePrice(entity.getLedgerSettlePrice().subtract(entity.getActualPrice()));
             entity.setCreateByText("创建人名称");
             entity.setUpdateByText("更新人名称");
         }
-        return new PageRes<>(new PageInfo<>(kwpLedgerLogisticsList));
+        return new PageInfo<>(kwpLedgerLogisticsList);
     }
 
 
     /**
      * 运费收款-物流订单详情
+     *
      * @author Aick Spt
      * @date 2023-07-24 16:22
      */
@@ -158,6 +171,7 @@ public class KwpSettlementLogisticsService {
 
     /**
      * 运费付款-物流订单详情
+     *
      * @author Aick Spt
      * @date 2023-07-24 16:24
      */
@@ -166,7 +180,6 @@ public class KwpSettlementLogisticsService {
     }
 
 
-
     /**
      * 根据id查物流结算订单
      *
@@ -177,5 +190,8 @@ public class KwpSettlementLogisticsService {
     public List<SettlementLogisticsDto> selectList(List<Long> ids) {
         return settlementLogisticsMapper.selectIds(ids);
     }
+    public List<SettlementLogisticsDto> selectList(Integer unitType) {
+        return settlementLogisticsMapper.selectList(unitType);
+    }
 
 }

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

@@ -6,6 +6,7 @@ import com.sckw.core.model.page.PageRes;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.payment.dao.KwpSettlementOfflineMapper;
 import com.sckw.payment.model.KwpSettlementOffline;
+import com.sckw.payment.model.constant.SettlementWalletPayTypeEnum;
 import com.sckw.payment.model.dto.SettlementOfflineDto;
 import com.sckw.payment.model.vo.req.SettlementOfflineReq;
 import com.sckw.payment.model.vo.req.SettlementReq;
@@ -30,6 +31,11 @@ public class KwpSettlementOfflineService {
 
     private final KwpSettlementOfflineMapper settlementOfflineMapper;
 
+    /**
+     * 物流-线下付款(运费收款)记录-列表
+     * @author Aick Spt
+     * @date 2023-07-26 17:15
+     */
     public PageRes<SettlementOfflineVo> pageListLogisticsCollection(SettlementOfflineReq settlementOfflineReq) {
 //        //todo 查询缓存,获取客户企业id
 //        String keywords = settlementReq.getKeywords();
@@ -39,15 +45,16 @@ public class KwpSettlementOfflineService {
         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<>());
         }
 
+        for (SettlementOfflineDto entity : settlementOfflineLogisticsList) {
+            entity.setCreateByText("创建人名称");
+            entity.setUpdateByText("更新人名称");
+        }
+
         //指定返回值
         List<SettlementOfflineVo> collect = settlementOfflineLogisticsList.stream().map(a -> {
             SettlementOfflineVo settlementOfflineVo = new SettlementOfflineVo();

+ 27 - 6
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementWalletService.java

@@ -2,10 +2,13 @@ package com.sckw.payment.service;
 
 import com.github.pagehelper.PageHelper;
 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.payment.dao.KwpSettlementWalletMapper;
 import com.sckw.payment.model.KwpSettlementWallet;
+import com.sckw.payment.model.constant.SettlementEnum;
+import com.sckw.payment.model.constant.SettlementWalletPayTypeEnum;
 import com.sckw.payment.model.dto.SettlementLogisticsDto;
 import com.sckw.payment.model.dto.SettlementWalletDto;
 import com.sckw.payment.model.vo.req.SettlementWalletReq;
@@ -31,6 +34,14 @@ public class KwpSettlementWalletService {
 
     private final KwpSettlementWalletMapper settlementWalletMapper;
 
+    private final KwpSettlementLogisticsService kwpSettlementLogisticsService;
+
+    /**
+     * 物流-电子钱包付款(货到付款)结算记录-列表
+     *
+     * @author Aick Spt
+     * @date 2023-07-26 16:43
+     */
     public PageRes<SettlementWalletVo> pageListLogisticsPayment(SettlementWalletReq settlementWalletReq) {
 //        //todo 查询缓存,获取客户企业id
 //        String keywords = settlementReq.getKeywords();
@@ -38,17 +49,18 @@ public class KwpSettlementWalletService {
 //            System.out.println("关键之:" + keywords);
 //        }
         PageHelper.startPage(settlementWalletReq.getPage(), settlementWalletReq.getPageSize());
-
+        settlementWalletReq.setPayType(SettlementWalletPayTypeEnum.CASH_ON_DELIVERY.getStatus());//只筛选 货到付款
         List<SettlementWalletDto> settlementWalletLogisticsList = settlementWalletMapper.pageListLogisticsPayment(settlementWalletReq);
-        for (SettlementWalletDto entity : settlementWalletLogisticsList) {
-            entity.setCreateByText("创建人名称");
-            entity.setUpdateByText("更新人名称");
-        }
 
         if (CollectionUtils.isEmpty(settlementWalletLogisticsList)) {
             return new PageRes<>(new PageInfo<>());
         }
 
+        for (SettlementWalletDto entity : settlementWalletLogisticsList) {
+            entity.setCreateByText("创建人名称");
+            entity.setUpdateByText("更新人名称");
+        }
+
         //指定返回值
         List<SettlementWalletVo> collect = settlementWalletLogisticsList.stream().map(a -> {
             SettlementWalletVo settlementWalletVo = new SettlementWalletVo();
@@ -84,8 +96,17 @@ public class KwpSettlementWalletService {
         log.info("接收到数据,开始物流-电子钱包付款(货到付款)结算记录-新增,待完善");
         //todo 待完善
         //先查询出结算单情况
-
+        SettlementLogisticsDto settlementLogistics = kwpSettlementLogisticsService.detailPayment(id);
+        log.info(String.valueOf(settlementLogistics));
         //检查结算单状态和所差金额
+        if (settlementLogistics == null) {
+            log.error("非法请求,查无数据:" + id);
+            throw new BusinessException("非法请求运费结算参数ID");
+        }
+        if (settlementLogistics.getStatus() == SettlementEnum.ALL_PAYMENT.getStatus()) {
+            log.error("非法请求,该订单已结算完成:" + id);
+            throw new BusinessException("该订单已结算完成,无法操作");
+        }
 
         //对比金额
 

+ 39 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/utils/PageMoreRes.java

@@ -0,0 +1,39 @@
+package com.sckw.payment.utils;
+
+import com.github.pagehelper.PageInfo;
+import com.sckw.core.model.page.PageRes;
+import com.sckw.payment.model.vo.res.SettlementLogisticsSumVo;
+
+import java.util.List;
+
+/**
+ * 返回的分页数据中,有额外需要返回的参数
+ *
+ * @author Aick Spt
+ * @date 2023-07-25 17:31
+ */
+public class PageMoreRes<T> extends PageRes<T> {
+
+    /**
+     * 更多其余数据
+     */
+    public SettlementLogisticsSumVo otherList;
+
+
+    public void setOtherList(SettlementLogisticsSumVo otherList) {
+        this.otherList = otherList;
+    }
+
+
+    public SettlementLogisticsSumVo getOtherList() {
+        return otherList;
+    }
+
+    public PageMoreRes(PageInfo<T> pageInfo, SettlementLogisticsSumVo otherList) {
+        super(pageInfo);
+        this.otherList = otherList;
+    }
+
+
+
+}

+ 66 - 14
sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementLogisticsMapper.xml

@@ -30,7 +30,7 @@
         ent_id,
         l_ledger_id,
         sl_order_no,
-        `name`,
+        name,
         total_price,
         actual_price,
         receipt_time,
@@ -39,7 +39,7 @@
         audit_phone,
         success_user,
         success_phone,
-        `status`,
+        status,
         create_by,
         create_time,
         update_by,
@@ -52,7 +52,7 @@
         s.ent_id        as entId,
         s.l_ledger_id   as lLedgerId,
         s.sl_order_no   as slOrderNo,
-        s.`name`,
+        s.name,
         s.total_price   as totalPrice,
         s.actual_price  as actualPrice,
         s.receipt_time  as receiptTime,
@@ -61,7 +61,7 @@
         s.audit_phone   as auditPhone,
         s.success_user  as successUser,
         s.success_phone as successPhone,
-        s.`status`,
+        s.status,
         s.create_by     as createBy,
         s.create_time   as createTime,
         s.update_by     as updateBy,
@@ -80,10 +80,11 @@
 
     <!--  连表筛选准备  -->
     <sql id="settlementLogisticsSelect">
-        select l.`name`       as ledgerName,
+        select l.name       as ledgerName,
                l.l_ledger_no  as lLedgerNo,
                l.trading      as ledgerTrading,
                l.settle_price as ledgerSettlePrice,
+                l.url          as attachmentUrl,
 
                lu.unit_type   as unitType,
                lu.firm_name   as CustomerName,
@@ -93,6 +94,15 @@
                  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="settlementLogisticsSelectSum">
+        select count(l.id)                                    total,
+               sum(l.settle_price)                         as actualReceivable,
+               sum(s.actual_price)                         as currentReceipt
+        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
+    </sql>
 
     <!--  根据连表,查询条件准备  -->
     <sql id="settlementLogisticsSelectWhere">
@@ -129,6 +139,20 @@
         order by s.update_time desc
     </select>
 
+    <!--  结算运费收款(承运方)-物流订单列表合计  -->
+    <select id="selectCollectionSum" resultType="com.sckw.payment.model.vo.res.SettlementLogisticsSumVo">
+        select a.*, (a.actualReceivable - a.currentReceipt) AS remainingReceivables From (
+        <include refid="settlementLogisticsSelectSum"/>
+        <where>
+            lu.unit_type = 1
+              and l.del_flag = 0
+              and s.del_flag = 0
+              and lu.del_flag = 0
+            <include refid="settlementLogisticsSelectWhere"/>
+        </where>
+        ) a
+    </select>
+
     <!-- 结算运费收款(承运方)-物流订单列表头部汇总数  -->
     <select id="getCountListCollection" resultType="java.lang.Long">
         select count(s.id) as num
@@ -146,13 +170,20 @@
 
     <!--  根据结算(承运方)物流订单id查详情   -->
     <select id="detailCollection" parameterType="java.lang.Long" resultType="com.sckw.payment.model.dto.SettlementLogisticsDto">
-        select
+        select l.name         as ledgerName,
+               l.l_ledger_no  as lLedgerNo,
+               l.trading      as ledgerTrading,
+               l.settle_price as ledgerSettlePrice,
+        l.url          as attachmentUrl,
+
+               lu.unit_type   as unitType,
+               lu.firm_name   as CustomerName,
         <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 = 1
+          and lu.unit_type = 1
     </select>
 
 
@@ -187,13 +218,20 @@
 
     <!-- 根据结算(托运方)物流订单id查详情   -->
     <select id="detailPayment" parameterType="java.lang.Long" resultType="com.sckw.payment.model.dto.SettlementLogisticsDto">
-        select
+        select l.name         as ledgerName,
+               l.l_ledger_no  as lLedgerNo,
+               l.trading      as ledgerTrading,
+               l.settle_price as ledgerSettlePrice,
+               l.url          as attachmentUrl,
+
+               lu.unit_type   as unitType,
+               lu.firm_name   as CustomerName,
         <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
+          and lu.unit_type = 2
     </select>
 
 
@@ -201,7 +239,10 @@
     <select id="selectIds" resultType="com.sckw.payment.model.dto.SettlementLogisticsDto">
         <include refid="settlementLogisticsSelect"/>
         <where>
-            s.del_flag = 0
+            lu.unit_type = 2
+            and l.del_flag = 0
+            and s.del_flag = 0
+            and lu.del_flag = 0
               and s.id in
             <foreach collection="ids" item="id" close=")" open="(" separator=",">
                 #{id,jdbcType=BIGINT}
@@ -209,4 +250,15 @@
         </where>
         order by s.update_time desc
     </select>
+
+    <select id="selectList" resultType="com.sckw.payment.model.dto.SettlementLogisticsDto">
+        <include refid="settlementLogisticsSelect"/>
+        <where>
+            lu.unit_type = #{unitType,jdbcType=INTEGER}
+              and l.del_flag = 0
+              and s.del_flag = 0
+              and lu.del_flag = 0
+        </where>
+        order by s.update_time desc
+    </select>
 </mapper>

+ 57 - 36
sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementOfflineMapper.xml

@@ -1,44 +1,65 @@
 <?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.KwpSettlementOfflineMapper">
-  <resultMap id="BaseResultMap" type="com.sckw.payment.model.KwpSettlementOffline">
-    <!--@mbg.generated-->
-    <!--@Table kwp_settlement_offline-->
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="ent_id" jdbcType="BIGINT" property="entId" />
-    <result column="settlement_id" jdbcType="BIGINT" property="settlementId" />
-    <result column="coll_ent_id" jdbcType="BIGINT" property="collEntId" />
-    <result column="coll_firm_name" jdbcType="VARCHAR" property="collFirmName" />
-    <result column="coll_price" jdbcType="DECIMAL" property="collPrice" />
-    <result column="coll_time" jdbcType="TIMESTAMP" property="collTime" />
-    <result column="coll_user_id" jdbcType="BIGINT" property="collUserId" />
-    <result column="coll_urls" jdbcType="VARCHAR" property="collUrls" />
-    <result column="pay_ent_id" jdbcType="BIGINT" property="payEntId" />
-    <result column="pay_firm_name" jdbcType="VARCHAR" property="payFirmName" />
-    <result column="pay_price" jdbcType="DECIMAL" property="payPrice" />
-    <result column="pay_time" jdbcType="TIMESTAMP" property="payTime" />
-    <result column="pay_user_id" jdbcType="BIGINT" property="payUserId" />
-    <result column="pay_urls" jdbcType="VARCHAR" property="payUrls" />
-    <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>
+    <resultMap id="BaseResultMap" type="com.sckw.payment.model.KwpSettlementOffline">
+        <!--@mbg.generated-->
+        <!--@Table kwp_settlement_offline-->
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="ent_id" jdbcType="BIGINT" property="entId"/>
+        <result column="settlement_id" jdbcType="BIGINT" property="settlementId"/>
+        <result column="order_type" jdbcType="TINYINT" property="orderType"/>
+        <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="url" jdbcType="VARCHAR" property="url"/>
+        <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,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>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        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="detailLogisticsCollection" resultType="com.sckw.payment.model.dto.SettlementOfflineDto">
-  </select>
+    <!-- 物流-线下付款(运费收款)记录-列表 -->
+    <select id="pageListLogisticsCollection" resultType="com.sckw.payment.model.dto.SettlementOfflineDto">
+        select
+        <include refid="Base_Column_List"/>
+        FROM kwp_settlement_offline
+        <where>
+            order_type = 1
+        </where>
+    </select>
 
-  <select id="confirmLogisticsCollection" resultType="java.lang.Integer">
-  </select>
+    <select id="detailLogisticsCollection" resultType="com.sckw.payment.model.dto.SettlementOfflineDto">
+        select
+        <include refid="Base_Column_List"/>
+        FROM kwp_settlement_offline
+        <where>
+            order_type = 1
+        </where>
+    </select>
+
+    <select id="confirmLogisticsCollection" resultType="java.lang.Integer">
+    </select>
 </mapper>

+ 75 - 36
sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementWalletMapper.xml

@@ -1,45 +1,84 @@
 <?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.KwpSettlementWalletMapper">
-  <resultMap id="BaseResultMap" type="com.sckw.payment.model.KwpSettlementWallet">
-    <!--@mbg.generated-->
-    <!--@Table kwp_settlement_wallet-->
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="ent_id" jdbcType="BIGINT" property="entId" />
-    <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" />
-    <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>
+    <resultMap id="BaseResultMap" type="com.sckw.payment.model.KwpSettlementWallet">
+        <!--@mbg.generated-->
+        <!--@Table kwp_settlement_wallet-->
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="ent_id" jdbcType="BIGINT" property="entId"/>
+        <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"/>
+        <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">
-   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>
+    <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>
+    <sql id="Join_Column_List">
+        w.id,
+        w.ent_id,
+        w.settlement_id,
+        w.order_type,
+        w.channel,
+        w.pay_time,
+        w.pay_price,
+        w.topay_price,
+        w.`type`,
+        w.remark,
+        w.`status`,
+        w.create_by,
+        w.create_time,
+        w.update_by,
+        w.update_time,
+        w.del_flag
+    </sql>
 
-  <select id="confirmLogisticsPayment" resultType="java.lang.Integer">
-      insert into kwp_settlement_wallet ( <include refid="Base_Column_List" />) value ();
+    <select id="pageListLogisticsPayment" resultType="com.sckw.payment.model.dto.SettlementWalletDto">
+        select
+        <include refid="Join_Column_List"/>
+        from kwp_settlement_wallet w
+        <where>
+            w.type = #{settlementWalletReq.payType}
+        </where>
+        order by w.update_time desc
+    </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>