|
@@ -2780,6 +2780,11 @@ public class KwtLogisticsConsignmentService {
|
|
|
if (Objects.isNull(logisticsOrder)){
|
|
if (Objects.isNull(logisticsOrder)){
|
|
|
throw new BusinessException("未找到该物流订单信息");
|
|
throw new BusinessException("未找到该物流订单信息");
|
|
|
}
|
|
}
|
|
|
|
|
+ List<Integer> statusList = Arrays.asList(LogisticsOrderV1Enum.WAIT_DELIVERY.getCode(),
|
|
|
|
|
+ LogisticsOrderV1Enum.WAIT_DELIVERY.getCode());
|
|
|
|
|
+ if (!statusList.contains(logisticsOrder.getStatus())){
|
|
|
|
|
+ throw new BusinessException("该物流订单状态不能进行派车");
|
|
|
|
|
+ }
|
|
|
//车牌id去重
|
|
//车牌id去重
|
|
|
List<DispatchCarReq.CarInfo> carInfos = req.getCarInfos();
|
|
List<DispatchCarReq.CarInfo> carInfos = req.getCarInfos();
|
|
|
Set<String> truckIds = carInfos.stream()
|
|
Set<String> truckIds = carInfos.stream()
|
|
@@ -2863,8 +2868,13 @@ public class KwtLogisticsConsignmentService {
|
|
|
}
|
|
}
|
|
|
KwtLogisticsOrder updateLogisticsOrder = new KwtLogisticsOrder();
|
|
KwtLogisticsOrder updateLogisticsOrder = new KwtLogisticsOrder();
|
|
|
updateLogisticsOrder.setId(logOrderId);
|
|
updateLogisticsOrder.setId(logOrderId);
|
|
|
|
|
+
|
|
|
|
|
+ if (!Arrays.asList(LogisticsOrderV1Enum.WAIT_DELIVERY, LogisticsOrderV1Enum.HAVE_RECONCILED.getCode()).contains(logisticsOrder.getStatus())){
|
|
|
|
|
+ throw new BusinessException("该物流订单状态不能进行完结");
|
|
|
|
|
+ }
|
|
|
if (Objects.equals(logisticsOrder.getStatus(), LogisticsOrderV1Enum.WAIT_DELIVERY.getCode())){
|
|
if (Objects.equals(logisticsOrder.getStatus(), LogisticsOrderV1Enum.WAIT_DELIVERY.getCode())){
|
|
|
- updateLogisticsOrder.setStatus(LogisticsOrderV1Enum.HAVE_FINISHED.getCode());
|
|
|
|
|
|
|
+ updateLogisticsOrder.setStatus(LogisticsOrderV1Enum.HAVE_RECONCILED.getCode());
|
|
|
|
|
+ return logisticsOrderRepository.updateLogisticsOrder(updateLogisticsOrder);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//查询物流订单下的所有运单
|
|
//查询物流订单下的所有运单
|
|
@@ -2874,9 +2884,9 @@ public class KwtLogisticsConsignmentService {
|
|
|
CarWaybillV1Enum.WAIT_UNLOADING.getCode()) || !Objects.equals(x.getStatus(),
|
|
CarWaybillV1Enum.WAIT_UNLOADING.getCode()) || !Objects.equals(x.getStatus(),
|
|
|
CarWaybillV1Enum.APPROVAL_TREAT.getCode()));
|
|
CarWaybillV1Enum.APPROVAL_TREAT.getCode()));
|
|
|
if (b){
|
|
if (b){
|
|
|
- updateLogisticsOrder.setStatus(LogisticsOrderEnum.NEARING_COMPLETION.getCode());
|
|
|
|
|
- }else if (Objects.equals(logisticsOrder.getStatus(), LogisticsOrderEnum.NEARING_COMPLETION.getCode())){
|
|
|
|
|
- updateLogisticsOrder.setStatus(LogisticsOrderEnum.HAVE_FINISHED.getCode());
|
|
|
|
|
|
|
+ updateLogisticsOrder.setStatus(LogisticsOrderV1Enum.HAVE_FINISHED.getCode());
|
|
|
|
|
+ }else {
|
|
|
|
|
+ updateLogisticsOrder.setStatus(LogisticsOrderV1Enum.HAVE_RECONCILED.getCode());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return logisticsOrderRepository.updateLogisticsOrder(updateLogisticsOrder);
|
|
return logisticsOrderRepository.updateLogisticsOrder(updateLogisticsOrder);
|