yys
15 小时以前 bf84fec7d8dd5e7fbcc93030b8d83da7ec0ece91
src/main/java/com/ruoyi/production/service/impl/ProductBomServiceImpl.java
@@ -137,15 +137,6 @@
                                  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 +152,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 +208,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);