From be8d4fab44c10ae683a689d8e799e5dd60d311e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Thu, 22 Aug 2024 16:22:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=85=A5SAP?= =?UTF-8?q?=E6=97=B6=E6=B7=BB=E5=8A=A0=E7=9B=B4=E5=8F=91=E5=8C=85parent?= =?UTF-8?q?=E7=9A=84=E4=B8=80=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/bomnew/service/BomNewPbomExportToSAPImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomExportToSAPImpl.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomExportToSAPImpl.java index d64b9441..bf602071 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomExportToSAPImpl.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomExportToSAPImpl.java @@ -160,6 +160,10 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP { } private BomNewPbomParentEntity addZFBParent(BomNewPbomChildEntity child) { + BomNewPbomParentEntity tp = bomNewPbomParentService.lambdaQuery() + .eq(BomNewPbomParentEntity::getMaterialNo, child.getMaterialNo()) + .eq(BomNewPbomParentEntity::getFacCode, child.getFacCode()) + .one(); BomNewPbomParentEntity parent = new BomNewPbomParentEntity(); parent.setRowId(IdWorker.getId()); parent.setCreatedTime(LocalDateTime.now()); @@ -170,7 +174,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP { parent.setBatchNo(""); parent.setCreatedBy(SessionUtil.getUserCode()); parent.setCreatedJob(UserJobEnum.ENGINEER.getValue()); - parent.setCurrentVersion(VersionUtil.getNextVersion("")); + parent.setCurrentVersion(Objects.isNull(tp) ? VersionUtil.getNextVersion("") : VersionUtil.getNextVersion(tp.getCurrentVersion())); parent.setDeptRowId(SessionUtil.getDepartRowId()); parent.setDeptName(SessionUtil.getDepartName()); parent.setDeviseName(SessionUtil.getRealName());