电控系统发货包优化2

This commit is contained in:
10002327 2024-09-14 11:16:09 +08:00
parent 032e790ce1
commit 2af307b195
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())) { if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {
//1删掉pbom 父级的数据 //1删掉pbom 父级的数据
List<BomNewPbomParentEntity> pbomParent = eBomToPBom.getPBomParentResult().stream().filter(p -> (p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("直发")) || 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); eBomToPBom.getPBomParentResult().removeAll(pbomParent);
//2删掉pbom 子级的数据 //2删掉pbom 子级的数据
List<BomNewPbomChildEntity> pbomChild = eBomToPBom.getPBomChildResult().stream() List<BomNewPbomChildEntity> pbomChild = eBomToPBom.getPBomChildResult().stream()
.filter(c -> pbomParent.stream().map(BomNewPbomParentEntity::getRowId).collect(Collectors.toList()).contains(c.getParentRowId())) .filter(c -> pbomParent.stream().map(BomNewPbomParentEntity::getRowId).collect(Collectors.toList()).contains(c.getParentRowId()))
.collect(Collectors.toList()); .collect(Collectors.toList());
eBomToPBom.getPBomChildResult().removeAll(pbomChild); eBomToPBom.getPBomChildResult().removeAll(pbomChild);
//3删掉ebom 父级的数据 if(!pbomParent.isEmpty()){
List<Long> ebomParentIdList = pbomParent.stream().map(BomNewPbomParentEntity::getSourceRowId).collect(Collectors.toList()); //3删掉ebom 父级的数据
this.delBatch(ebomParentIdList); List<Long> ebomParentIdList = pbomParent.stream().map(BomNewPbomParentEntity::getSourceRowId).collect(Collectors.toList());
//4删掉ebom 子级的数据 this.delBatch(ebomParentIdList);
ebomChildService.remove(Wrappers.<BomNewEbomChildEntity>lambdaQuery().in(BomNewEbomChildEntity::getParentRowId,ebomParentIdList)); //4删掉ebom 子级的数据
ebomChildService.remove(Wrappers.<BomNewEbomChildEntity>lambdaQuery().in(BomNewEbomChildEntity::getParentRowId,ebomParentIdList));
}
} }
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) { if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {