From ca6c4ab94086f021729e91bc91525291d078796b Mon Sep 17 00:00:00 2001 From: jing's Date: Tue, 12 Mar 2024 22:55:30 +0800 Subject: [PATCH] =?UTF-8?q?ebom=E7=BC=96=E8=BE=91=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/BomNewEbomParentService.java | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) 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 636f0113..362ab679 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 @@ -1492,6 +1492,7 @@ public class BomNewEbomParentService extends ServiceImpl childList = dto.getDatas(); if (dto.getParent().getRootIs() == null || dto.getParent().getRootIs() == 0) { @@ -1534,6 +1539,7 @@ public class BomNewEbomParentService extends ServiceImpl * 1. */ + @Transactional(rollbackFor = Exception.class) public Boolean submit(BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException { EBomEdit eBomEdit = new EBomEdit(EBomSourceEnum.FROM_MDM.getValue()); @@ -1594,9 +1600,7 @@ public class BomNewEbomParentService extends ServiceImpl computeLevelNumAndRootState()); + return true; } @@ -1614,8 +1618,15 @@ public class BomNewEbomParentService extends ServiceImpl delTagList = new ArrayList<>(); -// CheckEBomException checkEBomException = new CheckEBomException(delList); -// checkEBomException.initException(); + + List okList = delList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource()) + && Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList()); + + if(CollUtil.isNotEmpty(okList)){ + throw new NflgBusinessException(STATE.Error,"从原始Bom导入的数据,数据没有异常的情况下,不可以删除"); + } + + //原始bom不正常 List s1List = delList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource()) && !Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList());