Browse Source

备料提交

24282 1 year ago
parent
commit
93bc7045e8

+ 5 - 5
sd-business/src/main/java/com/sd/business/service/production/impl/StockPreparationServiceImpl.java

@@ -238,7 +238,7 @@ public class StockPreparationServiceImpl implements StockPreparationService {
         List<OrderSkuBom> orderSkuBomList = orderSkuBomService.list(q -> q.in(OrderSkuBom::getOrderId, orderIdList));
 
         // 合并sku主材和包材
-        Stream<InOutStorageBom> streamList = Stream.concat(
+        List<InOutStorageBom> list = Stream.concat(
                 orderSkuList.stream().map(item -> {
                     InOutStorageBom inOutStorageBom = new InOutStorageBom();
                     inOutStorageBom.setBomSpecId(item.getBomSpecId());
@@ -251,9 +251,9 @@ public class StockPreparationServiceImpl implements StockPreparationService {
                     inOutStorageBom.setQuantity(item.getQuantity());
                     return inOutStorageBom;
                 })
-        );
+        ).collect(Collectors.toList());
 
-        List<Long> bomSpecIdList = streamList.map(InOutStorageBom::getBomSpecId).collect(Collectors.toList());
+        List<Long> bomSpecIdList = list.stream().map(InOutStorageBom::getBomSpecId).collect(Collectors.toList());
         Map<Long, BomSpecBo> bomSpecBo = skuSpecService.getBomSpecBoByIdList(bomSpecIdList);
 
         // 主材从半成品仓出库
@@ -263,7 +263,7 @@ public class StockPreparationServiceImpl implements StockPreparationService {
         semiFinishedProduct.setWarehouseId(WarehouseConstant.SEMI_FINISHED_PRODUCT);
         semiFinishedProduct.setDepartmentId(DepartmentConstant.SD_SPORTS);
         semiFinishedProduct.setApplicant(SecurityUtils.getLoginUser().getUser().getNickName());
-        List<InOutStorageBom> semiFinishedProductInOutStorageBomList = streamList.filter(item -> {
+        List<InOutStorageBom> semiFinishedProductInOutStorageBomList = list.stream().filter(item -> {
             BomSpecBo tempBomSpecBo = bomSpecBo.get(item.getBomSpecId());
             if (tempBomSpecBo == null) {
                 return false;
@@ -280,7 +280,7 @@ public class StockPreparationServiceImpl implements StockPreparationService {
         packagingMaterial.setWarehouseId(WarehouseConstant.PACKAGING_MATERIAL);
         packagingMaterial.setDepartmentId(DepartmentConstant.SD_SPORTS);
         packagingMaterial.setApplicant(SecurityUtils.getLoginUser().getUser().getNickName());
-        List<InOutStorageBom> packagingMaterialInOutStorageBomList = streamList.filter(item -> {
+        List<InOutStorageBom> packagingMaterialInOutStorageBomList = list.stream().filter(item -> {
             BomSpecBo tempBomSpecBo = bomSpecBo.get(item.getBomSpecId());
             if (tempBomSpecBo == null) {
                 return true;