feat:(REQ-2750) 收口roleUserRelation删除的接口
This commit is contained in:
parent
c4e37637da
commit
7b08981945
@ -21,13 +21,6 @@ import java.util.stream.Collectors;
|
||||
@Repository
|
||||
public class SaasRoleUserRelationDao extends ServiceImpl<SaasRoleUserRelationMapper, SaasRoleUserRelation> {
|
||||
|
||||
public void deleteByRoleId(List<Long> roleId) {
|
||||
lambdaUpdate()
|
||||
.in(SaasRoleUserRelation::getRoleId,roleId)
|
||||
.set(BaseEntity::getIsDelete,TableIsDeleteEnum.DELETE.value)
|
||||
.update();
|
||||
}
|
||||
|
||||
public void deleteById(List<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return;
|
||||
|
||||
@ -988,11 +988,13 @@ public class RoleServiceImpl extends ServiceImpl<SaasRoleMapper, SaasRole>
|
||||
saasRoleDao.delete(deleteRoleParam.getRoleIds());
|
||||
// 收口remove接口,通过id更新不会出现死锁,并补发mq
|
||||
// 因为角色用户数据量巨大,应该是角色删除后发送mq,异步解耦去删除相关数据,但是得等角色的写接口收口后才能做
|
||||
saasRoleUserRelationService.listV2(ListRoleUserRelationParam.builder()
|
||||
List<SaasRoleUserV2DTO> saasRoleUsers = saasRoleUserRelationService.listV2(ListRoleUserRelationParam.builder()
|
||||
.roleIds(deleteRoleParam.getRoleIds())
|
||||
.build());
|
||||
|
||||
roleUserRelationDao.deleteByRoleId(deleteRoleParam.getRoleIds());
|
||||
saasRoleUserRelationService.batchRemove(SaasRoleUserRelationService.BatchRemoveParam.builder()
|
||||
.ids(saasRoleUsers.stream().map(SaasRoleUserV2DTO::getId).collect(Collectors.toSet()))
|
||||
.build());
|
||||
roleGroupRelationDao.deleteGroupRelation(deleteRoleParam.getRoleIds());
|
||||
saasPgroupRoleRelationDao.deleteByRoleId(deleteRoleParam.getRoleIds());
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user