From 94462f5e4f6f78adf678101923eb2fd54056c62f Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 03 四月 2026 15:50:24 +0800
Subject: [PATCH] yys bom

---
 src/main/java/com/ruoyi/production/service/impl/ProductBomServiceImpl.java |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductBomServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductBomServiceImpl.java
index b334365..256119c 100644
--- a/src/main/java/com/ruoyi/production/service/impl/ProductBomServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductBomServiceImpl.java
@@ -137,15 +137,7 @@
                                   ProductBom bom,ProductModel rootModel,
                                   Map<String, Long> processMap,
                                   List<BomImportErrorDto> errorList ) {
-        // 1. 鑾峰彇children涓瓙椤逛骇鍝佺紪鍙蜂负绌虹殑鏁版嵁
-        List<BomImportDto> parentChildren = children
-                .stream()
-                .filter(child -> StringUtils.isEmpty(child.getChildCode()))
-                .collect(Collectors.toList());
-        if(CollectionUtils.isEmpty(parentChildren)){
-            return;
-        }
-        BomImportDto parentId = parentChildren.get(0); // 鐖剁骇鏁版嵁
+
         ProductStructure rootNode = new ProductStructure();
         rootNode.setBomId(bom.getId());
         rootNode.setParentId(null); // 椤跺眰娌℃湁鐖惰妭鐐�
@@ -161,7 +153,7 @@
                 continue;
             }
             //  鑾峰彇瀛愰」妯″瀷淇℃伅
-            ProductModel childModel = findModel(child.getChildName(), child.getChildSpec());
+            ProductModel childModel = findModel(child.getChildName(), child.getChildCode());
             if(childModel.getId() == null){
                 BomImportErrorDto errorDto = new BomImportErrorDto();
                 BeanUtils.copyProperties(child, errorDto);
@@ -217,7 +209,7 @@
 
             //  鍒涘缓 BOM 鏁版嵁
             BomImportDto first = entry.getValue().get(0);
-            ProductModel rootModel = findModel(first.getParentName(), first.getParentSpec());
+            ProductModel rootModel = findModel(first.getParentName(), first.getParentCode());
             if(rootModel.getId() == null){
                 BomImportErrorDto error = new BomImportErrorDto();
                 BeanUtils.copyProperties(first, error);

--
Gitblit v1.9.3