|
|
|
@ -1181,15 +1181,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
throw new CustomerException(400, "配载计划不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Long nowWarehouseId = carsLoadEntity.getNowWarehouseId();//当前节点id
|
|
|
|
|
String carsNo = carsLoadEntity.getCarsNo(); |
|
|
|
|
|
|
|
|
|
if (!warehouseId.equals(nowWarehouseId)) { |
|
|
|
|
log.warn("#############cancelArriveCarByLoadId: 配载未到达当前仓 loadId={} nowWarehouseId={}", loadId, nowWarehouseId); |
|
|
|
|
throw new CustomerException(400, "配载未到达当前仓"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String loadStatus = carsLoadEntity.getLoadStatus(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (!"20".equals(loadStatus) && !"40".equals(loadStatus)) {
|
|
|
|
@ -1197,9 +1189,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
// throw new CustomerException(400, "配载计划暂未到车");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
TrunklineCarsLoadLineEntity currentCarsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, nowWarehouseId); |
|
|
|
|
TrunklineCarsLoadLineEntity currentCarsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId); |
|
|
|
|
if (Objects.isNull(currentCarsLoadLineEntity)) { |
|
|
|
|
log.warn("#############unloadByLoadId: 当前节点信息不存在 loadId={} nowWarehouseId={}", loadId, nowWarehouseId); |
|
|
|
|
log.warn("#############unloadByLoadId: 当前节点信息不存在 loadId={} warehouseId={}", loadId, warehouseId); |
|
|
|
|
throw new CustomerException(400, "当前节点信息不存在"); |
|
|
|
|
} |
|
|
|
|
String nodeStatus = currentCarsLoadLineEntity.getNodeStatus(); |
|
|
|
@ -1207,11 +1199,21 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
|
|
|
|
|
String unloadStatus = currentCarsLoadLineEntity.getUnloadStatus(); |
|
|
|
|
if (!"0".equals(unloadStatus)) { |
|
|
|
|
log.warn("#############unloadByLoadId: 已经确认过卸车 loadId={} nowWarehouseId={} unloadStatus={}", loadId, nowWarehouseId, unloadStatus); |
|
|
|
|
log.warn("#############unloadByLoadId: 已经确认过卸车 loadId={} warehouseId={} unloadStatus={}", loadId, warehouseId, unloadStatus); |
|
|
|
|
throw new CustomerException(400, "已经确认过卸车"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Long nowWarehouseId = carsLoadEntity.getNowWarehouseId();//当前节点id
|
|
|
|
|
String carsNo = carsLoadEntity.getCarsNo(); |
|
|
|
|
|
|
|
|
|
if (!warehouseId.equals(nowWarehouseId)) { |
|
|
|
|
log.warn("#############cancelArriveCarByLoadId: 配载未到达当前仓 loadId={} nowWarehouseId={}", loadId, nowWarehouseId); |
|
|
|
|
throw new CustomerException(400, "配载未到达当前仓"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String loadStatus = carsLoadEntity.getLoadStatus(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TrunklineCarsLoadLineEntity updateUnloadStatus = new TrunklineCarsLoadLineEntity(); |
|
|
|
|
WorkNodeEnums node = null; |
|
|
|
@ -13305,6 +13307,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
|
|
|
|
|
carsLoadScanEntities.forEach(carsLoadScanEntity -> { |
|
|
|
|
String orderPackageCode = carsLoadScanEntity.getScanCode(); |
|
|
|
|
Date unloadTime = carsLoadScanEntity.getUnloadTime(); |
|
|
|
|
TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = advanceDetailMap.get(orderPackageCode); |
|
|
|
|
if(!Objects.isNull(trunklineAdvanceDetailEntity)){ |
|
|
|
|
orderPackageCodeSet.add(orderPackageCode); |
|
|
|
@ -13317,7 +13320,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
incomingAdvanceDetailList.add(trunklineAdvanceDetailEntity); |
|
|
|
|
}else{ |
|
|
|
|
updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getNowWarehouseId()); |
|
|
|
|
trunklineAdvanceDetailEntity.setReserve5(CommonUtil.dateToStringGeneral(unloadTime)); |
|
|
|
|
udateAdvanceDetailList.add(trunklineAdvanceDetailEntity); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
updateScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode()); |
|
|
|
|
updateScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId()); |
|
|
|
@ -13342,27 +13347,67 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(CollUtil.isNotEmpty(udateAdvanceDetailList)){ |
|
|
|
|
|
|
|
|
|
advanceService.saveOrderAndPackages(udateAdvanceDetailList, warehouseId); |
|
|
|
|
|
|
|
|
|
List<DistributionParcelListEntity> updateParceList = new ArrayList<>(); |
|
|
|
|
udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> { |
|
|
|
|
|
|
|
|
|
String orderPackageCode = trunklineAdvanceDetailEntity.getOrderPackageCode(); |
|
|
|
|
List<DistributionParcelListEntity> list = distributionParcelListClient.findListByOrderPackageCodeAndStatus(orderPackageCode,"20"); |
|
|
|
|
//把list通过warehouseId进行分组
|
|
|
|
|
String reserve5 = trunklineAdvanceDetailEntity.getReserve5(); |
|
|
|
|
Date unloadTime = CommonUtil.StringToDate(reserve5); |
|
|
|
|
|
|
|
|
|
if(CollUtil.isNotEmpty(list)){ |
|
|
|
|
list.forEach(distributionParcelListEntity -> { |
|
|
|
|
//查询是否有在系统无编码后进行卸车的数据
|
|
|
|
|
int unloadNum = trunklineCarsLoadScanService.findEntityByOrderPackageCodeAndUnloadTime(orderPackageCode,unloadTime); |
|
|
|
|
if(unloadNum > 0){ |
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId); |
|
|
|
|
if(!Objects.isNull(parcelListEntity)){ |
|
|
|
|
DistributionParcelListEntity updateEntity = new DistributionParcelListEntity(); |
|
|
|
|
updateEntity.setId(distributionParcelListEntity.getId()); |
|
|
|
|
updateEntity.setId(parcelListEntity.getId()); |
|
|
|
|
updateEntity.setOrderPackageStatus("60"); |
|
|
|
|
updateEntity.setOrderCode(distributionParcelListEntity.getOrderCode()); |
|
|
|
|
updateEntity.setWarehouseId(distributionParcelListEntity.getWarehouseId()); |
|
|
|
|
updateEntity.setOrderCode(parcelListEntity.getOrderCode()); |
|
|
|
|
updateEntity.setWarehouseId(parcelListEntity.getWarehouseId()); |
|
|
|
|
updateParceList.add(updateEntity); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
List<DistributionParcelListEntity> list = distributionParcelListClient.findListByOrderPackageCodeAndStatusAndNoWarehouseId(orderPackageCode,"20",warehouseId); |
|
|
|
|
if(CollUtil.isNotEmpty(list)) { |
|
|
|
|
list.forEach(distributionParcelListEntity -> { |
|
|
|
|
DistributionParcelListEntity updateEntity = new DistributionParcelListEntity(); |
|
|
|
|
updateEntity.setId(distributionParcelListEntity.getId()); |
|
|
|
|
updateEntity.setOrderPackageStatus("60"); |
|
|
|
|
updateEntity.setOrderCode(distributionParcelListEntity.getOrderCode()); |
|
|
|
|
updateEntity.setWarehouseId(distributionParcelListEntity.getWarehouseId()); |
|
|
|
|
updateParceList.add(updateEntity); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
distributionParcelListClient.updateList(updateParceList); |
|
|
|
|
|
|
|
|
|
advanceService.saveOrderAndPackages(udateAdvanceDetailList, warehouseId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// List<DistributionParcelListEntity> updateParceList = new ArrayList<>();
|
|
|
|
|
// udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> {
|
|
|
|
|
// String orderPackageCode = trunklineAdvanceDetailEntity.getOrderPackageCode();
|
|
|
|
|
// List<DistributionParcelListEntity> list = distributionParcelListClient.findListByOrderPackageCodeAndStatus(orderPackageCode,"20");
|
|
|
|
|
// //把list通过warehouseId进行分组
|
|
|
|
|
//
|
|
|
|
|
// if(CollUtil.isNotEmpty(list)){
|
|
|
|
|
// list.forEach(distributionParcelListEntity -> {
|
|
|
|
|
// DistributionParcelListEntity updateEntity = new DistributionParcelListEntity();
|
|
|
|
|
// updateEntity.setId(distributionParcelListEntity.getId());
|
|
|
|
|
// updateEntity.setOrderPackageStatus("60");
|
|
|
|
|
// updateEntity.setOrderCode(distributionParcelListEntity.getOrderCode());
|
|
|
|
|
// updateEntity.setWarehouseId(distributionParcelListEntity.getWarehouseId());
|
|
|
|
|
// updateParceList.add(updateEntity);
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// });
|
|
|
|
|
// distributionParcelListClient.updateList(updateParceList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<TrunklineAdvanceDetailEntity> updateNowWarehouseList = new ArrayList<>(); |
|
|
|
|
udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> { |
|
|
|
|