优化代码以后提交代码,功能完善
This commit is contained in:
parent
80920a28a5
commit
d94955e69a
@ -59,8 +59,6 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
|
|||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Map<String, Object>> result = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Map<String, Object> item : listMap) {
|
for (Map<String, Object> item : listMap) {
|
||||||
Object idObj = item.get("id");
|
Object idObj = item.get("id");
|
||||||
// 避免空指针
|
// 避免空指针
|
||||||
@ -70,10 +68,10 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
|
|||||||
List<Map<String, Object>> childList = child(idObj.toString(), appId, orgname);
|
List<Map<String, Object>> childList = child(idObj.toString(), appId, orgname);
|
||||||
item.put("childList", childList); // 添加新列 子集
|
item.put("childList", childList); // 添加新列 子集
|
||||||
if (childList != null && !childList.isEmpty()) {
|
if (childList != null && !childList.isEmpty()) {
|
||||||
result.add(item); // 仅保留有子节点的数据
|
listMap.add(item); // 仅保留有子节点的数据
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return listMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user