|
|
|
@ -118,6 +118,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
Long loadId = loadCarsDTO.getLoadId(); |
|
|
|
|
Integer startCarType = loadCarsDTO.getStartCarType(); |
|
|
|
|
Long warehouseId = loadCarsDTO.getWarehouseId(); |
|
|
|
|
String fullLoadRate = loadCarsDTO.getFullLoadRate(); |
|
|
|
|
|
|
|
|
|
//先查询车辆配载计划
|
|
|
|
|
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); |
|
|
|
@ -136,6 +137,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
throw new CustomerException(400,"未有权限进行该操作"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(StringUtil.isNotBlank(fullLoadRate)){ |
|
|
|
|
carsLoadEntity.setFullLoadRate(new BigDecimal(fullLoadRate)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(startCarType == 1){ |
|
|
|
|
//车辆配载发车
|
|
|
|
|
//查询发站仓节点信息
|
|
|
|
@ -616,8 +621,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
Long nowWarehouseId = carsLoadEntity.getNowWarehouseId();//当前节点id
|
|
|
|
|
|
|
|
|
|
if(!warehouseId.equals(nowWarehouseId)){ |
|
|
|
|
log.warn("#############cancelArriveCarByLoadId: 未有权限进行该操作 loadId={} nowWarehouseId={}",loadId,nowWarehouseId); |
|
|
|
|
throw new CustomerException(400,"未有权限进行该操作"); |
|
|
|
|
log.warn("#############cancelArriveCarByLoadId: 配载未到达当前仓 loadId={} nowWarehouseId={}",loadId,nowWarehouseId); |
|
|
|
|
throw new CustomerException(400,"配载未到达当前仓"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String loadStatus = carsLoadEntity.getLoadStatus(); |
|
|
|
@ -634,6 +639,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
String nodeStatus = currentCarsLoadLineEntity.getNodeStatus(); |
|
|
|
|
Integer sort = currentCarsLoadLineEntity.getSort(); |
|
|
|
|
|
|
|
|
|
String unloadStatus = currentCarsLoadLineEntity.getUnloadStatus(); |
|
|
|
|
if(!"0".equals(unloadStatus)){ |
|
|
|
|
log.warn("#############unloadByLoadId: 已经确认过卸车 loadId={} nowWarehouseId={} unloadStatus={}",loadId,nowWarehouseId,unloadStatus); |
|
|
|
|
throw new CustomerException(400,"已经确认过卸车"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//修改已卸车数据为确认状态
|
|
|
|
|
trunklineCarsLoadScanService.updateUnloadCheckByLoadIdAndWarehouseId(loadId,warehouseId); |
|
|
|
|
|
|
|
|
|
if(unloadType == 1){ |
|
|
|
|
//网点卸车确认
|
|
|
|
|
if("40".equals(loadStatus)){ |
|
|
|
@ -1465,7 +1479,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
Long waybillId = null; |
|
|
|
|
String waybillNo = null; |
|
|
|
|
String orderCode = null; |
|
|
|
|
Integer isData = null; |
|
|
|
|
Integer isData = 1; |
|
|
|
|
Integer isAbnormal = null; |
|
|
|
|
Long trayId = null; |
|
|
|
|
String trayName = null; |
|
|
|
@ -1496,6 +1510,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
carsLoadScanEntity.setNum(1); |
|
|
|
|
carsLoadScanEntity.setType(1); |
|
|
|
|
carsLoadScanEntity.setIsSupple(0); |
|
|
|
|
carsLoadScanEntity.setUnloadCheck(0); |
|
|
|
|
if(Objects.isNull(parcelListEntity)){ |
|
|
|
|
carsLoadScanEntity.setLoadingAbnormal(1); |
|
|
|
|
isAbnormal = 1; |
|
|
|
@ -1552,16 +1567,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
Long packageId = parcelListEntity.getId(); |
|
|
|
|
waybillNo = parcelListEntity.getWaybillNumber(); |
|
|
|
|
orderCode = parcelListEntity.getOrderCode(); |
|
|
|
|
fromWarehouseId = parcelListEntity.getWarehouseId(); |
|
|
|
|
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo); |
|
|
|
|
if(Objects.isNull(waybillEntity)){ |
|
|
|
|
log.warn("##################loadingScan: 运单信息不存在 waybillNo={}",waybillNo); |
|
|
|
|
return R.fail(405,"运单信息不存在"); |
|
|
|
|
} |
|
|
|
|
waybillId = waybillEntity.getId(); |
|
|
|
|
|
|
|
|
|
carsLoadScanEntity.setWaybillId(waybillId); |
|
|
|
|
carsLoadScanEntity.setWaybillNo(waybillNo); |
|
|
|
|
carsLoadScanEntity.setOrderCode(orderCode); |
|
|
|
|
carsLoadScanEntity.setFromWarehouseId(warehouseId); |
|
|
|
|
carsLoadScanEntity.setFromWarehouseId(fromWarehouseId); |
|
|
|
|
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); |
|
|
|
|
if(Objects.isNull(stockArticleEntity)){ |
|
|
|
@ -1594,7 +1611,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
isAbnormal = 0; |
|
|
|
|
remark = "正常装车"; |
|
|
|
|
} |
|
|
|
|
carsLoadScanEntity.setFinalNodeId(carsOrderEntity.getFinalNodeId()); |
|
|
|
|
carsLoadScanEntity.setFinalNodeId(fromWarehouseId); |
|
|
|
|
} |
|
|
|
|
distributionParcelListClient.updateOrderPackageCodeById(packageId,"60"); |
|
|
|
|
distributionStockArticleClient.submitHandleNumByOrderId(1,articleId); |
|
|
|
@ -2050,6 +2067,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
|
|
|
|
|
distributionStockArticleClient.saveOrUpdate(zeroStockArticleEntity); |
|
|
|
|
} |
|
|
|
|
//更新数量
|
|
|
|
|
updateNumByLoadId(loadId); |
|
|
|
|
|
|
|
|
|
return R.success("添加成功"); |
|
|
|
|
} |
|
|
|
@ -2190,6 +2209,45 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
return R.success("打托成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R determineHasNoFinalNode(Long loadId, Long warehouseId) { |
|
|
|
|
|
|
|
|
|
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); |
|
|
|
|
if(Objects.isNull(carsLoadEntity)){ |
|
|
|
|
log.error("###########determineHasNoFinalNode: 配载计划不存在 loadId={}",loadId); |
|
|
|
|
return R.fail(405,"配载计划不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<HasNotFinalNodeIdDataVO> list = trunklineCarsLoadScanService.findNoFinalNodeData(loadId,warehouseId); |
|
|
|
|
if(Objects.isNull(list) || list.size() == 0){ |
|
|
|
|
return R.success("未有需要添加目的仓的数据"); |
|
|
|
|
}else{ |
|
|
|
|
return R.data(list); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R updateLoadScanFinalNodeIdById(LoadCarsDTO loadCarsDTO) { |
|
|
|
|
Long loadId = loadCarsDTO.getLoadId(); |
|
|
|
|
Long warehouseId = loadCarsDTO.getWarehouseId(); |
|
|
|
|
List<LoadScanFinalNodeIdVO> loadScanFinalNodeIdList = loadCarsDTO.getLoadScanFinalNodeIdList(); |
|
|
|
|
|
|
|
|
|
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); |
|
|
|
|
if(Objects.isNull(carsLoadEntity)){ |
|
|
|
|
log.error("###########determineHasNoFinalNode: 配载计划不存在 loadId={}",loadId); |
|
|
|
|
return R.fail(405,"配载计划不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (LoadScanFinalNodeIdVO loadScanFinalNodeIdVO : loadScanFinalNodeIdList) { |
|
|
|
|
Long loadScanId = loadScanFinalNodeIdVO.getLoadScanId(); |
|
|
|
|
Long finalNodeId = loadScanFinalNodeIdVO.getFinalNodeId(); |
|
|
|
|
trunklineCarsLoadScanService.updateFinalNodeIdById(loadScanId,finalNodeId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return R.success("更新成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R loadingTrayInfo(LoadCarsDTO loadCarsDTO) { |
|
|
|
|
log.info("##############loadingTrayInfo: 查询托盘的货物信息"); |
|
|
|
@ -2414,6 +2472,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R arriveUnloadPageList(LoadCarsDTO loadCarsDTO) { |
|
|
|
|
|
|
|
|
|
Long warehouseId = loadCarsDTO.getWarehouseId(); |
|
|
|
|
|
|
|
|
|
IPage<Object> page = new Page<>(); |
|
|
|
|
page.setCurrent(loadCarsDTO.getPageNum()); |
|
|
|
|
page.setSize(loadCarsDTO.getPageSize()); |
|
|
|
@ -2425,6 +2486,20 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
|
|
|
|
|
IPage<TrunklineCarsLoadVO> pageList = baseMapper.arriveUnloadPageList(page,loadCarsDTO); |
|
|
|
|
|
|
|
|
|
List<TrunklineCarsLoadVO> records = pageList.getRecords(); |
|
|
|
|
for (TrunklineCarsLoadVO trunklineCarsLoadVO : records) { |
|
|
|
|
Long loadId = trunklineCarsLoadVO.getId(); |
|
|
|
|
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId); |
|
|
|
|
Integer sort = carsLoadLineEntity.getSort(); |
|
|
|
|
TrunklineCarsLoadLineEntity upCarsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndSort(loadId, sort - 1); |
|
|
|
|
String nodeStatus = upCarsLoadLineEntity.getNodeStatus(); |
|
|
|
|
if("20".equals(nodeStatus)){ |
|
|
|
|
trunklineCarsLoadVO.setLastStartCarStatus(1); |
|
|
|
|
}else{ |
|
|
|
|
trunklineCarsLoadVO.setLastStartCarStatus(0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
pageList.setRecords(records); |
|
|
|
|
return R.data(pageList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2592,13 +2667,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
distributionParcelListEntity = new DistributionParcelListEntity(); |
|
|
|
|
BeanUtil.copy(parcelListEntity,distributionParcelListEntity); |
|
|
|
|
distributionParcelListEntity.setId(null); |
|
|
|
|
distributionParcelListEntity.setOrderPackageStatus("30"); |
|
|
|
|
distributionParcelListEntity.setIsTransfer(1); |
|
|
|
|
if(!Objects.isNull(warehouseWaybillEntity)){ |
|
|
|
|
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
|
|
|
|
|
if(destinationWarehouseId.equals(warehouseId)){ |
|
|
|
|
distributionParcelListEntity.setOrderPackageStatus("20"); |
|
|
|
|
distributionParcelListEntity.setIsTransfer(0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
distributionParcelListEntity.setAdvanceId(parcelListEntity.getAdvanceId()); |
|
|
|
|
distributionParcelListEntity.setOrderPackageStatus("20"); |
|
|
|
|
distributionParcelListEntity.setWarehouseId(warehouseId); |
|
|
|
|
distributionParcelListEntity.setWarehouse(warehouseName); |
|
|
|
|
distributionParcelListEntity.setTrainNumber(loadCode); |
|
|
|
@ -2923,9 +3000,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
return R.fail(405,"配载计划信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Integer planUnloadNum = 0; |
|
|
|
|
|
|
|
|
|
//查询已扫描卸车的包件
|
|
|
|
|
List<UnloadScanOrderVO> unloadScanOrderList = trunklineCarsLoadScanService.findPackageWithOrderList(loadId,warehouseId); |
|
|
|
|
for (UnloadScanOrderVO unloadScanOrderVO : unloadScanOrderList) { |
|
|
|
|
Integer loadingNum = unloadScanOrderVO.getLoadingNum(); |
|
|
|
|
planUnloadNum = planUnloadNum +loadingNum; |
|
|
|
|
String waybillNo = unloadScanOrderVO.getWaybillNo(); |
|
|
|
|
String orderCode = unloadScanOrderVO.getOrderCode(); |
|
|
|
|
List<UnloadPackageVO> unloadPackageList = trunklineCarsLoadScanService.findUnloadPackageList(loadId,warehouseId,waybillNo,orderCode); |
|
|
|
@ -2935,6 +3016,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
//查询已装车的零担
|
|
|
|
|
List<UnloadZeroVO> zeroList = trunklineCarsOrderService.findUnloadZeroList(loadId,warehouseId); |
|
|
|
|
for (UnloadZeroVO unloadZeroVO : zeroList) { |
|
|
|
|
Integer loadingNum = unloadZeroVO.getLoadingNum(); |
|
|
|
|
planUnloadNum = planUnloadNum +loadingNum; |
|
|
|
|
String waybillNo = unloadZeroVO.getWaybillNo(); |
|
|
|
|
String orderCode = unloadZeroVO.getOrderCode(); |
|
|
|
|
List<UnloadPackageVO> unloadPackageList = trunklineCarsLoadScanService.findUnloadPackageList(loadId,warehouseId,waybillNo,orderCode); |
|
|
|
@ -2955,6 +3038,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
trunklineCarsLoadVO.setUnloadScanOrderList(unloadScanOrderList); |
|
|
|
|
trunklineCarsLoadVO.setUnloadZeroList(zeroList); |
|
|
|
|
trunklineCarsLoadVO.setExceptionList(exceptionList); |
|
|
|
|
trunklineCarsLoadVO.setPlanUnloadNum(planUnloadNum); |
|
|
|
|
|
|
|
|
|
return R.data(trunklineCarsLoadVO); |
|
|
|
|
} |
|
|
|
|