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] =?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