fix(组织设置): Filter deleted organization members

This commit is contained in:
guoyuqi 2023-08-28 18:51:08 +08:00 committed by 刘瑞斌
parent b424da274b
commit 893656a506
2 changed files with 4 additions and 2 deletions

View File

@ -54,7 +54,7 @@
from (
select u.*, urr.role_id
from user_role_relation urr
join `user` u on urr.user_id = u.id
join `user` u on urr.user_id = u.id and u.deleted = false
<where>
<if test="request.organizationId != null and request.organizationId != ''">
urr.source_id = #{request.organizationId}

View File

@ -675,9 +675,11 @@ public class OrganizationService {
List<UserRoleRelation> userRoleRelations = userRoleRelationMapper.selectByExample(userRoleRelationExample);
List<String> userIds = userRoleRelations.stream().map(UserRoleRelation::getUserId).distinct().toList();
UserExample userExample = new UserExample();
UserExample.Criteria criteria = userExample.createCriteria();
if (CollectionUtils.isNotEmpty(userIds)) {
userExample.createCriteria().andIdNotIn(userIds);
criteria.andIdNotIn(userIds);
}
criteria.andDeletedEqualTo(false);
List<User> users = userMapper.selectByExample(userExample);
List<IdNameStructureDTO> userList = new ArrayList<>();
for (User user : users) {