zhibing.pu
2024-08-22 0a2d12997d7e4538da8f335ac4497cf2886563d7
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java
@@ -60,8 +60,7 @@
@RestController
@RequestMapping("/role")
@Api(tags = "角色模块")
public class SysRoleController extends BaseController
{
public class SysRoleController extends BaseController {
    @Resource
    private ISysRoleService roleService;
@@ -87,15 +86,12 @@
    private SiteClient siteClient;
    
    
    @ApiOperation(value = "获取角色列表", tags = {"管理后台-系统用户管理"})
    @GetMapping("/list")
    public AjaxResult list() {
        List<SysRole> list = roleService.list(new LambdaQueryWrapper<SysRole>().eq(SysRole::getDelFlag, 0).eq(SysRole::getStatus, 0));
        return AjaxResult.success(list);
    }
    
    
    @ResponseBody
@@ -121,14 +117,11 @@
    }
    
    
    @ResponseBody
    @PostMapping("/roleAdd")
    @ApiOperation(value = "添加角色", tags = {"管理后台-角色管理"})
    @GlobalTransactional(rollbackFor = Exception.class)//分布式事务
    public AjaxResult roleAdd(@Validated @RequestBody RoleAddDto dto)
    {
   public AjaxResult roleAdd(@Validated @RequestBody RoleAddDto dto) {
        SysRole role = new SysRole();
        role.setRoleName(dto.getRoleName());
        long count = roleService.count(Wrappers.lambdaQuery(SysRole.class)
@@ -202,7 +195,6 @@
    }
    @PostMapping("/roleUpdate")
    @ApiOperation(value = "编辑角色", tags = {"管理后台-角色管理"})
    @GlobalTransactional(rollbackFor = Exception.class)//分布式事务
@@ -257,7 +249,6 @@
    }
    /**
     * 删除角色
     */
@@ -270,15 +261,12 @@
    }
    
    /**
     * 查询已分配用户角色列表
     */
    @RequiresPermissions("system:role:list")
    @GetMapping("/authUser/allocatedList")
    public TableDataInfo allocatedList(SysUser user)
    {
   public TableDataInfo allocatedList(SysUser user) {
        startPage();
        List<SysUser> list = userService.selectAllocatedList(user);
        return getDataTable(list);
@@ -289,13 +277,11 @@
     */
    @RequiresPermissions("system:role:list")
    @GetMapping("/authUser/unallocatedList")
    public TableDataInfo unallocatedList(SysUser user)
    {
   public TableDataInfo unallocatedList(SysUser user) {
        startPage();
        List<SysUser> list = userService.selectUnallocatedList(user);
        return getDataTable(list);
    }
 
    /**
@@ -303,8 +289,7 @@
     */
    @RequiresPermissions("system:role:query")
    @GetMapping(value = "/deptTree/{roleId}")
    public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
    {
   public AjaxResult deptTree(@PathVariable("roleId") Long roleId) {
        AjaxResult ajax = AjaxResult.success();
        ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
        ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
@@ -314,6 +299,7 @@
    
    /**
     * 根据id集合获取数据
    *
     * @param ids
     * @return
     */