| | |
| | | } |
| | | } |
| | | |
| | | // 仓库编码过滤 |
| | | if (StringUtils.isNotBlank(condition.getWareHouseAreaId())) { |
| | | String wareHouseAreaId = condition.getWareHouseAreaId(); |
| | | LambdaQueryWrapper<WarehouseAreas> whWrapper = new LambdaQueryWrapper<>(); |
| | | whWrapper.eq(WarehouseAreas::getCode, wareHouseAreaId); |
| | | // 调用WarehouseService查询仓库信息(复用Service层方法) |
| | | List<WarehouseAreas> warehouses = warehouseAreasService.list(whWrapper); |
| | | if (!warehouses.isEmpty()) { |
| | | Long targetWarehouseId = warehouses.get(0).getId(); |
| | | // 过滤库位,只保留目标仓库的库位 |
| | | locMap = locMap.entrySet().stream() |
| | | .filter(entry -> Objects.equals(entry.getValue().getAreaId(), targetWarehouseId)) |
| | | .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); |
| | | |
| | | // 过滤locItems,只保留目标仓库的 |
| | | Set<Long> validLocIds = locMap.keySet(); |
| | | locItems = locItems.stream() |
| | | .filter(item -> item.getLocId() != null && validLocIds.contains(item.getLocId())) |
| | | .collect(Collectors.toList()); |
| | | |
| | | List<Long> warehouseAreaIds = Collections.singletonList(targetWarehouseId); |
| | | } else { |
| | | return R.ok().add(new ArrayList<>()); |
| | | } |
| | | } |
| | | |
| | | // 调用WarehouseService查询仓库信息(复用Service层方法) |
| | | Map<Long, Warehouse> warehouseMap = new HashMap<>(); |
| | | if (!warehouseIds.isEmpty()) { |