浏览代码

Merge branch 'develop' of gitadmin/tuoheng_oidc into release

tags/v2.4.1
xuziqing 1年前
父节点
当前提交
a98f977069
共有 1 个文件被更改,包括 4 次插入8 次删除
  1. +4
    -8
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantServiceImpl.java

+ 4
- 8
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantServiceImpl.java 查看文件

@@ -591,17 +591,13 @@ public class TenantServiceImpl implements TenantService {
tenantEmploys.forEach(t -> tenantEmployMapper.deleteById(t));
//现有list
List<ClientRoleDto> list = dto.getClientRoleDtoList();
//有集合
//有集合
List<ClientRoleDto> clientRoleDtos = getClientRoleDtos(list);
List<ClientRoleDto> deleteClientRoleDtoList;
//新的租户关联的平台集合
//原有集合
List<ClientRoleDto> finalClientRoleDtoList = getClientRoleDtos(clientRoleDtoList);
//筛选出一样的则不做相关操作
//删除租户原始权限
deleteClientRoleDtoList = clientRoleDtos.stream().filter(t -> !finalClientRoleDtoList.contains(t)).collect(Collectors.toList());
deleteClientRoleDtoList = getClientRoleDtos(deleteClientRoleDtoList);
clientRoleDtos = clientRoleDtos.stream().filter(t -> !list.contains(t)).collect(Collectors.toList());
for (ClientRoleDto clientRoleDto : deleteClientRoleDtoList) {
//删除租户所有原始权限
for (ClientRoleDto clientRoleDto : finalClientRoleDtoList) {
clientUserRoleMapper.deleteByUserIdAndClient(tenant.getUserId(), clientRoleDto.getClientId());
authoritiesMapper.deleteByUserIdAndClient(tenant.getUserId(), clientRoleDto.getClientId());


正在加载...
取消
保存