Explorar el Código

1:修复bug-SAS-791
2:修复bug-SAS-788
3:新增企业端app统计接口

lengfaqiang hace 2 años
padre
commit
49c212a958

+ 19 - 5
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/enterpriseApp/AppAcceptCarriageController.java

@@ -4,13 +4,12 @@ import com.alibaba.fastjson.JSONObject;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.transport.model.param.AcceptCarriageOrderQuery;
 import com.sckw.transport.service.AcceptCarriageOrderService;
+import com.sckw.transport.service.KwtWaybillOrderService;
 import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotBlank;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author lfdc
@@ -18,12 +17,16 @@ import org.springframework.web.bind.annotation.RestController;
  * @date 2023-08-21 16:08:41
  */
 @Slf4j
-@RestController("/appKwtAcceptCarriageOrder")
+@RestController
+@RequestMapping("/appKwtAcceptCarriageOrder")
 public class AppAcceptCarriageController {
 
     @Autowired
     private AcceptCarriageOrderService carriageOrderService;
 
+    @Autowired
+    private KwtWaybillOrderService waybillOrderService;
+
     @RequestMapping(name = "企业app订单管理数据承运订单统计", path = "/statisticsCarriage", method = RequestMethod.POST)
     public HttpResult statisticsCarriage(@Valid @RequestBody AcceptCarriageOrderQuery query) {
         log.info("企业app订单管理数据承运订单统计 query :{}", JSONObject.toJSONString(query));
@@ -35,4 +38,15 @@ public class AppAcceptCarriageController {
         }
     }
 
+    @RequestMapping(name = "企业app承运订单详情统计", path = "/statisticsCarriageByOrderId", method = RequestMethod.GET)
+    public HttpResult statisticsCarriageByOrderId(@NotBlank(message = "订单id不能为空") @RequestParam("orderId") String orderId) {
+        log.info("企业app承运订单详情统计 query :{}", orderId);
+        try {
+            return HttpResult.ok(waybillOrderService.statisticsByOrderId(orderId,"2"));
+        } catch (Exception e) {
+            log.error("企业app承运订单详情统计失败  query:{}, error:{}", orderId, e.getMessage(), e);
+            return HttpResult.error(e.getMessage());
+        }
+    }
+
 }

+ 19 - 5
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/enterpriseApp/AppConsignController.java

@@ -4,13 +4,12 @@ import com.alibaba.fastjson.JSONObject;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.transport.model.param.AcceptCarriageOrderQuery;
 import com.sckw.transport.service.ConsignOrderService;
+import com.sckw.transport.service.KwtWaybillOrderService;
 import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotBlank;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author lfdc
@@ -18,12 +17,16 @@ import org.springframework.web.bind.annotation.RestController;
  * @date 2023-08-21 16:08:41
  */
 @Slf4j
-@RestController("appKwtConsignOrder")
+@RestController
+@RequestMapping("/appKwtConsignOrder")
 public class AppConsignController {
 
     @Autowired
     private ConsignOrderService consignOrderService;
 
+    @Autowired
+    private KwtWaybillOrderService waybillOrderService;
+
     @RequestMapping(name = "企业app订单管理数据托运订单统计", path = "/statisticsConsign", method = RequestMethod.POST)
     public HttpResult statisticsConsign(@Valid  @RequestBody AcceptCarriageOrderQuery query) {
         log.info("企业app订单管理数据托运订单统计 query :{}", JSONObject.toJSONString(query));
@@ -35,4 +38,15 @@ public class AppConsignController {
         }
     }
 
+
+    @RequestMapping(name = "企业app托运订单详情统计", path = "/statisticsConsignByOrderId", method = RequestMethod.GET)
+    public HttpResult statisticsConsignByOrderId(@NotBlank(message = "订单id不能为空") @RequestParam("orderId") String orderId) {
+        log.info("企业app托运订单详情统计 query :{}",orderId);
+        try {
+            return HttpResult.ok(waybillOrderService.statisticsByOrderId(orderId,"1"));
+        } catch (Exception e) {
+            log.error("企业app托运订单详情统计失败  query:{}, error:{}", orderId, e.getMessage(), e);
+            return HttpResult.error(e.getMessage());
+        }
+    }
 }

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

@@ -213,6 +213,15 @@ public interface KwtLogisticsOrderMapper extends BaseMapper<KwtLogisticsOrder> {
                                                      @Param("entId") Long entId
     );
 
+    /**
+     * 物流订单号+状态统计数量
+     *
+     * @param orderId
+     * @param orderStatusList
+     * @return
+     */
+    Integer selectCountByLorderId(@Param("orderId") String orderId, @Param("orderStatusList") List<Integer> orderStatusList);
+
 //    List<TableTops> countAppLogisticsOrderListByStatus(@Param("type") String type,@Param("entId") Long entId
 //    );
 }

+ 5 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/LogisticsOrderDTO.java

@@ -74,4 +74,9 @@ public class LogisticsOrderDTO {
      * 指派人
      */
     private String createBy;
+
+    /**
+     * 指派人
+     */
+    private String createName;
 }

+ 41 - 2
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/OrderDetailVO.java

@@ -3,7 +3,9 @@ package com.sckw.transport.model.vo;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
+import java.math.BigDecimal;
 import java.time.LocalDate;
+import java.util.Date;
 
 /**
  * @author lfdc
@@ -93,12 +95,12 @@ public class OrderDetailVO {
     /**
      * 计划结束时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private LocalDate scheduleEndTime;
     /**
      * 计划开始时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private LocalDate scheduleStartTime;
     /**
      * 结算周期
@@ -158,4 +160,41 @@ public class OrderDetailVO {
      * 卸货详细地址
      */
     private String unloadAddressDetail;
+
+    /**
+     * 卸货-履约量(自己+下游承运总卸货量)
+     */
+    private BigDecimal totalUnloadAmount;
+
+    /**
+     * 装货-履约量(自己+下游承运总装货量)
+     */
+    private BigDecimal totalLoadAmount;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 付款方式
+     */
+    private Long payment;
+
+    /**
+     * 付款方式翻译
+     */
+    private String paymentLabel;
+
+    /**
+     * 签约方式
+     */
+    private Integer signingWay;
+
+    /**
+     * 签约方式翻译
+     */
+    private String signingWayLabel;
+
 }

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

@@ -1,5 +1,6 @@
 package com.sckw.transport.model.vo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.math.BigDecimal;
@@ -27,10 +28,12 @@ public class WaybillDetailVO {
     /**
      * 实际装货时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date stowageDateTime;
     /**
      * 实际卸货时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date unloadDateTime;
     /**
      * 运单类型
@@ -67,10 +70,12 @@ public class WaybillDetailVO {
     /**
      * 计划开始时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date startTime;
     /**
      * 计划结束时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endTime;
 
 }

+ 219 - 99
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtWaybillOrderService.java

@@ -1,6 +1,8 @@
 package com.sckw.transport.service;
 
 import com.github.pagehelper.PageHelper;
+import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.enums.CarWaybillEnum;
 import com.sckw.core.model.enums.LogisticsOrderEnum;
@@ -35,6 +37,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
+
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.*;
@@ -80,11 +83,11 @@ public class KwtWaybillOrderService {
 
     /**
      * @param driverId 司机ID
-     * @desc 统计司机任务数(待接单/出车/执行/完结)
+     * @desc 统计司机任务数(待接单 / 出车 / 执行 / 完结)
      * @author zk
      * @date 2023/8/1
      **/
-    public Map findStatisticsCountByDriver(Long driverId){
+    public Map findStatisticsCountByDriver(Long driverId) {
         return waybillOrderDao.findStatisticsCountByDriver(driverId);
     }
 
@@ -94,7 +97,7 @@ public class KwtWaybillOrderService {
      * @author zk
      * @date 2023/8/1
      **/
-    public Map findStatisticsSumByDriver(Map params){
+    public Map findStatisticsSumByDriver(Map params) {
         return waybillOrderDao.findStatisticsSumByDriver(params);
     }
 
@@ -104,7 +107,7 @@ public class KwtWaybillOrderService {
      * @author zk
      * @date 2023/8/1
      **/
-    public List<WaybillOrderDriverVo> findWaybillOrderByDriver(Map params){
+    public List<WaybillOrderDriverVo> findWaybillOrderByDriver(Map params) {
         /**参数处理**/
         //业务状态busStatus  1待接单/2出车/3执行/4完结
         Integer busStatus = Integer.parseInt(StringUtils.objectStr(params.get("busStatus")));
@@ -125,13 +128,13 @@ public class KwtWaybillOrderService {
 
         /**数据组装**/
         List<Long> entIds = new ArrayList<>();
-        for (WaybillOrderDriverVo waybillOrder:waybillOrders) {
+        for (WaybillOrderDriverVo waybillOrder : waybillOrders) {
             entIds.add(waybillOrder.getCarrierEntId());
         }
         //企业数据集
         entIds = entIds.stream().distinct().collect(Collectors.toList());
         Map<Long, EntCacheResDto> ents = remoteSystemService.queryEntCacheMapByIds(entIds);
-        for (WaybillOrderDriverVo waybillOrder:waybillOrders) {
+        for (WaybillOrderDriverVo waybillOrder : waybillOrders) {
             EntCacheResDto ent = ents == null ? null : ents.get(waybillOrder.getCarrierEntId());
             waybillOrder.setCarrierFirmName(ent != null ? ent.getFirmName() : null);
         }
@@ -144,7 +147,7 @@ public class KwtWaybillOrderService {
      * @author zk
      * @date 2023/8/2
      **/
-    public HttpResult changeWaybillOrder(@RequestParam("wOrderId") Long wOrderId){
+    public HttpResult changeWaybillOrder(@RequestParam("wOrderId") Long wOrderId) {
         //车辆运单信息
         KwtWaybillOrder waybillOrder = waybillOrderDao.selectById(wOrderId);
         //循环派车信息
@@ -156,7 +159,7 @@ public class KwtWaybillOrderService {
         Map<String, Object> result = new HashMap();
         result.put("id", wOrderId);
         result.put("wOrderId", wOrderId);
-        if (waybillOrder != null){
+        if (waybillOrder != null) {
             result.put("wOrderNo", waybillOrder.getWOrderNo());
             result.put("status", waybillOrder.getStatus());
             result.put("truckNo", waybillOrder.getTruckNo());
@@ -191,7 +194,7 @@ public class KwtWaybillOrderService {
      * @author zk
      * @date 2023/8/2
      **/
-    public HttpResult changeDriver(@RequestBody @Valid ChangeDriverDto params){
+    public HttpResult changeDriver(@RequestBody @Valid ChangeDriverDto params) {
         /**数据校验**/
         SckwWaybillOrder wOrder = new SckwWaybillOrder();
         //车辆运单信息
@@ -238,7 +241,7 @@ public class KwtWaybillOrderService {
      * @author zk
      * @date 2023/8/2
      **/
-    public HttpResult changeTruck(@RequestBody @Valid ChangeTruckDto params){
+    public HttpResult changeTruck(@RequestBody @Valid ChangeTruckDto params) {
         /**数据校验**/
         SckwWaybillOrder wOrder = new SckwWaybillOrder();
         //车辆运单信息
@@ -284,13 +287,13 @@ public class KwtWaybillOrderService {
 
     /**
      * @param circulateId 循环派车信息ID
-     * @param driver 司机信息
-     * @param truck 车辆信息
+     * @param driver      司机信息
+     * @param truck       车辆信息
      * @desc 变更循环派车信息
      * @author zk
      * @date 2023/8/2
      **/
-    public void changeWaybillOrderCirculate(Long circulateId, ChangeDriverDto driver, ChangeTruckDto truck){
+    public void changeWaybillOrderCirculate(Long circulateId, ChangeDriverDto driver, ChangeTruckDto truck) {
         //循环派车信息
         KwtLogisticsOrderCirculate circulate = new KwtLogisticsOrderCirculate();
         if (driver != null) {
@@ -309,12 +312,12 @@ public class KwtWaybillOrderService {
 
     /**
      * @param driver 司机信息
-     * @param truck 车辆信息
+     * @param truck  车辆信息
      * @desc 更新车辆运单信息
      * @author zk
      * @date 2023/8/2
      **/
-    public void changeWaybillOrder(ChangeDriverDto driver, ChangeTruckDto truck){
+    public void changeWaybillOrder(ChangeDriverDto driver, ChangeTruckDto truck) {
         //车辆运单信息
         KwtWaybillOrder waybillOrder = new KwtWaybillOrder();
         if (driver != null) {
@@ -349,7 +352,7 @@ public class KwtWaybillOrderService {
             return result;
         }
         //下游司机委派量累加(趟次)
-        BigDecimal ranksAmount = (BigDecimal)result.getData();
+        BigDecimal ranksAmount = (BigDecimal) result.getData();
 
         /**数据处理**/
         result = setWaybillOrder(params, logisticsOrder);
@@ -369,7 +372,7 @@ public class KwtWaybillOrderService {
 
         /**Mongodb数据存储**/
         //1车辆订单
-        for (SckwWaybillOrder waybillOrder:sckwWaybillOrders) {
+        for (SckwWaybillOrder waybillOrder : sckwWaybillOrders) {
             //rabbitMq业务汇总数据发送/消费对象
             SckwBusSum busSum = new SckwBusSum();
             //业务汇总类型
@@ -390,7 +393,7 @@ public class KwtWaybillOrderService {
     }
 
     /**
-     * @param params 派车请求参数
+     * @param params         派车请求参数
      * @param logisticsOrder 物流订单
      * @desc 派车校验
      * @author zk
@@ -399,13 +402,13 @@ public class KwtWaybillOrderService {
     public HttpResult checkWaybillOrder(List<SendCarDto1> params, KwtLogisticsOrder logisticsOrder) {
         /**校验物流运单是否可以派车**/
         if (logisticsOrder == null) {
-            return HttpResult.error("订单已不存在!" );
+            return HttpResult.error("订单已不存在!");
         }
 
         //状态校验
         if (logisticsOrder.getStatus() != LogisticsOrderEnum.WAIT_DELIVERY.getCode()
                 && logisticsOrder.getStatus() != LogisticsOrderEnum.IN_TRANSIT.getCode()) {
-            return HttpResult.error("订单"+LogisticsOrderEnum.getName(logisticsOrder.getStatus())+"不能派车!" );
+            return HttpResult.error("订单" + LogisticsOrderEnum.getName(logisticsOrder.getStatus()) + "不能派车!");
         }
 
         //剩余可运量校验
@@ -414,17 +417,17 @@ public class KwtWaybillOrderService {
         //历史下游司机委派量 + 分包量
         BigDecimal entrustAmountTotal = entrustAmount.add(subcontractAmount);
         if (entrustAmountTotal.compareTo(logisticsOrder.getAmount()) > 0) {
-            return HttpResult.error("剩余可运量已不能派车!" );
+            return HttpResult.error("剩余可运量已不能派车!");
         }
 
         /**校验是车辆委托量否超过物流订单剩余量**/
         //下游司机委派量累加(趟次)
         BigDecimal ranksAmount = new BigDecimal(Global.AMOUNT);
-        for (SendCarDto1 sendCarDto:params) {
+        for (SendCarDto1 sendCarDto : params) {
             if (sendCarDto.getType() == Global.NUMERICAL_ONE) {
                 //趟次派车趟次数量必填
                 if (sendCarDto.getCount() == null || sendCarDto.getCount() <= 0) {
-                    return HttpResult.error(sendCarDto.getTruckNo() + "趟次必须等于或大于0!" );
+                    return HttpResult.error(sendCarDto.getTruckNo() + "趟次必须等于或大于0!");
                 }
                 //承运订单该车辆计划运输总量:核定载量 * 趟次
                 Double truckEntrustAmount = sendCarDto.getEntrustAmount() * sendCarDto.getCount();
@@ -433,7 +436,7 @@ public class KwtWaybillOrderService {
                 //当前下游司机委派量 + 历史下游司机委派量 + 分包量
                 BigDecimal actualAmount = ranksAmount.add(entrustAmountTotal);
                 if (actualAmount.compareTo(logisticsOrder.getAmount()) > 0) {
-                    return HttpResult.error("累计派车量已大于剩余可运量!" );
+                    return HttpResult.error("累计派车量已大于剩余可运量!");
                 }
             }
         }
@@ -441,7 +444,7 @@ public class KwtWaybillOrderService {
     }
 
     /**
-     * @param params 派车请求参数
+     * @param params         派车请求参数
      * @param logisticsOrder 物流订单
      * @desc 派车存储
      * @author zk
@@ -462,13 +465,13 @@ public class KwtWaybillOrderService {
 
         /**MySql车辆运单数据处理/存储**/
         List<SckwWaybillOrder> sckwWaybillOrders = new ArrayList();
-        for (SendCarDto1 sendCarDto:params) {
+        for (SendCarDto1 sendCarDto : params) {
             /**KwtWaybillOrder数据组装**/
             KwtWaybillOrder waybillOrder = this.setKwtWaybillOrder(sendCarDto);
 
             /**数据存储**/
             if (sendCarDto.getType() == Global.NUMERICAL_ONE) {
-                for (int i=0; i<sendCarDto.getCount(); i++) {
+                for (int i = 0; i < sendCarDto.getCount(); i++) {
                     //车辆运单存储
                     ranksSave(waybillOrder, loadAddress, unloadAddress);
 
@@ -508,8 +511,8 @@ public class KwtWaybillOrderService {
     }
 
     /**
-     * @param waybillOrder 车辆订单信息
-     * @param loadAddress 装货地址信息
+     * @param waybillOrder  车辆订单信息
+     * @param loadAddress   装货地址信息
      * @param unloadAddress 卸货地址信息
      * @desc 趟次派车数据存储
      * @author zk
@@ -558,7 +561,7 @@ public class KwtWaybillOrderService {
     }
 
     /**
-     * @param lOrderId 物流订单ID
+     * @param lOrderId    物流订单ID
      * @param addressType 地址类型(1装货地址、2卸货地址)
      * @desc 获取物流订单地址信息
      * @author zk
@@ -581,8 +584,8 @@ public class KwtWaybillOrderService {
 
     /**
      * @param wOrderId 车辆订单ID
-     * @param status 车辆运单状态
-     * @param remark 备注
+     * @param status   车辆运单状态
+     * @param remark   备注
      * @desc 新增运单状态记录
      * @author zk
      * @date 2023/7/20
@@ -626,13 +629,13 @@ public class KwtWaybillOrderService {
     }
 
     /**
-     * @param sendCarDto 派车请求参数
+     * @param sendCarDto     派车请求参数
      * @param logisticsOrder 承运订单
-     * @param loadAddress 装货地址
-     * @param unloadAddress 卸货地址
-     * @param checkEnt 托运企业
-     * @param carrierEnt 承运企业
-     * @param goods 商品信息
+     * @param loadAddress    装货地址
+     * @param unloadAddress  卸货地址
+     * @param checkEnt       托运企业
+     * @param carrierEnt     承运企业
+     * @param goods          商品信息
      * @desc mongodb车辆运单对象赋值
      * @author zk
      * @date 2023/7/20
@@ -760,7 +763,7 @@ public class KwtWaybillOrderService {
         //int level = checkLogisticsLevel(logisticsOrder);
         String pids = logisticsOrder.getPids();
         if (StringUtils.isNotBlank(pids)) {
-            String [] idArray = pids.split(Global.COMMA);
+            String[] idArray = pids.split(Global.COMMA);
             for (String id : idArray) {
                 KwtLogisticsOrder order = logisticsOrderDao.selectById(id);
                 //承运订单-待派车
@@ -794,7 +797,7 @@ public class KwtWaybillOrderService {
      **/
     public int logisticsLevel(KwtLogisticsOrder logisticsOrder) {
         String pids = logisticsOrder.getPids();
-        String [] idArrays = StringUtils.isBlank(pids) ? new String[0] : pids.split(Global.COMMA);
+        String[] idArrays = StringUtils.isBlank(pids) ? new String[0] : pids.split(Global.COMMA);
         return idArrays.length <= 1 ? Global.NUMERICAL_ONE : (idArrays.length - Global.NUMERICAL_ONE);
     }
 
@@ -805,7 +808,7 @@ public class KwtWaybillOrderService {
      * @date 2023/7/24
      **/
     @Transactional(rollbackFor = Exception.class)
-    public HttpResult cancelSendCar(List<Long> ids){
+    public HttpResult cancelSendCar(List<Long> ids) {
         /**1数据校验**/
         if (CollectionUtils.isEmpty(ids)) {
             return HttpResult.error("请选择需要撤回的车辆运单!");
@@ -817,7 +820,7 @@ public class KwtWaybillOrderService {
             if (order != null) {
                 //3待接单的车辆运单才能撤回
                 if (order.getStatus() != CarWaybillEnum.PENDING_ORDER.getCode()) {
-                    return HttpResult.error("运单"+order.getWOrderNo()+"当前状态已不能撤回!");
+                    return HttpResult.error("运单" + order.getWOrderNo() + "当前状态已不能撤回!");
                 }
             } else {
                 //循环派车信息
@@ -873,13 +876,13 @@ public class KwtWaybillOrderService {
 
     /**
      * @param wOrder mongodb中车辆运单信息
-     * @param order 车辆运单信息
+     * @param order  车辆运单信息
      * @param method 操作对象(1新增/2修改/3替换数据)
      * @description 更新mongodb中车辆运单信息
      * @author zk
      * @date 2023/7/26
      **/
-    public void editSckwWaybillOrder(SckwWaybillOrder wOrder, KwtWaybillOrder order, int method){
+    public void editSckwWaybillOrder(SckwWaybillOrder wOrder, KwtWaybillOrder order, int method) {
         wOrder.setWOrderId(order.getId());
         wOrder.setStatus(order.getStatus());
         wOrder.setUpdateTime(order.getUpdateTime());
@@ -897,12 +900,12 @@ public class KwtWaybillOrderService {
 
     /**
      * @param lOrder mongodb中承运订单信息
-     * @param order 承运订单
+     * @param order  承运订单
      * @description 更新mongodb中承运订单信息
      * @author zk
      * @date 2023/7/26
      **/
-    public void editSckwLogisticsOrder(SckwLogisticsOrder lOrder, KwtLogisticsOrder order){
+    public void editSckwLogisticsOrder(SckwLogisticsOrder lOrder, KwtLogisticsOrder order) {
         lOrder.set_id(order.getId());
         lOrder.setLOrderId(order.getId());
         lOrder.setEntrustAmount(order.getEntrustAmount());
@@ -1038,7 +1041,7 @@ public class KwtWaybillOrderService {
 
     /**
      * @param circulate 循环派车记录
-     * @param wOrderId 车辆订单ID
+     * @param wOrderId  车辆订单ID
      * @desc 新增循环派车接单后车辆运单待接单记录
      * @author zk
      * @date 2023/7/26
@@ -1141,7 +1144,7 @@ public class KwtWaybillOrderService {
      * @date 2023/7/26
      **/
     @Transactional(rollbackFor = Exception.class)
-    public HttpResult confirmDeparture(OperateWaybillDto params){
+    public HttpResult confirmDeparture(OperateWaybillDto params) {
         /**1数据校验**/
         KwtWaybillOrder waybillOrder = waybillOrderDao.selectById(params.getWOrderId());
         if (waybillOrder == null) {
@@ -1177,7 +1180,7 @@ public class KwtWaybillOrderService {
      * @date 2023/7/26
      **/
     @Transactional(rollbackFor = Exception.class)
-    public HttpResult refuseDeparture(OperateWaybillDto params){
+    public HttpResult refuseDeparture(OperateWaybillDto params) {
         /**1数据校验**/
         KwtWaybillOrder waybillOrder = waybillOrderDao.selectById(params.getWOrderId());
         if (waybillOrder == null) {
@@ -1233,7 +1236,7 @@ public class KwtWaybillOrderService {
      * @date 2023/7/26
      **/
     @Transactional(rollbackFor = Exception.class)
-    public HttpResult arriveLoadLocation(OperateWaybillDto params){
+    public HttpResult arriveLoadLocation(OperateWaybillDto params) {
         /**1数据校验**/
         KwtWaybillOrder waybillOrder = waybillOrderDao.selectById(params.getWOrderId());
         if (waybillOrder == null) {
@@ -1269,7 +1272,7 @@ public class KwtWaybillOrderService {
      * @date 2023/7/26
      **/
     @Transactional(rollbackFor = Exception.class)
-    public HttpResult loading(WaybillOrderTicketDto params){
+    public HttpResult loading(WaybillOrderTicketDto params) {
         /**1数据校验**/
         KwtWaybillOrder waybillOrder = waybillOrderDao.selectById(params.getWOrderId());
         if (waybillOrder == null) {
@@ -1298,18 +1301,18 @@ public class KwtWaybillOrderService {
         waybillOrderTicketDao.insert(ticket);
 
         /**5跟新司机/车辆数据
-        //更新司机信息
-        editDriver(waybillOrder.getDriverId());
-        //更新车辆信息
-        editTruck(waybillOrder.getTruckId());**/
+         //更新司机信息
+         editDriver(waybillOrder.getDriverId());
+         //更新车辆信息
+         editTruck(waybillOrder.getTruckId());**/
 
         /**6更新承运订单entrustAmount
-        KwtLogisticsOrder logisticsOrder = logisticsOrderDao.selectById(waybillOrder.getLOrderId());
-        //承运订单已装货量=承运订单原装货量+当前车辆运单装货量
-        BigDecimal loadAmount = logisticsOrder.getLoadAmount() == null ? new BigDecimal(Global.AMOUNT) : logisticsOrder.getLoadAmount();
-        logisticsOrder.setLoadAmount(loadAmount.add(waybillOrder.getLoadAmount()));
-        logisticsOrder.setLoadTime(logisticsOrder.getLoadTime() == null ?waybillOrder.getUpdateTime() : logisticsOrder.getLoadTime());
-        logisticsOrderDao.updateById(logisticsOrder);**/
+         KwtLogisticsOrder logisticsOrder = logisticsOrderDao.selectById(waybillOrder.getLOrderId());
+         //承运订单已装货量=承运订单原装货量+当前车辆运单装货量
+         BigDecimal loadAmount = logisticsOrder.getLoadAmount() == null ? new BigDecimal(Global.AMOUNT) : logisticsOrder.getLoadAmount();
+         logisticsOrder.setLoadAmount(loadAmount.add(waybillOrder.getLoadAmount()));
+         logisticsOrder.setLoadTime(logisticsOrder.getLoadTime() == null ?waybillOrder.getUpdateTime() : logisticsOrder.getLoadTime());
+         logisticsOrderDao.updateById(logisticsOrder);**/
 
         /**7Mongodb数据更新**/
         //1车辆运单
@@ -1338,7 +1341,7 @@ public class KwtWaybillOrderService {
      * @date 2023/7/26
      **/
     @Transactional(rollbackFor = Exception.class)
-    public HttpResult arriveUnloadLocation(OperateWaybillDto params){
+    public HttpResult arriveUnloadLocation(OperateWaybillDto params) {
         /**1数据校验**/
         KwtWaybillOrder waybillOrder = waybillOrderDao.selectById(params.getWOrderId());
         if (waybillOrder == null) {
@@ -1374,7 +1377,7 @@ public class KwtWaybillOrderService {
      * @date 2023/7/26
      **/
     @Transactional(rollbackFor = Exception.class)
-    public HttpResult unloading(WaybillOrderTicketDto params){
+    public HttpResult unloading(WaybillOrderTicketDto params) {
         /**1数据校验**/
         KwtWaybillOrder waybillOrder = waybillOrderDao.selectById(params.getWOrderId());
         if (waybillOrder == null) {
@@ -1417,24 +1420,24 @@ public class KwtWaybillOrderService {
         }
 
         /**6跟新司机/车辆数据
-        //更新司机信息
-        editDriver(waybillOrder.getDriverId());
-        //更新车辆信息
-        editTruck(waybillOrder.getTruckId());**/
+         //更新司机信息
+         editDriver(waybillOrder.getDriverId());
+         //更新车辆信息
+         editTruck(waybillOrder.getTruckId());**/
 
         /**7更新承运订单entrustAmount
-        //更新卸货量/卸货时间/亏吨/亏吨扣款
-        //承运订单卸货量=承运订单原卸货量+当前车辆运单卸货量
-        BigDecimal unloadAmount = logisticsOrder.getUnloadAmount() == null ? new BigDecimal(Global.AMOUNT) : logisticsOrder.getUnloadAmount();
-        logisticsOrder.setUnloadAmount(unloadAmount.add(waybillOrder.getUnloadAmount()));
-        logisticsOrder.setUnloadTime(waybillOrder.getUpdateTime());
-        //承运订单亏吨量=承运订单装货量-承运订单卸货量
-        logisticsOrder.setDeficitAmount(logisticsOrder.getLoadAmount().subtract(logisticsOrder.getUnloadAmount()));
-        //承运订单亏吨扣款
-        deficitPrice = deficitPrice(logisticsOrder.getLoadAmount(), logisticsOrder.getDeficitAmount(),
-                logisticsOrder.getLoss(), logisticsOrder.getGoodsPrice());
-        logisticsOrder.setDeficitPrice(deficitPrice);
-        logisticsOrderDao.updateById(logisticsOrder);**/
+         //更新卸货量/卸货时间/亏吨/亏吨扣款
+         //承运订单卸货量=承运订单原卸货量+当前车辆运单卸货量
+         BigDecimal unloadAmount = logisticsOrder.getUnloadAmount() == null ? new BigDecimal(Global.AMOUNT) : logisticsOrder.getUnloadAmount();
+         logisticsOrder.setUnloadAmount(unloadAmount.add(waybillOrder.getUnloadAmount()));
+         logisticsOrder.setUnloadTime(waybillOrder.getUpdateTime());
+         //承运订单亏吨量=承运订单装货量-承运订单卸货量
+         logisticsOrder.setDeficitAmount(logisticsOrder.getLoadAmount().subtract(logisticsOrder.getUnloadAmount()));
+         //承运订单亏吨扣款
+         deficitPrice = deficitPrice(logisticsOrder.getLoadAmount(), logisticsOrder.getDeficitAmount(),
+         logisticsOrder.getLoss(), logisticsOrder.getGoodsPrice());
+         logisticsOrder.setDeficitPrice(deficitPrice);
+         logisticsOrderDao.updateById(logisticsOrder);**/
 
         /**8Mongodb数据更新**/
         //1车辆运单
@@ -1461,10 +1464,10 @@ public class KwtWaybillOrderService {
     }
 
     /**
-     * @param loadAmount 装货量
+     * @param loadAmount    装货量
      * @param deficitAmount 亏吨量
-     * @param loss 合理损耗
-     * @param goodsPrice 货值单价
+     * @param loss          合理损耗
+     * @param goodsPrice    货值单价
      * @desc 计算亏吨扣款
      * @author zk
      * @date 2023/7/27
@@ -1484,7 +1487,7 @@ public class KwtWaybillOrderService {
 
     /**
      * @param lOrderId 承运订单ID
-     * @description 校验当前承运订单是否运输完成(修改状态+统计量)
+     * @description 校验当前承运订单是否运输完成(修改状态 + 统计量)
      * @author zk
      * @date 2023/7/27
      **/
@@ -1502,7 +1505,10 @@ public class KwtWaybillOrderService {
 
         /**1-2校验当前承运订单是否运输完成**/
         //车辆运单统计
-        WaybillCountVo waybillCount = waybillOrderDao.findWaybillOrderCount( new HashMap(){{put("upperlOrderId", logisticsOrder.getId()); put("passStatus", 1); }});
+        WaybillCountVo waybillCount = waybillOrderDao.findWaybillOrderCount(new HashMap() {{
+            put("upperlOrderId", logisticsOrder.getId());
+            put("passStatus", 1);
+        }});
         logisticsOrder.setTotalLoadAmount(waybillCount.getLoadAmount());
         logisticsOrder.setTotalUnloadAmount(waybillCount.getUnloadAmount());
         BigDecimal subcontractAmount = logisticsOrder.getSubcontractAmount() == null ? new BigDecimal(Global.AMOUNT) : logisticsOrder.getSubcontractAmount();
@@ -1525,7 +1531,7 @@ public class KwtWaybillOrderService {
             /**1-5循环派车失效kwt_logistics_order_circulate**/
             //循环派车信息
             List<KwtLogisticsOrderCirculate> circulates = logisticsOrderCirculateDao.findCirculateList(logisticsOrder.getId(), null, null, 0);
-            for (KwtLogisticsOrderCirculate circulate:circulates) {
+            for (KwtLogisticsOrderCirculate circulate : circulates) {
                 circulate.setStatus(Global.NUMERICAL_ONE);
                 logisticsOrderCirculateDao.updateById(circulate);
 
@@ -1543,9 +1549,14 @@ public class KwtWaybillOrderService {
         /**1-6更新贸易订单总量**/
         if (logisticsLevel(logisticsOrder) == Global.NUMERICAL_ONE) {
             //查询贸易订单总装货量/总卸货量
-            WaybillCountVo tradeCount = waybillOrderDao.findWaybillOrderCount( new HashMap(){{put("tOrderId", logisticsOrder.getTOrderId()); put("passStatus", 1); }});
+            WaybillCountVo tradeCount = waybillOrderDao.findWaybillOrderCount(new HashMap() {{
+                put("tOrderId", logisticsOrder.getTOrderId());
+                put("passStatus", 1);
+            }});
             //查询贸易订单关联物流运单是否全部完结-totalUnfinished
-            WaybillCountVo tradeCount1 = waybillOrderDao.findWaybillOrderCount( new HashMap(){{put("tOrderId", logisticsOrder.getTOrderId()); }});
+            WaybillCountVo tradeCount1 = waybillOrderDao.findWaybillOrderCount(new HashMap() {{
+                put("tOrderId", logisticsOrder.getTOrderId());
+            }});
             CompleteLogisticsOrderParam tradeOrder = new CompleteLogisticsOrderParam();
             tradeOrder.setTOrderId(logisticsOrder.getTOrderId());
             tradeOrder.setActualLoadAmount(tradeCount.getLoadAmount());
@@ -1567,7 +1578,7 @@ public class KwtWaybillOrderService {
         //获取所有上级物流订单ID(当前物流订单ID除外)
         String pids = logisticsOrder.getPids();
         if (StringUtils.isNotBlank(pids)) {
-            String [] idArray = pids.split(Global.COMMA);
+            String[] idArray = pids.split(Global.COMMA);
             for (String id : idArray) {
                 Long pid = Long.parseLong(id);
                 //当前物流订单ID除外
@@ -1591,8 +1602,11 @@ public class KwtWaybillOrderService {
         if (subcontractAmount.compareTo(new BigDecimal(Global.AMOUNT)) > 0) {
             /**1-1校验下级分包是否全部运输完成**/
             List<KwtLogisticsOrder> logisticsOrders = logisticsOrderDao.findLogisticsOrder(
-                    new HashMap(){{put("upperlOrderId", logisticsOrder.getId()); put("ownOrderId", logisticsOrder.getId());}});
-            for (KwtLogisticsOrder logisticsOrder1:logisticsOrders) {
+                    new HashMap() {{
+                        put("upperlOrderId", logisticsOrder.getId());
+                        put("ownOrderId", logisticsOrder.getId());
+                    }});
+            for (KwtLogisticsOrder logisticsOrder1 : logisticsOrders) {
                 if (!LogisticsOrderEnum.transportCompleted(logisticsOrder1.getStatus())) {
                     //下级分包承运订单运输未完成
                     subcontractBool = false;
@@ -1673,7 +1687,7 @@ public class KwtWaybillOrderService {
      * @author zk
      * @date 2023/8/10
      **/
-    public HttpResult ticketWaybillOrder(Long wOrderId){
+    public HttpResult ticketWaybillOrder(Long wOrderId) {
         //车辆运单信息
         KwtWaybillOrder waybillOrder = waybillOrderDao.selectById(wOrderId);
         if (waybillOrder == null) {
@@ -1690,7 +1704,10 @@ public class KwtWaybillOrderService {
         //商品信息
         KwtLogisticsOrderGoods goods = logisticsOrderGoodsDao.findByGoods(waybillOrder.getLOrderId());
         //用户数据集
-        List<Long> createBys = new ArrayList(){{add(loadTicket.getUpdateBy()); add(unloadTicket.getUpdateBy());}};
+        List<Long> createBys = new ArrayList() {{
+            add(loadTicket.getUpdateBy());
+            add(unloadTicket.getUpdateBy());
+        }};
         createBys = createBys.stream().distinct().collect(Collectors.toList());
         Map<Long, UserCacheResDto> users = remoteSystemService.queryUserCacheMapByIds(createBys);
         UserCacheResDto loadUser = users == null ? null : users.get(loadTicket.getUpdateBy());
@@ -1814,13 +1831,15 @@ public class KwtWaybillOrderService {
      **/
     public void editDriver(Long driverId) {
         //数据统计
-        WaybillCountVo countVo = waybillOrderDao.findWaybillOrderCount(new HashMap(){{put("driverId", driverId);}});
+        WaybillCountVo countVo = waybillOrderDao.findWaybillOrderCount(new HashMap() {{
+            put("driverId", driverId);
+        }});
         RDriverVo driver = new RDriverVo();
         driver.setId(driverId);
         driver.setTotalComplete(countVo.getTotalComplete());
         driver.setTotalTake(countVo.getTotalTake());
         driver.setTotalWeight(countVo.getLoadAmount());
-        driver.setBusinessStatus(countVo.getTotalExecute() != null && countVo.getTotalExecute() > 0 ? 1 : 0 );
+        driver.setBusinessStatus(countVo.getTotalExecute() != null && countVo.getTotalExecute() > 0 ? 1 : 0);
         remoteFleetService.updateById(driver);
     }
 
@@ -1832,13 +1851,15 @@ public class KwtWaybillOrderService {
      **/
     public void editTruck(Long truckId) {
         //数据统计
-        WaybillCountVo countVo = waybillOrderDao.findWaybillOrderCount(new HashMap(){{put("truckId", truckId);}});
+        WaybillCountVo countVo = waybillOrderDao.findWaybillOrderCount(new HashMap() {{
+            put("truckId", truckId);
+        }});
         RTruckVo truck = new RTruckVo();
         truck.setId(truckId);
         truck.setTotalComplete(countVo.getTotalComplete());
         truck.setTotalTake(countVo.getTotalTake());
         truck.setTotalWeight(countVo.getLoadAmount());
-        truck.setBusinessStatus(countVo.getTotalExecute() != null && countVo.getTotalExecute() > 0 ? 1 : 0 );
+        truck.setBusinessStatus(countVo.getTotalExecute() != null && countVo.getTotalExecute() > 0 ? 1 : 0);
         remoteFleetService.updateById(truck);
     }
 
@@ -1853,14 +1874,14 @@ public class KwtWaybillOrderService {
     }
 
     /** 当前物流订单是全量下游则只能全量可运、否则可委托量或全量
-        校验上游是否全量,并获取全量跟节点物流订单或贸易订单(可委派量)
+     校验上游是否全量,并获取全量跟节点物流订单或贸易订单(可委派量)
      1、派车、循环派车接单需校验贸易订单/物流订单是否委派完成;
      2、装货需要统计物流订单总装货量;
      3、卸货需要统计物流订单总卸货量,变更上游状态;
      */
 
     /**
-     * @param lOrderId 物流订单信息ID
+     * @param lOrderId      物流订单信息ID
      * @param entrustAmount 委托量
      * @desc 校验委托量是否大于剩余可运量(趟次派车/循环运单接单、委托/全量可运)
      * @author zk
@@ -1872,7 +1893,7 @@ public class KwtWaybillOrderService {
         /**存在全量可运**/
         if (isComplete(logisticsOrder)) {
             //获取所有上级物流订单ID(当前物流订单ID除外)
-            List<Long> idArray = (List)CollectionUtils.toList(logisticsOrder.getPids(), false);
+            List<Long> idArray = (List) CollectionUtils.toList(logisticsOrder.getPids(), false);
             for (Long id : idArray) {
                 //当前物流订单ID除外
                 if (id != lOrderId) {
@@ -1925,4 +1946,103 @@ public class KwtWaybillOrderService {
         }
         return false;
     }
+
+    /**
+     * 承运订单-托运订单-订单详情数据统计
+     * @param orderId
+     * @param type
+     * @return
+     */
+    public Map<String, Integer> statisticsByOrderId(String orderId, String type) {
+        Map<String, Integer> map = new HashMap<>();
+        if (String.valueOf(NumberConstant.ONE).equals(type)) {
+            map = statisticsConsignByOrderId(orderId);
+        } else if (String.valueOf(NumberConstant.TWO).equals(type)) {
+            map = statisticsCarriageByOrderId(orderId);
+        } else {
+            throw new BusinessException("统计类型异常");
+        }
+        return map;
+    }
+
+    /**
+     * 承运数据统计
+     * @param orderId
+     * @return
+     */
+    private Map<String, Integer> statisticsCarriageByOrderId(String orderId) {
+        Map<String, Integer> map = new HashMap<>();
+        /**
+         * 【进行】:对应【待接单】、【待出车】、【已出车】、【到达装货地点】、【已装货】、【到达卸货地点】
+         * 【完成】:对应【已卸货】、【已核单】
+         * 【退回】:对应【拒绝接单】、【拒绝出车】、【单趟撤回】
+         * */
+        List<Integer> orderStatusList = new ArrayList<>();
+        orderStatusList.add(CarWaybillEnum.PENDING_ORDER.getCode());
+        orderStatusList.add(CarWaybillEnum.PENDING_VEHICLE.getCode());
+        orderStatusList.add(CarWaybillEnum.EXIT_COMPLETED.getCode());
+        orderStatusList.add(CarWaybillEnum.WAIT_LOADING.getCode());
+        orderStatusList.add(CarWaybillEnum.COMPLETION_LOADING.getCode());
+        orderStatusList.add(CarWaybillEnum.WAIT_UNLOADING.getCode());
+        Integer proceed = logisticsOrderDao.selectCountByLorderId(orderId, orderStatusList);
+        map.put("proceed", proceed);
+
+        orderStatusList.clear();
+        orderStatusList.add(CarWaybillEnum.COMPLETION_UNLOADING.getCode());
+        orderStatusList.add(CarWaybillEnum.APPROVAL_PASS.getCode());
+        Integer finish = logisticsOrderDao.selectCountByLorderId(orderId, orderStatusList);
+        map.put("finish", finish);
+
+        orderStatusList.clear();
+        orderStatusList.add(CarWaybillEnum.REJECT_ORDER.getCode());
+        orderStatusList.add(CarWaybillEnum.REFUSE_TRAFFIC.getCode());
+        orderStatusList.add(CarWaybillEnum.REVOKED.getCode());
+        orderStatusList.add(CarWaybillEnum.APPROVAL_NO_PASS.getCode());
+        Integer cancel = logisticsOrderDao.selectCountByLorderId(orderId, orderStatusList);
+        map.put("cancel", cancel);
+
+        map.put("total", proceed + finish + cancel);
+        return map;
+    }
+
+    /**
+     * 托运数据统计
+     * @param orderId
+     * @return
+     */
+    private Map<String, Integer> statisticsConsignByOrderId(String orderId) {
+
+        Map<String, Integer> map = new HashMap<>();
+        /**
+         * 【进行】:对应【待接单】、【待出车】、【已出车】、【到达装货地点】、【已装货】、【到达卸货地点】
+         * 【完成】:对应【已卸货】、【已核单】
+         * 【退回】:对应【拒绝接单】、【拒绝出车】、【单趟撤回】
+         * */
+        List<Integer> orderStatusList = new ArrayList<>();
+        orderStatusList.add(CarWaybillEnum.PENDING_ORDER.getCode());
+        orderStatusList.add(CarWaybillEnum.PENDING_VEHICLE.getCode());
+        orderStatusList.add(CarWaybillEnum.EXIT_COMPLETED.getCode());
+        orderStatusList.add(CarWaybillEnum.WAIT_LOADING.getCode());
+        orderStatusList.add(CarWaybillEnum.COMPLETION_LOADING.getCode());
+        orderStatusList.add(CarWaybillEnum.WAIT_UNLOADING.getCode());
+        Integer proceed = logisticsOrderDao.selectCountByLorderId(orderId, orderStatusList);
+        map.put("proceed", proceed);
+
+        orderStatusList.clear();
+        orderStatusList.add(CarWaybillEnum.COMPLETION_UNLOADING.getCode());
+        orderStatusList.add(CarWaybillEnum.APPROVAL_PASS.getCode());
+        Integer finish = logisticsOrderDao.selectCountByLorderId(orderId, orderStatusList);
+        map.put("finish", finish);
+
+        orderStatusList.clear();
+        orderStatusList.add(CarWaybillEnum.REJECT_ORDER.getCode());
+        orderStatusList.add(CarWaybillEnum.REFUSE_TRAFFIC.getCode());
+        orderStatusList.add(CarWaybillEnum.REVOKED.getCode());
+        orderStatusList.add(CarWaybillEnum.APPROVAL_NO_PASS.getCode());
+        Integer cancel = logisticsOrderDao.selectCountByLorderId(orderId, orderStatusList);
+        map.put("cancel", cancel);
+
+        map.put("total", proceed + finish + cancel);
+        return map;
+    }
 }

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

@@ -193,7 +193,7 @@ public class LogisticsConsignmentService {
         HttpResult httpResult = tradeOrderInfoService.createOrCancelLogisticsOrder(param);
         if (httpResult.getCode() != HttpStatus.SUCCESS_CODE) {
             log.info("{}生成物流托运失败!,返回信息:{}", tradeOrder.getTOrderNo(), JSONObject.toJSONString(httpResult));
-            throw new BusinessException("{"+tradeOrder.getTOrderNo()+"}生成物流托运失败!");
+            throw new BusinessException("{" + tradeOrder.getTOrderNo() + "}生成物流托运失败!");
         }
     }
 
@@ -638,9 +638,13 @@ public class LogisticsConsignmentService {
                 /**数据展示*/
                 list = kwtLogisticsOrderMapper.selectOrderListNotPage(id, type);
                 if (CollectionUtils.isNotEmpty(list)) {
-//                    for (LogisticsOrderDTO logisticsOrderDTO : list) {
+                    for (LogisticsOrderDTO logisticsOrderDTO : list) {
 //                        logisticsOrderDTO.setStatus(LogisticsOrderEnum.getDestination(logisticsOrderDTO.getStatus()));
-//                    }
+                        String createName = StringUtils.isBlank(logisticsOrderDTO.getCreateBy()) ? null :
+                                (remoteSystemService.queryUserCacheById(Long.parseLong(logisticsOrderDTO.getCreateBy())) == null ? null :
+                                        remoteSystemService.queryUserCacheById(Long.parseLong(logisticsOrderDTO.getCreateBy())).getName());
+                        logisticsOrderDTO.setCreateName(createName);
+                    }
                     returnList.addAll(list);
                 }
             }
@@ -732,9 +736,13 @@ public class LogisticsConsignmentService {
                 /**数据展示*/
                 list = kwtLogisticsOrderMapper.selectOrderListNotPage(id, type);
                 if (CollectionUtils.isNotEmpty(list)) {
-//                    for (LogisticsOrderDTO logisticsOrderDTO : list) {
+                    for (LogisticsOrderDTO logisticsOrderDTO : list) {
 //                        logisticsOrderDTO.setStatus(LogisticsOrderEnum.getDestination(logisticsOrderDTO.getStatus()));
-//                    }
+                        String createName = StringUtils.isBlank(logisticsOrderDTO.getCreateBy()) ? null :
+                                (remoteSystemService.queryUserCacheById(Long.parseLong(logisticsOrderDTO.getCreateBy())) == null ? null :
+                                        remoteSystemService.queryUserCacheById(Long.parseLong(logisticsOrderDTO.getCreateBy())).getName());
+                        logisticsOrderDTO.setCreateName(createName);
+                    }
                     returnList.addAll(list);
                 }
             }

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

@@ -162,6 +162,7 @@ public class TransportCommonService {
             if (CollectionUtils.isNotEmpty(contractBaseInfo) && !ObjectUtils.isEmpty(contractBaseInfo.get(contract.getContractId()))) {
                 orderDetailVO.setContractName(contractBaseInfo.get(contract.getContractId()).getContactName());
                 orderDetailVO.setContractNo(contractBaseInfo.get(contract.getContractId()).getContractCode());
+                orderDetailVO.setSigningWay(contractBaseInfo.get(contract.getContractId()).getSigningWay());
             }
         }
         if (unitOne != null) {
@@ -204,6 +205,18 @@ public class TransportCommonService {
         orderDetailVO.setScheduleStartTime(logisticsOrder.getStartTime() == null ? null : logisticsOrder.getStartTime());
         orderDetailVO.setScheduleEndTime(logisticsOrder.getEndTime() == null ? null : logisticsOrder.getEndTime());
         orderDetailVO.setPerformanceAmount(logisticsOrder.getLoadAmount() == null ? null : String.valueOf(logisticsOrder.getLoadAmount()));
+        orderDetailVO.setTotalLoadAmount(logisticsOrder.getTotalLoadAmount());
+        orderDetailVO.setTotalUnloadAmount(logisticsOrder.getTotalUnloadAmount());
+        orderDetailVO.setCreateTime(logisticsOrder.getCreateTime());
+        orderDetailVO.setPayment(logisticsOrder.getPayment());
+        if (logisticsOrder.getPayment() != null) {
+            Map<String, SysDictResDto> dictResDtoMap = remoteSystemService.queryDictMapByType(DictTypeEnum.TRADE_TYPE.getType());
+            orderDetailVO.setPaymentLabel(dictResDtoMap.isEmpty() ? null : dictResDtoMap.get(logisticsOrder.getPayment()).getLabel());
+        }
+        if (orderDetailVO.getSigningWay() != null) {
+            Map<String, SysDictResDto> dictResDtoMap = remoteSystemService.queryDictMapByType(DictTypeEnum.SIGNING_TYPE.getType());
+            orderDetailVO.setSigningWayLabel(dictResDtoMap.isEmpty() ? null : dictResDtoMap.get(orderDetailVO.getSigningWay()).getLabel());
+        }
         return orderDetailVO;
     }
 

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

@@ -695,7 +695,7 @@
         g.goods_type AS goodsType,
         f.contract_id AS contractId,
         f.contract_no AS contractNo,
-<!--        f.contract_name AS contractName,-->
+        <!--        f.contract_name AS contractName,-->
         f.signing_way AS signing,
         d.ent_id AS consignCompanyId,
         d.top_ent_id AS consignTopEntId,
@@ -748,7 +748,7 @@
         AND d.unit_type = 1 AND d.del_flag = 0
         LEFT JOIN kwt_logistics_order_unit e ON a.id = e.l_order_id
         AND e.unit_type = 2
-        LEFT JOIN kwt_logistics_order_goods g ON a.id = g.l_order_id  AND g.del_flag = 0
+        LEFT JOIN kwt_logistics_order_goods g ON a.id = g.l_order_id AND g.del_flag = 0
         LEFT JOIN kwt_logistics_order_contract f ON a.id = f.l_order_id AND f.del_flag = 0
         <where>
             a.del_flag = 0
@@ -814,7 +814,7 @@
         AND d.unit_type = 1 AND d.del_flag = 0
         LEFT JOIN kwt_logistics_order_unit e ON a.id = e.l_order_id
         AND e.unit_type = 2
-        LEFT JOIN kwt_logistics_order_goods g ON a.id = g.l_order_id  AND g.del_flag = 0
+        LEFT JOIN kwt_logistics_order_goods g ON a.id = g.l_order_id AND g.del_flag = 0
         LEFT JOIN kwt_logistics_order_contract f ON a.id = f.l_order_id AND f.del_flag = 0
         <where>
             a.del_flag = 0
@@ -865,4 +865,16 @@
         </where>
         group by a.status
     </select>
+    <select id="selectCountByLorderId" resultType="java.lang.Integer">
+        SELECT COUNT(id)
+        FROM kwt_waybill_order
+        WHERE del_flag = 0
+        and l_order_id = #{orderId}
+        <if test="orderStatusList != null and orderStatusList.size() > 0">
+            AND status IN
+            <foreach collection="orderStatusList" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+    </select>
 </mapper>