From 1055d24aba1890c7c7e5eadb89567451289b6727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Mon, 20 May 2024 10:04:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix(ebom):=20=E4=BC=98=E5=8C=96=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bomnew/service/BomNewEbomParentService.java | 2 +- .../bomnew/service/domain/EBom/EBomEdit.java | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 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 28d1c565..1a17381c 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 @@ -335,7 +335,7 @@ public class BomNewEbomParentService extends ServiceImpl parentChild = this.getBaseMapper().getParentChild(rowId); //排除项目类别的赋值 - materialMainService.intiMaterialInfoInPattern(parentChild, "^21 | ^31", EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); + materialMainService.intiMaterialInfoInPattern(parentChild, "^21 | ^31", EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT2); if (CollUtil.isNotEmpty(parentChild)) { List materialNos = parentChild.stream().map(BaseMaterialVO::getMaterialNo).filter(StrUtil::isNotBlank).collect(Collectors.toList()); if (CollUtil.isNotEmpty(materialNos)) { 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 ffe325ea..66bca524 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 @@ -3,10 +3,7 @@ package com.nflg.product.bomnew.service.domain.EBom; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; import cn.hutool.core.lang.TypeReference; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.NumberUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; +import cn.hutool.core.util.*; import cn.hutool.extra.spring.SpringUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.IdWorker; @@ -198,7 +195,7 @@ public class EBomEdit { EBomEdit.checkVirtualPackage(child); //新增数据 - if (child.getRowId() == null || child.getRowId().longValue() == 0) { + if (child.getRowId() == null || child.getRowId() == 0) { child.setRowId(IdWorker.getId()); child.setIdentityNo(StrUtil.join("_", parentEntity.getRowId(), child.getRowId())); child.setSource(source); @@ -207,7 +204,7 @@ public class EBomEdit { child.setSourceRowId(""); child.setParentRowId(parentEntity.getRowId()); if(StrUtil.isEmpty(child.getOrderNumber())){ - child.setOrderNumber("00"); + child.setOrderNumber("001"); } if (dto.getOpType() == 2) { child.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); @@ -218,6 +215,9 @@ public class EBomEdit { child.setProjectType(child.getProjectType().toUpperCase()); } if (StrUtil.equals(BomConstant.PROJECT_TYPE_TEMPORARY, child.getProjectType(), true)) { + String id = RandomUtil.randomNumbers(9); + child.setMaterialNo(BomConstant.PROJECT_TYPE_TEMPORARY + id); + child.setDrawingNo(BomConstant.PROJECT_TYPE_TEMPORARY + id); if (StrUtil.isBlank(child.getMaterialUnit())) { child.setMaterialUnit("PC"); } @@ -228,6 +228,9 @@ public class EBomEdit { child.setNum(BigDecimal.ONE); } } + if (parentEntity.getMaterialNo().startsWith("31")) { + child.setVirtualPartRootMaterialNo(parentEntity.getMaterialNo()); + } } From 53760502e81ca87429f2d32867aa860fd55612b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Mon, 20 May 2024 10:42:56 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix(ebom):=201=E3=80=8131=E7=A0=81=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E6=89=80=E6=9C=89=E7=89=A9=E6=96=99=E9=83=BD=E7=94=9F?= =?UTF-8?q?=E6=88=90=E8=99=9A=E6=8B=9F=E5=8C=85=E5=90=8E=E6=89=8D=E8=83=BD?= =?UTF-8?q?=E8=BD=ACpbom=202=E3=80=8131=E7=A0=81=E5=8F=AA=E8=83=BD?= =?UTF-8?q?=E7=94=9F=E6=88=901010=E7=9A=84pbom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/BomNewEbomParentService.java | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 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 1a17381c..6bf3db91 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 @@ -838,11 +838,22 @@ public class BomNewEbomParentService extends ServiceImpl parents = this.getBaseMapper().selectBatchIds(paramDto.getBomRowIds()); - VUtils.isTure(paramDto.getFacCodes().contains("1020") && parents.stream().anyMatch(u -> u.getMaterialNo().startsWith("31"))) - .throwMessage("31码不能生成仙桃(1020)的pbom"); + // VUtils.isTure(paramDto.getFacCodes().contains("1020") && parents.stream().anyMatch(u -> u.getMaterialNo().startsWith("31"))) + // .throwMessage("31码不能生成仙桃(1020)的pbom"); - VUtils.isTure(parents.stream().anyMatch(u -> u.getMaterialNo().startsWith("31") && u.getVirtrualPackageEnum() <= 0)) - .throwMessage("31码须有虚拟包"); + // VUtils.isTure(parents.stream().anyMatch(u -> u.getMaterialNo().startsWith("31") && u.getVirtrualPackageEnum() <= 0)) + // .throwMessage("31码须有虚拟包"); + parents.forEach(p -> { + if (p.getMaterialNo().startsWith("31")) { + List errors = new ArrayList<>(); + if (ebomChildService.lambdaQuery().eq(BomNewEbomChildEntity::getParentRowId, p.getRowId()) + .eq(BomNewEbomChildEntity::getVirtualPartType, VirtualPackageTypeEnum.UN_VIRTUAL_PACKAGE.getValue()) + .exists()) { + errors.add(p.getMaterialNo() + "下还有未生成发货包的物料"); + } + VUtils.isTure(CollUtil.isNotEmpty(errors)).throwMessage(StrUtil.join("
", errors)); + } + }); //检查该版本是否已转换过该工厂的Pbom for (BomNewEbomParentEntity parent : parents){ List list = pBomParentService.lambdaQuery().eq(BomNewPbomParentEntity::getMaterialNo, parent.getMaterialNo()).eq(BomNewPbomParentEntity::getCurrentVersion, parent.getCurrentVersion()) @@ -864,7 +875,9 @@ public class BomNewEbomParentService extends ServiceImpl Date: Mon, 20 May 2024 17:05:43 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix(pbom):=20=E4=BF=AE=E5=A4=8Dpbom?= =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E8=A1=A8=E5=AD=90=E7=BA=A7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=B1=95=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= 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 6d216d38..71f265f4 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 @@ -264,7 +264,7 @@ public class BomNewPbomParentService extends ServiceImpl parent.getStatus(), BomNewPbomParentEntity::getLastVersionIs, 1) - .gt(PBomStatusEnum.PUBLISH.getValue() <= parent.getStatus(), BomNewPbomParentEntity::getStatus, PBomStatusEnum.PUBLISH.getValue()) + .ge(PBomStatusEnum.PUBLISH.getValue() <= parent.getStatus(), BomNewPbomParentEntity::getStatus, PBomStatusEnum.PUBLISH.getValue()) .list(); Map bomListMap= list.parallelStream()