From 96a7e928988e73c04fc348f4778ea1fa3ffed2ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Mon, 3 Jun 2024 08:49:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(dqbom):=20=E5=90=8C=E6=AD=A5=E5=88=B0pbom?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=98=AF31=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E5=88=99=E7=8A=B6=E6=80=81=E4=B8=BA=E5=B7=B2=E5=88=86?= =?UTF-8?q?=E9=85=8D=E5=B7=A5=E5=8E=82=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=98=AF?= =?UTF-8?q?21=E7=A0=81=EF=BC=8C=E5=88=99=E7=8A=B6=E6=80=81=E4=B8=BA?= =?UTF-8?q?=E5=B7=B2=E5=8F=91=E5=B8=83=EF=BC=9B=E8=AE=BE=E7=BD=AEdept=5Fro?= =?UTF-8?q?w=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/nflg/product/bomnew/service/DQBomService.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java index ee8261f4..47b859b9 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java @@ -509,7 +509,7 @@ public class DQBomService { buildTree(root, parents, children); dQBomParentService.updateBatchById(parents); dQBomChildService.updateBatchById(children); - savePbomParents(parents); + savePbomParents(parents, root.getMaterialNo().startsWith("31") ? PBomStatusEnum.FACTORY_CONFIRM : PBomStatusEnum.PUBLISH); savePbomChildren(children, parents); CompletableFuture.runAsync(() -> { @@ -549,7 +549,7 @@ public class DQBomService { bomNewPbomChildService.saveBatch(pchildren); } - private void savePbomParents(List parents) { + private void savePbomParents(List parents, PBomStatusEnum status) { List pparents = Convert.toList(BomNewPbomParentEntity.class, parents); pparents.forEach(p -> { if (Objects.equals(p.getRootIs(), 1)) { @@ -571,12 +571,13 @@ public class DQBomService { p.setCreatedTime(LocalDateTime.now()); p.setModifyTime(null); p.setEditStatus(PBomEditStatusEnum.HANDLER_FINISHED.getValue()); - p.setStatus(PBomStatusEnum.WAIT_FACTORY.getValue()); + p.setStatus(status.getValue()); p.setFacCode(FactoryCodeEnum.FACTORY_1010.getValue()); p.setSourceRowId(p.getRowId()); p.setLevelNum(parents.stream().filter(ps -> Objects.equals(ps.getRowId(), p.getRowId())).findFirst().get().getLevel()); p.setReleaseTime(LocalDateTime.now()); p.setReleaseUserName(SessionUtil.getUserName()); + p.setDeptRowId(SessionUtil.getDepartRowId()); }); bomNewPbomParentService.saveBatch(pparents); } @@ -601,7 +602,7 @@ public class DQBomService { VUtils.isTure(true).throwMessage(StrUtil.format("{}的当前版本为{},比pbom中版本{}低", parent.getMaterialNo() , parent.getCurrentVersion(), pp.getCurrentVersion())); } else { - if (pp.getStatus() >= 4) { + if (pp.getStatus() >= PBomStatusEnum.PUBLISH.getValue()) { parent.setCurrentVersion(VersionUtil.getNextVersion(pp.getCurrentVersion())); pp.setLastVersionIs(0); bomNewPbomParentService.updateById(pp);