生成PBOM时,bom没有子项的话,仅生成EBOM正式表,不生成PBOM任务2

This commit is contained in:
10002327 2024-09-26 10:44:01 +08:00
parent cb40340257
commit cdcf08e706
1 changed files with 5 additions and 3 deletions

View File

@ -1022,9 +1022,10 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
// //4删掉ebom 子级的数据
// ebomChildService.remove(Wrappers.<BomNewEbomChildEntity>lambdaQuery().in(BomNewEbomChildEntity::getParentRowId,ebomParentIdList));
// }
//3判断parent下是否有子级如果没有的话把parent给删除了 物料****因下级全部是F项仅保存EBOM未生成PBOM数据
//3判断parent下是否有子级排除电控系统和仙桃的如果没有的话把parent给删除了 物料****因下级全部是F项仅保存EBOM未生成PBOM数据 仙桃)
List<BomNewPbomParentEntity> emptyChildParentList = eBomToPBom.getPBomParentResult().stream()
.filter(p -> !p.getMaterialDesc().contains("电控系统") && !eBomToPBom.getPBomChildResult().stream().map(BomNewPbomChildEntity::getParentRowId).collect(Collectors.toList()).contains(p.getRowId()) )
.filter(p -> !p.getMaterialDesc().contains("电控系统") && !p.getMaterialDesc().contains("仙桃)")
&& !eBomToPBom.getPBomChildResult().stream().map(BomNewPbomChildEntity::getParentRowId).collect(Collectors.toList()).contains(p.getRowId()) )
.collect(Collectors.toList());
if(!emptyChildParentList.isEmpty()){
List<BomNewPbomParentEntity> fList = emptyChildParentList.stream().filter(p -> {
@ -1216,7 +1217,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
eBomToPBom.getPBomChildResult().removeAll(pbomChild);
//3判断parent下是否有子级如果没有的话把parent给删除了 物料****因下级全部是F项仅保存EBOM未生成PBOM数据
List<BomNewPbomParentEntity> emptyChildParentList = eBomToPBom.getPBomParentResult().stream()
.filter(p -> !p.getMaterialDesc().contains("电控系统") && !eBomToPBom.getPBomChildResult().stream().map(BomNewPbomChildEntity::getParentRowId).collect(Collectors.toList()).contains(p.getRowId()) )
.filter(p -> !p.getMaterialDesc().contains("电控系统") && !p.getMaterialDesc().contains("仙桃)")
&& !eBomToPBom.getPBomChildResult().stream().map(BomNewPbomChildEntity::getParentRowId).collect(Collectors.toList()).contains(p.getRowId()) )
.collect(Collectors.toList());
if(!emptyChildParentList.isEmpty()){
List<BomNewPbomParentEntity> fList = emptyChildParentList.stream().filter(p -> {