From 33fd163cbdc8a81591d25277b7d1cf62b5e5a48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Fri, 17 May 2024 17:17:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(ebom):=20=E4=B8=80=E4=BA=9B=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/service/BomNewEbomParentService.java | 2 +- .../nflg/product/bomnew/service/BomNewPbomParentService.java | 2 +- 2 files changed, 2 insertions(+), 2 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 4effc2a9..c68c3755 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 @@ -988,7 +988,7 @@ public class BomNewEbomParentService extends ServiceImpl Date: Fri, 17 May 2024 17:29:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(ebom):=20=E7=BC=96=E8=BE=91=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=B7=BB=E5=8A=A0T=E7=B1=BB=E5=9E=8B=E7=89=A9?= =?UTF-8?q?=E6=96=99=E7=9A=84=E8=AE=BE=E7=BD=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bomnew/service/domain/EBom/EBomEdit.java | 49 +++++++++++++------ 1 file changed, 33 insertions(+), 16 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 b7493c50..ffe325ea 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 @@ -209,12 +209,25 @@ public class EBomEdit { if(StrUtil.isEmpty(child.getOrderNumber())){ child.setOrderNumber("00"); } - child.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); - // parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); - checkExcept(dto.getParent(), child); + if (dto.getOpType() == 2) { + child.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); + // parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); + checkExcept(dto.getParent(), child); + } if (StrUtil.isNotBlank(child.getProjectType())) { child.setProjectType(child.getProjectType().toUpperCase()); } + if (StrUtil.equals(BomConstant.PROJECT_TYPE_TEMPORARY, child.getProjectType(), true)) { + if (StrUtil.isBlank(child.getMaterialUnit())) { + child.setMaterialUnit("PC"); + } + if (StrUtil.isBlank(child.getMaterialOriginalUnit())) { + child.setMaterialOriginalUnit("PC"); + } + if (Objects.isNull(child.getNum())) { + child.setNum(BigDecimal.ONE); + } + } } @@ -224,23 +237,27 @@ public class EBomEdit { private void checkExcept(BomNewEbomParentVO parent, BomNewEbomChildEntity child) { - - if (StrUtil.isBlank(child.getMaterialNo()) || Objects.isNull(child.getNum()) - || BigDecimal.ZERO.compareTo(child.getNum()) >= 0) { - child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue()); - } else if (StrUtil.isEmpty(child.getProjectType())) { - child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue()); - } else if (StrUtil.isNotBlank(parent.getProjectType()) - && StrUtil.containsAny(parent.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue())) { - if (StrUtil.equals(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue(), child.getProjectType())) { - child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_9.getValue()); + if (StrUtil.equals(BomConstant.PROJECT_TYPE_TEMPORARY, child.getProjectType(), true)) { + if (StrUtil.isBlank(child.getMaterialDesc())) { + child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue()); } - if (StrUtil.equals(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue(), child.getProjectType())) { - child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_10.getValue()); + } else { + if (StrUtil.isBlank(child.getMaterialNo()) || Objects.isNull(child.getNum()) + || BigDecimal.ZERO.compareTo(child.getNum()) >= 0) { + child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue()); + } else if (StrUtil.isEmpty(child.getProjectType())) { + child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue()); + } else if (StrUtil.isNotBlank(parent.getProjectType()) + && StrUtil.containsAny(parent.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue())) { + if (StrUtil.equals(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue(), child.getProjectType())) { + child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_9.getValue()); + } + if (StrUtil.equals(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue(), child.getProjectType())) { + child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_10.getValue()); + } } } - } void checkDataRule(BomNewEBomParentEditDTO dto) {