Browse Source

1.修复卸车确认bug

pre-production
zhenghaoyu 2 days ago
parent
commit
035bef5e68
  1. 17
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java
  2. 13
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

17
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java

@ -547,17 +547,20 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
}
Map<String, DistributionParcelListEntity> parcelMap = new HashMap<>();
List<AftersalesAbnormalRecordEntity> addList = new ArrayList<>();
List<TrunklineCarsLoadScanEntity> noUnloadList = trunklineCarsLoadScanService.findUnloadCheckAbnormalNoUnloadList(loadId, warehouseId);
//把noUnloadList中所有元素的scanCode放入一个List
List<String> scanCodeList = noUnloadList.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toList());
FindParamterDTO findParamterDTO = new FindParamterDTO();
findParamterDTO.setOrderPackageCodeList(scanCodeList);
findParamterDTO.setWarehouseId(warehouseId);
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO);
//把parcelListEntityList转化成以orderPackageCode作为key的Map
Map<String, DistributionParcelListEntity> 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<DistributionParcelListEntity> 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();

13
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -13570,11 +13570,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
allAdvanceDetailList.addAll(advanceDetailEntityList);
});
Map<Long, TrunklineAdvanceEntity> advanceMap = new HashMap<>();
//把allAdvanceDetailList中所有advanceId放入一个Set集合
Set<Long> advanceIdSet = allAdvanceDetailList.stream().map(TrunklineAdvanceDetailEntity::getAdvanceId).collect(Collectors.toSet());
List<TrunklineAdvanceEntity> advanceEntities = advanceService.findListByIds(new ArrayList<>(advanceIdSet));
//把advanceEntities转化成id为key的Map
Map<Long, TrunklineAdvanceEntity> advanceMap = advanceEntities.stream().collect(Collectors.toMap(TrunklineAdvanceEntity::getId, Function.identity()));
if(CollUtil.isNotEmpty(advanceIdSet)){
List<TrunklineAdvanceEntity> 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<TrunklineCarsL
List<String> orderPackageCodeList = new ArrayList<>();
Set<String> orderPackageCodeSet = new HashSet<>();
Map<Long, TrunklineAdvanceEntity> finalAdvanceMap = advanceMap;
carsLoadScanEntities.forEach(carsLoadScanEntity -> {
String orderPackageCode = carsLoadScanEntity.getScanCode();
Date unloadTime = carsLoadScanEntity.getUnloadTime();
@ -13610,7 +13615,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
updateScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode());
updateScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId());
updateScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo());
TrunklineAdvanceEntity advanceEntity = advanceMap.get(advanceId);
TrunklineAdvanceEntity advanceEntity = finalAdvanceMap.get(advanceId);
if(!Objects.isNull(advanceEntity)){
updateScanEntity.setCustomerName(advanceEntity.getCustomerName());
updateScanEntity.setCustomerTelephone(advanceEntity.getCustomerPhone());

Loading…
Cancel
Save