项目库--列表查询

This commit is contained in:
zhn
2022-10-18 11:50:58 +08:00
parent 387df93346
commit 18efbb8a44
@@ -481,6 +481,12 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
List<ProjectLibraryBase> children = result.stream()
.filter(e -> StringUtils.isNotBlank(e.getParentId()) && projectLibraryBase.getId().equals(e.getParentId())).collect(Collectors.toList());
if(children.size() != 0){
//子项目的基础上添加的子项目
List<String> childrenIdList = children.stream().map(ProjectLibraryBase::getId).distinct().collect(Collectors.toList());
List<ProjectLibraryBase> childrenList = result.stream()
.filter(e -> StringUtils.isNotBlank(e.getParentId()) && childrenIdList.contains(e.getParentId())).collect(Collectors.toList());
children.addAll(childrenList);
//按版本排序
Collections.sort(children);
projectLibraryBase.setChildren(children);