| | |
| | | List<StockItem> stockItems = stockItemService.list(new LambdaQueryWrapper<StockItem>() |
| | | .eq(StockItem::getFieldsIndex, orderItem.getFieldsIndex())); |
| | | //获取库存中订单库位 |
| | | if (!stockItems.isEmpty()) { |
| | | Set<Long> stockIds = stockItems.stream().map(StockItem::getStockId).collect(Collectors.toSet()); |
| | | //获取库存库位信息 |
| | | List<Stock> stocks = stockService.list(new LambdaQueryWrapper<Stock>() |
| | | .in(Stock::getId, stockIds) |
| | | .eq(Stock::getType, OrderType.ORDER_IN.type) |
| | | .eq(Stock::getSourceCode, order.getCode())); |
| | | Set<String> locs = stocks.stream().map(Stock::getLocCode).collect(Collectors.toSet()); |
| | | String locCode = StringUtils.join(locs.toArray(), ","); |
| | | param.setZone(locCode); |
| | | Set<Long> longSet = stockItems.stream().map(StockItem::getStockId).collect(Collectors.toSet()); |
| | | //获取库存库位信息 |
| | | Stock stocks = stockService.getOne(new LambdaQueryWrapper<Stock>() |
| | | .in(Stock::getId, longSet) |
| | | .eq(Stock::getType, OrderType.ORDER_IN.type) |
| | | .eq(Stock::getSourceCode, order.getCode())); |
| | | if (!Objects.isNull(stocks)) { |
| | | param.setZone(stocks.getLocCode()); |
| | | } |
| | | } |
| | | //获取索引内容 |