| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.other.api.domain.TRoleSite; |
| | | import com.ruoyi.other.api.feignClient.RoleSiteClient; |
| | | import com.ruoyi.system.api.model.GetSysRoleByIds; |
| | |
| | | private SiteClient siteClient; |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/systemUserManagement", "/systemUserManagement/add", "/systemUserManagement/update", "/roleManagement", "/partners", |
| | | "/partners/add", "/partners/seleete", "/partners/update"}, logical = Logical.OR) |
| | | @ApiOperation(value = "获取角色列表", tags = {"管理后台-系统用户管理"}) |
| | | @GetMapping("/list") |
| | | public AjaxResult list() { |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/roleManagement"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/listPage") |
| | | @ApiOperation(value = "获取角色列表", tags = {"管理后台-角色管理"}) |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/roleManagement/add"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/roleAdd") |
| | | @ApiOperation(value = "添加角色", tags = {"管理后台-角色管理"}) |
| | |
| | | role.setCreateBy(SecurityUtils.getUsername()); |
| | | role.setCreateTime(new Date()); |
| | | roleService.insertRole(role); |
| | | |
| | | //添加站点权限 |
| | | List<TRoleSite> roleSites = new ArrayList<>(); |
| | | for (Integer siteId : dto.getSiteIds()) { |
| | | TRoleSite roleSite = new TRoleSite(); |
| | | roleSite.setRoleId(role.getRoleId().intValue()); |
| | | roleSite.setSiteId(siteId); |
| | | roleSites.add(roleSite); |
| | | if(null != dto.getSiteIds()){ |
| | | List<TRoleSite> roleSites = new ArrayList<>(); |
| | | for (Integer siteId : dto.getSiteIds()) { |
| | | TRoleSite roleSite = new TRoleSite(); |
| | | roleSite.setRoleId(role.getRoleId().intValue()); |
| | | roleSite.setSiteId(siteId); |
| | | roleSites.add(roleSite); |
| | | } |
| | | roleSiteClient.addRoleSite(roleSites); |
| | | } |
| | | roleSiteClient.addRoleSite(roleSites); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/roleManagement/info", "/roleManagement/update"}, logical = Logical.OR) |
| | | @GetMapping("/roleInfo") |
| | | @ApiOperation(value = "角色详情", tags = {"管理后台-角色管理"}) |
| | | public AjaxResult roleInfo(@RequestParam Long id) { |
| | |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/roleManagement/update"}, logical = Logical.OR) |
| | | @PostMapping("/roleUpdate") |
| | | @ApiOperation(value = "编辑角色", tags = {"管理后台-角色管理"}) |
| | | @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 |
| | |
| | | /** |
| | | * 删除角色 |
| | | */ |
| | | @RequiresPermissions(value = {"/roleManagement/del"}, logical = Logical.OR) |
| | | @Log(title = "角色管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{roleIds}") |
| | | @ApiOperation(value = "删除角色", tags = {"管理后台-角色管理"}) |
| | |
| | | /** |
| | | * 查询已分配用户角色列表 |
| | | */ |
| | | @RequiresPermissions("/roleManagement") |
| | | @GetMapping("/authUser/allocatedList") |
| | | public TableDataInfo allocatedList(SysUser user) { |
| | | startPage(); |
| | |
| | | /** |
| | | * 查询未分配用户角色列表 |
| | | */ |
| | | @RequiresPermissions("/roleManagement") |
| | | @GetMapping("/authUser/unallocatedList") |
| | | public TableDataInfo unallocatedList(SysUser user) { |
| | | startPage(); |
| | |
| | | /** |
| | | * 获取对应角色部门树列表 |
| | | */ |
| | | @RequiresPermissions("") |
| | | @GetMapping(value = "/deptTree/{roleId}") |
| | | public AjaxResult deptTree(@PathVariable("roleId") Long roleId) { |
| | | AjaxResult ajax = AjaxResult.success(); |