| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.ruoyi.common.annotation.DataScope; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.entity.SysUserRole; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | | import com.ruoyi.system.domain.SysRoleDept; |
| | | import com.ruoyi.system.domain.SysRoleMenu; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.mapper.SysRoleDeptMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMenuMapper; |
| | | import com.ruoyi.system.mapper.SysUserRoleMapper; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 角色 业务层处理 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | |
| | | |
| | | /** |
| | | * 根据条件分页查询角色数据 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 角色数据集合信息 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据用户ID查询角色 |
| | | * |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 角色列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据用户ID查询权限 |
| | | * |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 权限列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询所有角色 |
| | | * |
| | | * |
| | | * @return 角色列表 |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 根据用户ID获取角色选择框列表 |
| | | * |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 选中角色ID列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 通过角色ID查询角色 |
| | | * |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 角色对象信息 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 校验角色名称是否唯一 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 校验角色权限是否唯一 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 校验角色是否允许操作 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 校验角色是否有数据权限 |
| | | * |
| | | * |
| | | * @param roleId 角色id |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 通过角色ID查询角色使用数量 |
| | | * |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 新增保存角色信息 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改保存角色信息 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改角色状态 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改数据权限信息 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 新增角色菜单信息 |
| | | * |
| | | * |
| | | * @param role 角色对象 |
| | | */ |
| | | public int insertRoleMenu(SysRole role) |
| | |
| | | |
| | | /** |
| | | * 通过角色ID删除角色 |
| | | * |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量删除角色信息 |
| | | * |
| | | * |
| | | * @param roleIds 需要删除的角色ID |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 取消授权用户角色 |
| | | * |
| | | * |
| | | * @param userRole 用户和角色关联信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量取消授权用户角色 |
| | | * |
| | | * |
| | | * @param roleId 角色ID |
| | | * @param userIds 需要取消授权的用户数据ID |
| | | * @return 结果 |
| | |
| | | |
| | | /** |
| | | * 批量选择授权用户角色 |
| | | * |
| | | * |
| | | * @param roleId 角色ID |
| | | * @param userIds 需要授权的用户数据ID |
| | | * @return 结果 |