fix:自动分配重复key报错

This commit is contained in:
zhaoyf
2026-11-06 15:59:02 +08:00
parent c2a8c612c4
commit 97d6655479

View File

@@ -716,7 +716,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
throw new BadRequestException("当前单子" + pmDemand.getWork_order() + "不是生成状态无法勾选");
}
final List<DemandInventryDto> demandInventryDtos = this.queryInventory(pmDemand.getSku_code());
final Map<String, DemandInventryDto> inventryDtoMap = demandInventryDtos.stream().collect(Collectors.toMap(DemandInventryDto::getHouseCode, Function.identity()));
final Map<String, DemandInventryDto> inventryDtoMap = demandInventryDtos.stream().collect(Collectors.toMap(DemandInventryDto::getHouseCode, Function.identity(),(t1,t2) -> t2));
final DemandInventryDto demandInventryDto = inventryDtoMap.get(RegionConstant.R001);
final DemandInventryDto pInventryDto = inventryDtoMap.get(RegionConstant.R002);
if (demandInventryDto !=null && demandInventryDto.getQty()!=null && demandInventryDto.getQty().compareTo(pmDemand.getQty())>=0){