|
|
|
@ -1776,7 +1776,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
isAbnormal = 0; |
|
|
|
|
remark = "正常装车"; |
|
|
|
|
} |
|
|
|
|
carsLoadScanEntity.setFinalNodeId(carsOrderEntity.getFinalNodeId()); |
|
|
|
|
Long finalNodeId = carsOrderEntity.getFinalNodeId(); |
|
|
|
|
BasicdataWarehouseEntity finalNode = basicdataWarehouseClient.getEntityWarehouseId(finalNodeId); |
|
|
|
|
String finalNodeName = null; |
|
|
|
|
if(!Objects.isNull(finalNode)){ |
|
|
|
|
finalNodeName = finalNode.getName(); |
|
|
|
|
} |
|
|
|
|
carsLoadScanEntity.setFinalNodeId(finalNodeId); |
|
|
|
|
carsLoadScanEntity.setFinalNodeName(finalNodeName); |
|
|
|
|
} |
|
|
|
|
distributionParcelListClient.updateOrderPackageCodeById(packageId,"60"); |
|
|
|
|
distributionStockArticleClient.submitHandleNumByOrderId(1,articleId); |
|
|
|
@ -1852,6 +1859,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
Integer isData = 1; |
|
|
|
|
Integer planNum = null; |
|
|
|
|
Integer difficult = 0; |
|
|
|
|
Long finalNodeId = null; |
|
|
|
|
String finalNodeName = null; |
|
|
|
|
String loadCode = carsLoadEntity.getCarsNo(); |
|
|
|
|
//判断订单是否在计划当中
|
|
|
|
|
QueryWrapper<TrunklineCarsOrderEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
@ -1864,6 +1873,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
isAbnormal = 1; |
|
|
|
|
remark = "有数据,无计划,异常装车"; |
|
|
|
|
}else{ |
|
|
|
|
finalNodeId = carsOrderEntity.getFinalNodeId(); |
|
|
|
|
BasicdataWarehouseEntity finalNode = basicdataWarehouseClient.getEntityWarehouseId(finalNodeId); |
|
|
|
|
if(!Objects.isNull(finalNode)){ |
|
|
|
|
finalNodeName = finalNode.getName(); |
|
|
|
|
} |
|
|
|
|
planNum = carsOrderEntity.getPlanNum();//计划件数
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1910,7 +1924,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
carsLoadScanEntity.setTrayCode(trayCode); |
|
|
|
|
carsLoadScanEntity.setRemark(remark); |
|
|
|
|
carsLoadScanEntity.setFromWarehouseId(warehouseId); |
|
|
|
|
carsLoadScanEntity.setFinalNodeId(carsOrderEntity.getFinalNodeId()); |
|
|
|
|
carsLoadScanEntity.setFinalNodeId(finalNodeId); |
|
|
|
|
carsLoadScanEntity.setFinalNodeName(finalNodeName); |
|
|
|
|
trunklineCarsLoadScanService.save(carsLoadScanEntity); |
|
|
|
|
loadScanId = carsLoadScanEntity.getId(); |
|
|
|
|
difficult = enterNum; |
|
|
|
@ -2406,7 +2421,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
for (LoadScanFinalNodeIdVO loadScanFinalNodeIdVO : loadScanFinalNodeIdList) { |
|
|
|
|
Long loadScanId = loadScanFinalNodeIdVO.getLoadScanId(); |
|
|
|
|
Long finalNodeId = loadScanFinalNodeIdVO.getFinalNodeId(); |
|
|
|
|
trunklineCarsLoadScanService.updateFinalNodeIdById(loadScanId,finalNodeId); |
|
|
|
|
String finalNodeName = null; |
|
|
|
|
BasicdataWarehouseEntity finalNode = basicdataWarehouseClient.getEntityWarehouseId(finalNodeId); |
|
|
|
|
if(!Objects.isNull(finalNode)){ |
|
|
|
|
finalNodeName = finalNode.getName(); |
|
|
|
|
} |
|
|
|
|
trunklineCarsLoadScanService.updateFinalNodeIdAndFinalNodeNameById(loadScanId,finalNodeId,finalNodeName); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -3646,6 +3666,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
String orderCode = carsLoadScanEntity.getOrderCode(); |
|
|
|
|
Long loadScanId = carsLoadScanEntity.getId(); |
|
|
|
|
Long fromWarehouseId = carsLoadScanEntity.getFromWarehouseId(); |
|
|
|
|
Integer isData = carsLoadScanEntity.getIsData(); |
|
|
|
|
Integer isAbnormal = 0; |
|
|
|
|
if(warehouseId.equals(finalNodeId)){ |
|
|
|
|
carsLoadScanEntity.setUnloadAbnormal(0); |
|
|
|
@ -3672,81 +3693,82 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
trunklineCarsUnloadLogService.savaUnloadLog(warehouseId,warehouseName,loadId,loadCode,waybillId,waybillNo,orderCode,orderPackageCode,1, |
|
|
|
|
1,1,isAbnormal,trayId,trayCode,trayName,fromWarehouseId,loadScanId,remark); |
|
|
|
|
|
|
|
|
|
if(1 == isData){ |
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, fromWarehouseId); |
|
|
|
|
if(Objects.isNull(parcelListEntity)){ |
|
|
|
|
log.warn("##############unloadPackage: 包件信息不存在 orderPackageCode={} fromWarehouseId={}",orderPackageCode,fromWarehouseId); |
|
|
|
|
return R.fail(405,"包件信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, fromWarehouseId); |
|
|
|
|
if(Objects.isNull(parcelListEntity)){ |
|
|
|
|
log.warn("##############unloadPackage: 包件信息不存在 orderPackageCode={} fromWarehouseId={}",orderPackageCode,fromWarehouseId); |
|
|
|
|
return R.fail(405,"包件信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Long currentOrderId = null; |
|
|
|
|
//查询当前仓库订单信息有没有
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); |
|
|
|
|
if(Objects.isNull(stockArticleEntity)){ |
|
|
|
|
//查询包件前面仓的订单信息
|
|
|
|
|
DistributionStockArticleEntity articleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId); |
|
|
|
|
stockArticleEntity = new DistributionStockArticleEntity(); |
|
|
|
|
BeanUtil.copy(articleEntity,stockArticleEntity); |
|
|
|
|
stockArticleEntity.setId(null); |
|
|
|
|
stockArticleEntity.setWarehouseId(warehouseId); |
|
|
|
|
stockArticleEntity.setWarehouse(warehouseName); |
|
|
|
|
stockArticleEntity.setHandQuantity(0); |
|
|
|
|
stockArticleEntity.setCompleteSet(1); |
|
|
|
|
stockArticleEntity.setStockupStatus("10"); |
|
|
|
|
stockArticleEntity.setReservationStatus("10"); |
|
|
|
|
stockArticleEntity.setOrderStatus("10"); |
|
|
|
|
stockArticleEntity.setGroundingStatus("10"); |
|
|
|
|
stockArticleEntity.setOrderReceiveStatus("10"); |
|
|
|
|
stockArticleEntity.setFreezeStatus("10"); |
|
|
|
|
stockArticleEntity.setSortingQuantity(0); |
|
|
|
|
stockArticleEntity.setDeliveryQuantity(0); |
|
|
|
|
stockArticleEntity.setTransferQuantity(0); |
|
|
|
|
stockArticleEntity.setSigninQuantity(0); |
|
|
|
|
stockArticleEntity.setIncomingNum(0); |
|
|
|
|
currentOrderId = distributionStockArticleClient.addData(stockArticleEntity); |
|
|
|
|
stockArticleEntity.setId(currentOrderId); |
|
|
|
|
}else{ |
|
|
|
|
currentOrderId = stockArticleEntity.getId(); |
|
|
|
|
} |
|
|
|
|
Long currentOrderId = null; |
|
|
|
|
//查询当前仓库订单信息有没有
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); |
|
|
|
|
if(Objects.isNull(stockArticleEntity)){ |
|
|
|
|
//查询包件前面仓的订单信息
|
|
|
|
|
DistributionStockArticleEntity articleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId); |
|
|
|
|
stockArticleEntity = new DistributionStockArticleEntity(); |
|
|
|
|
BeanUtil.copy(articleEntity,stockArticleEntity); |
|
|
|
|
stockArticleEntity.setId(null); |
|
|
|
|
stockArticleEntity.setWarehouseId(warehouseId); |
|
|
|
|
stockArticleEntity.setWarehouse(warehouseName); |
|
|
|
|
stockArticleEntity.setHandQuantity(0); |
|
|
|
|
stockArticleEntity.setCompleteSet(1); |
|
|
|
|
stockArticleEntity.setStockupStatus("10"); |
|
|
|
|
stockArticleEntity.setReservationStatus("10"); |
|
|
|
|
stockArticleEntity.setOrderStatus("10"); |
|
|
|
|
stockArticleEntity.setGroundingStatus("10"); |
|
|
|
|
stockArticleEntity.setOrderReceiveStatus("10"); |
|
|
|
|
stockArticleEntity.setFreezeStatus("10"); |
|
|
|
|
stockArticleEntity.setSortingQuantity(0); |
|
|
|
|
stockArticleEntity.setDeliveryQuantity(0); |
|
|
|
|
stockArticleEntity.setTransferQuantity(0); |
|
|
|
|
stockArticleEntity.setSigninQuantity(0); |
|
|
|
|
stockArticleEntity.setIncomingNum(0); |
|
|
|
|
currentOrderId = distributionStockArticleClient.addData(stockArticleEntity); |
|
|
|
|
stockArticleEntity.setId(currentOrderId); |
|
|
|
|
}else{ |
|
|
|
|
currentOrderId = stockArticleEntity.getId(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//判断包件当前仓是否是目的仓
|
|
|
|
|
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo); |
|
|
|
|
//判断包件当前仓是否是目的仓
|
|
|
|
|
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo); |
|
|
|
|
|
|
|
|
|
if(Objects.isNull(distributionParcelListEntity)){ |
|
|
|
|
distributionParcelListEntity = new DistributionParcelListEntity(); |
|
|
|
|
BeanUtil.copy(parcelListEntity,distributionParcelListEntity); |
|
|
|
|
distributionParcelListEntity.setId(null); |
|
|
|
|
distributionParcelListEntity.setOrderPackageStatus("30"); |
|
|
|
|
if(!Objects.isNull(warehouseWaybillEntity)){ |
|
|
|
|
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
|
|
|
|
|
if(destinationWarehouseId.equals(warehouseId)){ |
|
|
|
|
distributionParcelListEntity.setOrderPackageStatus("20"); |
|
|
|
|
if(Objects.isNull(distributionParcelListEntity)){ |
|
|
|
|
distributionParcelListEntity = new DistributionParcelListEntity(); |
|
|
|
|
BeanUtil.copy(parcelListEntity,distributionParcelListEntity); |
|
|
|
|
distributionParcelListEntity.setId(null); |
|
|
|
|
distributionParcelListEntity.setOrderPackageStatus("30"); |
|
|
|
|
if(!Objects.isNull(warehouseWaybillEntity)){ |
|
|
|
|
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
|
|
|
|
|
if(destinationWarehouseId.equals(warehouseId)){ |
|
|
|
|
distributionParcelListEntity.setOrderPackageStatus("20"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
distributionParcelListEntity.setWarehouseId(warehouseId); |
|
|
|
|
distributionParcelListEntity.setWarehouse(warehouseName); |
|
|
|
|
distributionParcelListEntity.setTrainNumber(loadCode); |
|
|
|
|
distributionParcelListEntity.setStockArticleId(currentOrderId); |
|
|
|
|
distributionParcelListEntity.setOrderPackageFreezeStatus("10"); |
|
|
|
|
distributionParcelListEntity.setOrderPackageGroundingStatus("10"); |
|
|
|
|
distributionParcelListEntity.setOrderPackageStockupStatus("10"); |
|
|
|
|
distributionParcelListEntity.setOrderPackageReservationStatus("10"); |
|
|
|
|
distributionParcelListEntity.setOrderPackageLoadingStatus("10"); |
|
|
|
|
distributionParcelListEntity.setWarehouseEntryTimeEnd(new Date()); |
|
|
|
|
boolean add = distributionParcelListClient.add(distributionParcelListEntity); |
|
|
|
|
if(add){ |
|
|
|
|
distributionStockArticleClient.addIncomingNum(currentOrderId,1); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
Long packageId = distributionParcelListEntity.getId(); |
|
|
|
|
String packageStatus = "30"; |
|
|
|
|
if(!Objects.isNull(warehouseWaybillEntity)){ |
|
|
|
|
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
|
|
|
|
|
if(destinationWarehouseId.equals(warehouseId)){ |
|
|
|
|
packageStatus = "20"; |
|
|
|
|
distributionParcelListEntity.setWarehouseId(warehouseId); |
|
|
|
|
distributionParcelListEntity.setWarehouse(warehouseName); |
|
|
|
|
distributionParcelListEntity.setTrainNumber(loadCode); |
|
|
|
|
distributionParcelListEntity.setStockArticleId(currentOrderId); |
|
|
|
|
distributionParcelListEntity.setOrderPackageFreezeStatus("10"); |
|
|
|
|
distributionParcelListEntity.setOrderPackageGroundingStatus("10"); |
|
|
|
|
distributionParcelListEntity.setOrderPackageStockupStatus("10"); |
|
|
|
|
distributionParcelListEntity.setOrderPackageReservationStatus("10"); |
|
|
|
|
distributionParcelListEntity.setOrderPackageLoadingStatus("10"); |
|
|
|
|
distributionParcelListEntity.setWarehouseEntryTimeEnd(new Date()); |
|
|
|
|
boolean add = distributionParcelListClient.add(distributionParcelListEntity); |
|
|
|
|
if(add){ |
|
|
|
|
distributionStockArticleClient.addIncomingNum(currentOrderId,1); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
Long packageId = distributionParcelListEntity.getId(); |
|
|
|
|
String packageStatus = "30"; |
|
|
|
|
if(!Objects.isNull(warehouseWaybillEntity)){ |
|
|
|
|
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
|
|
|
|
|
if(destinationWarehouseId.equals(warehouseId)){ |
|
|
|
|
packageStatus = "20"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
distributionParcelListClient.updateOrderPackageCodeById(packageId,packageStatus); |
|
|
|
|
} |
|
|
|
|
distributionParcelListClient.updateOrderPackageCodeById(packageId,packageStatus); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
updateNumByLoadId(loadId); |
|
|
|
|