From 26108a818333587cffda3ed0ddaa39fb73e90218 Mon Sep 17 00:00:00 2001 From: jing's Date: Fri, 10 May 2024 11:50:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=9F=A5=E7=89=A9=E6=96=99=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E6=98=AF=E5=90=A6=E5=9C=A8=E4=B8=BB=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=AD=E5=AD=98=E5=9C=A8=20=E6=9A=82=E5=AD=98=E4=B8=8D?= =?UTF-8?q?=E9=9C=80=E6=A3=80=E6=9F=A5=EF=BC=8C=E6=8F=90=E4=BA=A4=E6=97=B6?= =?UTF-8?q?=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/bomnew/service/domain/EBom/EBomEdit.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomEdit.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomEdit.java index 4c8bea6d..1e2d470c 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomEdit.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomEdit.java @@ -255,11 +255,13 @@ public class EBomEdit { } materialNos.add(dto.getParent().getMaterialNo()); //检查物料编码是否在主数据中存在 - List materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).getMaterialBaseInfo(materialNos); - List effectiveMaterialNos = materialBaseInfo.stream().map(u -> u.getMaterialNo()).collect(Collectors.toList()); - Set difference = Sets.difference(new HashSet<>(materialNos), new HashSet<>(effectiveMaterialNos)); - VUtils.isTure(CollUtil.isNotEmpty(difference)).throwMessage(StrUtil.join(",", difference) + "在物料主数据中不存在"); - + //暂存不需检查,提交时检查 + if(ObjectUtil.equal(EbomEditStatusEnum.HANDLER_FINISHED.getValue(),dto.getOpType())) { + List materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).getMaterialBaseInfo(materialNos); + List effectiveMaterialNos = materialBaseInfo.stream().map(u -> u.getMaterialNo()).collect(Collectors.toList()); + Set difference = Sets.difference(new HashSet<>(materialNos), new HashSet<>(effectiveMaterialNos)); + VUtils.isTure(CollUtil.isNotEmpty(difference)).throwMessage(StrUtil.join(",", difference) + "在物料主数据中不存在"); + } //检查数据是否可修改 List notNullRowIdList= dto.getDatas().stream().filter(u->u.getRowId()!=null && u.getRowId()>0).collect(Collectors.toList());