| | |
| | | import org.dromara.common.core.constant.TenantConstants; |
| | | import org.dromara.common.core.domain.model.LoginUser; |
| | | import org.dromara.common.core.exception.ServiceException; |
| | | import org.dromara.common.core.service.RoleService; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.StreamUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class SysRoleServiceImpl implements ISysRoleService { |
| | | public class SysRoleServiceImpl implements ISysRoleService, RoleService { |
| | | |
| | | private final SysRoleMapper baseMapper; |
| | | private final SysRoleMenuMapper roleMenuMapper; |
| | |
| | | private int insertRoleMenu(SysRoleBo role) { |
| | | int rows = 1; |
| | | // 新增用户与角色管理 |
| | | List<SysRoleMenu> list = new ArrayList<SysRoleMenu>(); |
| | | List<SysRoleMenu> list = new ArrayList<>(); |
| | | for (Long menuId : role.getMenuIds()) { |
| | | SysRoleMenu rm = new SysRoleMenu(); |
| | | rm.setRoleId(role.getRoleId()); |
| | |
| | | private int insertRoleDept(SysRoleBo role) { |
| | | int rows = 1; |
| | | // 新增角色与部门(数据权限)管理 |
| | | List<SysRoleDept> list = new ArrayList<SysRoleDept>(); |
| | | List<SysRoleDept> list = new ArrayList<>(); |
| | | for (Long deptId : role.getDeptIds()) { |
| | | SysRoleDept rd = new SysRoleDept(); |
| | | rd.setRoleId(role.getRoleId()); |
| | |
| | | * @param roleId 角色ID |
| | | * @return 结果 |
| | | */ |
| | | @CacheEvict(cacheNames = CacheNames.SYS_ROLE_CUSTOM, key = "#roleId") |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int deleteRoleById(Long roleId) { |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |