/** * 跳转到用户角色管理页面. * * @param usbaId * @param session * @param model * @return */ @RequestMapping("/toEditUserRole/{usbaId}") public String toEditUserRole( @PathVariable("usbaId") int usbaId, HttpSession session, Model model) { Map<String, Object> userDetails = adminManageUserAccountService.getUserDetailsByUsbaId(usbaId); int gradId = (Integer) userDetails.get("grad_id"); int depaId = (Integer) userDetails.get("depa_id"); List<Byte> roleTypes = new ArrayList<Byte>(); List<Role> roles = adminManageUserAccountService.getRoleByRoleTypes(roleTypes); List<DepartmentTree> departmentTrees = new ArrayList<DepartmentTree>(); if (gradId == Constants.GRAD_SECOND) { DepartmentTree departmentTree = DepartmentTreeUtil.getDepartmentTreeByDepaId(depaId); departmentTrees = DepartmentTreeUtil.getGradeDepartmentTrees( departmentTree.getDepaId(), Constants.GRAD_THIRD); departmentTrees.add(0, departmentTree); } else if (gradId == Constants.GRAD_FIRST) { DepartmentTree departmentTree = DepartmentTreeUtil.getDepartmentTreeByDepaId(depaId); departmentTrees.add(0, departmentTree); } model.addAttribute("userDetails", userDetails); model.addAttribute("departmentTrees", departmentTrees); model.addAttribute("roles", roles); return "admin/manageuseraccount/edit_user_role"; }
/** * 跳转到添加用户账号的页面. * * @param model model. * @return */ @RequestMapping("/toAddUserAccount") public String toAddUserAccount(Model model) { DepartmentTree departmentTree = DepartmentTreeUtil.getDepartmentTree(); model.addAttribute("departmentTree", departmentTree); return "admin/manageuseraccount/add_user_account"; }