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);
}
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;
}
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");
}
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");
}
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;
}
Aggregations