From 38e9ed6d9361a337b1daba147c89f66268ac95ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=B1=B3?= <470431449@qq.com> Date: Tue, 23 Jan 2024 18:06:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A01|=E8=87=AA=E5=88=B6;2|=E5=A4=96?= =?UTF-8?q?=E5=8D=8F;3|=E9=87=87=E8=B4=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bomnew/pojo/vo/BomNewPbomParentVO.java | 2 -- .../service/BomNewEbomParentService.java | 13 ++++++++++++- .../service/BomNewOriginalParentService.java | 2 +- .../domain/EBom/CheckEBomException.java | 8 ++++++++ .../domain/EBom/EbomInitProjectType.java | 18 ++++++++++-------- .../service/domain/PBom/ConvertToMBom.java | 4 ++++ 6 files changed, 35 insertions(+), 12 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewPbomParentVO.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewPbomParentVO.java index 11023c0c..6cb60b8c 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewPbomParentVO.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewPbomParentVO.java @@ -274,8 +274,6 @@ public class BomNewPbomParentVO extends BaseMaterialVO implements Serializable { private String levelNo; - @ApiModelProperty("物料一级分类编码") - private String relCategoryCode; @ApiModelProperty("子级") List childNodes; diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java index efd807a0..e1ae2583 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java @@ -279,7 +279,7 @@ public class BomNewEbomParentService extends ServiceImpl materialNos = parentChild.stream().map(u -> u.getMaterialNo()).collect(Collectors.toList()); + List materialNos = parentChild.stream().filter(u->StrUtil.isNotBlank(u.getMaterialNo())).map(u -> u.getMaterialNo()).collect(Collectors.toList()); if (CollUtil.isNotEmpty(materialNos)) { List list = this.lambdaQuery().in(BomNewEbomParentEntity::getMaterialNo, materialNos) .eq(BomNewEbomParentEntity::getLastVersionIs, 1) @@ -440,6 +440,9 @@ public class BomNewEbomParentService extends ServiceImpl ignoreCheckException) throws ExecutionException, InterruptedException { + CheckEBomException checkEBomException = new CheckEBomException(bomRowId); + checkEBomException.initException(ignoreCheckException); + + //保存异常 + saveException(checkEBomException); + } + private void saveException(CheckEBomException checkEBomException) { List allBomDetail = checkEBomException.getAllBomDetail(); //父级 diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewOriginalParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewOriginalParentService.java index 82226c68..610486e3 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewOriginalParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewOriginalParentService.java @@ -140,7 +140,7 @@ public class BomNewOriginalParentService extends ServiceImpl getOriginalBomListPage(OriginalBomQuery query) { - Page result=null; + Page result= new Page<>(); //物料编码搜索或图号搜索 if (CollUtil.isNotEmpty(query.getMaterialNos()) || CollUtil.isNotEmpty(query.getDrawingNos())) { List queryDrawingNos= new ArrayList<>(); diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/CheckEBomException.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/CheckEBomException.java index 6b64f022..b3b551e5 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/CheckEBomException.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/CheckEBomException.java @@ -90,6 +90,14 @@ public class CheckEBomException { } + public void initException(List unCheckException) { + //初始化物料信息 + SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); + this.unCheckExcept=unCheckException; + checkException(); + + } + public void initException(String... ignorePropertyList) { SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, ignorePropertyList); 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 d7ad3a82..21021d1a 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 @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.extra.spring.SpringUtil; import com.google.common.collect.Sets; +import com.nflg.product.bomnew.constant.EBomExceptionStatusEnum; import com.nflg.product.bomnew.constant.ProjectTypeInputTypeEnum; import com.nflg.product.bomnew.mapper.master.BomNewEbomParentMapper; import com.nflg.product.bomnew.pojo.entity.BomNewEbomChildEntity; @@ -112,14 +113,15 @@ public class EbomInitProjectType { } //11 - if (StrUtil.isNotBlank(child.getMaterialCategoryCode()) && (child.getMaterialCategoryCode().startsWith("10") || child.getMaterialCategoryCode().startsWith("40")) && !child.getMaterialCategoryCode().startsWith("1013") && !child.getMaterialCategoryCode().startsWith("100601")); - { - MaterialHistoryProjectTypeVO materialHistoryProjectType = SpringUtil.getBean(BomNewEbomParentMapper.class).getMaterialHistoryProjectType(child.getMaterialNo()); - if (Objects.nonNull(materialHistoryProjectType)) { - child.setProjectType(materialHistoryProjectType.getProjectType()); - child.setProjectTypeInputType(ProjectTypeInputTypeEnum.HISTORY_STATISTICS.getValue()); - } - } +// if (StrUtil.isNotBlank(child.getMaterialCategoryCode()) && (child.getMaterialCategoryCode().startsWith("10") || child.getMaterialCategoryCode().startsWith("40")) && !child.getMaterialCategoryCode().startsWith("1013") && !child.getMaterialCategoryCode().startsWith("100601")); +// { +// MaterialHistoryProjectTypeVO materialHistoryProjectType = SpringUtil.getBean(BomNewEbomParentMapper.class).getMaterialHistoryProjectType(child.getMaterialNo()); +// if (Objects.nonNull(materialHistoryProjectType)) { +// child.setProjectType(materialHistoryProjectType.getProjectType()); +// child.setProjectTypeInputType(ProjectTypeInputTypeEnum.HISTORY_STATISTICS.getValue()); +// child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_14.getValue()); +// } +// } } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/ConvertToMBom.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/ConvertToMBom.java index 91092c30..b9de2283 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/ConvertToMBom.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/ConvertToMBom.java @@ -115,11 +115,15 @@ public class ConvertToMBom { mBomParent.setModifyTime(LocalDateTime.now()); mBomParent.setSourceRowId(parent.getRowId()); mBomParent.setLastVersionIs(1); + mBomParent.setStatus(MBomConstantEnum.MBomStatusEnum.UNPUB_SAP.getValue()); this.mBomParentResult.add(mBomParent); //1010 不做处理 // buildChild(EBomConstant.MAIN_FACTORY_CODE_1010.equals(facCode) ? allChildTreeList_1010 : allChildTreeList_1020, mBomParent.getRowId()); + allChild_1010.forEach(u->{ + u.setRelParentRowId(u.getParentRowId()); + }); buildChild(EBomConstant.MAIN_FACTORY_CODE_1010.equals(facCode) ? allChild_1010 : allChildTreeList_1020, mBomParent.getRowId());