From 9d18245de5d647dc273902b42b137c9c4720c4af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=B1=B3?= <470431449@qq.com> Date: Tue, 27 Aug 2024 11:00:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?PBOM-=E5=85=A8=E6=96=B0=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=9A=201=E3=80=81=E7=9B=B4=E5=8F=91=E5=8C=85=E4=B8=BA?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E9=97=AE=E9=A2=98=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=202=E3=80=8131=E7=94=9F=E6=88=90=E4=BA=86A00.1?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bomnew/pojo/vo/BomNewEbomParentVO.java | 4 +-- .../bomnew/pojo/vo/BomNewPbomParentVO.java | 6 ++--- .../service/BomNewPbomParentService.java | 25 +++++++++++++------ .../nflg/product/bomnew/util/MyStrUtil.java | 3 ++- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewEbomParentVO.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewEbomParentVO.java index 72f7fa34..d6c4572d 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewEbomParentVO.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewEbomParentVO.java @@ -366,13 +366,13 @@ public class BomNewEbomParentVO extends BaseMaterialVO implements Serializable { private String materialNoAndNumAndProjectType; public String getMaterialNoAndNumAndProjectType() { - return MyStrUtil.join(getMaterialNo(),getNum(),getProjectType()); + return MyStrUtil.joinStr(getMaterialNo(),getNum(),getProjectType()); } private String materialNoAndNum; public String getMaterialNoAndNum() { - return MyStrUtil.join(getMaterialNo(),getNum()); + return MyStrUtil.joinStr(getMaterialNo(),getNum()); } private static final long serialVersionUID = 1L; diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewPbomParentVO.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewPbomParentVO.java index 7a627df4..ada98668 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewPbomParentVO.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewPbomParentVO.java @@ -317,17 +317,17 @@ public class BomNewPbomParentVO extends BaseMaterialVO implements Serializable { private String materialNoAndNumAndProjectType; public String getMaterialNoAndProjectType() { - return MyStrUtil.join(getMaterialNo(),getProjectType()); + return MyStrUtil.joinStr(getMaterialNo(),getProjectType()); } public String getMaterialNoAndNumAndProjectType() { - return MyStrUtil.join(StrUtil.isNotBlank(getOriginalMaterialNo())?getOriginalMaterialNo(): getMaterialNo(),Objects.nonNull(getOriginalNum())?getOriginalNum(): getNum(),StrUtil.isNotBlank(getOriginalProjectType())?getOriginalProjectType(): getProjectType()); + return MyStrUtil.joinStr(StrUtil.isNotBlank(getOriginalMaterialNo())?getOriginalMaterialNo(): getMaterialNo(),Objects.nonNull(getOriginalNum())?getOriginalNum(): getNum(),StrUtil.isNotBlank(getOriginalProjectType())?getOriginalProjectType(): getProjectType()); } private String materialNoAndNum; public String getMaterialNoAndNum() { - return MyStrUtil.join(StrUtil.isNotBlank(getOriginalMaterialNo())?getOriginalMaterialNo(): getMaterialNo(),Objects.nonNull(getOriginalNum())?getOriginalNum(): getNum()); + return MyStrUtil.joinStr(StrUtil.isNotBlank(getOriginalMaterialNo())?getOriginalMaterialNo(): getMaterialNo(),Objects.nonNull(getOriginalNum())?getOriginalNum(): getNum()); } //发布PBOM 时 ,对比Pbom已发布版是否一致,一致则不转PBOM正式,直接删除PBOM 草稿数据 diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java index f47760c1..45fc2e3c 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java @@ -14,10 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; +import com.google.common.collect.*; import com.mzt.logapi.context.LogRecordContext; import com.nflg.product.base.core.conmon.util.SessionUtil; import com.nflg.product.base.core.exception.NflgBusinessException; @@ -1121,7 +1118,7 @@ public class BomNewPbomParentService extends ServiceImpl= PBomStatusEnum.PUBLISH.getValue()).throwMessage("pbom已发布无需在发布,请刷新数据"); + // VUtils.isTure(parent.getStatus() >= PBomStatusEnum.PUBLISH.getValue()).throwMessage("pbom已发布无需在发布,请刷新数据"); LogRecordContext.putVariable("bom", parent); try { List allBom = getAllBom(bomRowId, 0); @@ -1144,7 +1141,19 @@ public class BomNewPbomParentService extends ServiceImpl parentList=new ArrayList<>(); + parentList.add(parentVo); + initPBomCurrentVersion(parentList); + List delNoReleaseParentBom = parentList.stream().filter(u -> u.getDelIs().equals(1)).map(u->u.getBomRowId()).collect(Collectors.toList()); + if(CollUtil.isNotEmpty(delNoReleaseParentBom)){ + this.delPBom(delNoReleaseParentBom); + } + else { + bomRowIds.add(bomRowId); + } this.getBaseMapper().bomRelease(state, SessionUtil.getUserName(), bomRowIds); //同步sap // saySyncDEMO(); @@ -1173,6 +1182,8 @@ public class BomNewPbomParentService extends ServiceImpl oldBomDetail = this.getBaseMapper().getParentChild(oldParent.getRowId()); diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/MyStrUtil.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/MyStrUtil.java index 3515bc20..8aa0dac9 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/MyStrUtil.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/MyStrUtil.java @@ -6,7 +6,8 @@ import com.google.common.base.Joiner; public class MyStrUtil extends StrUtil { private static Joiner joiner=Joiner.on("").skipNulls(); - public static String joinStr(String ... str){ + public static String joinStr(Object ... str){ return joiner.join(str); } + } From a36e57f1dc1cef76862ad94a052228914ef38d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=B1=B3?= <470431449@qq.com> Date: Tue, 27 Aug 2024 11:02:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?PBOM-=E5=85=A8=E6=96=B0=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=9A=201=E3=80=81=E7=9B=B4=E5=8F=91=E5=8C=85=E4=B8=BA?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E9=97=AE=E9=A2=98=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=202=E3=80=8131=E7=94=9F=E6=88=90=E4=BA=86A00.1?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/service/BomNewPbomParentService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java index 45fc2e3c..9bf14927 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java @@ -1118,7 +1118,7 @@ public class BomNewPbomParentService extends ServiceImpl= PBomStatusEnum.PUBLISH.getValue()).throwMessage("pbom已发布无需在发布,请刷新数据"); + VUtils.isTure(parent.getStatus() >= PBomStatusEnum.PUBLISH.getValue()).throwMessage("pbom已发布无需在发布,请刷新数据"); LogRecordContext.putVariable("bom", parent); try { List allBom = getAllBom(bomRowId, 0);