From 9f45527909c07e1bc0d90cf1fa0d321d8be2ea05 Mon Sep 17 00:00:00 2001 From: luolm <470431449@qq.com> Date: Wed, 16 Oct 2024 15:27:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=ACPBOM-=E7=89=A9=E6=96=99=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/BomNewEbomParentService.java | 6 ++++++ .../bomnew/service/MaterialMainService.java | 21 +++++++++++++++++++ 2 files changed, 27 insertions(+) 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 2ca0f652..c0dcce20 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 @@ -998,6 +998,9 @@ public class BomNewEbomParentService extends ServiceImpl + */ + public void initMaterialNameAndDesc(List list) { + List materialNos = list.stream().filter(u -> StrUtil.isNotBlank(u.getMaterialNo())).map(u ->u.getMaterialNo()).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(materialNos)) { + + List materialBaseInfos = SpringUtil.getBean(MaterialMainService.class).getMaterialBaseInfo(materialNos); + Map materialMp = ListCommonUtil.listToMap(materialBaseInfos, BaseMaterialVO::getMaterialNo); + for (T t : list) { + if (StrUtil.isNotBlank(t.getMaterialNo()) && materialMp.containsKey(t.getMaterialNo())) { + t.setMaterialName(materialMp.get(t.getMaterialNo()).getMaterialName()); + t.setMaterialDesc(materialMp.get(t.getMaterialNo()).getMaterialDesc()); + } + } + } + + } +