Explorar o código

提交新增合同文件校验

chenxiaofei hai 1 mes
pai
achega
f5c43e1eab

+ 5 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillV1Enum.java

@@ -30,6 +30,11 @@ public enum CarWaybillV1Enum {
      * 已装货
      */
     EXIT_COMPLETED(10,  "已装货"),
+
+    /**
+     * 离场过磅
+     */
+    WEIGHT_TRAFFIC(11, "离场过磅"),
     /**
      * 已离场
      */

+ 8 - 0
sckw-modules-api/sckw-transport-api/src/main/java/com/sckw/transport/api/model/param/AddLogisticOrderParam.java

@@ -21,6 +21,14 @@ import java.util.List;
 public class AddLogisticOrderParam implements Serializable {
     @Serial
     private static final long serialVersionUID = 6529826978061848338L;
+    /**
+     * 企业id
+     */
+    private Long entId;
+    /**
+     * 用户id
+     */
+    private Long userId;
     //物流信息
     private List<LogisticInfo> logisticInfo;
     /**

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

@@ -1176,6 +1176,8 @@ public class TransportServiceImpl implements TransportRemoteService {
                 .map(TransportServiceImpl::getLogisticInfo)
                 .collect(Collectors.toList());
         addLogisticOrderDTO.setLogisticInfo(infos);
+        addLogisticOrderDTO.setEntId(param.getEntId());
+        addLogisticOrderDTO.setUserId(param.getUserId());
         addLogisticOrderDTO.setTradeOrderId(param.getTradeOrderId());
         addLogisticOrderDTO.setTradeOrderNo(param.getTradeOrderNo());
         addLogisticOrderDTO.setConsignCompany(param.getConsignCompany());

+ 9 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/AddLogisticOrderDTO.java

@@ -18,6 +18,15 @@ public class AddLogisticOrderDTO implements Serializable {
     private static final long serialVersionUID = 6529826978061848338L;
     //物流信息
     private List<LogisticData> logisticInfo;
+
+    /**
+     * 企业id
+     */
+    private Long entId;
+    /**
+     * 用户id
+     */
+    private Long userId;
     /**
      * 交易订单id
      */

+ 17 - 17
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtAcceptCarriageOrderService.java

@@ -3221,7 +3221,7 @@ public class KwtAcceptCarriageOrderService {
             //商品信息
             setLogisticGoodsInfo(orderDTO, lOrderId, lOrderNo, savelogOrderGoodsList);
             //物流订单与合同信息
-            setLogisticContractInfo(x, lOrderId, saveContractList);
+            setLogisticContractInfo(orderDTO,x, lOrderId, saveContractList);
             //企业信息数据
             setLogisticUnitInfo(orderDTO, x, lOrderId, savelogOrderUnitList);
 
@@ -3254,9 +3254,9 @@ public class KwtAcceptCarriageOrderService {
         consignUnit.setPhone(orderDTO.getConsignContactPhone());
 //        consignUnit.setRemark(orderDTO.getRemark());
         consignUnit.setStatus(NumberConstant.ZERO);
-        consignUnit.setCreateBy(LoginUserHolder.getUserId());
+        consignUnit.setCreateBy(orderDTO.getUserId());
         consignUnit.setCreateTime(new Date());
-        consignUnit.setUpdateBy(LoginUserHolder.getUserId());
+        consignUnit.setUpdateBy(orderDTO.getUserId());
         consignUnit.setUpdateTime(new Date());
         savelogOrderUnitList.add(consignUnit);
         //承运
@@ -3276,14 +3276,14 @@ public class KwtAcceptCarriageOrderService {
         unit.setPhone(x.getAcceptContactPhone());
 //        unit.setRemark(orderDTO.getRemark());
         unit.setStatus(NumberConstant.ZERO);
-        unit.setCreateBy(LoginUserHolder.getUserId());
+        unit.setCreateBy(orderDTO.getUserId());
         unit.setCreateTime(new Date());
-        unit.setUpdateBy(LoginUserHolder.getUserId());
+        unit.setUpdateBy(orderDTO.getUserId());
         unit.setUpdateTime(new Date());
         savelogOrderUnitList.add(unit);
     }
 
-    private static void setLogisticContractInfo(LogisticData x, Long lOrderId, List<KwtLogisticsOrderContract> saveContractList) {
+    private static void setLogisticContractInfo(AddLogisticOrderDTO orderDTO,LogisticData x, Long lOrderId, List<KwtLogisticsOrderContract> saveContractList) {
         KwtLogisticsOrderContract contract = new KwtLogisticsOrderContract();
         contract.setId(new IdWorker(NumberConstant.ONE).nextId());
         contract.setContractId(x.getContractId());
@@ -3291,9 +3291,9 @@ public class KwtAcceptCarriageOrderService {
         contract.setContractNo(x.getContractNo());
         contract.setContractName(x.getContractName());
         contract.setSigningWay(String.valueOf(x.getSigningWay()));
-        contract.setCreateBy(LoginUserHolder.getUserId());
+        contract.setCreateBy(orderDTO.getUserId());
         contract.setCreateTime(new Date());
-        contract.setUpdateBy(LoginUserHolder.getUserId());
+        contract.setUpdateBy(orderDTO.getUserId());
         contract.setUpdateTime(new Date());
         saveContractList.add(contract);
     }
@@ -3306,9 +3306,9 @@ public class KwtAcceptCarriageOrderService {
         goods.setGoodsName(orderDTO.getGoodsName());
         goods.setGoodsType(orderDTO.getGoodsType());
         goods.setStatus(NumberConstant.ZERO);
-        goods.setCreateBy(LoginUserHolder.getUserId());
+        goods.setCreateBy(orderDTO.getUserId());
         goods.setCreateTime(new Date());
-        goods.setUpdateBy(LoginUserHolder.getUserId());
+        goods.setUpdateBy(orderDTO.getUserId());
         goods.setUpdateTime(new Date());
         savelogOrderGoodsList.add( goods);
     }
@@ -3328,10 +3328,10 @@ public class KwtAcceptCarriageOrderService {
 
         loadAddress.setEntryType(NumberConstant.FOUR);
         loadAddress.setStatus(NumberConstant.ZERO);
-        loadAddress.setCreateBy(LoginUserHolder.getUserId());
+        loadAddress.setCreateBy(orderDTO.getUserId());
         Date date1 = new Date();
         loadAddress.setCreateTime(date1);
-        loadAddress.setUpdateBy(LoginUserHolder.getUserId());
+        loadAddress.setUpdateBy(orderDTO.getUserId());
         loadAddress.setUpdateTime(date1);
         saveAddressList.add(loadAddress);
         KwtLogisticsOrderAddress unloadAddress = new KwtLogisticsOrderAddress();
@@ -3347,9 +3347,9 @@ public class KwtAcceptCarriageOrderService {
         unloadAddress.setDetailAddress(x.getUnloadDetailAddress());
         unloadAddress.setEntryType(NumberConstant.FOUR);
         unloadAddress.setStatus(NumberConstant.ZERO);
-        unloadAddress.setCreateBy(LoginUserHolder.getUserId());
+        unloadAddress.setCreateBy(orderDTO.getUserId());
         unloadAddress.setCreateTime(date1);
-        unloadAddress.setUpdateBy(LoginUserHolder.getUserId());
+        unloadAddress.setUpdateBy(orderDTO.getUserId());
         unloadAddress.setUpdateTime(date1);
         saveAddressList.add(unloadAddress);
     }
@@ -3357,7 +3357,7 @@ public class KwtAcceptCarriageOrderService {
     private static void setLogisticOrderInfo(AddLogisticOrderDTO orderDTO, LogisticData x, Long lOrderId, String lOrderNo, List<KwtLogisticsOrder> saveLogisticsOrderList) {
         KwtLogisticsOrder kwtLogisticsOrder = new KwtLogisticsOrder();
         kwtLogisticsOrder.setId(lOrderId);
-        kwtLogisticsOrder.setEntId(LoginUserHolder.getEntId());
+        kwtLogisticsOrder.setEntId(orderDTO.getEntId());
         kwtLogisticsOrder.setType(String.valueOf(x.getType()));
         kwtLogisticsOrder.setTOrderId(orderDTO.getTradeOrderId());
         kwtLogisticsOrder.setTOrderNo(orderDTO.getTradeOrderNo());
@@ -3390,10 +3390,10 @@ public class KwtAcceptCarriageOrderService {
         kwtLogisticsOrder.setPayment(x.getPayment());
         kwtLogisticsOrder.setRemark(x.getRemark());
         kwtLogisticsOrder.setStatus(LogisticsOrderV1Enum.PENDING_ORDER.getCode());
-        kwtLogisticsOrder.setCreateBy(LoginUserHolder.getUserId());
+        kwtLogisticsOrder.setCreateBy(orderDTO.getUserId());
         Date date = new Date();
         kwtLogisticsOrder.setCreateTime(date);
-        kwtLogisticsOrder.setUpdateBy(LoginUserHolder.getUserId());
+        kwtLogisticsOrder.setUpdateBy(orderDTO.getUserId());
         kwtLogisticsOrder.setUpdateTime(date);
         kwtLogisticsOrder.setBindStatus(String.valueOf(NumberConstant.ZERO));
         saveLogisticsOrderList.add(kwtLogisticsOrder);

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

@@ -3662,6 +3662,7 @@ public class KwtWaybillOrderV1Service {
 
         statisticsWaybillResp.setTotalNum("0");
         List<CarWaybillV1Enum> carWaybillV1Enums = Arrays.stream(CarWaybillV1Enum.values())
+                .filter(x -> !Objects.equals(x.getCode(), CarWaybillV1Enum.WEIGHT_TRAFFIC.getCode()))
                 .sorted(Comparator.comparing(CarWaybillV1Enum::getCode))
                 .collect(Collectors.toList());
 
@@ -3786,7 +3787,7 @@ public class KwtWaybillOrderV1Service {
     @NotNull
     private static List<WaybillOrderNodeVo.WaybillOrderNode> getWaybillOrderNodes(List<WaybillOrderNodeVo.Timeline> voList) {
         Map<Integer, List<WaybillOrderNodeVo.Timeline>> statusAndTimelineMap = voList.stream()
-                .filter(t ->!Arrays.asList(CarWaybillV1Enum.WAIT_UNLOADING.getCode(),CarWaybillV1Enum.APPROVAL_TREAT.getCode(), CarWaybillV1Enum.COMPLETION_UNLOADING.getCode()).contains(t.getOrderStatus()))
+                .filter(t ->!Arrays.asList(CarWaybillV1Enum.WEIGHT_TRAFFIC.getCode(),CarWaybillV1Enum.WAIT_UNLOADING.getCode(),CarWaybillV1Enum.APPROVAL_TREAT.getCode(), CarWaybillV1Enum.COMPLETION_UNLOADING.getCode()).contains(t.getOrderStatus()))
                 .sorted(Comparator.comparing(WaybillOrderNodeVo.Timeline::getCreateTime))
                 .collect(Collectors.groupingBy(WaybillOrderNodeVo.Timeline::getOrderStatus));
         List<WaybillOrderNodeVo.WaybillOrderNode> nodeList = Lists.newArrayList();