Search in sources :

Example 6 with SysFunc

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

the class SysFuncController method assignPerm.

/**
 * 保存--权限分配
 * @param funcId
 * @param roleAssignVoList
 * @return
 */
@PostAction("assign/perm/{funcId}")
public RenderJSON assignPerm(Long funcId, List<RoleAssignVo> roleAssignVoList) {
    SysFunc sysFunc = sysFuncService.get(new Long(funcId));
    if (null == sysFunc)
        return json(R.fail("功能或菜单不存在。"));
    R r = sysPermissionService.savePermissionOfAssign(roleAssignVoList);
    return json(r);
}
Also used : R(com.artlongs.framework.vo.R) SysFunc(com.artlongs.sys.model.SysFunc) PostAction(org.osgl.mvc.annotation.PostAction)

Example 7 with SysFunc

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

the class SysFuncController method tree.

@GetAction("tree")
public String tree() {
    Map<Long, List<SysFunc>> moduleMap = sysFuncService.getModuleTreeMap();
    SysFunc topMenu = sysFuncService.buildFuncTree(moduleMap);
    String jsonStr = topMenu.childsToJqTreeStr();
    return jsonStr;
}
Also used : SysFunc(com.artlongs.sys.model.SysFunc) List(java.util.List) GetAction(org.osgl.mvc.annotation.GetAction)

Example 8 with SysFunc

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

the class SysFuncController method edit.

@GetAction("edit_box/{id}")
public RenderAny edit(@Param(defLongVal = -1) Long id) {
    SysFunc sysFunc = new SysFunc();
    // -1:新增
    sysFunc.setId(id);
    if (id > 0) {
        sysFunc = sysFuncService.get(new Long(id));
    }
    // 树型菜单的数据
    Map<Long, List<SysFunc>> moduleMap = sysFuncService.getModuleTreeMap();
    SysFunc topMenu = sysFuncService.buildFuncTree(moduleMap);
    String treeJsonStr = topMenu.childsToJqTreeStr();
    ctx.renderArg("treeJsonStr", treeJsonStr);
    ctx.renderArg("sysFunc", sysFunc);
    return render("edit_box.html");
}
Also used : SysFunc(com.artlongs.sys.model.SysFunc) List(java.util.List) GetAction(org.osgl.mvc.annotation.GetAction)

Example 9 with SysFunc

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

the class SysFuncController method perm_edit.

/**
 * 权限分配窗口页
 * @param id
 * @return
 */
@GetAction("perm_box/{funcId}")
public RenderAny perm_edit(Long funcId) {
    SysFunc sysFunc = sysFuncService.get(new Long(funcId));
    List<SysRole> sysRoleList = sysRoleService.getAllOfList();
    List<Long> roleIds = sysPermissionService.getRoleIdsOfFuncId(funcId);
    Map<Long, Boolean> roleMap = sysPermissionService.roleMapOfpermission(roleIds);
    ctx.renderArg("sysRoleList", sysRoleList);
    ctx.renderArg("sysFunc", sysFunc);
    ctx.renderArg("roleMap", roleMap);
    return render("perm_box.html");
}
Also used : SysFunc(com.artlongs.sys.model.SysFunc) SysRole(com.artlongs.sys.model.SysRole) GetAction(org.osgl.mvc.annotation.GetAction)

Example 10 with SysFunc

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

the class SysMenuService method getChildMenu.

/**
 * 构建树型子菜单
 * @param sysFunc
 * @param myActionFuncs
 * @return
 */
private SysFunc getChildMenu(SysFunc sysFunc, List<SysFunc> myActionFuncs) {
    for (SysFunc func : sysFunc.getChilds()) {
        List<SysFunc> childs = getChildsByParentId(myActionFuncs, func.getId());
        if (C.isEmpty(childs))
            break;
        func.setChilds(childs);
        getChildMenu(func, myActionFuncs);
    }
    return sysFunc;
}
Also used : SysFunc(com.artlongs.sys.model.SysFunc)

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