|
|
@@ -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()); |
|
|
|
|