/** * 展示没有分配到组织的其他权限 描述 * * @param map * @param organizationId * @return */ @RequiresPermissions("Organization:assign") @RequestMapping( value = "/lookup2create/organizationRole/{organizationId}", method = {RequestMethod.GET, RequestMethod.POST}) public String listUnassignRole(Map<String, Object> map, @PathVariable Long organizationId) { Page page = new Page(); page.setNumPerPage(Integer.MAX_VALUE); List<OrganizationRole> organizationRoles = organizationRoleService.findByOrganizationId(organizationId); List<Role> roles = roleService.findAll(page); List<Role> rentList = new ArrayList<Role>(); // 删除已分配roles for (Role role : roles) { boolean isHas = false; for (OrganizationRole or : organizationRoles) { if (or.getRole().getId().equals(role.getId())) { isHas = true; break; } } if (isHas == false) { rentList.add(role); } } map.put("organizationRoles", organizationRoles); map.put("roles", rentList); map.put("organizationId", organizationId); return LOOK_UP_ROLE; }
/** * 显示组织已分配的权限 描述 * * @param map * @param organizationId * @return */ @RequiresPermissions("Organization:assign") @RequestMapping( value = "/lookup2delete/organizationRole/{organizationId}", method = {RequestMethod.GET, RequestMethod.POST}) public String listOrganizationRole(Map<String, Object> map, @PathVariable Long organizationId) { List<OrganizationRole> organizationRoles = organizationRoleService.findByOrganizationId(organizationId); map.put("organizationRoles", organizationRoles); return LOOK_ORGANIZATION_ROLE; }