xucaiqin 2 лет назад
Родитель
Сommit
b1afa2e85c

+ 12 - 3
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/KwpLedgerLogisticsController.java

@@ -60,10 +60,12 @@ public class KwpLedgerLogisticsController {
     public HttpResult pageList(@RequestBody @Valid LogisticsReq logisticsReq) {
         return HttpResult.ok(kwpLedgerLogisticsService.pageList(logisticsReq));
     }
+
     @GetMapping("count")
     public HttpResult count() {
         return HttpResult.ok(kwpLedgerLogisticsService.orderCount());
     }
+
     /**
      * 删除对账单
      *
@@ -142,8 +144,15 @@ public class KwpLedgerLogisticsController {
      */
     @PostMapping("export")
     public HttpResult export(HttpServletResponse response, @RequestBody LogisticsReq logisticsReq) {
-        PageRes<LedgerLogisticsDto> pageResult = kwpLedgerLogisticsService.pageList(logisticsReq);
-        List<LedgerLogisticsDto> list = pageResult.getList();
+        List<Long> ids = logisticsReq.getIds();
+        List<LedgerLogisticsDto> list;
+        if (CollectionUtils.isEmpty(ids)) {
+            PageRes<LedgerLogisticsDto> pageResult = kwpLedgerLogisticsService.pageList(logisticsReq);
+            list = pageResult.getList();
+
+        } else {
+            list = kwpLedgerLogisticsService.selectList(ids);
+        }
         if (CollectionUtils.isEmpty(list)) {
             return HttpResult.error("没有可导出的数据");
         }
@@ -153,7 +162,7 @@ public class KwpLedgerLogisticsController {
             return ledgerLogisticsVo;
         }).collect(Collectors.toList());
 
-        ExcelUtil.download(response, LedgerLogisticsVo.class, collect);
+        ExcelUtil.downData(response, LedgerLogisticsVo.class, collect);
         return null;
     }
 }

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

@@ -26,4 +26,7 @@ public interface KwpLedgerLogisticsMapper extends BaseMapper<KwpLedgerLogistics>
 
     Map<String, Long> countOrder();
 
+    List<LedgerLogisticsDto> selectIds(@Param("ids") List<Long> ids);
+
+
 }

+ 34 - 6
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/KwpSettlementTrade.java

@@ -4,19 +4,17 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import java.math.BigDecimal;
-import java.time.LocalDateTime;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
 
-/**
- * @author xucaiqin
- * @date 2023-07-10 16:42:19
- */
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
 
 /**
  * 结算-交易订单
+ * @author xucaiqin
+ * @date 2023-07-18 14:51:38
  */
 @Getter
 @Setter
@@ -65,6 +63,36 @@ public class KwpSettlementTrade {
     @TableField(value = "actual_price")
     private BigDecimal actualPrice;
 
+    /**
+     * 预计收款日期
+     */
+    @TableField(value = "receipt_time")
+    private LocalDateTime receiptTime;
+
+    /**
+     * 对账审核人名称
+     */
+    @TableField(value = "audit_user")
+    private String auditUser;
+
+    /**
+     * 对账审核人电话
+     */
+    @TableField(value = "audit_phone")
+    private String auditPhone;
+
+    /**
+     * 对账完成人名称
+     */
+    @TableField(value = "success_user")
+    private String successUser;
+
+    /**
+     * 对账完成人电话
+     */
+    @TableField(value = "success_phone")
+    private String successPhone;
+
     /**
      * 备注
      */

+ 9 - 3
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/LedgerLogisticsDto.java

@@ -62,12 +62,14 @@ public class LedgerLogisticsDto {
     /**
      * 发票税率(%)
      */
-    private BigDecimal taxRate;
+    private String taxRateLabel;
+    private Integer taxRate;
 
     /**
      * 交易方式(预付款、货到付款)
      */
-    private String trading;
+    private Integer trading;
+    private String tradingLabel;
 
 
     /**
@@ -110,9 +112,11 @@ public class LedgerLogisticsDto {
     private String remark;
 
     /**
-     * 状态(待对账、对账中、已对账、已完成、已取消、已退回)
+     * 状态状态(1-已保存、2-待对账、3-已对账、4-已完成、5-已退回)
      */
     private Integer status;
+    private String statusLabel;
+
     /**
      * 客户联系人
      */
@@ -121,6 +125,8 @@ public class LedgerLogisticsDto {
      * 客户联系人电话
      */
     private String phone;
+    private String firmName;
+
     /**
      * 订单数量
      */

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

@@ -106,7 +106,7 @@ public class LedgerTradeDto {
     private String remark;
 
     /**
-     * 状态(待对账、对账中、已对账、已完成、已取消、已退回)
+     * 状态(1-已保存、2-待对账、3-已对账、4-已完成、5-已退回)
      */
     private Integer status;
     private String statusLabel;

+ 2 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/LogisticsSendReq.java

@@ -97,5 +97,7 @@ public class LogisticsSendReq {
     @NotEmpty(message = "承运订单不能为空")
     private List<Long> ids;
     private LocalDateTime generateTime;
+    private Integer status;
+
 
 }

+ 59 - 110
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/LedgerLogisticsVo.java

@@ -23,8 +23,13 @@ public class LedgerLogisticsVo {
     /**
      * 主键
      */
-    @ExcelProperty(value = "id")
+    @ExcelProperty(value = "序号")
     private Long id;
+    /**
+     * 状态(待对账、对账中、已对账、已完成、已取消、已退回)
+     */
+    @ExcelProperty(value = "状态")
+    private String statusLabel;
     /**
      * 物流对账单编号
      */
@@ -36,83 +41,45 @@ public class LedgerLogisticsVo {
      */
     @ExcelProperty(value = "对账单名称")
     private String name;
-
     /**
-     * 企业id
+     * 客户单位
      */
-    @ExcelProperty(value = "企业id")
-    private Long entId;
-
-    /**
-     * 托运单位
-     */
-    @ExcelProperty(value = "托运单位")
-    private Long checkEntId;
-
-    /**
-     * 承运单位
-     */
-    @ExcelProperty(value = "承运单位")
-    private Long carrierEntId;
-
-
-    /**
-     * 开始日期
-     */
-    @ExcelProperty(value = "开始日期")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime startTime;
+    @ExcelProperty(value = "客户单位")
+    private String firmName;
 
     /**
-     * 结束日期
+     * 订单数量
      */
-    @ExcelProperty(value = "结束日期")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime endTime;
+    @ExcelProperty(value = "订单数量")
+    private Long orderCount;
+//    /**
+//     * 开始日期
+//     */
+//    @ExcelProperty(value = "开始日期")
+//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+//    private LocalDateTime startTime;
+//
+//    /**
+//     * 结束日期
+//     */
+//    @ExcelProperty(value = "结束日期")
+//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+//    private LocalDateTime endTime;
 
     /**
-     * 对账金额
+     * 付款方式(预付款、货到付款)
      */
-    @ExcelProperty(value = "对账金额")
-    private BigDecimal price;
+    @ExcelProperty(value = "付款方式")
+    private String tradingLabel;
 
     /**
      * 发票税率(%)
      */
     @ExcelProperty(value = "发票税率(%)")
-    private BigDecimal taxRate;
-
-    /**
-     * 交易方式(预付款、货到付款)
-     */
-    @ExcelProperty(value = "交易方式")
-    private String trading;
-
-    /**
-     * 卸货量
-     */
-    @ExcelProperty(value = "卸货量")
-    private BigDecimal unloadAmount;
-
-    /**
-     * 装货量
-     */
-    @ExcelProperty(value = "装货量")
-    private BigDecimal loadAmount;
-
-    /**
-     * 亏损量
-     */
-    @ExcelProperty(value = "亏损量")
-    private BigDecimal deficitAmount;
+    private String taxRateLabel;
 
-    /**
-     * 合理损耗量
-     */
-    @ExcelProperty(value = "合理损耗量")
-    private BigDecimal loseAmount;
 
     /**
      * 总应收/元
@@ -120,11 +87,11 @@ public class LedgerLogisticsVo {
     @ExcelProperty(value = "总应收/元")
     private BigDecimal totalPrice;
 
-    /**
-     * 实际结算金额
-     */
-    @ExcelProperty(value = "实际结算金额")
-    private BigDecimal settlePrice;
+//    /**
+//     * 实际结算金额
+//     */
+//    @ExcelProperty(value = "实际结算金额")
+//    private BigDecimal settlePrice;
 
     /**
      * 已收款/元
@@ -133,22 +100,35 @@ public class LedgerLogisticsVo {
     private BigDecimal actualPrice;
 
     /**
-     * 对账审核人电话
+     * 客户联系人
      */
-    @ExcelProperty(value = "对账审核人电话")
-    private String auditPhone;
-
+    @ExcelProperty(value = "客户联系人")
+    private String contacts;
     /**
-     * 对账审核人名称
+     * 联系方式
      */
-    @ExcelProperty(value = "对账审核人名称")
-    private String auditUser;
+    @ExcelProperty(value = "联系方式")
+    private String phone;
+
+
+
+//    /**
+//     * 对账审核人电话
+//     */
+//    @ExcelProperty(value = "对账审核人电话")
+//    private String auditPhone;
 
     /**
-     * 对账清单凭证
+     * 对账审核人名称
      */
-    @ExcelProperty(value = "对账清单凭证")
-    private String url;
+    @ExcelProperty(value = "提交人")
+    private String auditUser;
+//
+//    /**
+//     * 对账清单凭证
+//     */
+//    @ExcelProperty(value = "对账清单凭证")
+//    private String url;
     /**
      * 生成时间
      */
@@ -157,35 +137,4 @@ public class LedgerLogisticsVo {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private LocalDateTime generateTime;
 
-    /**
-     * 备注
-     */
-    @ExcelProperty(value = "备注")
-    private String remark;
-
-    /**
-     * 状态(待对账、对账中、已对账、已完成、已取消、已退回)
-     */
-    @ExcelProperty(value = "状态")
-    private Integer status;
-
-    private Long createBy;
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime createTime;
-
-    private Long updateBy;
-
-    /**
-     * 更新时间
-     */
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime updateTime;
-
-    /**
-     * 订单数量
-     */
-    @ExcelProperty(value = "订单数量")
-    private Long orderCount;
 }

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

@@ -2,8 +2,10 @@ package com.sckw.payment.service;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.page.PageRes;
+import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.utils.OrderGenerateUtils;
 import com.sckw.payment.dao.KwpLedgerLogisticsMapper;
@@ -17,31 +19,60 @@ import com.sckw.payment.model.constant.LogisticsUnitType;
 import com.sckw.payment.model.dto.LedgerCountVo;
 import com.sckw.payment.model.dto.LedgerLogisticsDto;
 import com.sckw.payment.model.vo.req.*;
-import lombok.AllArgsConstructor;
+import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.model.dto.res.SysDictResDto;
+import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @author xucaiqin
  * @date 2023-07-10 16:38:36
  */
 @Service
-@AllArgsConstructor
 @Slf4j
 public class KwpLedgerLogisticsService extends AbsLedger {
-    private final KwpLedgerLogisticsTrackService logisticsTrackService;
-    private final KwpSettlementLogisticsService settlementLogisticsService;
-    private final KwpLedgerLogisticsUnitService logisticsUnitService;
-    private final KwpLedgerLogisticsOrderService logisticsOrderService;
-    private final KwpLedgerLogisticsMapper logisticsMapper;
+    @Resource
+    private KwpLedgerLogisticsTrackService logisticsTrackService;
+    @Resource
+    private KwpSettlementLogisticsService settlementLogisticsService;
+    @Resource
+    private KwpLedgerLogisticsUnitService logisticsUnitService;
+    @Resource
+    private KwpLedgerLogisticsOrderService logisticsOrderService;
+    @Resource
+    private KwpLedgerLogisticsMapper logisticsMapper;
+    @DubboReference(version = "2.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
+
+    private void changeDict(List<LedgerLogisticsDto> list) {
+        List<SysDictResDto> taxRateDict = remoteSystemService.queryDictByType(DictTypeEnum.TAX_RATE.getType());
+        Map<String, String> taxRateMap = new HashMap<>();
+        Map<String, String> tradingMap = new HashMap<>();
+
+        if (!CollectionUtils.isEmpty(taxRateDict)) {
+            taxRateMap = taxRateDict.stream().collect(Collectors.toMap(SysDictResDto::getValue, SysDictResDto::getLabel, (a, b) -> a));
+        }
+        List<SysDictResDto> tradingDict = remoteSystemService.queryDictByType(DictTypeEnum.TRADE_TYPE.getType());
+        if (!CollectionUtils.isEmpty(tradingDict)) {
+            tradingMap = tradingDict.stream().collect(Collectors.toMap(SysDictResDto::getValue, SysDictResDto::getLabel, (a, b) -> a));
+        }
+        for (LedgerLogisticsDto logisticsDto : list) {
+            Integer trading = logisticsDto.getTrading();
+            logisticsDto.setTradingLabel(tradingMap.get(String.valueOf(trading)));
+            Integer taxRate = logisticsDto.getTaxRate();
+            logisticsDto.setTaxRateLabel(taxRateMap.get(String.valueOf(taxRate)));
+
+            logisticsDto.setStatusLabel(LedgerEnum.getDesc(logisticsDto.getStatus()));
+        }
+    }
 
     /**
      * 分页查询物流对账单列表
@@ -52,7 +83,10 @@ public class KwpLedgerLogisticsService extends AbsLedger {
     public PageRes<LedgerLogisticsDto> pageList(LogisticsReq logisticsReq) {
         PageHelper.startPage(logisticsReq.getPage(), logisticsReq.getPageSize());
         List<LedgerLogisticsDto> kwpLedgerLogisticsList = logisticsMapper.pageSelect(logisticsReq, new ArrayList<>());
-
+        //字典转换
+        if (!CollectionUtils.isEmpty(kwpLedgerLogisticsList)) {
+            changeDict(kwpLedgerLogisticsList);
+        }
         return new PageRes<>(new PageInfo<>(kwpLedgerLogisticsList));
     }
 
@@ -68,11 +102,13 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         if (Objects.isNull(id)) {
             //新增
             logisticsReq.setGenerateTime(LocalDateTime.now());
+            logisticsReq.setStatus(LedgerEnum.TO_LEDGER.getStatus());
             Long aLong = saveDraft(logisticsReq);
             logisticsTrackService.saveTrack(aLong, "", LedgerTrackEnum.TO_LEDGER);
         } else {
             removeDraft(id);
             logisticsReq.setGenerateTime(LocalDateTime.now());
+            logisticsReq.setStatus(LedgerEnum.TO_LEDGER.getStatus());
             Long aLong = saveDraft(logisticsReq);
             logisticsTrackService.saveTrack(aLong, "", LedgerTrackEnum.TO_LEDGER);
 
@@ -93,8 +129,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         KwpLedgerLogistics kwpLedgerLogistics = new KwpLedgerLogistics();
         kwpLedgerLogistics.setId(Objects.isNull(logisticsSendReq.getId()) ? new IdWorker(1).nextId() : logisticsSendReq.getId());
         kwpLedgerLogistics.setEntId(0L);
-        kwpLedgerLogistics.setLLedgerNo("");
-        kwpLedgerLogistics.setName("");
+        kwpLedgerLogistics.setName(logisticsSendReq.getName());
         kwpLedgerLogistics.setStartTime(logisticsSendReq.getStartTime());
         kwpLedgerLogistics.setEndTime(logisticsSendReq.getEndTime());
         kwpLedgerLogistics.setTaxRate(logisticsSendReq.getTaxRate());
@@ -110,13 +145,14 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         kwpLedgerLogistics.setUrl("");
         kwpLedgerLogistics.setGenerateTime(logisticsSendReq.getGenerateTime());
         kwpLedgerLogistics.setRemark("");
-        kwpLedgerLogistics.setStatus(LedgerEnum.SAVE.getStatus());
+        kwpLedgerLogistics.setStatus(logisticsSendReq.getStatus());
         kwpLedgerLogistics.setCreateBy(0L);
         kwpLedgerLogistics.setCreateTime(LocalDateTime.now());
         kwpLedgerLogistics.setUpdateBy(0L);
         kwpLedgerLogistics.setUpdateTime(LocalDateTime.now());
         kwpLedgerLogistics.setDelFlag(0);
         if (Objects.isNull(logisticsSendReq.getId())) {
+            kwpLedgerLogistics.setLLedgerNo(OrderGenerateUtils.generateOrderNo("LL"));
             logisticsMapper.insert(kwpLedgerLogistics);
         } else {
             logisticsMapper.updateById(kwpLedgerLogistics);
@@ -130,7 +166,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         KwpLedgerLogisticsUnit kwpLedgerLogisticsUnit = new KwpLedgerLogisticsUnit();
         kwpLedgerLogisticsUnit.setId(new IdWorker(1).nextId());
         kwpLedgerLogisticsUnit.setLLedgerId(kwpLedgerLogistics.getId());
-        kwpLedgerLogisticsUnit.setLLedgerNo("");
+        kwpLedgerLogisticsUnit.setLLedgerNo(kwpLedgerLogistics.getLLedgerNo());
         kwpLedgerLogisticsUnit.setUnitType(LogisticsUnitType.SHIPPER);
         kwpLedgerLogisticsUnit.setEntId(checkEntId);
         kwpLedgerLogisticsUnit.setTopEntId(checkEntId);//todo
@@ -146,6 +182,26 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         kwpLedgerLogisticsUnit.setDelFlag(0);
 
         logisticsUnits.add(kwpLedgerLogisticsUnit);
+
+        KwpLedgerLogisticsUnit carrierUnit = new KwpLedgerLogisticsUnit();
+        carrierUnit.setId(new IdWorker(1).nextId());
+        carrierUnit.setLLedgerId(kwpLedgerLogistics.getId());
+        carrierUnit.setLLedgerNo(kwpLedgerLogistics.getLLedgerNo());
+        carrierUnit.setUnitType(LogisticsUnitType.CARRIER);
+        carrierUnit.setEntId(checkEntId);//todo
+        carrierUnit.setTopEntId(checkEntId);//todo
+        carrierUnit.setFirmName("");
+        carrierUnit.setContacts("");
+        carrierUnit.setPhone("");
+        carrierUnit.setRemark("");
+        carrierUnit.setStatus(0);
+        carrierUnit.setCreateBy(0L);
+        carrierUnit.setCreateTime(LocalDateTime.now());
+        carrierUnit.setUpdateBy(0L);
+        carrierUnit.setUpdateTime(LocalDateTime.now());
+        carrierUnit.setDelFlag(0);
+
+        logisticsUnits.add(carrierUnit);
         logisticsUnitService.saveList(logisticsUnits);
         return kwpLedgerLogistics.getId();
     }
@@ -159,6 +215,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
     @Transactional(rollbackFor = Exception.class)
     public String sendLedgerDraft(LogisticsSendReq logisticsReq) {
         logisticsReq.setGenerateTime(null);
+        logisticsReq.setStatus(LedgerEnum.SAVE.getStatus());
         Long aLong = saveDraft(logisticsReq);
         logisticsTrackService.saveTrack(aLong, "", LedgerTrackEnum.SAVE);
         return "草稿保存成功";
@@ -221,7 +278,6 @@ public class KwpLedgerLogisticsService extends AbsLedger {
             throw new BusinessException("对账单不存在!");
         }
         backCheck(kwpLedgerLogistics.getStatus());
-        backCheck(kwpLedgerLogistics.getStatus());
         kwpLedgerLogistics.setStatus(LedgerEnum.BACK.getStatus());
         kwpLedgerLogistics.setUpdateTime(LocalDateTime.now());
         logisticsMapper.updateById(kwpLedgerLogistics);
@@ -235,11 +291,13 @@ public class KwpLedgerLogisticsService extends AbsLedger {
      * @param confirmReq
      * @return
      */
+    @Transactional(rollbackFor = Exception.class)
     public Integer confirmOrder(LedgerConfirmReq confirmReq) {
         KwpLedgerLogistics kwpLedgerLogistics = logisticsMapper.selectById(confirmReq.getId());
         if (Objects.isNull(kwpLedgerLogistics)) {
             throw new BusinessException("对账单不存在!");
         }
+        confirmCheck(kwpLedgerLogistics.getStatus());
         kwpLedgerLogistics.setStatus(LedgerEnum.LEDGERED.getStatus());
         kwpLedgerLogistics.setAuditPhone(confirmReq.getAuditPhone());
         kwpLedgerLogistics.setAuditUser(confirmReq.getAuditUser());
@@ -262,6 +320,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
             throw new BusinessException("对账单不存在!");
         }
         successCheck(kwpLedgerLogistics.getStatus());
+
         kwpLedgerLogistics.setReceiptTime(ledgerReq.getReceiptTime());
         kwpLedgerLogistics.setStatus(LedgerEnum.SUCCESS.getStatus());
         kwpLedgerLogistics.setUpdateTime(LocalDateTime.now());
@@ -307,4 +366,10 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         }
         return res;
     }
+
+    public List<LedgerLogisticsDto> selectList(List<Long> ids) {
+        List<LedgerLogisticsDto> ledgerLogisticsDto = logisticsMapper.selectIds(ids);
+        changeDict(ledgerLogisticsDto);
+        return ledgerLogisticsDto;
+    }
 }

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

@@ -3,6 +3,7 @@ package com.sckw.payment.service;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.utils.CollectionUtils;
@@ -54,14 +55,14 @@ public class KwpLedgerTradeService extends AbsLedger {
     private RemoteSystemService remoteSystemService;
 
     private void changeDict(List<LedgerTradeDto> list) {
-        List<SysDictResDto> taxRateDict = remoteSystemService.queryDictByType("taxRate");//todo
+        List<SysDictResDto> taxRateDict = remoteSystemService.queryDictByType(DictTypeEnum.TAX_RATE.getType());
         Map<String, String> taxRateMap = new HashMap<>();
         Map<String, String> tradingMap = new HashMap<>();
 
         if (!CollectionUtils.isEmpty(taxRateDict)) {
             taxRateMap = taxRateDict.stream().collect(Collectors.toMap(SysDictResDto::getValue, SysDictResDto::getLabel, (a, b) -> a));
         }
-        List<SysDictResDto> tradingDict = remoteSystemService.queryDictByType("trade_type");//todo
+        List<SysDictResDto> tradingDict = remoteSystemService.queryDictByType(DictTypeEnum.TRADE_TYPE.getType());
         if (!CollectionUtils.isEmpty(tradingDict)) {
             tradingMap = tradingDict.stream().collect(Collectors.toMap(SysDictResDto::getValue, SysDictResDto::getLabel, (a, b) -> a));
         }
@@ -294,6 +295,7 @@ public class KwpLedgerTradeService extends AbsLedger {
      * @param confirmReq
      * @return
      */
+    @Transactional(rollbackFor = Exception.class)
     public Integer confirmOrder(LedgerConfirmReq confirmReq) {
         KwpLedgerTrade kwpLedgerTrade = tradeMapper.selectById(confirmReq.getId());
         if (Objects.isNull(kwpLedgerTrade)) {
@@ -323,6 +325,7 @@ public class KwpLedgerTradeService extends AbsLedger {
         }
         successCheck(kwpLedgerTrade.getStatus());
 
+        kwpLedgerTrade.setReceiptTime(ledgerReq.getReceiptTime());
         kwpLedgerTrade.setStatus(LedgerEnum.SUCCESS.getStatus());
         kwpLedgerTrade.setUpdateTime(LocalDateTime.now());
         tradeMapper.updateById(kwpLedgerTrade);
@@ -331,11 +334,16 @@ public class KwpLedgerTradeService extends AbsLedger {
         kwpSettlementTrade.setId(new IdWorker(1).nextId());
         kwpSettlementTrade.setEntId(0L);//todo
         kwpSettlementTrade.setTLedgerId(kwpLedgerTrade.getId());
-        kwpSettlementTrade.setStOrderNo(String.valueOf(new IdWorker(1).nextId()));
+        kwpSettlementTrade.setStOrderNo(OrderGenerateUtils.generateOrderNo("ST"));
         kwpSettlementTrade.setName(kwpLedgerTrade.getName());
         kwpSettlementTrade.setTotalPrice(kwpLedgerTrade.getTotalPrice());
         kwpSettlementTrade.setActualPrice(kwpLedgerTrade.getActualPrice());
         kwpSettlementTrade.setRemark("");
+        kwpSettlementTrade.setAuditUser(kwpLedgerTrade.getAuditUser());
+        kwpSettlementTrade.setAuditPhone(kwpLedgerTrade.getAuditPhone());
+        kwpSettlementTrade.setSuccessUser(ledgerReq.getSuccessUser());
+        kwpSettlementTrade.setSuccessPhone(ledgerReq.getSuccessPhone());
+        kwpSettlementTrade.setReceiptTime(ledgerReq.getReceiptTime());
         kwpSettlementTrade.setStatus(0);
         kwpSettlementTrade.setCreateBy(0L);
         kwpSettlementTrade.setCreateTime(LocalDateTime.now());

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

@@ -71,6 +71,8 @@
                kll.ex_tax_price  exTaxPrice,
                kll.settle_price  settlePrice,
                kll.actual_price  actualPrice,
+               kll.audit_phone   auditPhone,
+               kll.audit_user    auditUser,
                kll.url,
                kll.generate_time generateTime,
                kll.receipt_time  receiptTime,
@@ -116,4 +118,40 @@
         FROM `kwp_ledger_logistics`
         WHERE del_flag = 0;
     </select>
+
+    <select id="selectIds" resultType="com.sckw.payment.model.dto.LedgerLogisticsDto">
+        select kll.id,
+        kll.l_ledger_no   lLedgerNo,
+        kll.name,
+        kll.start_time    startTime,
+        kll.end_time      endTime,
+        kll.tax_rate      taxRate,
+        kll.trading,
+        kll.total_price   totalPrice,
+        kll.ex_tax_price  exTaxPrice,
+        kll.settle_price  settlePrice,
+        kll.actual_price  actualPrice,
+        kll.audit_phone   auditPhone,
+        kll.audit_user    auditUser,
+        kll.url,
+        kll.generate_time generateTime,
+        kll.receipt_time  receiptTime,
+        kll.remark,
+        kll.status,
+        kllu.contacts,
+        kllu.phone,
+        kllu.firm_name    firmName,
+        kll.order_count   orderCount
+        from kwp_ledger_logistics kll
+        inner join kwp_ledger_logistics_unit kllu on kll.id = kllu.l_ledger_id and kllu.del_flag = 0
+        <where>
+            kll.del_flag = 0
+            and kllu.unit_type = 1
+            and kll.id in
+            <foreach collection="ids" item="id" close=")" open="(" separator=",">
+                #{id,jdbcType=BIGINT}
+            </foreach>
+        </where>
+        order by kll.generate_time desc
+    </select>
 </mapper>

+ 8 - 2
sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementTradeMapper.xml

@@ -11,6 +11,11 @@
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="total_price" jdbcType="DECIMAL" property="totalPrice" />
     <result column="actual_price" jdbcType="DECIMAL" property="actualPrice" />
+    <result column="receipt_time" jdbcType="TIMESTAMP" property="receiptTime" />
+    <result column="audit_user" jdbcType="VARCHAR" property="auditUser" />
+    <result column="audit_phone" jdbcType="VARCHAR" property="auditPhone" />
+    <result column="success_user" jdbcType="VARCHAR" property="successUser" />
+    <result column="success_phone" jdbcType="VARCHAR" property="successPhone" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
@@ -21,7 +26,8 @@
   </resultMap>
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
-    id, ent_id, t_ledger_id, st_order_no, `name`, total_price, actual_price, remark, 
-    `status`, create_by, create_time, update_by, update_time, del_flag
+    id, ent_id, t_ledger_id, st_order_no, `name`, total_price, actual_price, receipt_time, 
+    audit_user, audit_phone, success_user, success_phone, remark, `status`, create_by, 
+    create_time, update_by, update_time, del_flag
   </sql>
 </mapper>