fix(系统设置): 删除组织用户

This commit is contained in:
chenjianxing 2020-11-23 21:26:44 +08:00
parent f023b9c602
commit 3225a76c43
8 changed files with 19 additions and 2 deletions

View File

@ -9,4 +9,5 @@ import java.util.List;
public interface ExtWorkspaceMapper {
List<WorkspaceDTO> getWorkspaceWithOrg(@Param("request") WorkspaceRequest request);
List<String> getWorkspaceIdsByOrgId(@Param("orgId") String orgId);
}

View File

@ -13,4 +13,9 @@
order by w.update_time desc
</select>
<select id="getWorkspaceIdsByOrgId" resultType="java.lang.String">
select id from workspace
where organization_id = #{orgId}
</select>
</mapper>

View File

@ -435,8 +435,12 @@ public class UserService {
}
public void delOrganizationMember(String organizationId, String userId) {
List<String> resourceIds = workspaceService.getWorkspaceIdsOrgId(organizationId);
resourceIds.add(organizationId);
UserRoleExample userRoleExample = new UserRoleExample();
userRoleExample.createCriteria().andRoleIdLike("%org%").andUserIdEqualTo(userId).andSourceIdEqualTo(organizationId);
userRoleExample.createCriteria().andUserIdEqualTo(userId).andSourceIdIn(resourceIds);
User user = userMapper.selectByPrimaryKey(userId);
if (StringUtils.equals(organizationId, user.getLastOrganizationId())) {

View File

@ -202,6 +202,10 @@ public class WorkspaceService {
return resultWorkspaceList;
}
public List<String> getWorkspaceIdsOrgId(String orgId) {
return extWorkspaceMapper.getWorkspaceIdsByOrgId(orgId);
}
public void updateWorkspaceMember(WorkspaceMemberDTO memberDTO) {
String workspaceId = memberDTO.getWorkspaceId();
String userId = memberDTO.getId();

View File

@ -217,7 +217,7 @@
})
},
del(row) {
this.$confirm(this.$t('member.remove_member'), '', {
this.$confirm(this.$t('member.org_remove_member'), '', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'

View File

@ -314,6 +314,7 @@ export default {
repeat_password: 'Repeat',
inconsistent_passwords: 'The two passwords entered are inconsistent',
remove_member: 'Are you sure you want to remove this member',
org_remove_member: 'Removing the user from the organization will also remove permissions from all workspaces under the organization. Are you sure you want to remove the member ?',
input_id_or_email: 'Please enter user ID, or user Email',
no_such_user: 'Without this user information, please enter the correct user ID or user Email!',
},

View File

@ -313,6 +313,7 @@ export default {
repeat_password: '确认密码',
inconsistent_passwords: '两次输入的密码不一致',
remove_member: '确定要移除该成员吗',
org_remove_member: '将该用户从组织中移除,将同时移除该组织下所有工作空间的权限,确定要移除该成员吗?',
input_id_or_email: '请输入用户 ID, 或者 用户邮箱',
no_such_user: '无此用户信息, 请输入正确的用户 ID 或者 用户邮箱!',
},

View File

@ -315,6 +315,7 @@ export default {
repeat_password: '確認密碼',
inconsistent_passwords: '兩次輸入的密碼不壹致',
remove_member: '確定要移除該成員嗎',
org_remove_member: '將該用戶從組織中移除,將同時移除該組織下所有工作空間的權限,確定要移除該成員嗎?',
input_id_or_email: '請輸入用戶 ID, 或者 用戶郵箱',
no_such_user: '無此用戶信息, 請輸入正確的用戶 ID 或者 用戶郵箱!',
},