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

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

czh 2 лет назад
Родитель
Сommit
179a90038e
35 измененных файлов с 203 добавлено и 161 удалено
  1. 2 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/StringUtils.java
  2. 1 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/Data.java
  3. 1 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/Page.java
  4. 1 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/Result.java
  5. 5 4
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverController.java
  6. 3 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfFleetController.java
  7. 3 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java
  8. 2 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckReportController.java
  9. 2 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfTruckReportDto.java
  10. 1 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckReportService.java
  11. 8 8
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckMapper.xml
  12. 2 2
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckReportMapper.xml
  13. 3 2
      sckw-modules/sckw-order/src/main/java/com/sckw/order/controller/KwoTransportDemandController.java
  14. 3 2
      sckw-modules/sckw-order/src/main/java/com/sckw/order/controller/KwpWantBuyController.java
  15. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/WalletController.java
  16. 1 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/wallet/CashLog.java
  17. 34 39
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WorkbenchService.java
  18. 9 9
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementRecordMapper.xml
  19. 3 2
      sckw-modules/sckw-product/src/main/java/com/sckw/product/controller/KwpGoodsController.java
  20. 3 2
      sckw-modules/sckw-product/src/main/java/com/sckw/product/controller/operation/GoodsManagerController.java
  21. 3 2
      sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/KwOrderController.java
  22. 2 2
      sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/KwTransportController.java
  23. 7 3
      sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/operator/TradeOrderManageController.java
  24. 5 4
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/AcceptCarriageOrderController.java
  25. 11 9
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/ConsignOrderController.java
  26. 3 3
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/LogisticsConsignmentController.java
  27. 8 6
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/operationManagement/ManagementLogisticsOrderController.java
  28. 6 4
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/operationManagement/ManagementWaybillOrderController.java
  29. 16 13
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/AcceptCarriageOrderService.java
  30. 30 4
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/CommonService.java
  31. 1 1
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ConsignOrderService.java
  32. 4 3
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/LogisticsConsignmentService.java
  33. 11 21
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ManagementWaybillOrderService.java
  34. 1 1
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/TransportCommonService.java
  35. 7 6
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/WaybillManagementService.java

+ 2 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/StringUtils.java

@@ -769,7 +769,8 @@ public class StringUtils {
         if (StringUtils.isBlank(text) || CollectionUtils.isEmpty(varNames)) {
             return text;
         }
-        Pattern pattern = Pattern.compile("\\$\\{([^}]+)\\}");
+        String str = "\\$\\{([^}]+)\\}";
+        Pattern pattern = Pattern.compile(str);
         Matcher matcher = pattern.matcher(text);
         StringBuilder result = new StringBuilder();
         while (matcher.find()) {

+ 1 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/Data.java

@@ -47,6 +47,7 @@ public class Data {
         this.page = page;
     }
 
+    @Override
     public String toString() {
         return "Data(body=" + this.getBody() + ", page=" + this.getPage() + ")";
     }

+ 1 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/Page.java

@@ -39,6 +39,7 @@ public class Page {
         this.pageSize = pageSize;
     }
 
+    @Override
     public String toString() {
         return "Page(total=" + this.getTotal() + ", page=" + this.getPage() + ", pageSize=" + this.getPageSize() + ")";
     }

+ 1 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/response/result/Result.java

@@ -166,6 +166,7 @@ public class Result implements Serializable {
         this.data = data;
     }
 
+    @Override
     public String toString() {
         return "Result(status=" + this.getStatus() + ", msg=" + this.getMsg() + ", data=" + this.getData() + ")";
     }

+ 5 - 4
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverController.java

@@ -2,14 +2,16 @@ package com.sckw.fleet.controller;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.core.web.response.ResponseUtil;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.fleet.model.dto.*;
 import com.sckw.fleet.model.vo.KwfDriverDetailVo;
@@ -22,7 +24,7 @@ import org.springframework.http.MediaType;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
-
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -133,10 +135,9 @@ public class KwfDriverController {
         List<KwfDriverVo> drivers = driverService.findPage(params);
 
         if (CollectionUtils.isEmpty(drivers)) {
-            throw new BusinessException("没有您想导出的数据!");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认!");
         }
         ExcelUtil.downData(response, KwfDriverVo.class, drivers);
-        //ResponseUtil.writer(response, HttpResult.error("没有您想导出的数据!"));
     }
 
     /**

+ 3 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfFleetController.java

@@ -3,10 +3,12 @@ package com.sckw.fleet.controller;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.enums.SystemTypeEnum;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.core.web.response.ResponseUtil;
@@ -85,12 +87,11 @@ public class KwfFleetController {
      **/
     @PostMapping(value = "/export", produces = MediaType.APPLICATION_JSON_VALUE)
     public void export(@RequestBody Map<String, Object> params, HttpServletResponse response) {
-        params.put("entId", LoginUserHolder.getEntId());
         /**查询分页数据**/
         List<KwfFleetVo> fleets = fleetService.findPage(params);
 
         if (CollectionUtils.isEmpty(fleets)) {
-            throw new BusinessException("没有您想导出的数据!");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认!");
         }
         ExcelUtil.downData(response, KwfFleetVo.class, fleets);
     }

+ 3 - 1
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java

@@ -6,12 +6,14 @@ import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
@@ -144,7 +146,7 @@ public class KwfTruckController {
         List<KwfTruckVo> trucks = truckService.findPage(params);
 
         if (CollectionUtils.isEmpty(trucks)) {
-            throw new BusinessException("没有您想导出的数据!");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认!");
         }
         ExcelUtil.downData(response, KwfTruckVo.class, trucks);
     }

+ 2 - 1
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckReportController.java

@@ -3,6 +3,7 @@ package com.sckw.fleet.controller;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.enums.SystemTypeEnum;
 import com.sckw.core.model.page.PageHelperUtil;
@@ -84,7 +85,7 @@ public class KwfTruckReportController {
         List<KwfTruckReportVo> trucks = reportService.findPage(params);
 
         if (CollectionUtils.isEmpty(trucks)) {
-            throw new BusinessException("没有您想导出的数据!");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认!");
         }
         ExcelUtil.downData(response, KwfTruckReportVo.class, trucks);
     }

+ 2 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/KwfTruckReportDto.java

@@ -19,14 +19,14 @@ public class KwfTruckReportDto {
      * 车牌号
      */
     @NotBlank(message = "车牌号不能为空!")
-    @Size(max=7, message = "车牌号长度不能大于7个字符!")
+    @Size(max=8, message = "车牌号长度不能大于8个字符!")
     private String truckNo;
 
     /**
      * 司机名称
      */
     @NotBlank(message = "司机姓名不能为空!")
-    @Size(max=10, message = "司机姓名长度不能大于10个字符!")
+    @Size(max=25, message = "司机姓名长度不能大于25个字符!")
     private String name;
 
     /**

+ 1 - 1
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckReportService.java

@@ -638,7 +638,7 @@ public class KwfTruckReportService {
         /**数据校验**/
         //车牌号-非空/长度为7
         String truckNo = strArray[0];
-        if (StringUtils.isBlank(truckNo) || truckNo.trim().length() != 7) {
+        if (StringUtils.isBlank(truckNo) || (truckNo.trim().length() != 7 && truckNo.trim().length() != 8)) {
             msg.append("车牌号格式不正确!");
         }
 

+ 8 - 8
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckMapper.xml

@@ -15,8 +15,8 @@
         <if test="truckNo != null and truckNo != ''">
             and tr.truck_no = #{truckNo, jdbcType=VARCHAR}
         </if>
-        <if test="type != null and type != ''">
-            and tr.type = #{type, jdbcType=VARCHAR}
+        <if test="truckType != null and truckType != ''">
+            and tr.type = #{truckType, jdbcType=VARCHAR}
         </if>
         <if test="energyType != null and energyType != ''">
             and tr.energy_type = #{energyType, jdbcType=VARCHAR}
@@ -57,8 +57,8 @@
         <if test="truckNo != null and truckNo != ''">
             and tr.truck_no = #{truckNo, jdbcType=VARCHAR}
         </if>
-        <if test="type != null and type != ''">
-            and tr.type = #{type, jdbcType=VARCHAR}
+        <if test="truckType != null and truckType != ''">
+            and tr.type = #{truckType, jdbcType=VARCHAR}
         </if>
         <if test="energyType != null and energyType != ''">
             and tr.energy_type = #{energyType, jdbcType=VARCHAR}
@@ -110,7 +110,7 @@
             and tr.truck_no = #{truckNo, jdbcType=VARCHAR}
         </if>
         <if test="truckType != null and truckType != ''">
-            and tr.type = #{type, jdbcType=VARCHAR}
+            and tr.type = #{truckType, jdbcType=VARCHAR}
         </if>
         <if test="energyType != null and energyType != ''">
             and tr.energy_type = #{energyType, jdbcType=VARCHAR}
@@ -170,7 +170,7 @@
             and tr.truck_no = #{truckNo, jdbcType=VARCHAR}
         </if>
         <if test="truckType != null and truckType != ''">
-            and tr.type = #{type, jdbcType=VARCHAR}
+            and tr.type = #{truckType, jdbcType=VARCHAR}
         </if>
         <if test="energyType != null and energyType != ''">
             and tr.energy_type = #{energyType, jdbcType=VARCHAR}
@@ -232,8 +232,8 @@
         <if test="wholeTruckNo != null and wholeTruckNo != ''">
             and tr.truck_no = #{wholeTruckNo, jdbcType=VARCHAR}
         </if>
-        <if test="type != null and type != ''">
-            and tr.type = #{type, jdbcType=VARCHAR}
+        <if test="truckType != null and truckType != ''">
+            and tr.type = #{truckType, jdbcType=VARCHAR}
         </if>
         <if test="energyType != null and energyType != ''">
             and tr.energy_type = #{energyType, jdbcType=VARCHAR}

+ 2 - 2
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckReportMapper.xml

@@ -18,7 +18,7 @@
             and tr.truck_no = #{truckNo, jdbcType=VARCHAR}
         </if>
         <if test="truckType != null and truckType != ''">
-            and tr.type = #{type, jdbcType=VARCHAR}
+            and tr.type = #{truckType, jdbcType=VARCHAR}
         </if>
         <if test="fleetId != null and fleetId != ''">
             and fl.id = #{fleetId, jdbcType=VARCHAR}
@@ -66,7 +66,7 @@
             and tr.truck_no = #{truckNo, jdbcType=VARCHAR}
         </if>
         <if test="truckType != null and truckType != ''">
-            and tr.type = #{type, jdbcType=VARCHAR}
+            and tr.type = #{truckType, jdbcType=VARCHAR}
         </if>
         <if test="fleetId != null and fleetId != ''">
             and fl.id = #{fleetId, jdbcType=VARCHAR}

+ 3 - 2
sckw-modules/sckw-order/src/main/java/com/sckw/order/controller/KwoTransportDemandController.java

@@ -1,8 +1,9 @@
 package com.sckw.order.controller;
 
-import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.order.model.dto.TransportDemandExport;
@@ -117,7 +118,7 @@ public class KwoTransportDemandController {
     public void export(@RequestBody ExportTransportDemandParam param, HttpServletResponse response) {
         List<TransportDemandExport> list = kwoTransportDemandService.export(param);
         if (CollectionUtils.isEmpty(list)) {
-            throw new BusinessException("暂无数据,请确认");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认");
         }
         ExcelUtil.downData(response, TransportDemandExport.class, list);
     }

+ 3 - 2
sckw-modules/sckw-order/src/main/java/com/sckw/order/controller/KwpWantBuyController.java

@@ -1,8 +1,9 @@
 package com.sckw.order.controller;
 
-import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.order.model.dto.WantBuyExport;
@@ -165,7 +166,7 @@ public class KwpWantBuyController {
     public void export(@RequestBody WantBuySelectParam param, HttpServletResponse response) {
         List<WantBuyExport> list = kwpWantBuyService.export(param);
         if (CollectionUtils.isEmpty(list)) {
-            throw new BusinessException("暂无数据,请确认");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认");
         }
         ExcelUtil.downData(response, WantBuyExport.class, list);
     }

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/WalletController.java

@@ -3,8 +3,8 @@ package com.sckw.payment.controller;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.payment.model.dto.Id;
 import com.sckw.payment.model.vo.req.*;
-import com.sckw.payment.model.vo.req.page.PrePayPage;
 import com.sckw.payment.model.vo.req.page.MoneyPage;
+import com.sckw.payment.model.vo.req.page.PrePayPage;
 import com.sckw.payment.model.vo.req.page.RefundPage;
 import com.sckw.payment.service.WalletService;
 import jakarta.annotation.Resource;

+ 1 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/wallet/CashLog.java

@@ -10,6 +10,7 @@ import java.io.Serializable;
 public class CashLog implements Serializable {
     @Serial
     private static final long serialVersionUID = 7233982475006805580L;
+    @JSONField(name = "order_no")
     private String orderNo;
     @JSONField(name = "status")
     private Integer status;

+ 34 - 39
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WorkbenchService.java

@@ -1,5 +1,6 @@
 package com.sckw.payment.service;
 
+import com.sckw.core.common.enums.NumberConstant;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.payment.model.vo.SettlementRecord;
 import com.sckw.payment.model.vo.req.FinanceCount;
@@ -14,8 +15,8 @@ import org.springframework.stereotype.Service;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 /**
@@ -30,6 +31,35 @@ public class WorkbenchService {
 
     @Resource
     private KwpSettlementRecordService kwpSettlementRecordService;
+    private final Map<String, Function<SettlementRecord, String>> map = new HashMap<>(NumberConstant.FOUR);
+
+    public WorkbenchService() {
+        DecimalFormat df = new DecimalFormat("0.00");
+        map.put("1", (d) -> {
+            if (Objects.isNull(d.getReceivedMoney())) {
+                return "0.00";
+            }
+            return df.format(d.getReceivedMoney().divide(new BigDecimal("10000.0"), 2, RoundingMode.HALF_UP));
+        });
+        map.put("2", (d) -> {
+            if (Objects.isNull(d.getExactMoney())) {
+                return "0.00";
+            }
+            return df.format(d.getExactMoney().divide(new BigDecimal("10000.0"), 2, RoundingMode.HALF_UP));
+        });
+        map.put("3", (d) -> {
+            if (Objects.isNull(d.getOverdueExactMoney())) {
+                return "0.00";
+            }
+            return df.format(d.getOverdueExactMoney().divide(new BigDecimal("10000.0"), 2, RoundingMode.HALF_UP));
+        });
+        map.put("4", (d) -> {
+            BigDecimal overdueExactMoney = d.getOverdueExactMoney();
+            //总应收金额
+            BigDecimal totalReceiveMoney = d.getTotalReceiveMoney();
+             return DecimalUtils.financePercent(overdueExactMoney, totalReceiveMoney);
+        });
+    }
 
     public Object financeCount(FinanceCount financeCount) {
         //周期维度 1-天 2-周 3-月
@@ -59,48 +89,13 @@ public class WorkbenchService {
             }
         }
         Long entId = LoginUserHolder.getEntId();
-        DecimalFormat df = new DecimalFormat("0.00");
         //获取数据,按照统计因子进行处理,并转换成万元
         List<SettlementRecord> settlementRecords = kwpSettlementRecordService.financeCount(time, entId, circle);
         return settlementRecords.stream().map(a -> {
             EChartsVo eChartsVo = new EChartsVo();
             eChartsVo.setCreateTime(a.getCreateTime());
-            switch (financeCount.getFactorOne()) {
-                case "1" ->
-                        eChartsVo.setFactorOne(df.format(a.getReceivedMoney().divide(new BigDecimal("10000.0"), 2, RoundingMode.HALF_UP)));
-                case "2" ->
-                        eChartsVo.setFactorOne(df.format(a.getExactMoney().divide(new BigDecimal("10000.0"), 2, RoundingMode.HALF_UP)));
-                case "3" ->
-                        eChartsVo.setFactorOne(df.format(a.getOverdueExactMoney().divide(new BigDecimal("10000.0"), 2, RoundingMode.HALF_UP)));
-                case "4" -> {
-                    BigDecimal overdueExactMoney = a.getOverdueExactMoney();
-                    //总应收金额
-                    BigDecimal totalReceiveMoney = a.getTotalReceiveMoney();
-                    if (totalReceiveMoney.compareTo(new BigDecimal("0.0")) <= 0) {
-                        eChartsVo.setFactorOne("0.00%");
-                    } else {
-                        eChartsVo.setFactorOne(DecimalUtils.financePercent(overdueExactMoney, totalReceiveMoney));
-                    }
-                }
-            }
-            switch (financeCount.getFactorTwo()) {
-                case "1" ->
-                        eChartsVo.setFactorTwo(df.format(a.getReceivedMoney().divide(new BigDecimal("10000.0"), 2, RoundingMode.HALF_UP)));
-                case "2" ->
-                        eChartsVo.setFactorTwo(df.format(a.getExactMoney().divide(new BigDecimal("10000.0"), 2, RoundingMode.HALF_UP)));
-                case "3" ->
-                        eChartsVo.setFactorTwo(df.format(a.getOverdueExactMoney().divide(new BigDecimal("10000.0"), 2, RoundingMode.HALF_UP)));
-                case "4" ->{
-                    BigDecimal overdueExactMoney = a.getOverdueExactMoney();
-                    //总应收金额
-                    BigDecimal totalReceiveMoney = a.getTotalReceiveMoney();
-                    if (totalReceiveMoney.compareTo(new BigDecimal("0.0")) <= 0) {
-                        eChartsVo.setFactorTwo("0.00%");
-                    } else {
-                        eChartsVo.setFactorTwo(DecimalUtils.financePercent(overdueExactMoney, totalReceiveMoney));
-                    }
-                }
-            }
+            eChartsVo.setFactorOne(map.get(financeCount.getFactorOne()).apply(a));
+            eChartsVo.setFactorTwo(map.get(financeCount.getFactorTwo()).apply(a));
             return eChartsVo;
         }).collect(Collectors.toList());
     }

+ 9 - 9
sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementRecordMapper.xml

@@ -117,15 +117,15 @@
     </select>
     <!--    支持时间范围筛选的按月统计-->
     <select id="countMonth" resultType="com.sckw.payment.model.vo.SettlementRecord">
-        select tmpd.createTime,
-               tmpd.totalReceiveMoney,
-               tmpd.exactMoney,
-               tmpd.receivedMoney,
-               tmpd.overdueExactMoney,
-               tmpd.totalPayMoney,
-               tmpd.unpaidMoney,
-               tmpd.paidMoney,
-               tmpd.overduePaidMoney
+        select temp.date as createTime,
+               ifnull(tmpd.totalReceiveMoney, 0),
+               ifnull(tmpd.exactMoney, 0),
+               ifnull(tmpd.receivedMoney, 0),
+               ifnull(tmpd.overdueExactMoney, 0),
+               ifnull(tmpd.totalPayMoney, 0),
+               ifnull(tmpd.unpaidMoney, 0),
+               ifnull(tmpd.paidMoney, 0),
+               ifnull(tmpd.overduePaidMoney, 0)
         FROM (
         <foreach collection="timeAll" item="date" separator="UNION ALL">
             SELECT #{date} AS date

+ 3 - 2
sckw-modules/sckw-product/src/main/java/com/sckw/product/controller/KwpGoodsController.java

@@ -1,8 +1,9 @@
 package com.sckw.product.controller;
 
-import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.product.model.GoodsListExport;
@@ -115,7 +116,7 @@ public class KwpGoodsController {
     public void export(@RequestBody ExportStatisticGoodsListParam params, HttpServletResponse response) {
         List<GoodsListExport> list = kwpGoodsService.export(params);
         if (CollectionUtils.isEmpty(list)) {
-            throw new BusinessException("暂无数据,请确认");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认");
         }
         ExcelUtil.downData(response, GoodsListExport.class, list);
     }

+ 3 - 2
sckw-modules/sckw-product/src/main/java/com/sckw/product/controller/operation/GoodsManagerController.java

@@ -1,7 +1,8 @@
 package com.sckw.product.controller.operation;
 
-import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.product.model.OperationGoodsListExport;
@@ -77,7 +78,7 @@ public class GoodsManagerController {
     public void export(@RequestBody @Validated OperatorGoodsExportQueryVO params, HttpServletResponse response) {
         List<OperationGoodsListExport> list = goodsManagerService.export(params);
         if (CollectionUtils.isEmpty(list)) {
-            throw new BusinessException("暂无数据,请确认");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认");
         }
         ExcelUtil.downData(response, OperationGoodsListExport.class, list);
     }

+ 3 - 2
sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/KwOrderController.java

@@ -1,7 +1,8 @@
 package com.sckw.report.controller;
 
-import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.report.service.KwOrderService;
@@ -85,7 +86,7 @@ public class KwOrderController {
     public void export(@RequestBody @Validated TradeOrderListExportParam params, HttpServletResponse response) {
         List<TradeOrderListExport> list = orderService.export(params);
         if (CollectionUtils.isEmpty(list)) {
-            throw new BusinessException("暂无数据,请确认");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认");
         }
         ExcelUtil.downData(response, TradeOrderListExport.class, list);
     }

+ 2 - 2
sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/KwTransportController.java

@@ -1,6 +1,6 @@
 package com.sckw.report.controller;
 
-import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
@@ -278,7 +278,7 @@ public class KwTransportController {
     public void wayBillOrderExport(@RequestBody @Validated WaybillOrderQuery query, HttpServletResponse response) {
         List<WaybillOrderListExport> list = transportService.wayBillOrderExport(query);
         if (CollectionUtils.isEmpty(list)) {
-            throw new BusinessException("暂无数据,请确认");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认");
         }
         ExcelUtil.downData(response, WaybillOrderListExport.class, list);
     }

+ 7 - 3
sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/operator/TradeOrderManageController.java

@@ -1,7 +1,8 @@
 package com.sckw.report.controller.operator;
 
-import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.report.model.vo.OperatorTOrderContractParam;
@@ -14,7 +15,10 @@ import jakarta.servlet.http.HttpServletResponse;
 import lombok.AllArgsConstructor;
 import org.springframework.http.MediaType;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
 
@@ -67,7 +71,7 @@ public class TradeOrderManageController {
     public void listExport(@RequestBody @Validated OperatorTOrderExportQueryVO params, HttpServletResponse response) {
         List<TradeOrderListExport> list = tradeOrderManageService.export(params);
         if (CollectionUtils.isEmpty(list)) {
-            throw new BusinessException("暂无数据,请确认");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认");
         }
         ExcelUtil.downData(response, TradeOrderListExport.class, list);
     }

+ 5 - 4
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/AcceptCarriageOrderController.java

@@ -1,6 +1,7 @@
 package com.sckw.transport.controller;
 
 import com.alibaba.fastjson.JSONObject;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.model.enums.OrderRuleEnum;
 import com.sckw.core.model.enums.RedisOrderGenerateEnum;
 import com.sckw.core.model.page.PageRes;
@@ -92,11 +93,11 @@ public class AcceptCarriageOrderController {
     public HttpResult exportAcceptCarriage(@Validated @RequestBody AcceptCarriageOrderQuery query) {
         HttpServletResponse response = RequestHolder.getResponse();
         List<AcceptCarriageOrderExcelVo> list = acceptCarriageOrderService.exportAcceptCarriage(query, "2");
-        if (!org.springframework.util.CollectionUtils.isEmpty(list)) {
-            ExcelUtil.download(response, AcceptCarriageOrderExcelVo.class, list);
-            return null;
+        if (org.springframework.util.CollectionUtils.isEmpty(list)){
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE,"暂无数据,请确认");
         }
-        return HttpResult.ok("没有可导出的数据");
+        ExcelUtil.download(response, AcceptCarriageOrderExcelVo.class, list);
+        return null;
     }
 
     /**

+ 11 - 9
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/ConsignOrderController.java

@@ -1,10 +1,12 @@
 package com.sckw.transport.controller;
 
 import com.alibaba.fastjson.JSONObject;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.model.enums.OrderRuleEnum;
 import com.sckw.core.model.enums.RedisOrderGenerateEnum;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.model.vo.BaseList;
+import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.OrderGenerateSeqNoUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
@@ -91,12 +93,12 @@ public class ConsignOrderController {
     @RequestMapping(value = "/consignExport", method = RequestMethod.POST)
     public HttpResult exportConsign(@Validated @RequestBody ConsignOrderQuery query) {
         HttpServletResponse response = RequestHolder.getResponse();
-        List<ConsignOrderExcelVo> list = consignOrderService.exportConsign(query,"1");
-        if (!org.springframework.util.CollectionUtils.isEmpty(list)) {
-            ExcelUtil.download(response, ConsignOrderExcelVo.class, list);
-            return null;
+        List<ConsignOrderExcelVo> list = consignOrderService.exportConsign(query, "1");
+        if (CollectionUtils.isEmpty(list)) {
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认");
         }
-        return HttpResult.ok("没有可导出的数据");
+        ExcelUtil.download(response, ConsignOrderExcelVo.class, list);
+        return null;
     }
 
 
@@ -156,7 +158,7 @@ public class ConsignOrderController {
     /**
      * 托运订单-设置停止接单-提交-针对循环单
      *
-     * @param stopOrderTakingDTO    请求参数
+     * @param stopOrderTakingDTO 请求参数
      * @return
      */
     @RequestMapping(value = "/consignStopDocumentCommit", method = RequestMethod.POST)
@@ -230,9 +232,9 @@ public class ConsignOrderController {
      * @return
      */
     @RequestMapping(value = "/getRejectReason", method = RequestMethod.GET)
-    public HttpResult getRejectReasonById( @NotBlank @RequestParam("id") String id,
-                                           @NotNull @RequestParam("status") Integer status) {
-        return consignOrderService.getRejectReasonById(id,status);
+    public HttpResult getRejectReasonById(@NotBlank @RequestParam("id") String id,
+                                          @NotNull @RequestParam("status") Integer status) {
+        return consignOrderService.getRejectReasonById(id, status);
     }
 
     /**

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

@@ -1,7 +1,7 @@
 package com.sckw.transport.controller;
 
 import com.alibaba.fastjson.JSONObject;
-import com.sckw.core.exception.BusinessException;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.model.enums.OrderRuleEnum;
 import com.sckw.core.model.enums.RedisOrderGenerateEnum;
 import com.sckw.core.model.vo.BaseList;
@@ -312,7 +312,7 @@ public class LogisticsConsignmentController {
     public void logisticOrderByPurchaseOrderIdExport(@RequestParam("ids") @NotBlank(message = "单据id不能为空") String ids, HttpServletResponse response) {
         List<PurchaseLogisticOrderExcelVo> list = logisticsConsignmentService.logisticOrderByPurchaseOrderIdExport(ids);
         if (CollectionUtils.isEmpty(list)) {
-            throw new BusinessException("暂无数据,请确认");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认");
         }
         ExcelUtil.downData(response, PurchaseLogisticOrderExcelVo.class, list);
     }
@@ -328,7 +328,7 @@ public class LogisticsConsignmentController {
     public void logisticOrderBySellOrderIdExport(@RequestParam("ids") @NotBlank(message = "单据id不能为空") String ids, HttpServletResponse response) {
         List<SellLogisticOrderExcelVo> list = logisticsConsignmentService.logisticOrderBySellOrderIdExport(ids);
         if (CollectionUtils.isEmpty(list)) {
-            throw new BusinessException("暂无数据,请确认");
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认");
         }
         ExcelUtil.downData(response, SellLogisticOrderExcelVo.class, list);
     }

+ 8 - 6
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/operationManagement/ManagementLogisticsOrderController.java

@@ -1,6 +1,7 @@
 package com.sckw.transport.controller.operationManagement;
 
 import com.alibaba.fastjson.JSONObject;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
@@ -18,6 +19,7 @@ import jakarta.validation.constraints.NotBlank;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
@@ -87,12 +89,12 @@ public class ManagementLogisticsOrderController {
         log.error("运营管理端-物流订单-导出 query :{}", JSONObject.toJSONString(query));
         HttpServletResponse response = RequestHolder.getResponse();
         List<ManagementLogisticsOrderExcelVo> list = managementLogisticsOrderService.exportLogisticsOrder(query);
-        if (!org.springframework.util.CollectionUtils.isEmpty(list)) {
-//            Translator.translate(list);
-            ExcelUtil.downData(response, ManagementLogisticsOrderExcelVo.class, list);
-            return null;
+        if (CollectionUtils.isEmpty(list)) {
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE, "暂无数据,请确认");
         }
-        return HttpResult.ok("没有可导出的数据");
+//      Translator.translate(list);
+        ExcelUtil.downData(response, ManagementLogisticsOrderExcelVo.class, list);
+        return null;
     }
 
 
@@ -140,7 +142,7 @@ public class ManagementLogisticsOrderController {
      */
     @RequestMapping(value = "/getLogisticsContract", method = RequestMethod.POST)
     public HttpResult getLogisticsContract(@Valid @RequestBody ManagementContractParam contractParam) {
-        log.info("基础档案-物流合同档案-根据合同id获取托运订单列表 query:{}",JSONObject.toJSONString(contractParam));
+        log.info("基础档案-物流合同档案-根据合同id获取托运订单列表 query:{}", JSONObject.toJSONString(contractParam));
         try {
             return managementLogisticsOrderService.getLogisticsContract(contractParam);
         } catch (Exception e) {

+ 6 - 4
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/operationManagement/ManagementWaybillOrderController.java

@@ -1,6 +1,7 @@
 package com.sckw.transport.controller.operationManagement;
 
 import com.alibaba.fastjson.JSONObject;
+import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.config.easyexcel.RequestHolder;
@@ -13,6 +14,7 @@ import jakarta.validation.Valid;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
@@ -79,11 +81,11 @@ public class ManagementWaybillOrderController {
         log.error("运营管理端-运单-导出 query :{}", JSONObject.toJSONString(query));
         HttpServletResponse response = RequestHolder.getResponse();
         List<ManagementWaybillOrderExcelVO> list = managementWaybillOrderService.exportWaybillOrder(query);
-        if (!org.springframework.util.CollectionUtils.isEmpty(list)) {
-            ExcelUtil.download(response, ManagementWaybillOrderExcelVO.class, list);
-            return null;
+        if (CollectionUtils.isEmpty(list)){
+            throw new CustomPromptException(HttpStatus.SUCCESS_CODE,"暂无数据,请确认");
         }
-        return HttpResult.ok("没有可导出的数据");
+        ExcelUtil.download(response, ManagementWaybillOrderExcelVO.class, list);
+        return null;
     }
 
 

+ 16 - 13
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/AcceptCarriageOrderService.java

@@ -1436,18 +1436,19 @@ public class AcceptCarriageOrderService {
             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());
-        statusList.add(CarWaybillEnum.APPROVAL_IN.getCode());
-        statusList.add(CarWaybillEnum.APPROVAL_NO_PASS.getCode());
-        int count = waybillOrderMapper.selectDataByLorderId(id, statusList);
-        if (count > NumberConstant.ZERO) {
-            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());
+//        statusList.add(CarWaybillEnum.APPROVAL_IN.getCode());
+//        statusList.add(CarWaybillEnum.APPROVAL_NO_PASS.getCode());
+//        int count = waybillOrderMapper.selectDataByLorderId(id, statusList);
+        boolean flag = commonService.judgmentWaybillOrderIsFinish(id);
+        if (flag) {
+            throw new BusinessException("检测您现在有运单正在执行中,该订单目前不可完结,请先将运单执行完毕");
         }
         BigDecimal ignoreAmount = logisticsOrder.getAmount().subtract(logisticsOrder.getTotalLoadAmount());
         //修改单据本身数据
@@ -1490,9 +1491,11 @@ public class AcceptCarriageOrderService {
             orderStatusList.add(LogisticsOrderEnum.IN_TRANSIT.getCode());
             List<KwtLogisticsOrder> logisticsOrders = logisticsOrderMapper.selectList(new LambdaQueryWrapper<KwtLogisticsOrder>()
                     .eq(KwtLogisticsOrder::getTOrderId, logisticsOrder.getTOrderId())
-                    .in(KwtLogisticsOrder::getStatus, statusList));
+                    .in(KwtLogisticsOrder::getStatus, orderStatusList));
             if (org.springframework.util.CollectionUtils.isEmpty(logisticsOrders)) {
                 tradeOrder.setIsAllComplete(true);
+            }else {
+                tradeOrder.setIsAllComplete(false);
             }
             tradeOrder.setTOrderId(logisticsOrder.getTOrderId());
 //            tradeOrder.setActualLoadAmount(map.get("totalLoadAmount"));

+ 30 - 4
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/CommonService.java

@@ -9,10 +9,7 @@ import com.sckw.core.common.enums.NumberConstant;
 import com.sckw.core.common.enums.enums.DictEnum;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.Global;
-import com.sckw.core.model.enums.LogisticsOrderEnum;
-import com.sckw.core.model.enums.OrderRuleEnum;
-import com.sckw.core.model.enums.RedisOrderGenerateEnum;
-import com.sckw.core.model.enums.TaxRateTypeEnum;
+import com.sckw.core.model.enums.*;
 import com.sckw.core.utils.*;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.fleet.api.RemoteFleetService;
@@ -30,6 +27,7 @@ import com.sckw.system.api.model.dto.res.UserCacheResDto;
 import com.sckw.transport.common.config.MessageUrlConfig;
 import com.sckw.transport.dao.KwtLogisticsOrderContractMapper;
 import com.sckw.transport.dao.KwtLogisticsOrderMapper;
+import com.sckw.transport.dao.KwtWaybillOrderMapper;
 import com.sckw.transport.model.KwtLogisticsOrder;
 import com.sckw.transport.model.KwtLogisticsOrderContract;
 import com.sckw.transport.model.KwtLogisticsOrderUnit;
@@ -83,6 +81,9 @@ public class CommonService {
     @Autowired
     private KwtLogisticsOrderContractMapper logisticsOrderContractMapper;
 
+    @Autowired
+    private KwtWaybillOrderMapper waybillOrderMapper;
+
     /**
      * 组装返回数据
      *
@@ -750,6 +751,31 @@ public class CommonService {
     }
 
 
+    /**
+     * 验证当前物流订单是否存在未完结的车辆运单
+     *
+     * @param id 对应物流订单id
+     */
+    public boolean judgmentWaybillOrderIsFinish(String id) {
+        boolean flag = false;
+        List<Integer> statusList = new ArrayList<>();
+//        statusList.add(CarWaybillEnum.PENDING_ORDER.getCode());
+        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());
+        statusList.add(CarWaybillEnum.APPROVAL_IN.getCode());
+        statusList.add(CarWaybillEnum.APPROVAL_NO_PASS.getCode());
+//        statusList.add(CarWaybillEnum.APPROVAL_PASS.getCode());
+        int count = waybillOrderMapper.selectDataByLorderId(id, statusList);
+        if (count > NumberConstant.ZERO) {
+            flag = true;
+        }
+        return flag;
+    }
+
     /**
      * @param loadAmount    装货量
      * @param deficitAmount 亏吨量

+ 1 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ConsignOrderService.java

@@ -871,7 +871,7 @@ public class ConsignOrderService {
             throw new BusinessException("当前订单并不属于【待派车】,【运输中】状态");
         }
         //验证当前物流订单是否还存在进行的车辆运单
-        boolean flag = judgmentWaybillOrderIsFinish(id);
+        boolean flag = commonService.judgmentWaybillOrderIsFinish(id);
         if (flag) {
             throw new BusinessException("检测您现在有运单正在执行中,该订单目前不可完结,请先将运单执行完毕!");
         }

+ 4 - 3
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/LogisticsConsignmentService.java

@@ -45,6 +45,7 @@ import com.sckw.transport.model.vo.PurchaseLogisticOrderExcelVo;
 import com.sckw.transport.model.vo.SellLogisticOrderExcelVo;
 import com.sckw.transport.model.vo.WaybillCountVo;
 import io.seata.core.context.RootContext;
+import io.seata.spring.annotation.GlobalTransactional;
 import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
@@ -1228,8 +1229,8 @@ public class LogisticsConsignmentService {
      * @param type           类型
      * @return
      */
-    @Transactional(rollbackFor = Exception.class)
-//    @GlobalTransactional(timeoutMills = 120000)
+//    @Transactional(rollbackFor = Exception.class)
+    @GlobalTransactional()
     public HttpResult orderFinish(OrderFinishDTO orderFinishDTO, String type) {
         HttpResult httpResult = ValidUtil.serviceValid(orderFinishDTO);
         if (!String.valueOf(httpResult.getCode()).equals(String.valueOf(HttpStatus.SUCCESS_CODE))) {
@@ -1290,7 +1291,7 @@ public class LogisticsConsignmentService {
             throw new BusinessException("当前订单并不属于【待派车】,【运输中】状态");
         }
         //验证当前物流订单是否还存在进行的车辆运单
-        boolean flag = judgmentWaybillOrderIsFinish(id);
+        boolean flag = commonService.judgmentWaybillOrderIsFinish(id);
         if (flag) {
             throw new BusinessException("检测您现在有运单正在执行中,该订单目前不可完结,请先将运单执行完毕!");
         }

+ 11 - 21
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ManagementWaybillOrderService.java

@@ -27,6 +27,7 @@ import org.springframework.data.mongodb.core.query.Query;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.regex.Pattern;
@@ -187,28 +188,17 @@ public class ManagementWaybillOrderService {
                 BigDecimal deficitAmount = waybillOrder.getDeficitAmount() == null ?
                         BigDecimal.valueOf(0) : waybillOrder.getDeficitAmount();
                 vo.setDeficitAmount(String.valueOf(deficitAmount));
-                // 存在装卸货差时 计算扣亏量
-                BigDecimal lossAmount = BigDecimal.valueOf(0);
-                BigDecimal loss = waybillOrder.getLoss() == null ? new BigDecimal("0.00") : waybillOrder.getLoss();
-                if (deficitAmount.compareTo(new BigDecimal("0.00")) > 0 && loss.compareTo(new BigDecimal("0.00")) > 0) {
-                    String lossUnit = waybillOrder.getLossUnit();
-                    Map<String, String> LossUnitType = commonService.getDictData(DictTypeEnum.TAX_RATE_TYPE.getType());
-                    String lossUnitString = LossUnitType.get(lossUnit);
+                // 计算扣亏量
+                BigDecimal loadAmount = waybillOrder.getLoadAmount() == null ? new BigDecimal("0.00") : waybillOrder.getLoadAmount();
+                BigDecimal unloadAmount = waybillOrder.getUnloadAmount() == null ? new BigDecimal("0.00") : waybillOrder.getUnloadAmount();
+                BigDecimal deficitRealAmount = commonService.deficitPrice(
+                        waybillOrder.getLoadAmount(),
+                        loadAmount.subtract(unloadAmount),
+                        waybillOrder.getLoss(),
+                        waybillOrder.getLossUnit()
+                );
+                vo.setDeficitRealAmount(deficitRealAmount.setScale(2, RoundingMode.HALF_UP).toString());
 
-                    if (lossUnitString.equals("%")) {
-                        // 百分比
-                        lossAmount = loss.multiply(waybillOrder.getLoadAmount()).divide(BigDecimal.valueOf(100));
-                    } else {
-                        // 千分比
-                        lossAmount = loss.multiply(waybillOrder.getLoadAmount()).divide(BigDecimal.valueOf(1000));
-                    }
-                    lossAmount = deficitAmount.subtract(lossAmount);
-                    if (lossAmount.compareTo(new BigDecimal("0.00")) < 0) {
-                        lossAmount = new BigDecimal("0.00");
-                    }
-                }
-                // 实际扣亏量
-                vo.setDeficitRealAmount(lossAmount.setScale(2).toString());
                 vo.setGoodsPriceUnit(waybillOrder.getGoodsPriceUnit() == null ?
                         null : String.valueOf(waybillOrder.getGoodsPriceUnit()));
                 returnList.add(vo);

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

@@ -352,7 +352,7 @@ public class TransportCommonService {
             return result;
         }
         /**以此字段判别是否存在分包操作*/
-        if (ObjectUtils.isEmpty(logisticsOrder.getPid())) {
+        if (ObjectUtils.isEmpty(logisticsOrder.getPid()) && "1".equals(logisticsOrder.getType())) {
             /**并不存在分包,撤销数据回归到贸易订单,[待接单状态]下才能撤销托运*/
             /**调用dubbo 修改数值*/
             Long tOrderId = logisticsOrder.getTOrderId();

+ 7 - 6
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/WaybillManagementService.java

@@ -187,15 +187,16 @@ public class WaybillManagementService {
                 }
             }
             waybillTicketVO.setDeficitAmount(String.valueOf(info.getDeficitAmount()));
+            // 计算扣亏量
             BigDecimal deficitLoss = info.getLoss() == null ? BigDecimal.valueOf(0) : info.getLoss();
-            BigDecimal deficitAmount = info.getDeficitAmount() == null ? BigDecimal.valueOf(0) : info.getDeficitAmount();
-//            BigDecimal deficitRealAmount = BigDecimal.valueOf(0);
-//            if (deficitAmount.compareTo(BigDecimal.valueOf(0)) > 0) {
-//                deficitRealAmount = deficitLoss.subtract(deficitAmount);
-//            }
             BigDecimal loadAmount = info.getLoadAmount() == null ? new BigDecimal("0.00") : info.getLoadAmount();
             BigDecimal unloadAmount = info.getUnloadAmount() == null ? new BigDecimal("0.00") : info.getUnloadAmount();
-            BigDecimal deficitRealAmount = commonService.deficitPrice(info.getLoadAmount(), loadAmount.subtract(unloadAmount), deficitLoss, info.getLossUnit());
+            BigDecimal deficitRealAmount = commonService.deficitPrice(
+                    info.getLoadAmount(),
+                    loadAmount.subtract(unloadAmount),
+                    deficitLoss,
+                    info.getLossUnit()
+            );
             waybillTicketVO.setDeficitRealAmount(deficitRealAmount.toString());
         }