|
|
@ -17,6 +17,7 @@ import com.ruoyi.common.annotation.Log; |
|
|
|
import com.ruoyi.common.constant.UserConstants; |
|
|
|
import com.ruoyi.common.constant.UserConstants; |
|
|
|
import com.ruoyi.common.core.controller.BaseController; |
|
|
|
import com.ruoyi.common.core.controller.BaseController; |
|
|
|
import com.ruoyi.common.core.domain.AjaxResult; |
|
|
|
import com.ruoyi.common.core.domain.AjaxResult; |
|
|
|
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysDept; |
|
|
|
import com.ruoyi.common.core.domain.entity.SysRole; |
|
|
|
import com.ruoyi.common.core.domain.entity.SysRole; |
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser; |
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser; |
|
|
|
import com.ruoyi.common.core.domain.model.LoginUser; |
|
|
|
import com.ruoyi.common.core.domain.model.LoginUser; |
|
|
@ -27,6 +28,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil; |
|
|
|
import com.ruoyi.framework.web.service.SysPermissionService; |
|
|
|
import com.ruoyi.framework.web.service.SysPermissionService; |
|
|
|
import com.ruoyi.framework.web.service.TokenService; |
|
|
|
import com.ruoyi.framework.web.service.TokenService; |
|
|
|
import com.ruoyi.system.domain.SysUserRole; |
|
|
|
import com.ruoyi.system.domain.SysUserRole; |
|
|
|
|
|
|
|
import com.ruoyi.system.service.ISysDeptService; |
|
|
|
import com.ruoyi.system.service.ISysRoleService; |
|
|
|
import com.ruoyi.system.service.ISysRoleService; |
|
|
|
import com.ruoyi.system.service.ISysUserService; |
|
|
|
import com.ruoyi.system.service.ISysUserService; |
|
|
|
|
|
|
|
|
|
|
@ -51,6 +53,9 @@ public class SysRoleController extends BaseController |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private ISysUserService userService; |
|
|
|
private ISysUserService userService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private ISysDeptService deptService; |
|
|
|
|
|
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:role:list')") |
|
|
|
@PreAuthorize("@ss.hasPermi('system:role:list')") |
|
|
|
@GetMapping("/list") |
|
|
|
@GetMapping("/list") |
|
|
|
public TableDataInfo list(SysRole role) |
|
|
|
public TableDataInfo list(SysRole role) |
|
|
@ -242,4 +247,18 @@ public class SysRoleController extends BaseController |
|
|
|
roleService.checkRoleDataScope(roleId); |
|
|
|
roleService.checkRoleDataScope(roleId); |
|
|
|
return toAjax(roleService.insertAuthUsers(roleId, userIds)); |
|
|
|
return toAjax(roleService.insertAuthUsers(roleId, userIds)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取对应角色部门树列表 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:role:list')") |
|
|
|
|
|
|
|
@GetMapping(value = "/deptTree/{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())); |
|
|
|
|
|
|
|
return ajax; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|