From afd82d5c154b8c12bebfc3337766c02ee097fe5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=B1=B3?= <470431449@qq.com> Date: Mon, 9 Sep 2024 15:14:31 +0800 Subject: [PATCH] =?UTF-8?q?EBOM-=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=B1=BB=E5=88=AB=EF=BC=9A=E8=B7=B3=E8=BF=87=E5=B7=B2?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E7=89=88BOM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/EBom/EbomInitProjectType.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EbomInitProjectType.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EbomInitProjectType.java index 8dcb839f..26728c01 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EbomInitProjectType.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EbomInitProjectType.java @@ -3,6 +3,7 @@ package com.nflg.product.bomnew.service.domain.EBom; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.google.common.collect.Sets; +import com.nflg.product.bomnew.constant.EBomStatusEnum; import com.nflg.product.bomnew.constant.ProjectTypeInputTypeEnum; import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO; import lombok.Getter; @@ -42,7 +43,7 @@ public class EbomInitProjectType { public void initProjectType() { for (BomNewEbomParentVO child : allChild) { - if (StrUtil.isBlank(child.getMaterialCategoryCode())) { + if (StrUtil.isBlank(child.getMaterialCategoryCode()) || skipPublishedBom(child)) { continue; } String materialProjectType = child.getProjectType(); @@ -126,6 +127,9 @@ public class EbomInitProjectType { List sameLevelChild = new ArrayList<>(); List sResult = new ArrayList<>(); for (BomNewEbomParentVO child : list2009) { + if(skipPublishedBom(child)){ + continue; + } sameLevelChild = getChilds(child.getParentRowId()); sResult = sameLevelChild.stream().filter(u -> u.getMaterialCategoryCode().startsWith("2005") || u.getMaterialCategoryCode().startsWith("2006")).collect(Collectors.toList()); if (CollUtil.isNotEmpty(sResult)) { @@ -142,6 +146,9 @@ public class EbomInitProjectType { List sResult1004 = new ArrayList<>(); List sResultProjectL = new ArrayList<>(); for (BomNewEbomParentVO child : list1004) { + if(skipPublishedBom(child)){ + continue; + } //同层物料 sameLevelChild1004 = getChilds(child.getParentRowId()); //除紧固件外的其他物料 @@ -165,6 +172,15 @@ public class EbomInitProjectType { } + /** + * 已发布BOM-跳过初始化项目类别 + * @param vo + */ + private boolean skipPublishedBom(BomNewEbomParentVO vo){ + List voParent = allChild.stream().filter(u -> u.getBomRowId().equals(vo.getParentRowId())).collect(Collectors.toList()); + return CollUtil.isNotEmpty(voParent) && voParent.get(0).getStatus()>= EBomStatusEnum.PUBLISHED.getValue(); + + } /** * 判断项目类型是否一致 *