From 0372a359e29bae38d1f481dc2840e0c8ad83bace Mon Sep 17 00:00:00 2001 From: "review512jwy@163.com" <“review512jwy@163.com”> Date: Thu, 28 May 2026 13:12:49 +0800 Subject: [PATCH] =?UTF-8?q?getBoundLevel=E6=8E=A5=E5=8F=A3=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/LevelRoleServiceImpl.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) 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);