Ver Fonte

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

xucaiqin há 2 semanas atrás
pai
commit
a27ec4334e

+ 2 - 0
sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/dubbo/TransportRemoteService.java

@@ -204,4 +204,6 @@ public interface TransportRemoteService {
     WaybillOrderSubtaskVo queryWaybillOrderId(Long wayBillOrderId);
 
     List<KwtLogisticsOrderAddressVo> queryByWOrderId(Long wayBillOrderId);
+
+    List<WayContaractbillOrderVo> queryLogisticContractByContTradeIds(Set<Long> contractIds);
 }

+ 9 - 0
sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/model/vo/KwtLogisticsOrderVO.java

@@ -180,5 +180,14 @@ public class KwtLogisticsOrderVO implements Serializable {
     private Integer delFlag;
 
     private static final long serialVersionUID = 1L;
+    /**
+     * 卸货-履约量(自己+下游承运总卸货量)
+     */
+    private BigDecimal totalUnloadAmount;
+
+    /**
+     * 装货-履约量(自己+下游承运总装货量)
+     */
+    private BigDecimal totalLoadAmount;
 
 }

+ 29 - 0
sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/model/vo/WayContaractbillOrderVo.java

@@ -0,0 +1,29 @@
+package com.sckw.transport.api.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * desc 车辆运单
+ * author zk
+ * date 2023/9/6 0006
+ */
+@Data
+public class WayContaractbillOrderVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -2991208083876944003L;
+    /**
+     * 物流合同id
+     */
+    private Long contractId;
+    //物流合同
+    List<KwtLogisticsOrderVO> orderVos;
+
+}

+ 0 - 1
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/entity/KwcContractTrade.java

@@ -58,7 +58,6 @@ public class KwcContractTrade implements Serializable {
     /**
      * 结束日期
      */
-    @TableField(insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
     private Date endTime;
 
     /**

+ 69 - 22
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/operateService/KwcContractLogisticsService.java

@@ -46,7 +46,9 @@ import com.sckw.system.api.model.dto.res.KwsUserResDto;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
 import com.sckw.system.api.model.dto.res.UserCacheResDto;
 import com.sckw.transport.api.dubbo.TransportRemoteService;
+import com.sckw.transport.api.model.vo.KwtLogisticsOrderVO;
 import com.sckw.transport.api.model.vo.RWaybillSubOrderVo;
+import com.sckw.transport.api.model.vo.WayContaractbillOrderVo;
 import jakarta.servlet.http.HttpServletResponse;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -1140,13 +1142,19 @@ public class KwcContractLogisticsService {
             logTradeOrderIdAndWaybillMap = rWaybillSubOrderVos.stream()
                     .collect(Collectors.toMap(RWaybillSubOrderVo::getLogContractId, Function.identity(), (x, y) -> x));
         }
-
+        List<WayContaractbillOrderVo> wayContaractbillOrderVos = transportRemoteService.queryLogisticContractByContTradeIds(contractIds);
+        Map<Long, WayContaractbillOrderVo> contractIdAndLogisticsOrderMap = Optional.ofNullable(wayContaractbillOrderVos)
+                .orElse(List.of())
+                .stream()
+                .collect(Collectors.toMap(WayContaractbillOrderVo::getContractId, Function.identity(), (x, y) -> x));
         Map<Long, UserCacheResDto> finalLongUserCacheResDtoMap = longUserCacheResDtoMap;
         Map<String, KwcContractLogisticsUnit> finalContractUniTypeAndUnitMap = contractUniTypeAndUnitMap;
         Map<Long, List<KwcContractLogisticsGoods>> finalContractIdAndGoodsMap = contractIdAndGoodsMap;
         Map<Long, RWaybillSubOrderVo> finalLogTradeOrderIdAndWaybillMap = logTradeOrderIdAndWaybillMap;
         List<QueryLogisticListResp> resp = records.stream()
-                .map(r -> getQueryLogisticListResp(r, finalContractUniTypeAndUnitMap, finalContractIdAndGoodsMap, finalLongUserCacheResDtoMap, finalLogTradeOrderIdAndWaybillMap))
+                .map(r -> getQueryLogisticListResp(r, finalContractUniTypeAndUnitMap,
+                        finalContractIdAndGoodsMap, finalLongUserCacheResDtoMap, finalLogTradeOrderIdAndWaybillMap,
+                        contractIdAndLogisticsOrderMap))
                 .collect(Collectors.toList());
 
         return PageDataResult.of(page, resp);
@@ -1157,7 +1165,8 @@ public class KwcContractLogisticsService {
                                                                   Map<String, KwcContractLogisticsUnit> finalContractUniTypeAndUnitMap,
                                                                   Map<Long, List<KwcContractLogisticsGoods>> finalContractIdAndGoodsMap,
                                                                   Map<Long, UserCacheResDto> finalLongUserCacheResDtoMap,
-                                                                  Map<Long, RWaybillSubOrderVo> logTradeOrderIdAndWaybillMap) {
+                                                                  Map<Long, RWaybillSubOrderVo> logTradeOrderIdAndWaybillMap,
+                                                                  Map<Long, WayContaractbillOrderVo> contractIdAndLogisticsOrderMap) {
         QueryLogisticListResp queryLogisticListResp = new QueryLogisticListResp();
         queryLogisticListResp.setId(r.getId());
         queryLogisticListResp.setContractStatus(r.getStatus());
@@ -1183,8 +1192,7 @@ public class KwcContractLogisticsService {
         //设置派车方式和派车方式描述字段
         queryLogisticListResp.setDispatchWay(r.getDispatchWay());
         queryLogisticListResp.setDispatchWayDesc(DispatchingTypeEnum.getLabel(r.getDispatchWay()));
-        queryLogisticListResp.setPerformedAmount(Objects.nonNull(r.getPerformedAmount())
-                ? r.getPerformedAmount().toPlainString() : null);
+
         List<KwcContractLogisticsGoods> goods = finalContractIdAndGoodsMap.get(r.getId());
         if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(goods)){
             boolean b = goods.stream().anyMatch(g -> Objects.isNull(g.getAmount()));
@@ -1202,25 +1210,64 @@ public class KwcContractLogisticsService {
         RWaybillSubOrderVo waybillSubOrderVo = logTradeOrderIdAndWaybillMap.getOrDefault(r.getId(), new RWaybillSubOrderVo());
         List<RWaybillSubOrderVo.BillSubOrder> subOrders = waybillSubOrderVo.getSubOrders();
         BigDecimal totalTransportAmount = BigDecimal.ZERO;
-        if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(subOrders)){
-            String billMode = subOrders.get(0).getBillMode();
-            if (org.apache.commons.lang3.StringUtils.equals(billMode, DictEnum.LOAD_UNLOAD_WAY_1.getValue())){
-                totalTransportAmount = subOrders.stream()
-                        .filter(x->Arrays.asList(CarWaybillV1Enum.COMPLETION_LOADING.getCode(),CarWaybillV1Enum.COMPLETED.getCode()).contains(x.getStatus()))
-                        .map(RWaybillSubOrderVo.BillSubOrder::getLoadAmount)
-                        .filter(Objects::nonNull)
-                        .reduce(BigDecimal.ZERO, BigDecimal::add);
-            }else {
-                totalTransportAmount = subOrders.stream()
-                        .filter(x->Objects.equals(x.getStatus(), CarWaybillV1Enum.COMPLETED.getCode()))
-                        .map(RWaybillSubOrderVo.BillSubOrder::getUnloadAmount)
-                        .filter(Objects::nonNull)
-                        .reduce(BigDecimal.ZERO, BigDecimal::add);
+        BigDecimal totalAmount = BigDecimal.ZERO;
+//        BigDecimal performedAmount = BigDecimal.ZERO;
+//        if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(subOrders)){
+//            String billMode = subOrders.get(0).getBillMode();
+//            if (org.apache.commons.lang3.StringUtils.equals(billMode, DictEnum.LOAD_UNLOAD_WAY_1.getValue())){
+//                totalTransportAmount = subOrders.stream()
+//                        .filter(x->Arrays.asList(CarWaybillV1Enum.COMPLETION_LOADING.getCode(),CarWaybillV1Enum.COMPLETED.getCode()).contains(x.getStatus()))
+//                        .map(RWaybillSubOrderVo.BillSubOrder::getLoadAmount)
+//                        .filter(Objects::nonNull)
+//                        .reduce(BigDecimal.ZERO, BigDecimal::add);
+//            }else {
+//                totalTransportAmount = subOrders.stream()
+//                        .filter(x->Objects.equals(x.getStatus(), CarWaybillV1Enum.COMPLETED.getCode()))
+//                        .map(RWaybillSubOrderVo.BillSubOrder::getUnloadAmount)
+//                        .filter(Objects::nonNull)
+//                        .reduce(BigDecimal.ZERO, BigDecimal::add);
+//            }
+//
+//            queryLogisticListResp.setTotalTransportAmount(totalTransportAmount.setScale(2, RoundingMode.HALF_UP).toPlainString());
+//        }
+        WayContaractbillOrderVo wayContaractbillOrderVo = contractIdAndLogisticsOrderMap.get(r.getId());
+        if (Objects.nonNull(wayContaractbillOrderVo) ){
+            List<KwtLogisticsOrderVO> orderVos = wayContaractbillOrderVo.getOrderVos();
+            if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(orderVos)){
+                String billingMode = orderVos.get(0).getBillingMode();
+                if (org.apache.commons.lang3.StringUtils.equals(billingMode, DictEnum.LOAD_UNLOAD_WAY_1.getValue())){
+                    totalTransportAmount = orderVos.stream()
+                            .map(KwtLogisticsOrderVO::getTotalLoadAmount)
+                            .filter(Objects::nonNull)
+                            .reduce(BigDecimal.ZERO, BigDecimal::add);
+
+
+                    totalAmount = orderVos.stream()
+                            .filter(x->Arrays.asList(CarWaybillV1Enum.COMPLETION_LOADING.getCode(),CarWaybillV1Enum.COMPLETED.getCode()).contains(x.getStatus()))
+                            .map(vo -> {
+                                BigDecimal loadAmount = vo.getTotalLoadAmount();
+                                BigDecimal price = vo.getPrice() != null ? vo.getPrice() : BigDecimal.ONE;
+                                return loadAmount != null ? loadAmount.multiply(price) : BigDecimal.ZERO;
+                            })
+                            .reduce(BigDecimal.ZERO, BigDecimal::add);
+                }else {
+                    totalTransportAmount = orderVos.stream()
+                            .map(KwtLogisticsOrderVO::getTotalUnloadAmount)
+                            .filter(Objects::nonNull)
+                            .reduce(BigDecimal.ZERO, BigDecimal::add);
+                    totalAmount = orderVos.stream()
+                            .filter(x->Arrays.asList(CarWaybillV1Enum.COMPLETION_LOADING.getCode(),CarWaybillV1Enum.COMPLETED.getCode()).contains(x.getStatus()))
+                            .map(vo -> {
+                                BigDecimal loadAmount = vo.getTotalUnloadAmount();
+                                BigDecimal price = vo.getPrice() != null ? vo.getPrice() : BigDecimal.ONE;
+                                return loadAmount != null ? loadAmount.multiply(price) : BigDecimal.ZERO;
+                            })
+                            .reduce(BigDecimal.ZERO, BigDecimal::add);
+                }
             }
-            queryLogisticListResp.setTotalTransportAmount(totalTransportAmount.setScale(2, RoundingMode.HALF_UP).toPlainString());
         }
-
-
+        queryLogisticListResp.setPerformedAmount(totalTransportAmount.setScale(2, RoundingMode.HALF_UP).toPlainString());
+        queryLogisticListResp.setTotalTransportAmount(totalAmount.setScale(2, RoundingMode.HALF_UP).toPlainString());
         String startDate = DateUtils.format(r.getStartTime(), DateUtils.DATE_PATTERN);
         queryLogisticListResp.setStartDate(startDate);
         String endDate = DateUtils.format(r.getEndTime(), DateUtils.DATE_PATTERN);

+ 31 - 0
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/operateService/KwcContractTradeService.java

@@ -1193,6 +1193,8 @@ public class KwcContractTradeService {
         log.info("补充合同请求参数,req:{}", JSON.toJSONString(req));
         //校验标的信息是否有重复
         checkParams(req);
+        //校验合同基本信息
+        checkParam(req.getBaseInfo());
         //保存补充合同
         long contactId = new IdWorker(1L).nextId();
         saveTradeContract(req, contactId);
@@ -1248,6 +1250,12 @@ public class KwcContractTradeService {
         });
 
         kwcContractTradeGoodsRepository.saveOrUpdateBatch(saveOrUpdateTradeGoods);
+
+        //存单位信息
+        TradeBaseInfoReqVo baseInfoReqVo = new TradeBaseInfoReqVo();
+        org.springframework.beans.BeanUtils.copyProperties(req.getBaseInfo(), baseInfoReqVo);
+        kwcContractTradeUnitService.saveContractTradeUnit(contactId, baseInfoReqVo);
+
     }
 
     private static void buildTradeGoods(SupplyContractTradeReq req, SupplyContractTradeReq.TradeGoodsInfo g,
@@ -1359,6 +1367,29 @@ public class KwcContractTradeService {
         }
     }
 
+    private void checkParam(SupplyContractTradeReq.TradeBaseInfo baseInfo) {
+        if (Objects.nonNull(baseInfo)) {
+            if (StringUtils.isNotBlank(baseInfo.getContractCode()) && baseInfo.getContractCode().length() > 20) {
+                throw new SystemException("合同编号超长!");
+            }
+
+            if (StringUtils.isNotBlank(baseInfo.getContractName()) && baseInfo.getContractName().length() > 20) {
+                throw new SystemException("合同名称超长!");
+            }
+        }
+
+        if (Objects.equals(DispatchWayEnums.MANUAL_DISPATCH.getCode(), baseInfo.getDispatchWay())) {
+            if (baseInfo.getConsignment() == null) {
+                throw new SystemException("派车方式为手动派单时,托运方式不能为空!");
+            }
+        }
+        KwcContractTrade kwcContractTrade = kwcContractTradeRepository.queryByContractNo(baseInfo.getContractCode());
+        if (Objects.nonNull(kwcContractTrade)) {
+            throw new SystemException("合同编号已存在!");
+        }
+    }
+
+
     private static boolean hasDuplicateGoodsIds(List<SupplyContractTradeReq.TradeGoodsInfo> goodsInfo) {
         if (goodsInfo == null || goodsInfo.isEmpty()) {
             return false;

+ 81 - 4
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dubbo/TransportServiceImpl.java

@@ -60,6 +60,7 @@ import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.apache.dubbo.config.annotation.DubboService;
+import org.checkerframework.checker.units.qual.C;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -72,6 +73,7 @@ import java.time.ZoneId;
 import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * @author lfdc
@@ -1241,10 +1243,11 @@ public class TransportServiceImpl implements TransportRemoteService {
             rWaybillSubOrderVo.setLogContractId(x.getContractId());
             KwtLogisticsOrder logisticsOrder = logIdAndLogOrderMap.getOrDefault(x.getLOrderId(), new KwtLogisticsOrder());
             KwtLogisticsOrderGoods goods = finalLogisticsOrderGoodsMap.getOrDefault(x.getLOrderId(), new KwtLogisticsOrderGoods());
-           List<KwtWaybillOrderSubtask> subtasks = logIdAndWaybillOrderSubtasksMap.getOrDefault(x.getLOrderId(), new ArrayList<>());
-            subtasks.stream()
-                    .map(s -> getRWaybillSubOrderVo(s, goods.getGoodsId(),logisticsOrder))
-                            .collect(Collectors.toList());
+            List<KwtWaybillOrderSubtask> subtasks = logIdAndWaybillOrderSubtasksMap.getOrDefault(x.getLOrderId(), new ArrayList<>());
+            List<RWaybillSubOrderVo.BillSubOrder> subOrders = subtasks.stream()
+                    .map(s -> getRWaybillSubOrderVo(s, goods.getGoodsId(), logisticsOrder))
+                    .collect(Collectors.toList());
+            rWaybillSubOrderVo.setSubOrders(subOrders);
             return rWaybillSubOrderVo;
         }).collect(Collectors.toList());
 
@@ -1491,4 +1494,78 @@ public class TransportServiceImpl implements TransportRemoteService {
 
     }
 
+    @Override
+    public List<WayContaractbillOrderVo> queryLogisticContractByContTradeIds(Set<Long> contractIds) {
+        if (CollectionUtils.isEmpty(contractIds)){
+            return List.of();
+        }
+        //根据物流合同查询物流id
+        List<KwtLogisticsOrderContract> logisticsOrderContracts = logisticsOrderContractRepository.queryByLogContractIds(contractIds);
+        if (CollectionUtils.isEmpty(logisticsOrderContracts)){
+            return List.of();
+        }
+        Map<Long, List<KwtLogisticsOrderContract>> logContractIdAndContractsMap = logisticsOrderContracts.stream().collect(Collectors.groupingBy(KwtLogisticsOrderContract::getContractId));
+        List<Long> logIds = logisticsOrderContracts.stream()
+                .map(KwtLogisticsOrderContract::getLOrderId)
+                .distinct()
+                .collect(Collectors.toList());
+        if (CollectionUtils.isEmpty(logIds)){
+            return List.of();
+        }
+        //查询物流订单
+        List<KwtLogisticsOrder> kwtLogisticsOrders = logisticsOrderRepository.queryByLogisticsOrderIds(logIds);
+        if (CollectionUtils.isEmpty(kwtLogisticsOrders)){
+            return List.of();
+        }
+        List<WayContaractbillOrderVo> result = Lists.newArrayList();
+        logContractIdAndContractsMap.forEach((contractId, contracts) -> {
+            WayContaractbillOrderVo wayContaractbillOrderVo = new WayContaractbillOrderVo();
+            wayContaractbillOrderVo.setContractId(contractId);
+            List<KwtLogisticsOrder> logisticsOrders = kwtLogisticsOrders.stream()
+                    .filter(log -> contracts.contains(log.getId()))
+                    .collect(Collectors.toList());
+            List<KwtLogisticsOrderVO> kwtLogisticsOrderVOS = Optional.ofNullable(logisticsOrders).orElse(List.of()).stream().map(x -> {
+                KwtLogisticsOrderVO rWaybillOrderVo = new KwtLogisticsOrderVO();
+                rWaybillOrderVo.setId(x.getId());
+                rWaybillOrderVo.setEntId(x.getEntId());
+                rWaybillOrderVo.setTOrderId(x.getTOrderId());
+                rWaybillOrderVo.setTOrderNo(x.getTOrderNo());
+                rWaybillOrderVo.setLOrderNo(x.getLOrderNo());
+                rWaybillOrderVo.setPid(x.getPid());
+                rWaybillOrderVo.setSettlementCycle(x.getSettlementCycle());
+                rWaybillOrderVo.setBillingMode(x.getBillingMode());
+                rWaybillOrderVo.setPrice(x.getPrice());
+                rWaybillOrderVo.setPriceType(x.getPriceType());
+                rWaybillOrderVo.setAmount(x.getAmount());
+                rWaybillOrderVo.setUnit(x.getUnit());
+                rWaybillOrderVo.setLoss(x.getLoss());
+                rWaybillOrderVo.setLossUnit(x.getLossUnit());
+                rWaybillOrderVo.setGoodsPrice(x.getGoodsPrice());
+                rWaybillOrderVo.setGoodsPriceUnit(x.getGoodsPriceUnit());
+                rWaybillOrderVo.setSubcontractAmount(x.getSubcontractAmount());
+                rWaybillOrderVo.setEntrustAmount(x.getEntrustAmount());
+                rWaybillOrderVo.setUnloadAmount(x.getUnloadAmount());
+                rWaybillOrderVo.setLoadAmount(x.getLoadAmount());
+                rWaybillOrderVo.setIgnoreAmount(x.getIgnoreAmount());
+                rWaybillOrderVo.setDeficitAmount(x.getDeficitAmount());
+                rWaybillOrderVo.setDeficitPrice(x.getDeficitPrice());
+                rWaybillOrderVo.setPayment(x.getPayment());
+                rWaybillOrderVo.setTaxRate(x.getTaxRate());
+                rWaybillOrderVo.setTotalLoadAmount(x.getTotalLoadAmount());
+                rWaybillOrderVo.setTotalUnloadAmount(x.getTotalUnloadAmount());
+                rWaybillOrderVo.setRemark(x.getRemark());
+                rWaybillOrderVo.setStatus(x.getStatus());
+                rWaybillOrderVo.setCreateBy(x.getCreateBy());
+                rWaybillOrderVo.setCreateTime(x.getCreateTime());
+                rWaybillOrderVo.setUpdateBy(x.getUpdateBy());
+                rWaybillOrderVo.setUpdateTime(x.getUpdateTime());
+                rWaybillOrderVo.setDelFlag(x.getDelFlag());
+                return rWaybillOrderVo;
+            }).collect(Collectors.toList());
+            wayContaractbillOrderVo.setOrderVos(kwtLogisticsOrderVOS);
+            result.add(wayContaractbillOrderVo);
+        });
+        return result;
+    }
+
 }

+ 5 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/LogisticsOrderDetailResp.java

@@ -56,6 +56,11 @@ public class LogisticsOrderDetailResp implements Serializable {
     public static class ContractInfoVO implements Serializable{
         @Serial
         private static final long serialVersionUID = 572103438745722443L;
+        /**
+         * 物流合同id
+         */
+        @Schema(description = "物流合同id")
+        private Long contractId;
         /**
          * 物流合同编号
          */

+ 3 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/repository/KwtLogisticsOrderContractRepository.java

@@ -39,6 +39,8 @@ public class KwtLogisticsOrderContractRepository extends ServiceImpl<KwtLogistic
     }
 
     public List<KwtLogisticsOrderContract> queryByLogContractIds(Set<Long> logContractIds) {
-        return null;
+        return list(Wrappers.<KwtLogisticsOrderContract>lambdaQuery()
+                .eq(KwtLogisticsOrderContract::getDelFlag,0)
+                .in(KwtLogisticsOrderContract::getContractId,logContractIds));
     }
 }

+ 15 - 2
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwfTaskService.java

@@ -29,8 +29,10 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.dubbo.config.annotation.DubboReference;
+import org.jetbrains.annotations.NotNull;
 import org.springframework.stereotype.Service;
 
+import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.time.YearMonth;
 import java.time.ZoneId;
@@ -72,10 +74,18 @@ public class KwfTaskService {
             log.info("该企业下物流订单数据,企业id:{}", entId);
             return new TaskStatisticsVo();
         }
+        Date date = new Date();
+        // 获取昨日开始时间
+        Date startDate = DateUtils.getStartOfDay(date);
+        // 获取昨日结束时间
+        Date endDate = DateUtils.getEndOfDay(date);
+
         //查询子运单
         List<KwtWaybillOrderSubtask> kwtWaybillOrderSubtasks = waybillOrderSubtaskDao.selectList(Wrappers.<KwtWaybillOrderSubtask>lambdaQuery()
                 .in(KwtWaybillOrderSubtask::getLOrderId, logOrderIds)
-                .eq(BaseModel::getDelFlag, 0));
+                .eq(BaseModel::getDelFlag, 0)
+                .ge(BaseModel::getCreateTime, startDate)
+                .le(BaseModel::getCreateTime, endDate));
         if(org.apache.commons.collections4.CollectionUtils.isEmpty(kwtWaybillOrderSubtasks)){
             log.info("该企业下子运单的订单数据不存在,企业id:{}", entId);
             return new TaskStatisticsVo();
@@ -97,7 +107,10 @@ public class KwfTaskService {
         }else {
             totalCount = kwtWaybillOrderStream.size();
         }
-        List<Integer> tasking = Arrays.asList(CarWaybillV1Enum.CANCELLED.getCode(), CarWaybillV1Enum.COMPLETED.getCode());
+        List<Integer> tasking = Arrays.asList(CarWaybillV1Enum.CANCELLED.getCode(),
+                CarWaybillV1Enum.COMPLETED.getCode(),
+                CarWaybillV1Enum.COMPLETION_LOADING.getCode(),
+                CarWaybillV1Enum.REVIEW_REJECTION.getCode());
         //处理中的任务数
         long taskingCount = waybillOrder.stream()
                 .filter(w -> !tasking.contains(w.getStatus()) && StringUtils.isNotBlank(w.getTruckNo()))

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

@@ -2826,6 +2826,7 @@ public class KwtLogisticsConsignmentService {
     private static void setContractInfo(KwtLogisticsOrderContract orderContract, KwcContractLogisticsDto tradeContractResDto, LogisticsOrderDetailResp logisticsOrderDetailResp) {
         LogisticsOrderDetailResp.ContractInfoVO contractInfoVO = new LogisticsOrderDetailResp.ContractInfoVO();
         if (Objects.nonNull(tradeContractResDto)) {
+            contractInfoVO.setContractId(tradeContractResDto.getId());
             contractInfoVO.setContractNo(tradeContractResDto.getContractNo());
             contractInfoVO.setContractName(tradeContractResDto.getName());
         }

+ 2 - 2
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtWaybillOrderV1Service.java

@@ -4216,8 +4216,8 @@ public class KwtWaybillOrderV1Service {
 
         KwtLogisticsOrder kwtLogisticsOrder = new KwtLogisticsOrder();
         kwtLogisticsOrder.setId(kwtLogistics.getId());
-        kwtLogisticsOrder.setLoadAmount(loadAmount.add(subLoadAmount));
-        kwtLogisticsOrder.setUnloadAmount(unloadAmount.add(subUnloadAmount));
+        kwtLogisticsOrder.setTotalLoadAmount(loadAmount.add(subLoadAmount));
+        kwtLogisticsOrder.setTotalUnloadAmount(unloadAmount.add(subUnloadAmount));
 
         //如果审核的状态是 完成,那么就要去查询物流订单状态是完结中,并且所有物流订单下的运单全部是完成或者取消如果是则更新状态为已完成
         if (Objects.equals(kwtLogistics.getStatus(), LogisticsOrderV1Enum.NEARING_COMPLETION.getCode()) && Objects.equals(status,CarWaybillV1Enum.COMPLETED.getCode())){