From e4c6973305744e17f26e0a7559cfc6197df13be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Sun, 14 Apr 2024 12:24:27 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=A4=84=E7=90=86=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/BomNewOriginalParentService.java | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) 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 48532f26..a7d90f47 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 @@ -188,15 +188,13 @@ public class BomNewOriginalParentService extends ServiceImpl parentDrawingNos = new ArrayList<>(getParentMaterialByDrawingNo(queryDrawingNos)); // parentDrawingNos.addAll(queryDrawingNos); - Set parentDrawingNos = new HashSet<>(getParentDrawingNoByMaterialNo(queryDrawingNos)); - parentDrawingNos.addAll(queryDrawingNos); if (CollUtil.isNotEmpty(parentDrawingNos)) { List childs=new ArrayList<>(); List parents = this.getBaseMapper().getParentForDrawingNoSeach(parentDrawingNos, query.getStatus()); - materialMainService.intiMaterialInfo(parents, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); - if(CollUtil.isNotEmpty(parents)) { - childs = this.getBaseMapper().getChildForDrawingNoSeach(parentDrawingNos, parents.stream().map(u -> u.getRowId()).collect(Collectors.toSet())); - materialMainService.intiMaterialInfo(childs, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); + materialMainService.intiMaterialInfo(parents, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT2); + if (CollUtil.isNotEmpty(parents)) { + childs = this.getBaseMapper().getChildForDrawingNoSeach(parentDrawingNos, parents.stream().map(BomOriginalListVO::getRowId).collect(Collectors.toSet())); + materialMainService.intiMaterialInfo(childs, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT2); childs.stream().filter(f -> StrUtil.isBlank(f.getCurrentVersion())).forEach(f -> { if (MaterialshouldBomExistUtil.checkShouldBomExist(f.getMaterialCategoryCode(), f.getMaterialGetType())) { f.setCurrentVersion(OriginalConstant.NO_BOM_VERSION); @@ -205,20 +203,6 @@ public class BomNewOriginalParentService extends ServiceImpl data = new ArrayList<>(); -// data.addAll(parents); -// data.addAll(childs); -// materialMainService.intiMaterialInfo(data, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); - materialMainService.intiMaterialInfo(parents, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT2); - List childs = this.getBaseMapper().getChildForDrawingNoSeach(parentDrawingNos,query.getStatus()); - materialMainService.intiMaterialInfo(childs, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT2); - childs.stream().filter(f -> StrUtil.isBlank(f.getCurrentVersion())).forEach(f -> { - if (MaterialshouldBomExistUtil.checkShouldBomExist(f.getMaterialCategoryCode(), f.getMaterialGetType())) { - f.setCurrentVersion(OriginalConstant.NO_BOM_VERSION); - } else { - f.setCurrentVersion(OriginalConstant.DEFAULT_BOM_VERSION); - } - }); result = handSeachToTree(parents, childs); } }