Merge remote-tracking branch 'origin/master-convertToPBom-lhj09014' into test

This commit is contained in:
10001392 2024-09-14 11:19:05 +08:00
commit 674909b5e3
1 changed files with 8 additions and 7 deletions

View File

@ -997,19 +997,20 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {
//1删掉pbom 父级的数据
List<BomNewPbomParentEntity> pbomParent = eBomToPBom.getPBomParentResult().stream().filter(p -> (p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("直发")) ||
p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("制作")).collect(Collectors.toList());
(p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("制作"))).collect(Collectors.toList());
eBomToPBom.getPBomParentResult().removeAll(pbomParent);
//2删掉pbom 子级的数据
List<BomNewPbomChildEntity> pbomChild = eBomToPBom.getPBomChildResult().stream()
.filter(c -> pbomParent.stream().map(BomNewPbomParentEntity::getRowId).collect(Collectors.toList()).contains(c.getParentRowId()))
.collect(Collectors.toList());
eBomToPBom.getPBomChildResult().removeAll(pbomChild);
//3删掉ebom 父级的数据
List<Long> ebomParentIdList = pbomParent.stream().map(BomNewPbomParentEntity::getSourceRowId).collect(Collectors.toList());
this.delBatch(ebomParentIdList);
//4删掉ebom 子级的数据
ebomChildService.remove(Wrappers.<BomNewEbomChildEntity>lambdaQuery().in(BomNewEbomChildEntity::getParentRowId,ebomParentIdList));
if(!pbomParent.isEmpty()){
//3删掉ebom 父级的数据
List<Long> ebomParentIdList = pbomParent.stream().map(BomNewPbomParentEntity::getSourceRowId).collect(Collectors.toList());
this.delBatch(ebomParentIdList);
//4删掉ebom 子级的数据
ebomChildService.remove(Wrappers.<BomNewEbomChildEntity>lambdaQuery().in(BomNewEbomChildEntity::getParentRowId,ebomParentIdList));
}
}
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {