|
|
|
@ -1999,7 +1999,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
return R.fail(405,"配载计划节点信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<TrunklineCarsLoadScanEntity> carsLoadScanEntities = new ArrayList<>(); |
|
|
|
|
for (ZeroSuppleVO zeroSuppleVO : zeroSuppleList) { |
|
|
|
|
String waybillNo = zeroSuppleVO.getWaybillNo(); |
|
|
|
|
String orderCode = zeroSuppleVO.getOrderCode(); |
|
|
|
@ -2038,13 +2037,152 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
carsLoadScanEntity.setRemark("零担补录异常装车"); |
|
|
|
|
carsLoadScanEntity.setUnloadCheck(0); |
|
|
|
|
carsLoadScanEntity.setIsSupple(1); |
|
|
|
|
carsLoadScanEntities.add(carsLoadScanEntity); |
|
|
|
|
trunklineCarsLoadScanService.save(carsLoadScanEntity); |
|
|
|
|
|
|
|
|
|
zeroStockArticleEntity.setHandQuantity(zeroStockArticleEntity.getHandQuantity() - enterNum); |
|
|
|
|
|
|
|
|
|
distributionStockArticleClient.saveOrUpdate(zeroStockArticleEntity); |
|
|
|
|
} |
|
|
|
|
trunklineCarsLoadScanService.saveBatch(carsLoadScanEntities); |
|
|
|
|
|
|
|
|
|
return R.success("添加成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R deleteZeroSuppleById(Long carsLoadScanId,Long warehouseId) { |
|
|
|
|
|
|
|
|
|
TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.getById(carsLoadScanId); |
|
|
|
|
if(Objects.isNull(carsLoadScanEntity)){ |
|
|
|
|
log.warn("##########deleteZeroSuppleById: 零担补录装车信息不存在 carsLoadScanId={}",carsLoadScanId); |
|
|
|
|
return R.fail(405,"零担补录装车信息不存在"); |
|
|
|
|
} |
|
|
|
|
String orderCode = carsLoadScanEntity.getOrderCode(); |
|
|
|
|
Integer num = carsLoadScanEntity.getNum(); |
|
|
|
|
Integer unloadNum = carsLoadScanEntity.getUnloadNum(); |
|
|
|
|
|
|
|
|
|
if(unloadNum != 0){ |
|
|
|
|
log.warn("##########deleteZeroSuppleById: 零担补录已卸车不能删除 carsLoadScanId={}",carsLoadScanId); |
|
|
|
|
return R.fail(405,"零担补录已卸车不能删除"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
trunklineCarsLoadScanService.removeById(carsLoadScanId); |
|
|
|
|
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(orderCode, warehouseId); |
|
|
|
|
if(Objects.isNull(stockArticleEntity)){ |
|
|
|
|
log.warn("##########deleteZeroSuppleById: 零担订单信息不存在 orderCode={} warehouseId={}",orderCode,warehouseId); |
|
|
|
|
return R.fail(405,"零担订单信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity() + num); |
|
|
|
|
|
|
|
|
|
distributionStockArticleClient.saveOrUpdate(stockArticleEntity); |
|
|
|
|
|
|
|
|
|
return R.success("删除成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R updateZeroSuppleNum(LoadCarsDTO loadCarsDTO) { |
|
|
|
|
Long carsLoadScanId = loadCarsDTO.getCarsLoadScanId(); |
|
|
|
|
Long warehouseId = loadCarsDTO.getWarehouseId(); |
|
|
|
|
Integer enterNum = loadCarsDTO.getEnterNum(); |
|
|
|
|
|
|
|
|
|
TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.getById(carsLoadScanId); |
|
|
|
|
if(Objects.isNull(carsLoadScanEntity)){ |
|
|
|
|
log.warn("##########deleteZeroSuppleById: 零担补录装车信息不存在 carsLoadScanId={}",carsLoadScanId); |
|
|
|
|
return R.fail(405,"零担补录装车信息不存在"); |
|
|
|
|
} |
|
|
|
|
String orderCode = carsLoadScanEntity.getOrderCode(); |
|
|
|
|
Integer num = carsLoadScanEntity.getNum(); |
|
|
|
|
Integer unloadNum = carsLoadScanEntity.getUnloadNum(); |
|
|
|
|
|
|
|
|
|
if(enterNum < unloadNum){ |
|
|
|
|
log.warn("##########deleteZeroSuppleById: 零担补录数量不能小于卸车数量 carsLoadScanId={} enterNum={}",carsLoadScanId,enterNum); |
|
|
|
|
return R.fail(405,"零担补录数量不能小于卸车数量"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int diffeuct = num - enterNum; |
|
|
|
|
|
|
|
|
|
carsLoadScanEntity.setNum(enterNum); |
|
|
|
|
trunklineCarsLoadScanService.updateById(carsLoadScanEntity); |
|
|
|
|
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(orderCode, warehouseId); |
|
|
|
|
if(Objects.isNull(stockArticleEntity)){ |
|
|
|
|
log.warn("##########deleteZeroSuppleById: 零担订单信息不存在 orderCode={} warehouseId={}",orderCode,warehouseId); |
|
|
|
|
return R.fail(405,"零担订单信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity() + diffeuct); |
|
|
|
|
|
|
|
|
|
distributionStockArticleClient.saveOrUpdate(stockArticleEntity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return R.success("修改成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R findNextNodeList(Long loadId, Long warehouseId) { |
|
|
|
|
|
|
|
|
|
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId); |
|
|
|
|
if(Objects.isNull(carsLoadLineEntity)){ |
|
|
|
|
log.warn("##########findNextNodeList: 当前节点信息不存在 loadId={} warehouseId={}",loadId,warehouseId); |
|
|
|
|
return R.fail(405,"当前节点信息不存在"); |
|
|
|
|
} |
|
|
|
|
Integer sort = carsLoadLineEntity.getSort(); |
|
|
|
|
List<TrunklineCarsLoadLineEntity> listMoreSortByLoadId = trunklineCarsLoadLineService.findListMoreSortByLoadId(loadId, sort); |
|
|
|
|
List<JSONObject> ls = new ArrayList<>(); |
|
|
|
|
for (TrunklineCarsLoadLineEntity trunklineCarsLoadLineEntity : listMoreSortByLoadId) { |
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
jsonObject.put("warehouseId",trunklineCarsLoadLineEntity.getNodeId()); |
|
|
|
|
jsonObject.put("warehouseName",trunklineCarsLoadLineEntity.getNodeName()); |
|
|
|
|
ls.add(jsonObject); |
|
|
|
|
} |
|
|
|
|
return R.data(ls); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R unloadTrayAllOne(LoadCarsDTO loadCarsDTO) { |
|
|
|
|
|
|
|
|
|
Long loadId = loadCarsDTO.getLoadId(); |
|
|
|
|
String trayCode = loadCarsDTO.getTrayCode(); |
|
|
|
|
String trayType = loadCarsDTO.getTrayType(); |
|
|
|
|
Integer isZero = loadCarsDTO.getIsZero(); |
|
|
|
|
String orderPackageCode = loadCarsDTO.getOrderPackageCode(); |
|
|
|
|
String orderCode = loadCarsDTO.getOrderCode(); |
|
|
|
|
String waybillNo = loadCarsDTO.getWaybillNo(); |
|
|
|
|
Integer enterNum = loadCarsDTO.getEnterNum(); |
|
|
|
|
Long warehouseId = loadCarsDTO.getWarehouseId(); |
|
|
|
|
|
|
|
|
|
if(0 == isZero){ |
|
|
|
|
unloadPackage(loadId,orderPackageCode,warehouseId,1,"卸分一体 卸车"); |
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("trayType",trayType); |
|
|
|
|
map.put("trayCode",trayCode); |
|
|
|
|
map.put("warehouseId",warehouseId); |
|
|
|
|
map.put("orderPackageCode",orderPackageCode); |
|
|
|
|
boolean b = trayTypeClient.orderScanOrderPackageCode(map); |
|
|
|
|
if(!b){ |
|
|
|
|
log.warn("##########findNextNodeList: 打托失败 trayCode={} orderPackageCode={}",trayCode,orderPackageCode); |
|
|
|
|
return R.fail(405,"打托失败"); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
unloadZero(loadId,waybillNo,enterNum,warehouseId,1,null,orderCode,"卸分一体 卸车"); |
|
|
|
|
|
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("trayType",trayType); |
|
|
|
|
map.put("trayCode",trayCode); |
|
|
|
|
map.put("warehouseId",warehouseId); |
|
|
|
|
map.put("orderCode",orderCode); |
|
|
|
|
map.put("num",enterNum); |
|
|
|
|
boolean b = trayTypeClient.enterZeroOrderByTrayCode(map); |
|
|
|
|
if(!b){ |
|
|
|
|
log.warn("##########findNextNodeList: 打托失败 trayCode={} orderCode={}",trayCode,orderCode); |
|
|
|
|
return R.fail(405,"打托失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return R.success("打托成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R loadingTrayInfo(LoadCarsDTO loadCarsDTO) { |
|
|
|
|
log.info("##############loadingTrayInfo: 查询托盘的货物信息"); |
|
|
|
|