diff --git a/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/LevelRoleServiceImpl.java b/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/LevelRoleServiceImpl.java index 68d53e9..3913d5c 100644 --- a/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/LevelRoleServiceImpl.java +++ b/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/LevelRoleServiceImpl.java @@ -360,7 +360,7 @@ public class LevelRoleServiceImpl implements LevelRoleService { Map> buildingMap = groupByParent(buildings); // 用于去重,避免重复根节点 - Set visitedKeys = new HashSet<>(); +// Set visitedKeys = new HashSet<>(); // 组装树结构 List result = new ArrayList<>(); @@ -370,8 +370,8 @@ public class LevelRoleServiceImpl implements LevelRoleService { TreeMenusDTO root = new TreeMenusDTO(); String rootKey = ref.getType() + "-" + ref.getId(); - if (visitedKeys.contains(rootKey)) continue; // 已存在跳过 - visitedKeys.add(rootKey); +// if (visitedKeys.contains(rootKey)) continue; // 已存在跳过 +// visitedKeys.add(rootKey); root.setKey(rootKey); root.setLabel(ref.getName()); @@ -380,7 +380,8 @@ public class LevelRoleServiceImpl implements LevelRoleService { // 构建该节点下的子树 root.setChildren(buildTree( ref.getType(), ref.getId(), rootKey, - storeMap, areaMap, siteMap, buildingMap, visitedKeys + storeMap, areaMap, siteMap, buildingMap +// , visitedKeys )); result.add(root); } @@ -446,8 +447,9 @@ public class LevelRoleServiceImpl implements LevelRoleService { Map> storeMap, Map> areaMap, Map> siteMap, - Map> buildingMap, - Set visitedKeys) { + Map> buildingMap +// ,Set visitedKeys + ) { Map> childMap = switch (type) { case "BRANCH" -> storeMap; @@ -467,8 +469,8 @@ public class LevelRoleServiceImpl implements LevelRoleService { for (RefKey c : children) { String key = c.getType() + "-" + c.getId(); - if (visitedKeys.contains(key)) continue; // 已存在跳过 - visitedKeys.add(key); +// if (visitedKeys.contains(key)) continue; // 已存在跳过 +// visitedKeys.add(key); TreeMenusDTO node = new TreeMenusDTO(); node.setKey(key); @@ -477,7 +479,8 @@ public class LevelRoleServiceImpl implements LevelRoleService { node.setChildren(buildTree( c.getType(), c.getId(), key, - storeMap, areaMap, siteMap, buildingMap, visitedKeys + storeMap, areaMap, siteMap, buildingMap +// , visitedKeys )); list.add(node);