Ver código fonte

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

zk 2 anos atrás
pai
commit
f763198055
22 arquivos alterados com 977 adições e 183 exclusões
  1. 63 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/StringTimeUtil.java
  2. 3 3
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/LedgerSuccessReq.java
  3. 4 6
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/LogisticsReq.java
  4. 8 8
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/LogisticsSendReq.java
  5. 4 5
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/TradeReq.java
  6. 8 8
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/TradeSendReq.java
  7. 18 7
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerLogisticsService.java
  8. 19 7
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerTradeService.java
  9. 515 34
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/PayCenterService.java
  10. 0 50
      sckw-modules/sckw-report/src/main/java/com/sckw/report/enums/CarWaybillEnum.java
  11. 1 1
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwTransportService.java
  12. 2 2
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/KwtWaybillOrderController.java
  13. 38 2
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/LogisticsConsignmentController.java
  14. 8 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtLogisticsOrderMapper.java
  15. 10 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtWaybillOrderMapper.java
  16. 10 10
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/OrderFinishDTO.java
  17. 26 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/OrderFinishVO.java
  18. 11 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/AcceptCarriageOrderService.java
  19. 157 5
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/LogisticsConsignmentService.java
  20. 5 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/TransportCommonService.java
  21. 15 0
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderMapper.xml
  22. 52 35
      sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderMapper.xml

+ 63 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/StringTimeUtil.java

@@ -0,0 +1,63 @@
+package com.sckw.core.utils;
+
+import com.sckw.core.exception.BusinessException;
+import lombok.extern.slf4j.Slf4j;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * @author xucaiqin
+ * @date 2023-07-26 11:42:43
+ */
+@Slf4j
+public class StringTimeUtil {
+    private final static DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+    private final static DateTimeFormatter dateTimeYMD = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+
+    @SuppressWarnings("all")
+    private static void formatCheck(String time) {
+        try {
+            LocalDate.parse(time, dateTimeYMD);
+        } catch (Exception e) {
+            log.error("时间格式化错误", e);
+            throw new BusinessException("时间格式化错误!");
+        }
+    }
+
+    /**
+     * @param time yyyy-MM-dd
+     * @return String yyyy-MM-dd HH:mm:ss
+     * @throws RuntimeException
+     */
+    public static String fillStart(String time) {
+        formatCheck(time);
+        return time + " 00:00:00";
+    }
+
+    /**
+     * @param time yyyy-MM-dd
+     * @return String yyyy-MM-dd HH:mm:ss
+     * @throws RuntimeException
+     */
+    public static String fillEnd(String time) {
+        formatCheck(time);
+        return time + " 23:59:59";
+    }
+
+    /**
+     * @param time yyyy-MM-dd
+     * @return LocalDateTime yyyy-MM-dd HH:mm:ss
+     */
+    public static LocalDateTime startDateTime(String time) {
+        return LocalDateTime.parse(fillStart(time), dateTimeFormatter);
+    }
+
+    /**
+     * @param time yyyy-MM-dd
+     * @return LocalDateTime yyyy-MM-dd HH:mm:ss
+     */
+    public static LocalDateTime endDateTime(String time) {
+        return LocalDateTime.parse(fillEnd(time), dateTimeFormatter);
+    }
+}

+ 3 - 3
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/LedgerSuccessReq.java

@@ -7,7 +7,7 @@ import jakarta.validation.constraints.Size;
 import lombok.Getter;
 import lombok.Setter;
 
-import java.time.LocalDateTime;
+import java.time.LocalDate;
 
 /**
  * 对账完成
@@ -25,8 +25,8 @@ public class LedgerSuccessReq {
     private String successUser;
 
     @NotNull(message = "预计收款日期不能为空")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime receiptTime;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private LocalDate receiptTime;
 
     @NotBlank(message = "财务联系电话不能为空")
     @Size(max = 11, message = "财务联系电话不能超过11个字符")

+ 4 - 6
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/LogisticsReq.java

@@ -7,7 +7,6 @@ import lombok.Getter;
 import lombok.Setter;
 
 import java.io.Serial;
-import java.time.LocalDateTime;
 import java.util.List;
 
 /**
@@ -19,11 +18,10 @@ import java.util.List;
 public class LogisticsReq extends BasePara {
     @Serial
     private static final long serialVersionUID = 5328731681168692784L;
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-
-    private LocalDateTime startCreateTime;
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private LocalDateTime endCreateTime;
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private String startCreateTime;
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private String endCreateTime;
     private Integer trading;
     /**
      * @see LedgerEnum

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

@@ -34,17 +34,17 @@ public class LogisticsSendReq {
     /**
      * 开始日期
      */
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @NotNull(message = "计划开始日期不能为空")
-    private LocalDateTime startTime;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+//    @NotNull(message = "计划开始日期不能为空")
+    private String startTime;
     /**
      * 结束日期
      */
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @NotNull(message = "计划结束日期不能为空")
-    private LocalDateTime endTime;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+//    @NotNull(message = "计划结束日期不能为空")
+    private String endTime;
     /**
      * 实际结算金额
      */

+ 4 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/TradeReq.java

@@ -7,7 +7,6 @@ import lombok.Getter;
 import lombok.Setter;
 
 import java.io.Serial;
-import java.time.LocalDateTime;
 import java.util.List;
 
 /**
@@ -19,10 +18,10 @@ import java.util.List;
 public class TradeReq extends BasePara {
     @Serial
     private static final long serialVersionUID = 5328731681168692784L;
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private LocalDateTime startCreateTime;
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private LocalDateTime endCreateTime;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String startCreateTime;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String endCreateTime;
     private Integer trading;
     /**
      * @see LedgerEnum

+ 8 - 8
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/TradeSendReq.java

@@ -35,17 +35,17 @@ public class TradeSendReq {
     /**
      * 开始日期
      */
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @NotNull(message = "计划开始日期不能为空")
-    private LocalDateTime startTime;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+//    @NotNull(message = "计划开始日期不能为空")
+    private String startTime;
     /**
      * 结束日期
      */
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @NotNull(message = "计划结束日期不能为空")
-    private LocalDateTime endTime;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+//    @NotNull(message = "计划结束日期不能为空")
+    private String endTime;
     /**
      * 实际结算金额
      */

+ 18 - 7
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerLogisticsService.java

@@ -8,6 +8,7 @@ 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.core.utils.StringTimeUtil;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.payment.dao.KwpLedgerLogisticsMapper;
 import com.sckw.payment.model.*;
@@ -25,12 +26,14 @@ import com.sckw.transport.api.model.dto.vo.KwtLogisticsOrderVO;
 import com.sckw.transport.api.model.dto.vo.LogisticsOrderVO;
 import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 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.time.LocalTime;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -77,9 +80,17 @@ public class KwpLedgerLogisticsService extends AbsLedger {
             logisticsDto.setStatusLabel(LedgerEnum.getDesc(logisticsDto.getStatus()));
         }
     }
-
-    public PageRes<ILedger> shipperList(LogisticsReq logisticsReq) {
+    private void fillPara(LogisticsReq logisticsReq) {
         logisticsReq.setEntId(LoginUserHolder.getEntId());
+        if (StringUtils.isNotBlank(logisticsReq.getStartCreateTime())) {
+            logisticsReq.setStartCreateTime(StringTimeUtil.fillStart(logisticsReq.getStartCreateTime()));
+        }
+        if (StringUtils.isNotBlank(logisticsReq.getEndCreateTime())) {
+            logisticsReq.setEndCreateTime(StringTimeUtil.fillEnd(logisticsReq.getEndCreateTime()));
+        }
+    }
+    public PageRes<ILedger> shipperList(LogisticsReq logisticsReq) {
+        fillPara(logisticsReq);
         PageHelper.startPage(logisticsReq.getPage(), logisticsReq.getPageSize());
         List<LedgerShipperDto> kwpLedgerLogisticsList = logisticsMapper.shipperSelect(logisticsReq);
         //字典转换
@@ -92,7 +103,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
     }
 
     public PageRes<ILedger> carrierList(LogisticsReq logisticsReq) {
-        logisticsReq.setEntId(LoginUserHolder.getEntId());
+        fillPara(logisticsReq);
         PageHelper.startPage(logisticsReq.getPage(), logisticsReq.getPageSize());
         List<LedgerCarrierDto> kwpLedgerLogisticsList = logisticsMapper.carrierSelect(logisticsReq);
         //字典转换
@@ -144,8 +155,8 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         kwpLedgerLogistics.setId(Objects.isNull(logisticsSendReq.getId()) ? new IdWorker(1).nextId() : logisticsSendReq.getId());
         kwpLedgerLogistics.setEntId(LoginUserHolder.getEntId());
         kwpLedgerLogistics.setName(logisticsSendReq.getName());
-        kwpLedgerLogistics.setStartTime(logisticsSendReq.getStartTime());
-        kwpLedgerLogistics.setEndTime(logisticsSendReq.getEndTime());
+        kwpLedgerLogistics.setStartTime(StringTimeUtil.startDateTime(logisticsSendReq.getStartTime()));
+        kwpLedgerLogistics.setEndTime(StringTimeUtil.endDateTime(logisticsSendReq.getEndTime()));
         kwpLedgerLogistics.setTaxRate(logisticsSendReq.getTaxRate());
         kwpLedgerLogistics.setTrading(logisticsSendReq.getTrading());
         kwpLedgerLogistics.setTotalPrice(logisticsSendReq.getTotalPrice());
@@ -370,7 +381,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
 
         successCheck(kwpLedgerLogistics.getStatus());
 
-        kwpLedgerLogistics.setReceiptTime(ledgerReq.getReceiptTime());
+        kwpLedgerLogistics.setReceiptTime(LocalDateTime.of(ledgerReq.getReceiptTime(), LocalTime.MIN));
         kwpLedgerLogistics.setStatus(LedgerEnum.SUCCESS.getStatus());
         kwpLedgerLogistics.setUpdateBy(LoginUserHolder.getUserId());
         kwpLedgerLogistics.setUpdateTime(LocalDateTime.now());
@@ -389,7 +400,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         kwpSettlementLogistics.setAuditPhone(kwpLedgerLogistics.getAuditPhone());
         kwpSettlementLogistics.setSuccessUser(ledgerReq.getSuccessUser());
         kwpSettlementLogistics.setSuccessPhone(ledgerReq.getSuccessPhone());
-        kwpSettlementLogistics.setReceiptTime(ledgerReq.getReceiptTime());
+        kwpSettlementLogistics.setReceiptTime(LocalDateTime.of(ledgerReq.getReceiptTime(), LocalTime.MIN));
         kwpSettlementLogistics.setStatus(1);//1-待结算
         kwpSettlementLogistics.setCreateBy(LoginUserHolder.getUserId());
         kwpSettlementLogistics.setCreateTime(LocalDateTime.now());

+ 19 - 7
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerTradeService.java

@@ -9,6 +9,7 @@ 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.core.utils.StringTimeUtil;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.order.api.dubbo.TradeOrderInfoService;
 import com.sckw.order.api.model.OrderDetailRes;
@@ -25,12 +26,14 @@ import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
 import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 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.time.LocalTime;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -79,6 +82,16 @@ public class KwpLedgerTradeService extends AbsLedger {
         }
     }
 
+    private void fillPara(TradeReq tradeReq) {
+        tradeReq.setEntId(LoginUserHolder.getEntId());
+        if (StringUtils.isNotBlank(tradeReq.getStartCreateTime())) {
+            tradeReq.setStartCreateTime(StringTimeUtil.fillStart(tradeReq.getStartCreateTime()));
+        }
+        if (StringUtils.isNotBlank(tradeReq.getEndCreateTime())) {
+            tradeReq.setEndCreateTime(StringTimeUtil.fillEnd(tradeReq.getEndCreateTime()));
+        }
+    }
+
     /**
      * 销售方
      *
@@ -86,7 +99,7 @@ public class KwpLedgerTradeService extends AbsLedger {
      * @return
      */
     public PageRes<ILedger> sellList(TradeReq tradeReq) {
-        tradeReq.setEntId(LoginUserHolder.getEntId());
+        fillPara(tradeReq);
         PageHelper.startPage(tradeReq.getPage(), tradeReq.getPageSize());
         List<LedgerSellDto> ledgerTradeDto = tradeMapper.sellList(tradeReq);
         //字典转换
@@ -105,8 +118,7 @@ public class KwpLedgerTradeService extends AbsLedger {
      * @return
      */
     public PageRes<ILedger> purchaseList(TradeReq tradeReq) {
-        tradeReq.setEntId(LoginUserHolder.getEntId());
-
+        fillPara(tradeReq);
         PageHelper.startPage(tradeReq.getPage(), tradeReq.getPageSize());
         List<LedgerPurchaseDto> ledgerTradeDto = tradeMapper.purchaseList(tradeReq);
         //字典转换
@@ -132,8 +144,8 @@ public class KwpLedgerTradeService extends AbsLedger {
         kwpLedgerTrade.setId(Objects.isNull(tradeSendReq.getId()) ? new IdWorker(1).nextId() : tradeSendReq.getId());
         kwpLedgerTrade.setEntId(LoginUserHolder.getEntId());
         kwpLedgerTrade.setName(tradeSendReq.getName());
-        kwpLedgerTrade.setStartTime(tradeSendReq.getStartTime());
-        kwpLedgerTrade.setEndTime(tradeSendReq.getEndTime());
+        kwpLedgerTrade.setStartTime(StringTimeUtil.startDateTime(tradeSendReq.getStartTime()));
+        kwpLedgerTrade.setEndTime(StringTimeUtil.endDateTime(tradeSendReq.getEndTime()));
         kwpLedgerTrade.setTaxRate(tradeSendReq.getTaxRate());
         kwpLedgerTrade.setTrading(tradeSendReq.getTrading());
         kwpLedgerTrade.setTotalPrice(tradeSendReq.getTotalPrice());
@@ -396,7 +408,7 @@ public class KwpLedgerTradeService extends AbsLedger {
         }
         successCheck(kwpLedgerTrade.getStatus());
 
-        kwpLedgerTrade.setReceiptTime(ledgerReq.getReceiptTime());
+        kwpLedgerTrade.setReceiptTime(LocalDateTime.of(ledgerReq.getReceiptTime(), LocalTime.MIN));
         kwpLedgerTrade.setStatus(LedgerEnum.SUCCESS.getStatus());
         kwpLedgerTrade.setUpdateTime(LocalDateTime.now());
         tradeMapper.updateById(kwpLedgerTrade);
@@ -414,7 +426,7 @@ public class KwpLedgerTradeService extends AbsLedger {
         kwpSettlementTrade.setAuditPhone(kwpLedgerTrade.getAuditPhone());
         kwpSettlementTrade.setSuccessUser(ledgerReq.getSuccessUser());
         kwpSettlementTrade.setSuccessPhone(ledgerReq.getSuccessPhone());
-        kwpSettlementTrade.setReceiptTime(ledgerReq.getReceiptTime());
+        kwpSettlementTrade.setReceiptTime(LocalDateTime.of(ledgerReq.getReceiptTime(), LocalTime.MIN));
         kwpSettlementTrade.setStatus(1);//1-待结算
         kwpSettlementTrade.setCreateBy(LoginUserHolder.getUserId());
         kwpSettlementTrade.setCreateTime(LocalDateTime.now());

+ 515 - 34
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/PayCenterService.java

@@ -3,20 +3,26 @@ package com.sckw.payment.service;
 import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
 import com.alibaba.fastjson2.TypeReference;
+import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.OkHttpUtils;
-import com.sckw.core.utils.StringUtils;
 import com.sckw.payment.api.model.constant.ChannelEnum;
-import com.sckw.payment.api.model.dto.MemberDetail;
-import com.sckw.payment.api.model.dto.R;
-import com.sckw.payment.api.model.dto.WalletDto;
+import com.sckw.payment.api.model.dto.*;
+import com.sckw.payment.api.model.dto.common.BusinessNo;
+import com.sckw.payment.api.model.dto.common.R;
+import com.sckw.payment.api.model.dto.page.CashPage;
+import com.sckw.payment.api.model.dto.page.PrePayIndexPage;
+import com.sckw.payment.api.model.dto.page.RecordPage;
 import com.sckw.payment.model.constant.PayCenterEnum;
+import jakarta.validation.constraints.NotBlank;
 import jakarta.validation.constraints.NotNull;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cloud.context.config.annotation.RefreshScope;
 import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
 
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
 
 /**
  * 转发中台接口
@@ -26,6 +32,8 @@ import java.util.Objects;
  */
 @Service
 @Slf4j
+@RefreshScope
+@Validated
 public class PayCenterService {
     @Value("${payCenter.address}")
     private String payCenterAddr;
@@ -42,6 +50,72 @@ public class PayCenterService {
         return ok;
     }
 
+    private String getHttp(PayCenterEnum payCenterEnum, Map<String, Object> para) {
+        log.info("{}入参->{}", payCenterEnum.getDesc(), JSONObject.toJSONString(para));
+        OkHttpUtils okHttpUtils = OkHttpUtils.builder().url(payCenterAddr + payCenterEnum.getAddr());
+        if (!CollectionUtils.isEmpty(para)) {
+            for (Map.Entry<String, Object> p : para.entrySet()) {
+                //跳过非空参数
+                if (Objects.isNull(p.getValue())) {
+                    continue;
+                }
+                if (p.getValue() instanceof ChannelEnum channelEnum) {
+                    okHttpUtils.addPara(p.getKey(), channelEnum.getChannel());
+                } else {
+                    okHttpUtils.addPara(p.getKey(), (String) p.getValue());
+                }
+            }
+        }
+        String sync;
+        try {
+            sync = okHttpUtils.get().sync();
+        } catch (Exception e) {
+            log.error("中台服务异常", e.getCause());
+            throw new RuntimeException("支付服务异常!");
+        }
+        log.info("{}返回值->{}", payCenterEnum.getDesc(), sync);
+        return changeRes(sync);
+    }
+
+    private String postHttp(PayCenterEnum payCenterEnum, Map<String, Object> para) {
+        log.info("{}入参->{}", payCenterEnum.getDesc(), JSONObject.toJSONString(para));
+        OkHttpUtils okHttpUtils = OkHttpUtils.builder().url(payCenterAddr + payCenterEnum.getAddr());
+        if (!CollectionUtils.isEmpty(para)) {
+            for (Map.Entry<String, Object> p : para.entrySet()) {
+                //跳过非空参数
+                if (Objects.isNull(p.getValue())) {
+                    continue;
+                }
+                if (p.getValue() instanceof ChannelEnum channelEnum) {
+                    okHttpUtils.addBodyPara(p.getKey(), channelEnum.getChannel());
+                } else {
+                    okHttpUtils.addBodyPara(p.getKey(), (String) p.getValue());
+                }
+            }
+        }
+        String sync;
+        try {
+            sync = okHttpUtils.post(true).sync();
+        } catch (Exception e) {
+            log.error("中台服务异常", e.getCause());
+            throw new RuntimeException("支付服务异常!");
+        }
+        log.info("{}返回值->{}", payCenterEnum.getDesc(), sync);
+        return changeRes(sync);
+    }
+
+    private String changeRes(String sync) {
+        JSONObject jsonObject = JSONObject.parseObject(sync);
+        //我的泛型是对象 返回值有可能 是对象或数组 {} []
+        //data:[]->转换成 data:null 进入if
+        Object data = jsonObject.get("data");
+        if (Objects.nonNull(data) && data instanceof JSONArray d && d.isEmpty()) {
+            jsonObject.put("data", null);
+            sync = jsonObject.toJSONString();
+        }
+        return sync;
+    }
+
     /**
      * 会员详情
      *
@@ -49,23 +123,12 @@ public class PayCenterService {
      * @param channel
      * @return
      */
-    public R<MemberDetail> memberDetail(String uid, ChannelEnum channel) {
-        log.info("{}入参->uid:{} channel:{}", PayCenterEnum.DETAIL.getDesc(), uid, channel);
-        String sync = OkHttpUtils.builder().url(payCenterAddr + PayCenterEnum.DETAIL.getAddr()).addPara("uid", uid).addPara("channel", channel.getChannel()).get().sync();
-        log.info("{}返回值:{}", PayCenterEnum.DETAIL.getDesc(), sync);
-        return JSONObject.parseObject(sync, new TypeReference<R<MemberDetail>>() {
-        });
-    }
-
-    public R<MemberDetail> withdraw(String uid, String view, String orderNo) {
-        log.info("{}入参->uid:{} view:{} orderNo:{}", PayCenterEnum.WITHDRAW.getDesc(), uid, view, orderNo);
-        String sync = OkHttpUtils.builder().url(payCenterAddr + PayCenterEnum.WITHDRAW.getAddr())
-                .addPara("uid", uid)
-                .addPara("view", view)
-                .addPara("orderNo", orderNo)
-                .get().sync();
-        log.info("{}返回值:{}", PayCenterEnum.WITHDRAW.getDesc(), sync);
-        return JSONObject.parseObject(sync, new TypeReference<R<MemberDetail>>() {
+    public R<MemberDetail> memberDetail(String uid, @NotNull(message = "渠道类型不能为空") ChannelEnum channel) {
+        String sync = getHttp(PayCenterEnum.MEMBER_DETAIL, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
         });
     }
 
@@ -78,18 +141,436 @@ public class PayCenterService {
      * @return
      */
     public R<List<WalletDto>> wallet(@NotNull String uid, ChannelEnum channel, String filter) {
-        log.info("钱包清单入参->uid:{} channel:{} filter:{}", uid, channel, filter);
-        OkHttpUtils okHttpUtils = OkHttpUtils.builder().url(payCenterAddr + PayCenterEnum.WALLET.getAddr())
-                .addPara("uid", uid);
-        if (Objects.nonNull(channel)) {
-            okHttpUtils.addPara("channel", channel.getChannel());
-        }
-        if (StringUtils.isNotBlank(filter)) {
-            okHttpUtils.addPara("filter", filter);
-        }
-        String sync = okHttpUtils.get().sync();
-        log.info("钱包清单返回值:{}", sync);
+        String sync = getHttp(PayCenterEnum.MEMBER_WALLET, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("filter", filter);
+        }});
         return parseArray(sync, WalletDto.class);
     }
 
+    /**
+     * 提现详情
+     *
+     * @param uid
+     * @param view
+     * @param orderNo
+     * @return
+     */
+    public R<CashDetail> withdrawDetail(@NotBlank(message = "提现用户不能为空") String uid, @NotBlank(message = "") String view, @NotBlank(message = "订单编号不能为空") String orderNo) {
+        String sync = getHttp(PayCenterEnum.WITHDRAW_DETAIL, new HashMap<>() {{
+            put("uid", uid);
+            put("view", view);
+            put("order_no", orderNo);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 提现清单
+     *
+     * @param uid
+     * @param channel
+     * @param page
+     * @param pageSize
+     * @return
+     */
+    public R<CashPage> withdrawIndex(@NotBlank(message = "提现用户不能为空") String uid, @NotNull(message = "支付渠道不能为空") ChannelEnum channel, @NotNull(message = "分页参数不能为空") Integer page, @NotNull(message = "分页大小参数不能为空") Integer pageSize) {
+        String sync = getHttp(PayCenterEnum.WITHDRAW_INDEX, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("page", page);
+            put("pageSize", pageSize);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 订单状态
+     *
+     * @param type
+     * @return
+     */
+    public R<Map<String, String>> withdrawStatus(String type) {
+        if (StringUtils.isBlank(type)) {
+            type = "order";
+        }
+        String finalType = type;
+        String sync = getHttp(PayCenterEnum.WITHDRAW_STATUS, new HashMap<>() {{
+            put("type", finalType);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 取消提现
+     *
+     * @param uid
+     * @param orderNo
+     * @return
+     */
+    public R<Object> withdrawCancel(@NotBlank(message = "提现用户不能为空") String uid, @NotBlank(message = "体现订单号不能为空") String orderNo) {
+        String sync = postHttp(PayCenterEnum.WITHDRAW_CANCEL, new HashMap<>() {{
+            put("uid", uid);
+            put("order_no", orderNo);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 申请提现
+     *
+     * @param uid
+     * @param channel
+     * @param money
+     * @param remarks
+     * @return
+     */
+    public R<Order> withdrawTake(@NotBlank(message = "提现用户不能为空") String uid, @NotBlank(message = "渠道不能为空") ChannelEnum channel, @NotBlank(message = "金额(分)不能为空") Long money, @NotBlank(message = "备注不能为空") String remarks) {
+        String sync = postHttp(PayCenterEnum.WITHDRAW_TAKE, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("money", money);
+            put("remarks", remarks);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 统计信息
+     *
+     * @param uid
+     * @param channel
+     * @param filter
+     * @return
+     */
+    public R<WalletInfo> totalInfo(@NotBlank(message = "用户不能为空") String uid, @NotBlank(message = "渠道不能为空") ChannelEnum channel, @NotBlank(message = "乙方用户不能为空") String filter) {
+        String sync = getHttp(PayCenterEnum.TOTAL_INFO, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("filter", filter);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 操作记录-下载
+     *
+     * @param uid
+     * @param channel
+     * @param filter
+     * @return
+     */
+    public R<OperateDown> operateDownload(String uid, ChannelEnum channel, String filter) {
+        String sync = getHttp(PayCenterEnum.OPERATE_DOWNLOAD, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("filter", filter);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 操作记录-分类
+     *
+     * @return
+     */
+    public R<Map<String, String>> operateCategory() {
+        String sync = getHttp(PayCenterEnum.OPERATE_CATEGORY, new HashMap<>());
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 操作记录
+     *
+     * @param uid
+     * @param channel
+     * @param page
+     * @param pageSize
+     * @return
+     */
+    public R<Operate> operateIndex(String uid, ChannelEnum channel, Integer page, Integer pageSize) {
+        String sync = getHttp(PayCenterEnum.OPERATE_INDEX, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("page", page);
+            put("pageSize", pageSize);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 钱包日志类型
+     *
+     * @return
+     */
+    public R<Map<String, String>> logCategory() {
+        String sync = getHttp(PayCenterEnum.LOG_CATEGORY, new HashMap<>());
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 获取钱包使用明细
+     *
+     * @param uid
+     * @param filter
+     * @param page
+     * @param pageSize
+     * @return
+     */
+    public R<RecordPage> record(String uid, String filter, Integer page, Integer pageSize) {
+        String sync = getHttp(PayCenterEnum.RECORD, new HashMap<>() {{
+            put("uid", uid);
+            put("filter", filter);
+            put("page", page);
+            put("pageSize", pageSize);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 余额转出
+     *
+     * @param uid
+     * @param channel
+     * @param money
+     * @param filter
+     * @return
+     */
+    public R<Object> transfer(String uid, ChannelEnum channel, Long money, String filter) {
+        String sync = postHttp(PayCenterEnum.TRANSFER, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("money", money);
+            put("filter", filter);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 预付订单详情
+     *
+     * @param orderNo
+     * @return
+     */
+    public R<CashDetail> advancePayDetail(String orderNo) {
+        String sync = getHttp(PayCenterEnum.ADVANCE_PAY_DETAIL, new HashMap<>() {{
+            put("order_no", orderNo);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 发起预付
+     *
+     * @param uid     乙方uid
+     * @param channel 渠道
+     * @param filter  甲方uid
+     * @param money   金额,分
+     * @return
+     */
+    public R<Order> advancePayApply(String uid, ChannelEnum channel, String filter, Long money) {
+        String sync = postHttp(PayCenterEnum.ADVANCE_PAY_APPLY, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("money", money);
+            put("filter", filter);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /***
+     * 预付订单清单
+     * @param uid
+     * @param channel
+     * @param filter
+     * @param page
+     * @param pageSize
+     * @return
+     */
+    public R<PrePayIndexPage> advancePayIndex(String uid, ChannelEnum channel, String filter, Integer page, Integer pageSize) {
+        String sync = getHttp(PayCenterEnum.ADVANCE_PAY_INDEX, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("filter", filter);
+            put("page", page);
+            put("pageSize", pageSize);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 预付订单状态
+     *
+     * @return
+     */
+    public R<List<String>> advancePayStatus() {
+        String sync = getHttp(PayCenterEnum.ADVANCE_PAY_STATUS, new HashMap<>());
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 获取通道清单
+     *
+     * @return
+     */
+    public R<List<Channel>> index() {
+        String sync = getHttp(PayCenterEnum.INDEX, new HashMap<>());
+        return parseArray(sync, Channel.class);
+    }
+
+    /**
+     * 订单记录
+     *
+     * @param uid
+     * @param channel
+     * @param filter
+     * @param page
+     * @param pageSize
+     * @return
+     */
+    public R<PayRecordPage> memberPayIndex(String uid, ChannelEnum channel, String filter, Integer page, Integer pageSize) {
+        String sync = getHttp(PayCenterEnum.MEMBER_PAY_INDEX, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("filter", filter);
+            put("page", page);
+            put("pageSize", pageSize);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 创建/更新账户
+     *
+     * @param memberCreate
+     * @return
+     */
+    public R<MemberRes> memberIndex(MemberCreate memberCreate) {
+        Map<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(memberCreate), new TypeReference<>() {
+        });
+        String sync = postHttp(PayCenterEnum.MEMBER_INDEX, map);
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 在线充值
+     *
+     * @param buyUid  付款方/乙方/买货方 账户
+     * @param sellUid 收款方/甲方/供货方 账户
+     * @param channel 渠道方
+     * @param money   金额,单位分
+     * @return
+     */
+    public R<PayIndex> payIndex(String buyUid, String sellUid, ChannelEnum channel, Long money) {
+        String sync = postHttp(PayCenterEnum.PAY_INDEX, new HashMap<>() {{
+            put("buyUid", buyUid);
+            put("sellUid", sellUid);
+            put("channel", channel);
+            put("money", money);
+        }});
+
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 冻结资金
+     *
+     * @param uid        付款方uid
+     * @param channel    支付通道
+     * @param money      冻结金额,单位分
+     * @param filter     收款方uid
+     * @param businessNo 流水号
+     * @return
+     */
+    public R<Freeze> walletFreeze(String uid, ChannelEnum channel, String filter, Long money, String businessNo) {
+        String sync = postHttp(PayCenterEnum.WALLET_FREEZE, new HashMap<>() {{
+            put("uid", uid);
+            put("filter", filter);
+            put("channel", channel);
+            put("money", money);
+            put("businessNo", businessNo);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 解冻金额
+     *
+     * @param businessNo
+     * @return
+     */
+    public R<BusinessNo> walletUnFreeze(String businessNo) {
+        String sync = postHttp(PayCenterEnum.WALLET_UNFREEZE, new HashMap<>() {{
+            put("business_no", businessNo);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 清分
+     *
+     * @param buyUid
+     * @param sellUid
+     * @param channel
+     * @param money
+     * @param batchPayList
+     * @param businessNo
+     * @return
+     */
+    public R<BusinessNo> payAgentPay(String buyUid, String sellUid, ChannelEnum channel, Long money, List<PatchPay> batchPayList, String businessNo) {
+        String sync = postHttp(PayCenterEnum.PAY_AGENT_PAY, new HashMap<>() {{
+            put("buy_uid", buyUid);
+            put("sell_uid", sellUid);
+            put("channel", channel);
+            put("money", money);
+            put("batch_pay_list", JSONObject.toJSONString(batchPayList));
+            put("business_no", businessNo);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 创建钱包
+     *
+     * @param uid
+     * @param channel
+     * @param filter
+     * @param nickname
+     * @return
+     */
+    public R<Object> walletIndex(@NotBlank(message = "uid不能为空") String uid,
+                                 @NotNull(message = "支付渠道不能为空") ChannelEnum channel,
+                                 @NotBlank(message = "filter不能为空") String filter, String nickname) {
+        String sync = postHttp(PayCenterEnum.WALLET_INDEX, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("filter", filter);
+            put("nickname", nickname);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
 }

+ 0 - 50
sckw-modules/sckw-report/src/main/java/com/sckw/report/enums/CarWaybillEnum.java

@@ -1,50 +0,0 @@
-package com.sckw.report.enums;
-
-public enum CarWaybillEnum {
-    PENDING_ORDER(1, "pendingOrder", "1", "待接单"),
-    PENDING_VEHICLE(2, "pendingVehicle", "2", "待出车"),
-    EXIT_COMPLETED(3, "exitCompleted", "3", "已出车"),
-    WAIT_LOADING(4, "waitLoading", "4", "到达装货点"),
-    COMPLETION_LOADING(5, "completionLoading", "5", "已装货"),
-    WAIT_UNLOADING(6, "waitUnloading", "6", "到达卸货点"),
-    COMPLETION_UNLOADING(7, "completionUnloading", "7", "已卸货"),
-    APPROVAL_COMPLETED(8, "approvalCompleted", "8", "已核单"),
-    REJECT_ORDER(9, "rejectOrder", "9", "拒接单");
-
-    private final Integer code;
-    private final String value;
-    private final String status;
-    private final String destination;
-
-    public Integer getCode() {
-        return code;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public String getDestination() {
-        return destination;
-    }
-
-    CarWaybillEnum(Integer code, String value, String status, String destination) {
-        this.code = code;
-        this.value = value;
-        this.status = status;
-        this.destination = destination;
-    }
-
-    public static String getLogisticsOrderValue(Integer code) {
-        for (CarWaybillEnum waybillEnum : CarWaybillEnum.values()) {
-            if (waybillEnum.getCode().equals(code)) {
-                return waybillEnum.getValue();
-            }
-        }
-        return null;
-    }
-}

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

@@ -1,6 +1,7 @@
 package com.sckw.report.service;
 
 import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.enums.CarWaybillEnum;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.StringUtils;
@@ -12,7 +13,6 @@ import com.sckw.mongo.model.SckwLogisticsOrder;
 import com.sckw.mongo.model.SckwWaybillOrder;
 import com.sckw.mongo.model.TableTops;
 import com.sckw.report.dao.SckwLogisticsOrderRepository;
-import com.sckw.report.enums.CarWaybillEnum;
 import com.sckw.report.service.param.WaybillOrderQuery;
 import com.sckw.report.service.vo.CarWaybillVo;
 import com.sckw.report.service.vo.WaybillsCountVo;

+ 2 - 2
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/KwtWaybillOrderController.java

@@ -64,7 +64,7 @@ public class KwtWaybillOrderController {
     }
 
     /**
-     * 承运订单更换司机
+     * 承运订单-更换司机
      * @param dto
      * @return
      */
@@ -79,7 +79,7 @@ public class KwtWaybillOrderController {
     }
 
     /**
-     * 承运订单更换车辆
+     * 承运订单-更换车辆
      * @param dto
      * @return
      */

+ 38 - 2
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/LogisticsConsignmentController.java

@@ -6,8 +6,10 @@ import com.sckw.core.web.response.HttpResult;
 import com.sckw.transport.model.dto.OrderFinishDTO;
 import com.sckw.transport.model.param.LogisticsConsignmentParam;
 import com.sckw.transport.service.LogisticsConsignmentService;
+import io.seata.spring.annotation.GlobalTransactional;
 import jakarta.validation.Valid;
 import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -76,7 +78,7 @@ public class LogisticsConsignmentController {
      */
     @Validated
     @RequestMapping(value = "/purchaseCancelConsign", method = RequestMethod.POST)
-//    @GlobalTransactional(name = "default_tx_group")
+    @GlobalTransactional(name = "default_tx_group")
     public HttpResult purchaseCancelConsign(@RequestParam("ids") @NotBlank(message = "单据不能为空") List<String> ids) {
         log.info("采购订单-托运订单列表-撤销托运:{}", JSONObject.toJSONString(ids));
         try {
@@ -109,6 +111,23 @@ public class LogisticsConsignmentController {
         }
     }
 
+    /**
+     * 采购订单-托运订单列表-订单完结-数据查询
+     * @param orderId   物流订单id
+     * @return
+     */
+    @Validated
+    @RequestMapping(value = "/selectPurchaseOrderFinish", method = RequestMethod.GET)
+    public HttpResult selectPurchaseOrderFinish(@RequestParam("orderId") @NotNull(message = "数据id不能为空") String orderId) {
+        log.info("采购订单-托运订单列表-订单完结-数据查询 传递参数信息:{}", orderId);
+        try {
+            return logisticsConsignmentService.selectOrderFinishVo(orderId, "1");
+        } catch (Exception e) {
+            log.error("采购订单-托运订单列表-订单完结-数据查询 error :{}", e.getMessage(), e);
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+    }
+
     /**
      * 采购订单-托运订单列表-完结订单
      * @param OrderFinishDTO
@@ -189,7 +208,7 @@ public class LogisticsConsignmentController {
      * @return
      */
     @RequestMapping(value = "/sellCancelConsign", method = RequestMethod.GET)
-//    @GlobalTransactional(name = "default_tx_group")
+    @GlobalTransactional(name = "default_tx_group")
     public HttpResult sellCancelConsign(@RequestParam("ids") @NotBlank(message = "单据id不能为空") List<String> ids) {
         log.info("销售订单-车辆列表 传递参数信息:{}", JSONObject.toJSONString(ids));
         try {
@@ -200,6 +219,23 @@ public class LogisticsConsignmentController {
         }
     }
 
+    /**
+     * 销售订单-托运订单列表-订单完结-数据查询
+     * @param orderId   物流订单id
+     * @return
+     */
+    @Validated
+    @RequestMapping(value = "/selectSellOrderFinish", method = RequestMethod.GET)
+    public HttpResult selectSellOrderFinish(@RequestParam("orderId") @NotNull(message = "数据id不能为空") String orderId) {
+        log.info("销售订单-托运订单列表-订单完结-数据查询 传递参数信息:{}", orderId);
+        try {
+            return logisticsConsignmentService.selectOrderFinishVo(orderId, "2");
+        } catch (Exception e) {
+            log.error("销售订单-托运订单列表-订单完结-数据查询 error :{}", e.getMessage(), e);
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+    }
+
     /**
      * 销售订单-托运订单列表-完结订单
      * @param orderFinishDTO

+ 8 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtLogisticsOrderMapper.java

@@ -7,6 +7,7 @@ import com.sckw.transport.model.KwtLogisticsOrder;
 import com.sckw.transport.model.param.DriverParam;
 import com.sckw.transport.model.param.LogisticsOrderParam;
 import com.sckw.transport.model.vo.DriverListVo;
+import com.sckw.transport.model.vo.OrderFinishVO;
 import com.sckw.transport.model.vo.SubcontractConsignmentVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -92,4 +93,11 @@ public interface KwtLogisticsOrderMapper extends BaseMapper<KwtLogisticsOrder> {
      * @return
      */
     List<LogisticsOrderVO> selectLogisticOrderList(@Param("ids") List<String> ids);
+
+    /**
+     * 通过物流订单id获取统计数据
+     * @param orderId
+     * @return
+     */
+    OrderFinishVO selectOrderFinishData(@Param("orderId") String orderId);
 }

+ 10 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtWaybillOrderMapper.java

@@ -39,6 +39,7 @@ public interface KwtWaybillOrderMapper extends BaseMapper<KwtWaybillOrder> {
 
     /**
      * 根据司机id+运单状态获取物流订单id
+     *
      * @param id
      * @param status
      * @return
@@ -47,9 +48,18 @@ public interface KwtWaybillOrderMapper extends BaseMapper<KwtWaybillOrder> {
 
     /**
      * 根基运单ID查询关联数据
+     *
      * @param id
      * @return
      */
     WayBillDetailDTO selectWaybillRelate(@Param("id") Long id);
 
+    /**
+     * 通过物流订单id+车辆运单状态查询是否存在处理中的数据
+     *
+     * @param id
+     * @param statusList
+     * @return
+     */
+    int selectDataByLorderId(@Param("id") String id, @Param("statusList") List<Integer> statusList);
 }

+ 10 - 10
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/OrderFinishDTO.java

@@ -24,19 +24,19 @@ public class OrderFinishDTO {
     @Length(max = 200,message = "单据编号长度错误最大长度:{max}")
     private String remark;
     /**
-     * 
+     * 装货
      */
 
-    @Digits(integer = 10, fraction=2, message = "量格式错误")
-    @DecimalMin(value = "0.00", message = "总量最小值不能低于0.00元")
+    @Digits(integer = 10, fraction=2, message = "装货量格式错误")
+    @DecimalMin(value = "0.00", message = "装货量最小值不能低于0.00")
 //    @DecimalMax(value = "10.00", message = "资金最大值不能高于10.00元")
-    @NotNull(message = "量不可为空")
-    private BigDecimal amount;
+    @NotNull(message = "装货量不可为空")
+    private BigDecimal loadAmount;
     /**
-     * 交付
+     * 卸货
      */
-    @Digits(integer = 10, fraction=2, message = "交付量格式错误")
-    @DecimalMin(value = "0.00", message = "交付量最小值不能低于0.00元")
-    @NotNull(message = "交付量不可为空")
-    private BigDecimal entrustAmount;
+    @Digits(integer = 10, fraction=2, message = "卸货量格式错误")
+    @DecimalMin(value = "0.00", message = "卸货量最小值不能低于0.00")
+    @NotNull(message = "卸货量不可为空")
+    private BigDecimal unloadAmount;
 }

+ 26 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/OrderFinishVO.java

@@ -0,0 +1,26 @@
+package com.sckw.transport.model.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author lfdc
+ * @description 完结订单数据展示返回vo
+ * @date 2023-07-26 08:07:50
+ */
+@Data
+public class OrderFinishVO {
+    /**
+     * 总运单次数
+     */
+    private Integer number;
+    /**
+     * 总卸货量
+     */
+    private BigDecimal unloadAmount;
+    /**
+     * 总装货量
+     */
+    private BigDecimal loadAmount;
+}

+ 11 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/AcceptCarriageOrderService.java

@@ -723,6 +723,7 @@ public class AcceptCarriageOrderService {
                     logisticsOrderCirculateMapper.update(null, new LambdaUpdateWrapper<KwtLogisticsOrderCirculate>()
                             .set(KwtLogisticsOrderCirculate::getStatus, NumberConstant.ONE)
                             .eq(KwtLogisticsOrderCirculate::getWOrderId, wOrderId));
+//                    /**更新MongoDB*/
                     jsonObject.put("status", HttpStatus.SUCCESS_CODE);
                     jsonObject.put("message", "停止接单成功");
                 }
@@ -783,6 +784,16 @@ public class AcceptCarriageOrderService {
             orderTrack.setUpdateBy(LoginUserHolder.getUserId());
             orderTrack.setUpdateTime(new Date());
             waybillOrderTrackMapper.insert(orderTrack);
+            /**修改mongodb*/
+            //mongodb更新订单状态
+            SckwWaybillOrder updateParam = new SckwWaybillOrder();
+            updateParam.setWOrderId(Long.parseLong(id)).setStatus(CarWaybillEnum.REVOKED.getCode())
+                    .setUpdateBy(LoginUserHolder.getUserId()).setUpdateByName(LoginUserHolder.getUserName()).setUpdateTime(new Date());
+            SckwBusSum busSum = new SckwBusSum();
+            busSum.setBusSumType(BusinessTypeEnum.WAYBILL_ORDER_TYPE.getName());
+            busSum.setMethod(2);
+            busSum.setObject(updateParam);
+            streamBridge.send("sckw-busSum", com.alibaba.fastjson2.JSON.toJSONString(busSum));
             result.put("status", HttpStatus.SUCCESS_CODE);
             result.put("message", "取消成功");
         }

+ 157 - 5
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/LogisticsConsignmentService.java

@@ -3,9 +3,11 @@ package com.sckw.transport.service;
 import cn.hutool.core.util.ArrayUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.sckw.core.common.enums.NumberConstant;
 import com.sckw.core.common.enums.enums.DictTypeEnum;
+import com.sckw.core.model.enums.CarWaybillEnum;
 import com.sckw.core.model.enums.LogisticsOrderEnum;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.CollectionUtils;
@@ -32,6 +34,7 @@ import com.sckw.transport.model.dto.LogisticsOrderDTO;
 import com.sckw.transport.model.dto.OrderCarDTO;
 import com.sckw.transport.model.dto.OrderFinishDTO;
 import com.sckw.transport.model.param.LogisticsConsignmentParam;
+import com.sckw.transport.model.vo.OrderFinishVO;
 import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
@@ -670,7 +673,7 @@ public class LogisticsConsignmentService {
              */
             KwtLogisticsOrder kwtLogisticsOrder = kwtLogisticsOrderMapper.selectOne(new LambdaUpdateWrapper<KwtLogisticsOrder>()
                     .eq(KwtLogisticsOrder::getId, s));
-            if (kwtLogisticsOrder == null || (!String.valueOf(LogisticsOrderEnum.PENDING_ORDER.getCode()).equals(kwtLogisticsOrder.getStatus()))) {
+            if (kwtLogisticsOrder == null || (!LogisticsOrderEnum.PENDING_ORDER.getStatus().equals(String.valueOf(kwtLogisticsOrder.getStatus())))) {
                 log.info("物流订单单据id:{}", s);
                 jsonObject.put("message", "单据状态异常或单据不存在");
                 jsonObject.put("status", HttpStatus.GLOBAL_EXCEPTION_CODE);
@@ -715,7 +718,7 @@ public class LogisticsConsignmentService {
         } else {
             throw new RuntimeException("完结订单-单据类型异常!");
         }
-        return null;
+        return HttpResult.ok("完结订单-成功");
     }
 
     /**
@@ -725,9 +728,65 @@ public class LogisticsConsignmentService {
      */
     private void sellOrderFinish(OrderFinishDTO orderFinishDTO) {
         /** 订单完结 物流运单状态为【待派车】、【运输中】可操作*/
-        /**完结拦截 必须车辆运单无正在运输中的单据才能完结*/
-        /**完结订单 不做页面填写数量与数据库数量进行计算验证*/
-
+        /**完结拦截 必须车辆运单无正在运输中的单据才能完结 状态有 待接单之后已核弹之前的状态 都不能完结*/
+        /**完结订单 不做页面填写数量与数据库数量进行计算验证-直接获取页面填写数据进行保存处理*/
+        //物流订单id
+        String id = orderFinishDTO.getId();
+        KwtLogisticsOrder logisticsOrder = kwtLogisticsOrderMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrder>()
+                .eq(KwtLogisticsOrder::getId, id));
+        if (logisticsOrder == null) {
+            throw new RuntimeException("采购订单-完结订单-物流单据不存在!");
+        }
+        /**订单状态验证*/
+        if (!LogisticsOrderEnum.WAIT_DELIVERY.getStatus().equals(String.valueOf(logisticsOrder.getStatus()))
+                && !LogisticsOrderEnum.IN_TRANSIT.getStatus().equals(String.valueOf(logisticsOrder.getStatus()))) {
+            throw new RuntimeException("当前运单并不属于【待派车】,【运输中】状态");
+        }
+        /**完结拦截*/
+        List<Integer> statusList = new ArrayList<>();
+        statusList.add(CarWaybillEnum.PENDING_VEHICLE.getCode());
+        statusList.add(CarWaybillEnum.EXIT_COMPLETED.getCode());
+        statusList.add(CarWaybillEnum.WAIT_LOADING.getCode());
+        statusList.add(CarWaybillEnum.COMPLETION_LOADING.getCode());
+        statusList.add(CarWaybillEnum.WAIT_UNLOADING.getCode());
+        statusList.add(CarWaybillEnum.COMPLETION_UNLOADING.getCode());
+        int count = waybillOrderMapper.selectDataByLorderId(id, statusList);
+        if (count > NumberConstant.ZERO) {
+            throw new RuntimeException("检测您现在有运单正在执行中,该订单目前不可完结,请先将运单执行完毕");
+        }
+        /**单据完结修改状态以及数据*/
+        logisticsOrder.setStatus(LogisticsOrderEnum.HAVE_FINISHED.getCode());
+        logisticsOrder.setLoadAmount(orderFinishDTO.getLoadAmount());
+        logisticsOrder.setUnloadAmount(orderFinishDTO.getUnloadAmount());
+        logisticsOrder.setCreateBy(LoginUserHolder.getUserId());
+        logisticsOrder.setUpdateTime(new Date());
+        logisticsOrder.setRemark(orderFinishDTO.getRemark());
+        kwtLogisticsOrderMapper.updateById(logisticsOrder);
+        KwtLogisticsOrderTrack track = new KwtLogisticsOrderTrack();
+        track.setId(new IdWorker(NumberConstant.ONE).nextId());
+        track.setLOrderId(logisticsOrder.getId());
+        track.setStatus(LogisticsOrderEnum.HAVE_FINISHED.getCode());
+        track.setCreateTime(new Date());
+        track.setRemark(orderFinishDTO.getRemark());
+        track.setCreateBy(LoginUserHolder.getUserId());
+        track.setUpdateBy(LoginUserHolder.getUserId());
+        track.setUpdateTime(new Date());
+        kwtLogisticsOrderTrackMapper.insert(track);
+        /**单据完结修改Mongodb*/
+        SckwLogisticsOrder updateParam = new SckwLogisticsOrder();
+        updateParam.setLOrderId(Long.parseLong(id))
+                .setStatus(LogisticsOrderEnum.HAVE_FINISHED.getStatus())
+                .setUpdateBy(LoginUserHolder.getUserId())
+                .setUpdateByName(LoginUserHolder.getUserName())
+                .setUpdateTime(new Date())
+                .setLoadAmount(orderFinishDTO.getLoadAmount())
+                .setUnloadAmount(orderFinishDTO.getUnloadAmount())
+        ;
+        SckwBusSum busSum = new SckwBusSum();
+        busSum.setBusSumType(BusinessTypeEnum.LOGISTICS_ORDER_TYPE.getName());
+        busSum.setMethod(2);
+        busSum.setObject(updateParam);
+        streamBridge.send("sckw-busSum", com.alibaba.fastjson2.JSON.toJSONString(busSum));
     }
 
     /**
@@ -736,6 +795,99 @@ public class LogisticsConsignmentService {
      * @param orderFinishDTO
      */
     private void purchaseOrderFinish(OrderFinishDTO orderFinishDTO) {
+        /** 订单完结 物流运单状态为【待派车】、【运输中】可操作*/
+        /**完结拦截 必须车辆运单无正在运输中的单据才能完结 状态有 待接单之后已核弹之前的状态 都不能完结*/
+        /**完结订单 不做页面填写数量与数据库数量进行计算验证-直接获取页面填写数据进行保存处理*/
+        //物流订单id
+        String id = orderFinishDTO.getId();
+        KwtLogisticsOrder logisticsOrder = kwtLogisticsOrderMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrder>()
+                .eq(KwtLogisticsOrder::getId, id));
+        if (logisticsOrder == null) {
+            throw new RuntimeException("采购订单-完结订单-物流单据不存在!");
+        }
+        /**订单状态验证*/
+        if (!LogisticsOrderEnum.WAIT_DELIVERY.getStatus().equals(String.valueOf(logisticsOrder.getStatus()))
+                && !LogisticsOrderEnum.IN_TRANSIT.getStatus().equals(String.valueOf(logisticsOrder.getStatus()))) {
+            throw new RuntimeException("当前运单并不属于【待派车】,【运输中】状态");
+        }
+        /**完结拦截*/
+        List<Integer> statusList = new ArrayList<>();
+        statusList.add(CarWaybillEnum.PENDING_VEHICLE.getCode());
+        statusList.add(CarWaybillEnum.EXIT_COMPLETED.getCode());
+        statusList.add(CarWaybillEnum.WAIT_LOADING.getCode());
+        statusList.add(CarWaybillEnum.COMPLETION_LOADING.getCode());
+        statusList.add(CarWaybillEnum.WAIT_UNLOADING.getCode());
+        statusList.add(CarWaybillEnum.COMPLETION_UNLOADING.getCode());
+        int count = waybillOrderMapper.selectDataByLorderId(id, statusList);
+        if (count > NumberConstant.ZERO) {
+            throw new RuntimeException("检测您现在有运单正在执行中,该订单目前不可完结,请先将运单执行完毕");
+        }
+        /**单据完结修改状态以及数据*/
+        logisticsOrder.setStatus(LogisticsOrderEnum.HAVE_FINISHED.getCode());
+        logisticsOrder.setLoadAmount(orderFinishDTO.getLoadAmount());
+        logisticsOrder.setUnloadAmount(orderFinishDTO.getUnloadAmount());
+        logisticsOrder.setCreateBy(LoginUserHolder.getUserId());
+        logisticsOrder.setUpdateTime(new Date());
+        logisticsOrder.setRemark(orderFinishDTO.getRemark());
+        kwtLogisticsOrderMapper.updateById(logisticsOrder);
+        KwtLogisticsOrderTrack track = new KwtLogisticsOrderTrack();
+        track.setId(new IdWorker(NumberConstant.ONE).nextId());
+        track.setLOrderId(logisticsOrder.getId());
+        track.setStatus(LogisticsOrderEnum.HAVE_FINISHED.getCode());
+        track.setCreateTime(new Date());
+        track.setRemark(orderFinishDTO.getRemark());
+        track.setCreateBy(LoginUserHolder.getUserId());
+        track.setUpdateBy(LoginUserHolder.getUserId());
+        track.setUpdateTime(new Date());
+        kwtLogisticsOrderTrackMapper.insert(track);
+        /**单据完结修改Mongodb*/
+        SckwLogisticsOrder updateParam = new SckwLogisticsOrder();
+        updateParam.setLOrderId(Long.parseLong(id))
+                .setStatus(LogisticsOrderEnum.HAVE_FINISHED.getStatus())
+                .setUpdateBy(LoginUserHolder.getUserId())
+                .setUpdateByName(LoginUserHolder.getUserName())
+                .setUpdateTime(new Date())
+                .setLoadAmount(orderFinishDTO.getLoadAmount())
+                .setUnloadAmount(orderFinishDTO.getUnloadAmount())
+        ;
+        SckwBusSum busSum = new SckwBusSum();
+        busSum.setBusSumType(BusinessTypeEnum.LOGISTICS_ORDER_TYPE.getName());
+        busSum.setMethod(2);
+        busSum.setObject(updateParam);
+        streamBridge.send("sckw-busSum", com.alibaba.fastjson2.JSON.toJSONString(busSum));
+    }
 
+    /**
+     * 采购订单/销售订单-托运订单列表-订单完结-数据查询
+     *
+     * @param orderId 物流订单id
+     * @param type    1采购订单2销售订单
+     * @return
+     */
+    public HttpResult selectOrderFinishVo(String orderId, String type) {
+        HttpResult httpResult = new HttpResult();
+        httpResult.setCode(HttpStatus.SUCCESS_CODE);
+        if (String.valueOf(NumberConstant.ONE).equals(type)) {
+            httpResult = selectOrderFinishData(orderId);
+        } else if (String.valueOf(NumberConstant.TWO).equals(type)) {
+            httpResult = selectOrderFinishData(orderId);
+        } else {
+            httpResult.setCode(HttpStatus.SUCCESS_CODE);
+            httpResult.setMsg("订单完结查询,类型错误!");
+        }
+        return httpResult;
+    }
+
+    /**
+     * 采购订单/销售订单-托运订单列表-订单完结-数据查询
+     *
+     * @param orderId 物流订单id
+     * @return
+     */
+    private HttpResult selectOrderFinishData(String orderId) {
+        HttpResult httpResult = new HttpResult();
+        OrderFinishVO orderFinishVO = kwtLogisticsOrderMapper.selectOrderFinishData(orderId);
+        httpResult.setData(orderFinishVO);
+        return httpResult;
     }
 }

+ 5 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/TransportCommonService.java

@@ -300,6 +300,11 @@ public class TransportCommonService {
         return result;
     }
 
+    /**
+     * 对账管理-运费收款对账界面查询接口
+     * @param logisticsOrderParam
+     * @return
+     */
     public HttpResult getAcceptCarriageOrder(LogisticsOrderParam logisticsOrderParam) {
         SysDictResDto sysDictResDto = remoteSystemService.queryDictByTypeAndValue(logisticsOrderParam.getPaymentType(), logisticsOrderParam.getPayment());
         Long dictId = sysDictResDto.getId();

+ 15 - 0
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderMapper.xml

@@ -358,4 +358,19 @@
         </where>
         ORDER BY a.create_time DESC
     </select>
+
+    <select id="selectOrderFinishData" resultType="com.sckw.transport.model.vo.OrderFinishVO">
+        SELECT COUNT(a.id) AS number,
+        SUM(IFNULL(a.load_amount, 0)) as loadAmount,
+        SUM(IFNULL(a.unload_amount, 0)) AS unloadAmount
+        FROM kwt_waybill_order a
+        LEFT JOIN kwt_logistics_order b ON b.id = a.l_order_id
+        AND a.del_flag = 0
+        AND b.del_flag = 0
+        <where>
+            <if test="orderId != null and orderId != ''">
+                and b.id=#{orderId}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 52 - 35
sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderMapper.xml

@@ -33,16 +33,16 @@
     update_time, del_flag,start_time,end_time
     </sql>
     <select id="selectWaybillOrderCarList" resultType="com.sckw.transport.model.dto.OrderCarDTO">
-        SELECT a.id               as wOrderId,
-               a.w_order_no       as wOrderNo,
-               a.driver_id        as driverId,
-               a.driver_name      as driverName,
-               a.driver_phone     as driverPhone,
-               a.driver_idcard    as driverIdcard,
-               a.l_order_id       as lOrderId,
-               b.l_order_no       as lOrderNo,
-               b.t_order_id       as tOrderId,
-               b.t_order_no       as tOrderNo
+        SELECT a.id            as wOrderId,
+               a.w_order_no    as wOrderNo,
+               a.driver_id     as driverId,
+               a.driver_name   as driverName,
+               a.driver_phone  as driverPhone,
+               a.driver_idcard as driverIdcard,
+               a.l_order_id    as lOrderId,
+               b.l_order_no    as lOrderNo,
+               b.t_order_id    as tOrderId,
+               b.t_order_no    as tOrderNo
         FROM kwt_waybill_order a
                  LEFT JOIN kwt_logistics_order b ON a.l_order_id = b.id
         WHERE a.del_flag = '0'
@@ -80,34 +80,30 @@
         group by lOrderId
     </select>
     <select id="getWaybillData" resultType="com.sckw.transport.model.vo.WaybillDetailVO">
-
     </select>
 
     <select id="selectWaybillRelate" resultType="com.sckw.transport.model.dto.WayBillDetailDTO">
-        SELECT
-            `order`.`id` AS `wOrderId`,
-            `order`.`w_order_no` AS `wOrderNo`,
-            `order`.`truck_no` AS `truckNo`,
-            `order`.`entrust_amount` AS `entrustAmount`,
-            `order`.`truck_id` AS `truckId`,
-            `order`.`driver_id` AS `driverId`,
-            `order`.`driver_name` AS `driverName`,
-            `order`.`driver_phone` AS `driverPhone`,
-            `order`.`driver_idcard` AS `driverIdcard`,
-            `order`.`type`,
-            `order`.`start_time` AS `startTime`,
-            `order`.`end_time` AS `endTime`,
-            `order`.`create_by` AS `createBy`,
-            `logistics`.`id` AS `lOrderId`,
-            `logistics`.`l_order_no` AS `lOrderNo`,
-            `logistics`.`price_type` AS `priceType`,
-            `goods`.`goods_name` AS goodsName
-        FROM
-            `kwt_waybill_order` `order`
-                LEFT JOIN `kwt_logistics_order` `logistics` ON `logistics`.`id` = `order`.`l_order_id`
-                LEFT JOIN `kwt_logistics_order_goods` `goods` ON `goods`.`l_order_id` = `order`.`l_order_id`
-        WHERE
-            `order`.`id` = #{id,jdbcType=BIGINT}
+        SELECT `order`.`id`             AS `wOrderId`,
+               `order`.`w_order_no`     AS `wOrderNo`,
+               `order`.`truck_no`       AS `truckNo`,
+               `order`.`entrust_amount` AS `entrustAmount`,
+               `order`.`truck_id`       AS `truckId`,
+               `order`.`driver_id`      AS `driverId`,
+               `order`.`driver_name`    AS `driverName`,
+               `order`.`driver_phone`   AS `driverPhone`,
+               `order`.`driver_idcard`  AS `driverIdcard`,
+               `order`.`type`,
+               `order`.`start_time`     AS `startTime`,
+               `order`.`end_time`       AS `endTime`,
+               `order`.`create_by`      AS `createBy`,
+               `logistics`.`id`         AS `lOrderId`,
+               `logistics`.`l_order_no` AS `lOrderNo`,
+               `logistics`.`price_type` AS `priceType`,
+               `goods`.`goods_name`     AS goodsName
+        FROM `kwt_waybill_order` `order`
+                 LEFT JOIN `kwt_logistics_order` `logistics` ON `logistics`.`id` = `order`.`l_order_id`
+                 LEFT JOIN `kwt_logistics_order_goods` `goods` ON `goods`.`l_order_id` = `order`.`l_order_id`
+        WHERE `order`.`id` = #{id,jdbcType=BIGINT}
     </select>
 
     <select id="statistics" resultType="com.sckw.mongo.model.TableTops">
@@ -128,4 +124,25 @@
             </if>
         </where>
     </select>
+
+    <select id="selectDataByLorderId" resultType="int">
+        SELECT
+        COUNT(b.id)
+        FROM
+        kwt_waybill_order a
+        LEFT JOIN kwt_logistics_order b ON a.l_order_id = b.id
+        AND a.del_flag = 0
+        AND b.del_flag = 0
+        <where>
+            <if test="id != null and id !=''">
+                and b.id = #{id}
+            </if>
+            <if test="statusList != null and statusList.size() >0">
+                AND a.`status` IN
+                <foreach collection="statusList" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+    </select>
 </mapper>