|
@@ -332,13 +332,12 @@ public class StockPreparationServiceImpl implements StockPreparationService {
|
|
|
.map(OutBomVo::getBomSpecId)
|
|
|
.collect(Collectors.toList());
|
|
|
if (semiFinishedProductBomSpecIdList.size() > 0) {
|
|
|
- semiFinishedProductInventoryMap = inventoryService.mapKV(
|
|
|
- Inventory::getBomSpecId,
|
|
|
- item -> item.getQuantity().add(item.getLockQuantity()),
|
|
|
- q -> q.eq(Inventory::getWarehouseId, WarehouseConstant.SEMI_FINISHED_PRODUCT)
|
|
|
- .eq(Inventory::getDepartmentId, outDepartmentId)
|
|
|
- .in(Inventory::getBomSpecId, semiFinishedProductBomSpecIdList)
|
|
|
- );
|
|
|
+ List<Inventory> tempList = inventoryService.list(q -> q.eq(Inventory::getWarehouseId, WarehouseConstant.SEMI_FINISHED_PRODUCT)
|
|
|
+ .eq(Inventory::getDepartmentId, outDepartmentId)
|
|
|
+ .in(Inventory::getBomSpecId, semiFinishedProductBomSpecIdList));
|
|
|
+ semiFinishedProductInventoryMap = tempList.stream().collect(Collectors.toMap(Inventory::getBomSpecId,
|
|
|
+ item -> item.getQuantity().add(item.getLockQuantity()), (v1, v2) -> v2));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 包材库存
|
|
@@ -348,13 +347,13 @@ public class StockPreparationServiceImpl implements StockPreparationService {
|
|
|
.map(OutBomVo::getBomSpecId)
|
|
|
.collect(Collectors.toList());
|
|
|
if (packagingMaterialBomSpecIdList.size() > 0) {
|
|
|
- packagingMaterialInventoryMap = inventoryService.mapKV(
|
|
|
- Inventory::getBomSpecId,
|
|
|
- item -> item.getQuantity().add(item.getLockQuantity()),
|
|
|
- q -> q.eq(Inventory::getWarehouseId, WarehouseConstant.PACKAGING_MATERIAL)
|
|
|
- .eq(Inventory::getDepartmentId, outDepartmentId)
|
|
|
- .in(Inventory::getBomSpecId, packagingMaterialBomSpecIdList)
|
|
|
+ List<Inventory> tempList = inventoryService.list(q -> q
|
|
|
+ .eq(Inventory::getWarehouseId, WarehouseConstant.PACKAGING_MATERIAL)
|
|
|
+ .eq(Inventory::getDepartmentId, outDepartmentId)
|
|
|
+ .in(Inventory::getBomSpecId, packagingMaterialBomSpecIdList)
|
|
|
);
|
|
|
+ packagingMaterialInventoryMap = tempList.stream().collect(Collectors.toMap(Inventory::getBomSpecId,
|
|
|
+ item -> item.getQuantity().add(item.getLockQuantity()), (v1, v2) -> v2));
|
|
|
}
|
|
|
|
|
|
// 赋值库存
|