/** * 进入更新角色菜单的页面 * * @return * @throws Exception */ public String updaterolepage() throws Exception { menus = roleService.getAllMenus(); System.out.println(trole.getRid()); trole = roleService.getRole(trole.getRid()); if (trole.getTmenus() != null && trole.getTmenus().size() > 0) { Iterator<Tmenu> iterator = trole.getTmenus().iterator(); while (iterator.hasNext()) { Tmenu menus = iterator.next(); trole.getRoles().add(menus.getMid()); } } return "updaterolepage"; }
/** * 更新角色 * * @return * @throws Exception */ public String update() throws Exception { roleService.updateRole(trole); return success("更新成功", true, "oa2"); }
/** * 新建角色 * * @return * @throws Exception */ public String newRole() throws Exception { roleService.newRole(trole); return success("添加成功", true, "oa2"); }
/** * 进入新建角色页面 * * @return * @throws Exception */ public String intoAddPage() throws Exception { menus = roleService.getAllMenus(); return "toaddpage"; }
/** * 角色列表 * * @return * @throws Exception */ public String rolelist() throws Exception { pageModel = roleService.getRoles(this.currentPage, this.pageSize, trole); return "rolelist"; }
/** * 判断角色是否存在 * * @return * @throws Exception */ public String roleIsonly() throws Exception { roleflag = roleService.roleIsOnly(trole.getRname(), trole.getRid()); return "roleisonly"; }
/** * 删除角色 * * @return * @throws Exception */ public String deleterole() throws Exception { String message = roleService.deleteRole(trole); return success(message, false, "oa2"); }