Commit e800ef3a authored by chenzhao's avatar chenzhao

修改建筑树展示,过滤掉其他单位建筑

parent 01f2cf9b
......@@ -806,6 +806,9 @@ LEFT JOIN (
#{bizOrgType}
</foreach>
</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
and usr.biz_org_code LIKE CONCAT (#{bizOrgCode},'%')
</if>
order by usr.rec_date
</select>
......
......@@ -1152,13 +1152,19 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}).collect(Collectors.toList());
// 3.将建筑的bizOrgCode转换为parentId连接树 ,拼接数据准备
Map<String, Long> comMap = companyList.stream().collect(Collectors.toMap(BuildingTreeVo::getBizOrgCode, BuildingTreeVo::getId));
buildingTreeVos.forEach(b -> {
//增加了一层对树的过滤,过滤掉指定公司外的其他建筑。
List<BuildingTreeVo> collect = buildingTreeVos.stream().filter(build ->companyList.stream().map(m -> {
String bizOrgCode = m.getBizOrgCode();
return bizOrgCode;
}).collect(Collectors.toList()).contains(build.getBizOrgCode())).collect(Collectors.toList());
collect.forEach(b -> {
b.setParentId("0".equals(b.getParentId()) ? String.valueOf(comMap.get(b.getBizOrgCode())) : b.getParentId());
b.setDetailPaneApi(address);
b.setApiUrl(apiUrl);
});
// 4.组装树
companyList.addAll(buildingTreeVos);
companyList.addAll(collect);
return companyList;
}
......
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