optimize(ebom): 优化逻辑

This commit is contained in:
曹鹏飞 2024-07-02 11:19:35 +08:00
parent ab5a23afbd
commit f2ca749534
1 changed files with 4 additions and 5 deletions

View File

@ -2866,14 +2866,13 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
return bomRowIds.stream().map(bomRowId -> { return bomRowIds.stream().map(bomRowId -> {
CheckBomProjectTypeVO vo = new CheckBomProjectTypeVO(); CheckBomProjectTypeVO vo = new CheckBomProjectTypeVO();
vo.setBomRowId(bomRowId); vo.setBomRowId(bomRowId);
if (CollUtil.isEmpty(children)) { List<BomNewEbomChildEntity> cc = children.stream().filter(c -> c.getParentRowId().equals(bomRowId)).collect(Collectors.toList());
if (CollUtil.isEmpty(cc)) {
vo.setExistsQ(false); vo.setExistsQ(false);
vo.setAllIsF(false); vo.setAllIsF(false);
} else { } else {
vo.setExistsQ(children.stream().anyMatch(c -> c.getParentRowId().equals(bomRowId) vo.setExistsQ(cc.stream().anyMatch(c -> StrUtil.equals(c.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue())));
&& StrUtil.equals(c.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue()))); vo.setAllIsF(cc.stream().allMatch(c -> StrUtil.equals(c.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue())));
vo.setAllIsF(children.stream().allMatch(c -> c.getParentRowId().equals(bomRowId)
&& StrUtil.equals(c.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue())));
} }
return vo; return vo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());