mirror of https://gitee.com/stylefeng/roses
【8.1.8】【sys】更新父级菜单id的查询
parent
22f864bd46
commit
d289b0e92b
|
@ -15,7 +15,7 @@ import java.util.Set;
|
|||
public class MenuPathCalcFactory {
|
||||
|
||||
/**
|
||||
* 获取指定菜单id对应的父级id路径上,父级id没有其他子菜单的情况下,所有id的集合
|
||||
* 获取指定菜单id对应的父级id路径上,所有id的集合
|
||||
*
|
||||
* @return 返回的id集合包含参数的menuId
|
||||
* @author fengshuonan
|
||||
|
@ -45,19 +45,11 @@ public class MenuPathCalcFactory {
|
|||
return;
|
||||
}
|
||||
|
||||
// 检查父菜单是否有其他子节点
|
||||
boolean hasOtherChildren = menuParentMap.entrySet().stream()
|
||||
.anyMatch(entry -> entry.getValue().equals(parentId) && !entry.getKey().equals(currentMenuId));
|
||||
|
||||
// 如果父菜单没有其他子节点,则继续递归处理父菜单
|
||||
if (!hasOtherChildren) {
|
||||
|
||||
// 将当前菜单ID加入结果集合
|
||||
uniquePathMenuIds.add(parentId);
|
||||
|
||||
// 继续递归向上找
|
||||
findUniquePathMenuIdsRecursive(parentId, menuParentMap, uniquePathMenuIds);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue