|
|
|
@ -242,15 +242,29 @@ public class StComboxController { |
|
|
|
return R.data(new ArrayList<>()); |
|
|
|
return R.data(new ArrayList<>()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<StRealtimeStockVO> allStockList = new ArrayList<>(); |
|
|
|
// 4. 取出 物料ID(从传入的 stStorehouse 里拿)
|
|
|
|
// 4. 取出 物料ID(从传入的 stStorehouse 里拿)
|
|
|
|
StGoods goods = stGoodsMapper.queryByCode(stStorehouse.getGoodsCode()); |
|
|
|
if (StrUtil.isNotBlank(stStorehouse.getGoodsCodeAndGoodsName())) { |
|
|
|
|
|
|
|
List<Long> goodsIdList = stGoodsMapper.getGoods(stStorehouse.getGoodsCodeAndGoodsName()); |
|
|
|
|
|
|
|
|
|
|
|
// 5. 调用 实时库存查询(传入 物料ID + 库房ID)
|
|
|
|
// 5. 调用 实时库存查询(传入 物料ID + 库房ID)
|
|
|
|
List<StRealtimeStockVO> allStockList = new ArrayList<>(); |
|
|
|
for (Long shId : shIdList) { |
|
|
|
for (Long shId : shIdList) { |
|
|
|
for (Long goodsId : goodsIdList) { |
|
|
|
IPage<StRealtimeStockVO> stockPage = stRealtimeStockService.selectByGoodsIdShId(Condition.getPage(query), goods.getId(), shId, null, null); |
|
|
|
|
|
|
|
allStockList.addAll(stockPage.getRecords()); |
|
|
|
IPage<StRealtimeStockVO> stockPage = stRealtimeStockService.selectByGoodsIdShId(Condition.getPage(query), goodsId, shId, null, null); |
|
|
|
|
|
|
|
allStockList.addAll(stockPage.getRecords()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
StGoods goods = stGoodsMapper.queryByCode(stStorehouse.getGoodsCode()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 5. 调用 实时库存查询(传入 物料ID + 库房ID)
|
|
|
|
|
|
|
|
for (Long shId : shIdList) { |
|
|
|
|
|
|
|
IPage<StRealtimeStockVO> stockPage = stRealtimeStockService.selectByGoodsIdShId(Condition.getPage(query), goods.getId(), shId, null, null); |
|
|
|
|
|
|
|
allStockList.addAll(stockPage.getRecords()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return R.data(allStockList); |
|
|
|
return R.data(allStockList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|