diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java index 5946e2af6..17d636f55 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java @@ -547,17 +547,20 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { } + Map parcelMap = new HashMap<>(); List addList = new ArrayList<>(); List noUnloadList = trunklineCarsLoadScanService.findUnloadCheckAbnormalNoUnloadList(loadId, warehouseId); //把noUnloadList中所有元素的scanCode放入一个List List scanCodeList = noUnloadList.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toList()); - FindParamterDTO findParamterDTO = new FindParamterDTO(); - findParamterDTO.setOrderPackageCodeList(scanCodeList); - findParamterDTO.setWarehouseId(warehouseId); - List parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO); - //把parcelListEntityList转化成以orderPackageCode作为key的Map - Map parcelMap = parcelListEntityList.stream() - .collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, Function.identity())); + if(CollUtil.isNotEmpty(scanCodeList)){ + FindParamterDTO findParamterDTO = new FindParamterDTO(); + findParamterDTO.setOrderPackageCodeList(scanCodeList); + findParamterDTO.setWarehouseId(warehouseId); + List parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO); + //把parcelListEntityList转化成以orderPackageCode作为key的Map + parcelMap = parcelListEntityList.stream() + .collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, Function.identity())); + } for (TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity : noUnloadList) { String loadCode = trunklineCarsLoadScanEntity.getLoadCode(); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index 8aa67349c..e4a5a7055 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -13570,11 +13570,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl advanceMap = new HashMap<>(); //把allAdvanceDetailList中所有advanceId放入一个Set集合 Set advanceIdSet = allAdvanceDetailList.stream().map(TrunklineAdvanceDetailEntity::getAdvanceId).collect(Collectors.toSet()); - List advanceEntities = advanceService.findListByIds(new ArrayList<>(advanceIdSet)); - //把advanceEntities转化成id为key的Map - Map advanceMap = advanceEntities.stream().collect(Collectors.toMap(TrunklineAdvanceEntity::getId, Function.identity())); + if(CollUtil.isNotEmpty(advanceIdSet)){ + List advanceEntities = advanceService.findListByIds(new ArrayList<>(advanceIdSet)); + //把advanceEntities转化成id为key的Map + advanceMap = advanceEntities.stream().collect(Collectors.toMap(TrunklineAdvanceEntity::getId, Function.identity())); + } + //把allAdvanceDetailList转化成orderPackageCode为key的Map @@ -13586,6 +13590,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl orderPackageCodeList = new ArrayList<>(); Set orderPackageCodeSet = new HashSet<>(); + Map finalAdvanceMap = advanceMap; carsLoadScanEntities.forEach(carsLoadScanEntity -> { String orderPackageCode = carsLoadScanEntity.getScanCode(); Date unloadTime = carsLoadScanEntity.getUnloadTime(); @@ -13610,7 +13615,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl