Commit 49a694d3 authored by lisong's avatar lisong

修改单位树视频数量统计

parent 610c6c9b
......@@ -1245,7 +1245,11 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
vo.setTotal(countMap.get(orgUsrDto.getBizOrgCode()) == null ? 0L : countMap.get(orgUsrDto.getBizOrgCode()));
return vo;
}).collect(Collectors.toList());
return companyList.stream().filter(a -> companyList.stream().noneMatch(c -> c.getId().toString().equals(a.getParentId()))).peek(b -> b.setChildren(getCompanyBuildingChildrenTree(b.getId().toString(), companyList))).collect(Collectors.toList());
return companyList.stream().filter(a -> companyList.stream().noneMatch(c -> c.getId().toString().equals(a.getParentId())))
.peek(b -> {
b.setChildren(getCompanyBuildingChildrenTree(b.getId().toString(), companyList));
b.setTotal(b.getChildren().stream().filter(c -> c.getTotal() != null).mapToLong(BuildingTreeVo::getTotal).sum());
}).collect(Collectors.toList());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment