feat:(REQ-2750) 收口roleUserRelation删除的接口

This commit is contained in:
lilong 2024-09-24 17:33:32 +08:00
parent c4e37637da
commit 7b08981945
2 changed files with 4 additions and 9 deletions

View File

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

View File

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