Search in sources :

Example 16 with SysMenu

use of com.ruoyi.system.domain.SysMenu in project RuoYi-Cloud-Plus by JavaLionLi.

the class SysMenuServiceImpl method recursionFn.

/**
 * 递归列表
 *
 * @param list
 * @param t
 */
private void recursionFn(List<SysMenu> list, SysMenu t) {
    // 得到子节点列表
    List<SysMenu> childList = getChildList(list, t);
    t.setChildren(childList);
    for (SysMenu tChild : childList) {
        if (hasChild(list, tChild)) {
            recursionFn(list, tChild);
        }
    }
}
Also used : SysMenu(com.ruoyi.system.domain.SysMenu)

Example 17 with SysMenu

use of com.ruoyi.system.domain.SysMenu in project RuoYi-Cloud-Plus by JavaLionLi.

the class SysMenuServiceImpl method getChildPerms.

/**
 * 根据父节点的ID获取所有子节点
 *
 * @param list     分类表
 * @param parentId 传入的父节点ID
 * @return String
 */
public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) {
    List<SysMenu> returnList = new ArrayList<SysMenu>();
    for (SysMenu t : list) {
        // 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
        if (t.getParentId() == parentId) {
            recursionFn(list, t);
            returnList.add(t);
        }
    }
    return returnList;
}
Also used : SysMenu(com.ruoyi.system.domain.SysMenu)

Aggregations

SysMenu (com.ruoyi.system.domain.SysMenu)17 ArrayList (java.util.ArrayList)8 MetaVo (com.ruoyi.system.domain.vo.MetaVo)3 RouterVo (com.ruoyi.system.domain.vo.RouterVo)3 AjaxResult (com.ruoyi.common.core.web.domain.AjaxResult)2 LinkedList (java.util.LinkedList)2 List (java.util.List)2 GetMapping (org.springframework.web.bind.annotation.GetMapping)2