电控系统发货包优化

This commit is contained in:
10002327 2024-09-14 10:39:19 +08:00
parent 11279f4335
commit 032e790ce1
1 changed files with 18 additions and 0 deletions

View File

@ -993,6 +993,24 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
EBomToPbomBase eBomToPBom =parent.getMaterialNo().startsWith("31")? new EBomToPBomFor31(parent, bomTree, paramDto.getFacCodes(), 0L,EnumUtils.getValueEnum(ConvertToPBomModelEnum.class,paramDto.getConvertMode())):new EBomToPBom(parent, bomTree, paramDto.getFacCodes(), 0L,EnumUtils.getValueEnum(ConvertToPBomModelEnum.class,paramDto.getConvertMode())); EBomToPbomBase eBomToPBom =parent.getMaterialNo().startsWith("31")? new EBomToPBomFor31(parent, bomTree, paramDto.getFacCodes(), 0L,EnumUtils.getValueEnum(ConvertToPBomModelEnum.class,paramDto.getConvertMode())):new EBomToPBom(parent, bomTree, paramDto.getFacCodes(), 0L,EnumUtils.getValueEnum(ConvertToPBomModelEnum.class,paramDto.getConvertMode()));
eBomToPBom.convert(); eBomToPBom.convert();
//电控系统 发货包优化 删除 直发制作下的物料 by 10002327 240914
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());
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 (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) { if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {
pBomParentService.saveOrUpdateBatch(eBomToPBom.getPBomParentResult()); pBomParentService.saveOrUpdateBatch(eBomToPBom.getPBomParentResult());