| | |
| | | /* |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | | */ |
| | | /** |
| | | * 角色信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | * <p> |
| | | * 根据角色编号获取详细信息 |
| | | * <p> |
| | | * 新增角色 |
| | | * <p> |
| | | * 修改保存角色 |
| | | * <p> |
| | | * 修改保存数据权限 |
| | | * <p> |
| | | * 状态修改 |
| | | * <p> |
| | | * 删除角色 |
| | | * <p> |
| | | * 获取角色选择框列表 |
| | | * <p> |
| | | * 查询已分配用户角色列表 |
| | | * <p> |
| | | * 查询未分配用户角色列表 |
| | | * <p> |
| | | * 取消授权用户 |
| | | * <p> |
| | | * 批量取消授权用户 |
| | | * <p> |
| | | * 批量选择用户授权 |
| | | * <p> |
| | | * 获取对应角色部门树列表 |
| | | *//* |
| | | |
| | | @Api(tags = "角色信息") |
| | | @RestController |
| | | @RequestMapping("/system/role") |
| | |
| | | // util.exportExcel(response, list, "角色数据"); |
| | | // } |
| | | |
| | | */ |
| | | /** |
| | | * 根据角色编号获取详细信息 |
| | | */ |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/{roleId}") |
| | | public AjaxResult getInfo(@PathVariable Long roleId) |
| | |
| | | } |
| | | |
| | | |
| | | */ |
| | | /** |
| | | * 新增角色 |
| | | */ |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:add')") |
| | | @ApiOperation(value = "新增角色") |
| | | @Log(title = "角色信息-新增角色", businessType = BusinessType.INSERT) |
| | |
| | | |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 修改保存角色 |
| | | */ |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @ApiOperation(value = "编辑角色") |
| | | @Log(title = "角色信息-编辑角色", businessType = BusinessType.UPDATE) |
| | |
| | | return error("修改角色'" + dto.getRoleName() + "'失败,请联系管理员"); |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 修改保存数据权限 |
| | | */ |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/dataScope") |
| | |
| | | return AjaxResult.success(roleService.authDataScope(role)); |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 状态修改 |
| | | */ |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @ApiOperation(value = "状态修改") |
| | | @Log(title = "角色信息-角色状态修改", businessType = BusinessType.UPDATE) |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 删除角色 |
| | | */ |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:remove')") |
| | | @ApiOperation(value = "删除角色") |
| | | @Log(title = "角色信息-角色删除角色", businessType = BusinessType.DELETE) |
| | |
| | | return AjaxResult.success(roleService.deleteRoleByIds(id)); |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 获取角色选择框列表 |
| | | */ |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | |
| | | return AjaxResult.success(roleService.selectRoleAll()); |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 查询已分配用户角色列表 |
| | | */ |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/allocatedList") |
| | | public TableDataInfo allocatedList(SysUser user) |
| | |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 查询未分配用户角色列表 |
| | | */ |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/unallocatedList") |
| | | public TableDataInfo unallocatedList(SysUser user) |
| | |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 取消授权用户 |
| | | */ |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancel") |
| | |
| | | return AjaxResult.success(roleService.deleteAuthUser(userRole)); |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 批量取消授权用户 |
| | | */ |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancelAll") |
| | |
| | | return AjaxResult.success(roleService.deleteAuthUsers(roleId, userIds)); |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 批量选择用户授权 |
| | | */ |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/selectAll") |
| | |
| | | return AjaxResult.success(roleService.insertAuthUsers(roleId, userIds)); |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 获取对应角色部门树列表 |
| | | */ |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/deptTree/{roleId}") |
| | | public AjaxResult deptTree(@PathVariable("roleId") Long roleId) |
| | |
| | | return ajax; |
| | | } |
| | | } |
| | | */ |