查询条件变更

This commit is contained in:
jing's 2024-04-01 13:10:10 +08:00
parent 60c7f489e2
commit 02b08c008d
1 changed files with 17 additions and 11 deletions

View File

@ -1623,16 +1623,19 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
//同一物料且存在一个 lastVersionIs=1 //同一物料且存在一个 lastVersionIs=1
if(ObjectUtil.isNotNull(eBomEdit.getParentEntity().getLastVersionIs()) if(ObjectUtil.isNotNull(eBomEdit.getParentEntity().getLastVersionIs())
&& ObjectUtil.equal(eBomEdit.getParentEntity().getLastVersionIs(),1L)) { && ObjectUtil.equal(eBomEdit.getParentEntity().getLastVersionIs(),1L)) {
BomNewEbomParentEntity oldParent= this.lambdaQuery() List<BomNewEbomParentEntity> oldParent= this.lambdaQuery()
.eq(BomNewEbomParentEntity::getMaterialNo, eBomEdit.getParentEntity().getMaterialNo()) .eq(BomNewEbomParentEntity::getMaterialNo, eBomEdit.getParentEntity().getMaterialNo())
.eq(BomNewEbomParentEntity::getLastVersionIs,1) .eq(BomNewEbomParentEntity::getLastVersionIs,1)
//.ne(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()) //.ne(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue())
.ne(BomNewEbomParentEntity::getRowId, eBomEdit.getParentEntity().getRowId()) .ne(BomNewEbomParentEntity::getRowId, eBomEdit.getParentEntity().getRowId())
.one(); .list();
if(Objects.nonNull(oldParent)){ if(CollUtil.isNotEmpty(oldParent)){
oldParent.setLastVersionIs(0); // oldParent.setLastVersionIs(0);
this.updateById(oldParent); oldParent.forEach(u->{
u.setLastVersionIs(0);
});
this.updateBatchById(oldParent);
} }
} }
@ -1693,16 +1696,19 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
//同一物料且存在一个 lastVersionIs=1 //同一物料且存在一个 lastVersionIs=1
if(ObjectUtil.isNotNull(eBomEdit.getParentEntity().getLastVersionIs()) if(ObjectUtil.isNotNull(eBomEdit.getParentEntity().getLastVersionIs())
&& ObjectUtil.equal(eBomEdit.getParentEntity().getLastVersionIs(),1L)) { && ObjectUtil.equal(eBomEdit.getParentEntity().getLastVersionIs(),1L)) {
BomNewEbomParentEntity oldParent= this.lambdaQuery() List<BomNewEbomParentEntity> oldParent= this.lambdaQuery()
.eq(BomNewEbomParentEntity::getMaterialNo, eBomEdit.getParentEntity().getMaterialNo()) .eq(BomNewEbomParentEntity::getMaterialNo, eBomEdit.getParentEntity().getMaterialNo())
.eq(BomNewEbomParentEntity::getLastVersionIs,1) .eq(BomNewEbomParentEntity::getLastVersionIs,1)
//.ne(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()) //.ne(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue())
.ne(BomNewEbomParentEntity::getRowId, eBomEdit.getParentEntity().getRowId()) .ne(BomNewEbomParentEntity::getRowId, eBomEdit.getParentEntity().getRowId())
.one(); .list();
if(Objects.nonNull(oldParent)){ if(CollUtil.isNotEmpty(oldParent)){
oldParent.setLastVersionIs(0); // oldParent.setLastVersionIs(0);
this.updateById(oldParent); oldParent.forEach(u->{
u.setLastVersionIs(0);
});
this.updateBatchById(oldParent);
} }
} }