optimize(ebom): 优化逻辑
This commit is contained in:
parent
ab5a23afbd
commit
f2ca749534
|
|
@ -2866,14 +2866,13 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
return bomRowIds.stream().map(bomRowId -> {
|
||||
CheckBomProjectTypeVO vo = new CheckBomProjectTypeVO();
|
||||
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.setAllIsF(false);
|
||||
} else {
|
||||
vo.setExistsQ(children.stream().anyMatch(c -> c.getParentRowId().equals(bomRowId)
|
||||
&& StrUtil.equals(c.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue())));
|
||||
vo.setAllIsF(children.stream().allMatch(c -> c.getParentRowId().equals(bomRowId)
|
||||
&& StrUtil.equals(c.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue())));
|
||||
vo.setExistsQ(cc.stream().anyMatch(c -> StrUtil.equals(c.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue())));
|
||||
vo.setAllIsF(cc.stream().allMatch(c -> StrUtil.equals(c.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue())));
|
||||
}
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
|
|
|
|||
Loading…
Reference in New Issue