Search in sources :

Example 11 with SysFunc

use of com.artlongs.sys.model.SysFunc in project act-eagle-allone by mailtous.

the class SysMenuService method getMyAllFuncMap.

/**
 * 取得我的全部功能列表
 *
 * @param roleIds
 * @return
 */
private Map<Integer, List<SysFunc>> getMyAllFuncMap(Integer sysUserId) {
    if (null == funcMap.get(sysUserId)) {
        List<SysFunc> funcList = C.newList();
        List<Integer> roleIds = sysUserService.getMyRoleList(sysUserId);
        if (C.notEmpty(roleIds)) {
            permissionMap = getPermissionMap(roleIds);
            if (C.notEmpty(permissionMap)) {
                for (List<SysPermission> permissionList : permissionMap.values()) {
                    for (SysPermission sysPermission : permissionList) {
                        SysFunc func = sysFuncService.get(sysPermission.getFuncId());
                        if (null != func) {
                            funcList.add(func);
                        }
                    }
                }
            }
            // 按sequence从小到大排序
            Collections.sort(funcList, Comparator.comparing(SysFunc::getSequence));
            // add
            funcMap.put(sysUserId, funcList);
        }
    }
    return funcMap;
}
Also used : SysFunc(com.artlongs.sys.model.SysFunc) SysPermission(com.artlongs.sys.model.SysPermission)

Aggregations

SysFunc (com.artlongs.sys.model.SysFunc)11 GetAction (org.osgl.mvc.annotation.GetAction)3 List (java.util.List)2 R (com.artlongs.framework.vo.R)1 SysPermission (com.artlongs.sys.model.SysPermission)1 SysRole (com.artlongs.sys.model.SysRole)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 PostAction (org.osgl.mvc.annotation.PostAction)1