From 02b08c008d2279a18a49c88d4a437a26e9954f9e Mon Sep 17 00:00:00 2001 From: jing's Date: Mon, 1 Apr 2024 13:10:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E5=8F=98?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/BomNewEbomParentService.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 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 8642cd82..7bc0ab9d 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 @@ -1623,16 +1623,19 @@ public class BomNewEbomParentService extends ServiceImpl oldParent= this.lambdaQuery() .eq(BomNewEbomParentEntity::getMaterialNo, eBomEdit.getParentEntity().getMaterialNo()) .eq(BomNewEbomParentEntity::getLastVersionIs,1) - // .ne(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()) + //.ne(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()) .ne(BomNewEbomParentEntity::getRowId, eBomEdit.getParentEntity().getRowId()) - .one(); + .list(); - if(Objects.nonNull(oldParent)){ - oldParent.setLastVersionIs(0); - this.updateById(oldParent); + if(CollUtil.isNotEmpty(oldParent)){ + // oldParent.setLastVersionIs(0); + oldParent.forEach(u->{ + u.setLastVersionIs(0); + }); + this.updateBatchById(oldParent); } } @@ -1693,16 +1696,19 @@ public class BomNewEbomParentService extends ServiceImpl oldParent= this.lambdaQuery() .eq(BomNewEbomParentEntity::getMaterialNo, eBomEdit.getParentEntity().getMaterialNo()) .eq(BomNewEbomParentEntity::getLastVersionIs,1) //.ne(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()) .ne(BomNewEbomParentEntity::getRowId, eBomEdit.getParentEntity().getRowId()) - .one(); + .list(); - if(Objects.nonNull(oldParent)){ - oldParent.setLastVersionIs(0); - this.updateById(oldParent); + if(CollUtil.isNotEmpty(oldParent)){ + // oldParent.setLastVersionIs(0); + oldParent.forEach(u->{ + u.setLastVersionIs(0); + }); + this.updateBatchById(oldParent); } }