小组管理 用户权限 优化数据加载慢的问题
This commit is contained in:
parent
e4bf4617f3
commit
f1e1bc366c
Binary file not shown.
@ -111,12 +111,13 @@ public class CooperationQueryAPIManager {
|
||||
// 获取符合权限的子流程
|
||||
List<PALRepositoryModel> childrenList = getUsedPalRepositoryModelsByPidNew(wsId, teamId, pid);
|
||||
CooperationUtil.sortByLevelAndOrderIndex(childrenList);
|
||||
Map<String, Integer> grandChildrenCountMap = new HashMap<>();
|
||||
for (PALRepositoryModel chlidModel : childrenList) {
|
||||
List<PALRepositoryModel> grandChildrenList = getUsedPalRepositoryModelsByPidNew(wsId, teamId, chlidModel.getId());
|
||||
grandChildrenCountMap.put(chlidModel.getId(), grandChildrenList.size());
|
||||
}
|
||||
JSONArray result = list2JsonNew(childrenList, grandChildrenCountMap);
|
||||
|
||||
// Map<String, Integer> grandChildrenCountMap = new HashMap<>();
|
||||
// for (PALRepositoryModel chlidModel : childrenList) {
|
||||
// List<PALRepositoryModel> grandChildrenList = getUsedPalRepositoryModelsByPidNew(wsId, teamId, chlidModel.getId());
|
||||
// grandChildrenCountMap.put(chlidModel.getId(), grandChildrenList.size());
|
||||
// }
|
||||
JSONArray result = list2JsonNew(childrenList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -188,7 +189,7 @@ public class CooperationQueryAPIManager {
|
||||
* @param childrenCountMap list中的model是否具有子节点map记录
|
||||
* @return
|
||||
*/
|
||||
private JSONArray list2JsonNew(List<PALRepositoryModel> list, Map<String, Integer> childrenCountMap) {
|
||||
private JSONArray list2JsonNew(List<PALRepositoryModel> list) {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
for (PALRepositoryModel model : list) {
|
||||
JSONObject object = new JSONObject();
|
||||
@ -216,7 +217,7 @@ public class CooperationQueryAPIManager {
|
||||
}
|
||||
object.put("icon", icon);
|
||||
List<PALRepositoryModel> children = null;
|
||||
if (childrenCountMap.containsKey(model.getId()) && childrenCountMap.get(model.getId()) > 0) {
|
||||
if (PALRepositoryCache.getByPid(model.getWsId(), model.getId()).hasNext()) {
|
||||
object.put("leaf", false);// 非叶子节点
|
||||
} else {
|
||||
object.put("leaf", true);// 叶子节点
|
||||
|
||||
Loading…
Reference in New Issue
Block a user