|
|
|
@ -29,6 +29,7 @@ import com.logpm.distribution.feign.IDistributionParcelListClient;
|
|
|
|
|
import com.logpm.distribution.feign.IDistributionParcelNumberClient; |
|
|
|
|
import com.logpm.distribution.feign.IDistributionStockArticleClient; |
|
|
|
|
import com.logpm.distribution.vo.DistributionParcelListVO; |
|
|
|
|
import com.logpm.distribution.vo.ZeroPackageSupplyVO; |
|
|
|
|
import com.logpm.factorydata.enums.BrandEnums; |
|
|
|
|
import com.logpm.factorydata.feign.IFactoryDataClient; |
|
|
|
|
import com.logpm.factorydata.util.FactoryDataMessageSender; |
|
|
|
@ -1313,8 +1314,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
entity -> entity, |
|
|
|
|
(entity1, entity2) -> entity1)); // 处理可能的键冲突
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DistributionParcelListEntity> updateParceList = new ArrayList<>(); |
|
|
|
|
List<DistributionParcelNumberEntity> updateParceNumberList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
@ -1673,8 +1672,24 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
page.setSize(loadCarsDTO.getPageSize()); |
|
|
|
|
|
|
|
|
|
//查询当前仓零担在库列表
|
|
|
|
|
// IPage<JSONObject> pageList = distributionStockArticleClient.findZeroListByWarehouseId(warehouseId,pageNum,pageSize);
|
|
|
|
|
IPage<JSONObject> pageList = baseMapper.findSignOrderZeroListByWarehouseId(page, loadCarsDTO); |
|
|
|
|
IPage<ZeroSuppleListVO> pageList = baseMapper.findSignOrderZeroListByWarehouseId(page, loadCarsDTO); |
|
|
|
|
List<ZeroSuppleListVO> records = pageList.getRecords(); |
|
|
|
|
//把records中所有元素的orderId放入一个集合
|
|
|
|
|
List<Long> orderIdList = records.stream().map(ZeroSuppleListVO::getOrderId).collect(Collectors.toList()); |
|
|
|
|
List<ZeroPackageSupplyVO> packageList = distributionParcelListClient.findListByStockArticleIds(orderIdList); |
|
|
|
|
//把packageList中所有元素通过stockArticleId进行分组
|
|
|
|
|
Map<Long, List<ZeroPackageSupplyVO>> map = packageList.stream().collect(Collectors.groupingBy(ZeroPackageSupplyVO::getStockArticleId)); |
|
|
|
|
records.forEach(zeroSuppleListVO -> { |
|
|
|
|
Long orderId = zeroSuppleListVO.getOrderId(); |
|
|
|
|
List<JSONObject> jsonObjectList = new ArrayList<>(); |
|
|
|
|
List<ZeroPackageSupplyVO> zeroPackageSupplyVOS = map.get(orderId); |
|
|
|
|
zeroPackageSupplyVOS.forEach(zeroPackageSupplyVO -> { |
|
|
|
|
jsonObjectList.add(JSONObject.parseObject(JSONObject.toJSONString(zeroPackageSupplyVO))); |
|
|
|
|
}); |
|
|
|
|
zeroSuppleListVO.setZeroPackageSupplyVOS(jsonObjectList); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
pageList.setRecords(records); |
|
|
|
|
return R.data(pageList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -3768,8 +3783,24 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
page.setSize(loadCarsDTO.getPageSize()); |
|
|
|
|
|
|
|
|
|
//查询当前仓零担在库列表
|
|
|
|
|
// IPage<JSONObject> pageList = distributionStockArticleClient.findZeroListByWarehouseId(warehouseId,pageNum,pageSize);
|
|
|
|
|
IPage<JSONObject> pageList = baseMapper.findZeroListByWarehouseId(page, loadCarsDTO); |
|
|
|
|
IPage<ZeroSuppleListVO> pageList = baseMapper.findZeroListByWarehouseId(page, loadCarsDTO); |
|
|
|
|
List<ZeroSuppleListVO> records = pageList.getRecords(); |
|
|
|
|
//把records中所有元素的orderId放入一个集合
|
|
|
|
|
List<Long> orderIdList = records.stream().map(ZeroSuppleListVO::getOrderId).collect(Collectors.toList()); |
|
|
|
|
List<ZeroPackageSupplyVO> packageList = distributionParcelListClient.findListByStockArticleIds(orderIdList); |
|
|
|
|
//把packageList中所有元素通过stockArticleId进行分组
|
|
|
|
|
Map<Long, List<ZeroPackageSupplyVO>> map = packageList.stream().collect(Collectors.groupingBy(ZeroPackageSupplyVO::getStockArticleId)); |
|
|
|
|
records.forEach(zeroSuppleListVO -> { |
|
|
|
|
Long orderId = zeroSuppleListVO.getOrderId(); |
|
|
|
|
List<JSONObject> jsonObjectList = new ArrayList<>(); |
|
|
|
|
List<ZeroPackageSupplyVO> zeroPackageSupplyVOS = map.get(orderId); |
|
|
|
|
zeroPackageSupplyVOS.forEach(zeroPackageSupplyVO -> { |
|
|
|
|
jsonObjectList.add(JSONObject.parseObject(JSONObject.toJSONString(zeroPackageSupplyVO))); |
|
|
|
|
}); |
|
|
|
|
zeroSuppleListVO.setZeroPackageSupplyVOS(jsonObjectList); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
pageList.setRecords(records); |
|
|
|
|
return R.data(pageList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -3821,6 +3852,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
Integer enterNum = zeroSuppleVO.getEnterNum(); |
|
|
|
|
Long finalNodeId = zeroSuppleVO.getFinalNodeId(); |
|
|
|
|
Long signOrderId = zeroSuppleVO.getSignOrderId(); |
|
|
|
|
List<ZeroPackageDTO> zeroPackageList = zeroSuppleVO.getZeroPackageList(); |
|
|
|
|
|
|
|
|
|
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo); |
|
|
|
|
if (Objects.isNull(warehouseWaybillEntity)) { |
|
|
|
@ -3864,6 +3896,23 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
carsLoadScanEntity.setIsSupple(1); |
|
|
|
|
carsLoadScanEntity.setSignOrderId(signOrderId); |
|
|
|
|
trunklineCarsLoadScanService.save(carsLoadScanEntity); |
|
|
|
|
Long scanLoadId = carsLoadScanEntity.getId(); |
|
|
|
|
List<TrunklineScanZeroDetailEntity> scanZeroDetailEntityList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
zeroPackageList.forEach(zeroPackageDTO -> { |
|
|
|
|
Long packageId = zeroPackageDTO.getPackageId(); |
|
|
|
|
Integer packageNum = zeroPackageDTO.getEnterNum(); |
|
|
|
|
TrunklineScanZeroDetailEntity scanZeroDetailEntity = new TrunklineScanZeroDetailEntity(); |
|
|
|
|
scanZeroDetailEntity.setScanId(scanLoadId); |
|
|
|
|
scanZeroDetailEntity.setPackageId(zeroPackageDTO.getPackageId()); |
|
|
|
|
scanZeroDetailEntity.setGoodsId(zeroPackageDTO.getGoodsId()); |
|
|
|
|
scanZeroDetailEntity.setGoodsName(zeroPackageDTO.getGoodsName()); |
|
|
|
|
scanZeroDetailEntity.setLoadingNum(packageNum); |
|
|
|
|
scanZeroDetailEntity.setUnloadNum(0); |
|
|
|
|
scanZeroDetailEntityList.add(scanZeroDetailEntity); |
|
|
|
|
distributionParcelListClient.addZeroQuantity(packageId,-packageNum); |
|
|
|
|
}); |
|
|
|
|
scanZeroDetailService.saveBatch(scanZeroDetailEntityList); |
|
|
|
|
|
|
|
|
|
zeroStockArticleEntity.setHandQuantity(zeroStockArticleEntity.getHandQuantity() - enterNum); |
|
|
|
|
|
|
|
|
@ -3876,14 +3925,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
|
|
|
|
|
if(!Objects.isNull(signOrderId)){ |
|
|
|
|
updateSignOrderNumBySignOrderId(signOrderId); |
|
|
|
|
// TrunklineLoadSignOrderEntity signOrderEntity = trunklineLoadSignOrderService.getById(signOrderId);
|
|
|
|
|
// signOrderEntity.setPlanNum(signOrderEntity.getPlanNum() + enterNum);
|
|
|
|
|
// signOrderEntity.setLoadingNum(signOrderEntity.getLoadingNum() + enterNum);
|
|
|
|
|
// Integer signNum = signOrderEntity.getSignNum();
|
|
|
|
|
// if(signNum > 0 ){
|
|
|
|
|
// signOrderEntity.setSignStatus("10");
|
|
|
|
|
// }
|
|
|
|
|
// trunklineLoadSignOrderService.updateById(signOrderEntity);
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//更新数量
|
|
|
|
@ -4130,6 +4171,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
return R.fail(405, "配载计划信息不存在"); |
|
|
|
|
} |
|
|
|
|
String loadCode = carsLoadEntity.getCarsNo(); |
|
|
|
|
String carrierName = carsLoadEntity.getCarrierName(); |
|
|
|
|
|
|
|
|
|
// TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
|
|
|
|
|
// if(Objects.isNull(carsLoadLineEntity)){
|
|
|
|
@ -4140,7 +4182,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
Long trayId = null; |
|
|
|
|
String trayName = null; |
|
|
|
|
String trayCode = null; |
|
|
|
|
String content = "包件在 "+warehouseName+" 扫码 卸车,车次号:"+loadCode+"."; |
|
|
|
|
String content = "包件在 "+warehouseName+" 扫码 卸车,车次号:"+loadCode+",由["+carrierName+"] 承运."; |
|
|
|
|
|
|
|
|
|
//判断包件是否已入库
|
|
|
|
|
// DistributionParcelListEntity distributionParcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
|
|
|
|
@ -4359,7 +4401,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R transferUnloadZero(Long carsLoadScanId,Long loadId, String waybillNo, Integer enterNum, Long warehouseId, Integer unbindTray, String trayCode, String orderCode, String remark) { |
|
|
|
|
public R transferUnloadZero(Long carsLoadScanId,Long loadId, String waybillNo, Integer enterNum, Long warehouseId, Integer unbindTray, String trayCode, String orderCode, String remark,List<ZeroPackageDTO> zeroPackageList) { |
|
|
|
|
log.info("#############transferUnloadZero: 三方中转卸车零担"); |
|
|
|
|
|
|
|
|
|
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); |
|
|
|
@ -4422,6 +4464,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
carsLoadScanEntity.setScanStatus("2"); |
|
|
|
|
trunklineCarsLoadScanService.updateById(carsLoadScanEntity); |
|
|
|
|
|
|
|
|
|
List<TrunklineScanZeroDetailEntity> updateScanZeroDetailList = new ArrayList<>(); |
|
|
|
|
zeroPackageList.forEach(zeroPackageDTO -> { |
|
|
|
|
TrunklineScanZeroDetailEntity scanZeroDetailEntity = new TrunklineScanZeroDetailEntity(); |
|
|
|
|
scanZeroDetailEntity.setId(zeroPackageDTO.getId()); |
|
|
|
|
scanZeroDetailEntity.setUnloadNum(zeroPackageDTO.getEnterNum()); |
|
|
|
|
updateScanZeroDetailList.add(scanZeroDetailEntity); |
|
|
|
|
}); |
|
|
|
|
scanZeroDetailService.updateBatchById(updateScanZeroDetailList); |
|
|
|
|
|
|
|
|
|
trunklineCarsUnloadLogService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode, |
|
|
|
|
scanCode, enterNum, 2, 1, isAbnormal, trayId, trayCode, trayName, fromWarehouseId, loadScanId, remark); |
|
|
|
|
|
|
|
|
@ -4466,7 +4517,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
Integer num = carsLoadScanEntity.getNum(); |
|
|
|
|
String orderCode = carsLoadScanEntity.getOrderCode(); |
|
|
|
|
Long carsLoadScanId = carsLoadScanEntity.getId(); |
|
|
|
|
transferUnloadZero(carsLoadScanId,loadId, waybillNo, num, warehouseId, 0, trayCode, orderCode, "三方中装托盘零担正常卸车"); |
|
|
|
|
List<TrunklineScanZeroDetailVO> zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanId(carsLoadScanId); |
|
|
|
|
List<ZeroPackageDTO> zeroPackageList = new ArrayList<>(); |
|
|
|
|
zeroDetailVOList.forEach(zeroDetailVO -> { |
|
|
|
|
ZeroPackageDTO zeroPackageDTO = new ZeroPackageDTO(); |
|
|
|
|
zeroPackageDTO.setId(zeroDetailVO.getId()); |
|
|
|
|
zeroPackageDTO.setPackageId(zeroDetailVO.getPackageId()); |
|
|
|
|
zeroPackageDTO.setGoodsId(zeroDetailVO.getGoodsId()); |
|
|
|
|
zeroPackageDTO.setGoodsName(zeroDetailVO.getGoodsName()); |
|
|
|
|
zeroPackageDTO.setEnterNum(zeroDetailVO.getLoadingNum()); |
|
|
|
|
zeroPackageList.add(zeroPackageDTO); |
|
|
|
|
}); |
|
|
|
|
transferUnloadZero(carsLoadScanId,loadId, waybillNo, num, warehouseId, 0, trayCode, orderCode, "三方中装托盘零担正常卸车",zeroPackageList); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -5031,7 +5093,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
String trayCode = unloadZeroDTO.getTrayCode(); |
|
|
|
|
String orderCode = unloadZeroDTO.getOrderCode(); |
|
|
|
|
Long carsLoadScanId = unloadZeroDTO.getCarsLoadScanId(); |
|
|
|
|
transferUnloadZero(carsLoadScanId,loadId, waybillNo, enterNum, warehouseId, 1, trayCode, orderCode, "批量卸车零担正常卸车"); |
|
|
|
|
List<TrunklineScanZeroDetailVO> zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanId(carsLoadScanId); |
|
|
|
|
List<ZeroPackageDTO> zeroPackageList = new ArrayList<>(); |
|
|
|
|
zeroDetailVOList.forEach(zeroDetailVO -> { |
|
|
|
|
ZeroPackageDTO zeroPackageDTO = new ZeroPackageDTO(); |
|
|
|
|
zeroPackageDTO.setId(zeroDetailVO.getId()); |
|
|
|
|
zeroPackageDTO.setPackageId(zeroDetailVO.getPackageId()); |
|
|
|
|
zeroPackageDTO.setGoodsId(zeroDetailVO.getGoodsId()); |
|
|
|
|
zeroPackageDTO.setGoodsName(zeroDetailVO.getGoodsName()); |
|
|
|
|
zeroPackageDTO.setEnterNum(zeroDetailVO.getLoadingNum()); |
|
|
|
|
zeroPackageList.add(zeroPackageDTO); |
|
|
|
|
}); |
|
|
|
|
transferUnloadZero(carsLoadScanId,loadId, waybillNo, enterNum, warehouseId, 1, trayCode, orderCode, "批量卸车零担正常卸车",zeroPackageList); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -5339,20 +5412,52 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
Long fromWarehouseId = signOrderVO.getWarehouseId(); |
|
|
|
|
|
|
|
|
|
//查询订单列表
|
|
|
|
|
List<SignScanOrderVO> signScanOrderList = trunklineCarsOrderService.findSignOrderList(loadId, fromWarehouseId,signOrderId); |
|
|
|
|
List<SignScanOrderVO> signScanOrderList = trunklineCarsOrderService.findSignOrderListBySignOrderId(signOrderId); |
|
|
|
|
List<SignPackageVO> signPackageList = trunklineCarsLoadScanService.findSignPackageListBySignOrderId(signOrderId); |
|
|
|
|
|
|
|
|
|
for (SignScanOrderVO signScanOrderVO : signScanOrderList) { |
|
|
|
|
String waybillNo = signScanOrderVO.getWaybillNo(); |
|
|
|
|
String orderCode = signScanOrderVO.getOrderCode(); |
|
|
|
|
List<SignPackageVO> signPackageList = trunklineCarsLoadScanService.findSignPackageList(loadId, fromWarehouseId, orderCode, waybillNo); |
|
|
|
|
signScanOrderVO.setSignPackageList(signPackageList); |
|
|
|
|
} |
|
|
|
|
String waybillNo = StringUtil.isBlank(signScanOrderVO.getWaybillNo())?"null":signScanOrderVO.getWaybillNo(); |
|
|
|
|
String orderCode = StringUtil.isBlank(signScanOrderVO.getOrderCode())?"null":signScanOrderVO.getOrderCode(); |
|
|
|
|
List<SignPackageVO> ls = new ArrayList<>(); |
|
|
|
|
signPackageList.forEach(e -> { |
|
|
|
|
String waybillNo1 = StringUtil.isBlank(e.getWaybillNo())?"null":e.getWaybillNo(); |
|
|
|
|
String orderCode1 = StringUtil.isBlank(e.getOrderCode())?"null":e.getOrderCode(); |
|
|
|
|
if(waybillNo.equals(waybillNo1) && orderCode.equals(orderCode1)){ |
|
|
|
|
ls.add(e); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
signScanOrderVO.setSignPackageList(ls); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<SignScanOrderVO> signScanZeroOrderList = trunklineCarsOrderService.findSignZeroOrderListBySignOrderId(signOrderId); |
|
|
|
|
List<SignPackageVO> signZeroPackageList = trunklineCarsLoadScanService.findSignPackageListBySignOrderId(signOrderId); |
|
|
|
|
// 创建一个包含所有carsLoadScanId的新列表
|
|
|
|
|
List<Long> carsLoadScanIds = signZeroPackageList.stream() |
|
|
|
|
.map(SignPackageVO::getCarsLoadScanId) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
List<TrunklineScanZeroDetailVO> scanZeroDetailList = scanZeroDetailService.findListByCarsLoadScanIds(carsLoadScanIds); |
|
|
|
|
//把scanZeroDetailList中所有元素通过id进行分组
|
|
|
|
|
Map<Long, List<TrunklineScanZeroDetailVO>> scanZeroDetailMap = scanZeroDetailList.stream() |
|
|
|
|
.collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getScanId)); |
|
|
|
|
|
|
|
|
|
signZeroPackageList.forEach(signPackageVO -> { |
|
|
|
|
Long carsLoadScanId = signPackageVO.getCarsLoadScanId(); |
|
|
|
|
List<TrunklineScanZeroDetailVO> list = scanZeroDetailMap.get(carsLoadScanId); |
|
|
|
|
signPackageVO.setScanZeroDetailList(list); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
List<SignScanOrderVO> signScanZeroOrderList = trunklineCarsOrderService.findSignZeroOrderList(loadId, fromWarehouseId,signOrderId); |
|
|
|
|
for (SignScanOrderVO signScanOrderVO : signScanZeroOrderList) { |
|
|
|
|
String waybillNo = signScanOrderVO.getWaybillNo(); |
|
|
|
|
String orderCode = signScanOrderVO.getOrderCode(); |
|
|
|
|
List<SignPackageVO> signPackageList = trunklineCarsLoadScanService.findSignPackageList(loadId, fromWarehouseId, orderCode, waybillNo); |
|
|
|
|
signScanOrderVO.setSignPackageList(signPackageList); |
|
|
|
|
String waybillNo = StringUtil.isBlank(signScanOrderVO.getWaybillNo())?"null":signScanOrderVO.getWaybillNo(); |
|
|
|
|
String orderCode = StringUtil.isBlank(signScanOrderVO.getOrderCode())?"null":signScanOrderVO.getOrderCode(); |
|
|
|
|
List<SignPackageVO> ls = new ArrayList<>(); |
|
|
|
|
signZeroPackageList.forEach(e -> { |
|
|
|
|
String waybillNo1 = StringUtil.isBlank(e.getWaybillNo())?"null":e.getWaybillNo(); |
|
|
|
|
String orderCode1 = StringUtil.isBlank(e.getOrderCode())?"null":e.getOrderCode(); |
|
|
|
|
if(waybillNo.equals(waybillNo1) && orderCode.equals(orderCode1)){ |
|
|
|
|
ls.add(e); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
signScanOrderVO.setSignPackageList(ls); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询异常列表
|
|
|
|
@ -5706,7 +5811,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R signZeroOrder(Long signOrderId, Long carsLoadScanId, Integer enterNum, String remark) { |
|
|
|
|
public R signZeroOrder(Long signOrderId, Long carsLoadScanId, Integer enterNum, String remark,List<ZeroPackageDTO> zeroPackageList) { |
|
|
|
|
Date date = new Date(); |
|
|
|
|
TrunklineLoadSignOrderEntity signOrderEntity = trunklineLoadSignOrderService.getById(signOrderId); |
|
|
|
|
if (Objects.isNull(signOrderEntity)) { |
|
|
|
@ -5768,6 +5873,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
carsLoadScanEntity.setSignOrderId(signOrderId); |
|
|
|
|
trunklineCarsLoadScanService.updateById(carsLoadScanEntity); |
|
|
|
|
|
|
|
|
|
List<TrunklineScanZeroDetailEntity> updateScanZeroDetailList = new ArrayList<>(); |
|
|
|
|
zeroPackageList.forEach(zeroPackage -> { |
|
|
|
|
TrunklineScanZeroDetailEntity updateEntity = new TrunklineScanZeroDetailEntity(); |
|
|
|
|
updateEntity.setId(zeroPackage.getId()); |
|
|
|
|
updateEntity.setUnloadNum(zeroPackage.getEnterNum()); |
|
|
|
|
updateScanZeroDetailList.add(updateEntity); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if(CollUtil.isNotEmpty(updateScanZeroDetailList)){ |
|
|
|
|
scanZeroDetailService.updateBatchById(updateScanZeroDetailList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//生成签收记录
|
|
|
|
|
trunklineCarsSignLogService.addEntity(carsLoadScanEntity, remark); |
|
|
|
|
|
|
|
|
@ -5835,7 +5952,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
List<Long> signOrderIds = new ArrayList<>(); |
|
|
|
|
List<TrunklineCarsLoadScanEntity> updateCarsLoadScanList = new ArrayList<>(); |
|
|
|
|
List<DistributionParcelListEntity> updateParcelList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
List<TrunklineScanZeroDetailEntity> updateZerpPackageList = new ArrayList<>(); |
|
|
|
|
Date date = new Date(); |
|
|
|
|
|
|
|
|
|
if (!list.isEmpty()) { |
|
|
|
@ -5864,7 +5981,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
entity.setUnloadTime(date); |
|
|
|
|
entity.setUnloadNodeId(warehouseId); |
|
|
|
|
entity.setUnloadNodeName(warehouseName); |
|
|
|
|
if (entity.getType().equals(1)) { |
|
|
|
|
Integer type = entity.getType(); |
|
|
|
|
Long carsLoadScanId = t.getCarsLoadScanId(); |
|
|
|
|
if (type.equals(1)) { |
|
|
|
|
String scanCode = entity.getScanCode(); |
|
|
|
|
List<DistributionParcelListEntity> parcelList = parcelListMap.get(scanCode); |
|
|
|
|
if (!Objects.isNull(parcelList)) { |
|
|
|
@ -5874,6 +5993,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
orderPackageCodes.add(entity.getScanCode()); |
|
|
|
|
}else if(type.equals(2)){ |
|
|
|
|
//零担
|
|
|
|
|
List<TrunklineScanZeroDetailVO> zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanId(carsLoadScanId); |
|
|
|
|
zeroDetailVOList.forEach(p -> { |
|
|
|
|
TrunklineScanZeroDetailEntity scanZeroDetailEntity = new TrunklineScanZeroDetailEntity(); |
|
|
|
|
scanZeroDetailEntity.setId(p.getId()); |
|
|
|
|
scanZeroDetailEntity.setUnloadNum(p.getLoadingNum()); |
|
|
|
|
updateZerpPackageList.add(scanZeroDetailEntity); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
updateCarsLoadScanList.add(entity); |
|
|
|
|
loadIds.add(entity.getLoadId()); |
|
|
|
@ -5908,6 +6037,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
|
|
|
|
|
trunklineCarsLoadScanService.updateBatchById(updateCarsLoadScanList); |
|
|
|
|
|
|
|
|
|
if(CollUtil.isNotEmpty(updateZerpPackageList)){ |
|
|
|
|
scanZeroDetailService.updateBatchById(updateZerpPackageList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//生成签收记录
|
|
|
|
|
trunklineCarsSignLogService.addList(updateCarsLoadScanList, "PC批量签收"); |
|
|
|
|
|
|
|
|
@ -9458,11 +9591,20 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
//把orderCodeNumList中所有元素转化成以orderCode为key的map
|
|
|
|
|
Map<String, OrderCodeNumVO> orderCodeNumMap = orderCodeNumList.stream().collect(Collectors.toMap(OrderCodeNumVO::getOrderCode, Function.identity())); |
|
|
|
|
|
|
|
|
|
List<UnloadPackageVO> unloadList = trunklineCarsLoadScanService.findUnloadPackageListByLoadIdAndFinalNodeId(loadId,warehouseId); |
|
|
|
|
|
|
|
|
|
for (UnloadScanOrderVO unloadScanOrderVO : unloadScanOrderList) { |
|
|
|
|
String waybillNo = unloadScanOrderVO.getWaybillNo(); |
|
|
|
|
String orderCode = unloadScanOrderVO.getOrderCode(); |
|
|
|
|
String waybillNo = StringUtil.isBlank(unloadScanOrderVO.getWaybillNo())?"null":unloadScanOrderVO.getWaybillNo(); |
|
|
|
|
String orderCode = StringUtil.isBlank(unloadScanOrderVO.getOrderCode())?"null":unloadScanOrderVO.getOrderCode(); |
|
|
|
|
unloadScanOrderVO.setTotalNumber(orderCodeNumMap.get(orderCode).getTotalNum()); |
|
|
|
|
List<UnloadPackageVO> unloadPackageList = trunklineCarsLoadScanService.findUnloadPackageList(loadId, warehouseId, waybillNo, orderCode); |
|
|
|
|
List<UnloadPackageVO> unloadPackageList = new ArrayList<>(); |
|
|
|
|
unloadList.forEach(unloadPackageVO -> { |
|
|
|
|
String orderCode1 = StringUtil.isBlank(unloadPackageVO.getOrderCode())?"null":unloadPackageVO.getOrderCode(); |
|
|
|
|
String waybillNo1 = StringUtil.isBlank(unloadPackageVO.getWaybillNo())?"null":unloadPackageVO.getWaybillNo(); |
|
|
|
|
if(waybillNo.equals(waybillNo1) && orderCode.equals(orderCode1)){ |
|
|
|
|
unloadPackageList.add(unloadPackageVO); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
unloadScanOrderVO.setUnloadPackageList(unloadPackageList); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -9470,11 +9612,34 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
|
|
|
|
|
//查询已装车的零担
|
|
|
|
|
List<UnloadZeroVO> zeroList = trunklineCarsLoadScanService.findUnloadZeroList(loadId, warehouseId); |
|
|
|
|
|
|
|
|
|
List<UnloadPackageVO> unloadPackageList = trunklineCarsLoadScanService.findUnloadZeroListByLoadIdAndFinalNodeId(loadId, warehouseId); |
|
|
|
|
List<Long> carsLoadScanIds = unloadPackageList.stream() |
|
|
|
|
.map(UnloadPackageVO::getCarsLoadScanId) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
List<TrunklineScanZeroDetailVO> scanZeroDetailList = scanZeroDetailService.findListByCarsLoadScanIds(carsLoadScanIds); |
|
|
|
|
//把scanZeroDetailList中所有元素通过id进行分组
|
|
|
|
|
Map<Long, List<TrunklineScanZeroDetailVO>> scanZeroDetailMap = scanZeroDetailList.stream() |
|
|
|
|
.collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getScanId)); |
|
|
|
|
|
|
|
|
|
unloadPackageList.forEach(unloadPackageVO -> { |
|
|
|
|
Long carsLoadScanId = unloadPackageVO.getCarsLoadScanId(); |
|
|
|
|
List<TrunklineScanZeroDetailVO> list = scanZeroDetailMap.get(carsLoadScanId); |
|
|
|
|
unloadPackageVO.setScanZeroDetailList(list); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
for (UnloadZeroVO unloadZeroVO : zeroList) { |
|
|
|
|
String waybillNo = unloadZeroVO.getWaybillNo(); |
|
|
|
|
String orderCode = unloadZeroVO.getOrderCode(); |
|
|
|
|
List<UnloadPackageVO> unloadPackageList = trunklineCarsLoadScanService.findUnloadZeroList(loadId, warehouseId, waybillNo, orderCode); |
|
|
|
|
unloadZeroVO.setUnloadPackageList(unloadPackageList); |
|
|
|
|
String waybillNo = StringUtil.isBlank(unloadZeroVO.getWaybillNo())?"null":unloadZeroVO.getWaybillNo(); |
|
|
|
|
String orderCode = StringUtil.isBlank(unloadZeroVO.getOrderCode())?"null":unloadZeroVO.getOrderCode(); |
|
|
|
|
List<UnloadPackageVO> unloadLs = new ArrayList<>(); |
|
|
|
|
unloadPackageList.forEach(unloadPackageVO -> { |
|
|
|
|
String orderCode1 = StringUtil.isBlank(unloadPackageVO.getOrderCode())?"null":unloadPackageVO.getOrderCode(); |
|
|
|
|
String waybillNo1 = StringUtil.isBlank(unloadPackageVO.getWaybillNo())?"null":unloadPackageVO.getWaybillNo(); |
|
|
|
|
if(waybillNo.equals(waybillNo1) && orderCode.equals(orderCode1)){ |
|
|
|
|
unloadLs.add(unloadPackageVO); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
unloadZeroVO.setUnloadPackageList(unloadLs); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询异常列表
|
|
|
|
|