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); } }