diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserRoleMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserRoleMapper.java index 10e360fecb..f7ba3aa152 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserRoleMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserRoleMapper.java @@ -2,6 +2,7 @@ package io.metersphere.base.mapper.ext; import io.metersphere.base.domain.User; import io.metersphere.controller.request.member.QueryMemberRequest; +import io.metersphere.controller.request.organization.QueryOrgMemberRequest; import io.metersphere.dto.UserRoleHelpDTO; import org.apache.ibatis.annotations.Param; @@ -12,4 +13,6 @@ public interface ExtUserRoleMapper { List getUserRoleHelpList(@Param("userId") String userId); List getMemberList(@Param("member") QueryMemberRequest request); + + List getOrgMemberList(@Param("orgMember") QueryOrgMemberRequest request); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserRoleMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserRoleMapper.xml index 873a5e7229..0e563bb4de 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserRoleMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserRoleMapper.xml @@ -35,4 +35,12 @@ + + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/controller/UserController.java b/backend/src/main/java/io/metersphere/controller/UserController.java index 07ea025080..6bb7923634 100644 --- a/backend/src/main/java/io/metersphere/controller/UserController.java +++ b/backend/src/main/java/io/metersphere/controller/UserController.java @@ -9,6 +9,7 @@ import io.metersphere.commons.utils.Pager; import io.metersphere.controller.request.member.AddMemberRequest; import io.metersphere.controller.request.member.QueryMemberRequest; import io.metersphere.controller.request.organization.AddOrgMemberRequest; +import io.metersphere.controller.request.organization.QueryOrgMemberRequest; import io.metersphere.dto.UserDTO; import io.metersphere.dto.UserRoleDTO; import io.metersphere.service.UserService; @@ -115,4 +116,13 @@ public class UserController { userService.delOrganizationMember(organizationId, userId); } + /** + * 查询组织成员列表 + */ + @PostMapping("/orgmember/list/{goPage}/{pageSize}") + public Pager> getOrgMemberList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryOrgMemberRequest request) { + Page page = PageHelper.startPage(goPage, pageSize, true); + return PageUtils.setPageInfo(page, userService.getOrgMemberList(request)); + } + } diff --git a/backend/src/main/java/io/metersphere/controller/request/organization/QueryOrgMemberRequest.java b/backend/src/main/java/io/metersphere/controller/request/organization/QueryOrgMemberRequest.java new file mode 100644 index 0000000000..23e7ce6d66 --- /dev/null +++ b/backend/src/main/java/io/metersphere/controller/request/organization/QueryOrgMemberRequest.java @@ -0,0 +1,34 @@ +package io.metersphere.controller.request.organization; + +import io.metersphere.commons.constants.RoleConstants; + +public class QueryOrgMemberRequest { + + private String name; + private String organizationId; + private String roleId = RoleConstants.ORG_ADMIN; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getOrganizationId() { + return organizationId; + } + + public void setOrganizationId(String organizationId) { + this.organizationId = organizationId; + } + + public String getRoleId() { + return roleId; + } + + public void setRoleId(String roleId) { + this.roleId = roleId; + } +} diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index 66f7d24bcb..843892ffcf 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -11,6 +11,7 @@ import io.metersphere.commons.exception.MSException; import io.metersphere.controller.request.member.AddMemberRequest; import io.metersphere.controller.request.member.QueryMemberRequest; import io.metersphere.controller.request.organization.AddOrgMemberRequest; +import io.metersphere.controller.request.organization.QueryOrgMemberRequest; import io.metersphere.dto.UserDTO; import io.metersphere.dto.UserRoleDTO; import io.metersphere.dto.UserRoleHelpDTO; @@ -265,7 +266,7 @@ public class UserService { for (String userId : request.getUserIds()) { UserRole userRole = new UserRole(); userRole.setId(UUID.randomUUID().toString()); - userRole.setRoleId(RoleConstants.ORG_OTHER); + userRole.setRoleId(RoleConstants.ORG_ADMIN); userRole.setSourceId(request.getOrganizationId()); userRole.setUserId(userId); userRole.setUpdateTime(System.currentTimeMillis()); @@ -277,8 +278,12 @@ public class UserService { public void delOrganizationMember(String organizationId, String userId) { UserRoleExample userRoleExample = new UserRoleExample(); - userRoleExample.createCriteria().andRoleIdEqualTo(RoleConstants.ORG_OTHER) + userRoleExample.createCriteria().andRoleIdEqualTo(RoleConstants.ORG_ADMIN) .andUserIdEqualTo(userId).andSourceIdEqualTo(organizationId); userRoleMapper.deleteByExample(userRoleExample); } + + public List getOrgMemberList(QueryOrgMemberRequest request) { + return extUserRoleMapper.getOrgMemberList(request); + } } diff --git a/frontend/src/performance/components/router/router.js b/frontend/src/performance/components/router/router.js index 878115751f..eae8293484 100644 --- a/frontend/src/performance/components/router/router.js +++ b/frontend/src/performance/components/router/router.js @@ -7,6 +7,7 @@ import User from "../settings/User"; import CreateTestPlan from "../testPlan/CreateTestPlan"; import AllTestPlan from "../testPlan/AllTestPlan"; import Organization from "../settings/Organization"; +import OrganizationMember from "../settings/OrganizationMember"; import Member from "../settings/Member"; import TestResourcePool from "../settings/TestResourcePool"; import MsProject from "../project/MsProject"; @@ -48,6 +49,10 @@ const router = new VueRouter({ roles: ['admin'] } }, + { + path: 'organizationmember', + component: OrganizationMember, + }, { path: 'member', component: Member diff --git a/frontend/src/performance/components/settings/OrganizationMember.vue b/frontend/src/performance/components/settings/OrganizationMember.vue new file mode 100644 index 0000000000..8acece4256 --- /dev/null +++ b/frontend/src/performance/components/settings/OrganizationMember.vue @@ -0,0 +1,189 @@ + + + + + diff --git a/frontend/src/performance/components/settings/SettingMenu.vue b/frontend/src/performance/components/settings/SettingMenu.vue index 82c6392fa9..21b4c6acbe 100644 --- a/frontend/src/performance/components/settings/SettingMenu.vue +++ b/frontend/src/performance/components/settings/SettingMenu.vue @@ -8,6 +8,7 @@ 用户 测试资源池 组织 + 组织成员 工作空间 API Keys