| | |
| | | */ |
| | | @Override |
| | | public int updateRoleStatus(Long roleId, String status) { |
| | | if (UserConstants.ROLE_DISABLE.equals(status) && this.countUserRoleByRoleId(roleId) > 0) { |
| | | throw new ServiceException("角色已分配,不能禁用!"); |
| | | } |
| | | return baseMapper.update(null, |
| | | new LambdaUpdateWrapper<SysRole>() |
| | | .set(SysRole::getStatus, status) |
| | |
| | | checkRoleAllowed(BeanUtil.toBean(role, SysRoleBo.class)); |
| | | checkRoleDataScope(roleId); |
| | | if (countUserRoleByRoleId(roleId) > 0) { |
| | | throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName())); |
| | | throw new ServiceException(String.format("%1$s已分配,不能删除!", role.getRoleName())); |
| | | } |
| | | } |
| | | List<Long> ids = Arrays.asList(roleIds); |