From 27b57dcb9af1bfa1608d952a91c1e0ba1aeff7a3 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 27 Feb 2020 15:27:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=8F=9C=E5=8D=95=E6=88=90?= =?UTF-8?q?=E5=91=98=E5=88=97=E8=A1=A8=E6=B7=BB=E5=8A=A0=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/mapper/ext/ExtUserRoleMapper.java | 5 + .../base/mapper/ext/ExtUserRoleMapper.xml | 27 +++++ .../controller/UserController.java | 7 ++ .../dto/OrganizationMemberDTO.java | 98 +++++++++++++++++++ .../io/metersphere/service/UserService.java | 5 + .../settings/OrganizationMember.vue | 10 +- 6 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 backend/src/main/java/io/metersphere/dto/OrganizationMemberDTO.java 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 f7ba3aa152..2244d8e9ec 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 @@ -3,6 +3,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.OrganizationMemberDTO; import io.metersphere.dto.UserRoleHelpDTO; import org.apache.ibatis.annotations.Param; @@ -15,4 +16,8 @@ public interface ExtUserRoleMapper { List getMemberList(@Param("member") QueryMemberRequest request); List getOrgMemberList(@Param("orgMember") QueryOrgMemberRequest request); + + List getOrganizationMemberDTO(@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 80d0b3dd29..4bd2cff595 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 @@ -2,6 +2,21 @@ + + + + + + + + + + + + + + + + + + + \ 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 97ea6aa166..0181c19e0d 100644 --- a/backend/src/main/java/io/metersphere/controller/UserController.java +++ b/backend/src/main/java/io/metersphere/controller/UserController.java @@ -10,6 +10,7 @@ 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.OrganizationMemberDTO; import io.metersphere.dto.UserDTO; import io.metersphere.dto.UserRoleDTO; import io.metersphere.service.UserService; @@ -139,4 +140,10 @@ public class UserController { return PageUtils.setPageInfo(page, userService.getOrgMemberList(request)); } + @PostMapping("/orgmemberdto/list/{goPage}/{pageSize}") + public Pager> getOrganizationMemberDTO(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryOrgMemberRequest request) { + Page page = PageHelper.startPage(goPage, pageSize, true); + return PageUtils.setPageInfo(page, userService.getOrganizationMemberDTO(request)); + } + } diff --git a/backend/src/main/java/io/metersphere/dto/OrganizationMemberDTO.java b/backend/src/main/java/io/metersphere/dto/OrganizationMemberDTO.java new file mode 100644 index 0000000000..e2335b4381 --- /dev/null +++ b/backend/src/main/java/io/metersphere/dto/OrganizationMemberDTO.java @@ -0,0 +1,98 @@ +package io.metersphere.dto; + +import io.metersphere.base.domain.Role; + +import java.util.ArrayList; +import java.util.List; + +public class OrganizationMemberDTO { + private String id; + + private String name; + + private String email; + + private String phone; + + private String status; + + private Long createTime; + + private Long updateTime; + + private String language; + + private List roles = new ArrayList<>(); + + public List getRoles() { + return roles; + } + + public void setRoles(List roles) { + this.roles = roles; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Long updateTime) { + this.updateTime = updateTime; + } + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } +} diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index d89e9b22bf..c0f4c5f30d 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -10,6 +10,7 @@ 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.OrganizationMemberDTO; import io.metersphere.dto.UserDTO; import io.metersphere.dto.UserRoleDTO; import io.metersphere.dto.UserRoleHelpDTO; @@ -306,4 +307,8 @@ public class UserService { example.createCriteria().andIdEqualTo(userId).andPasswordEqualTo(CodingUtil.md5(password)); return userMapper.countByExample(example) > 0; } + + public List getOrganizationMemberDTO(QueryOrgMemberRequest request) { + return extUserRoleMapper.getOrganizationMemberDTO(request); + } } diff --git a/frontend/src/performance/components/settings/OrganizationMember.vue b/frontend/src/performance/components/settings/OrganizationMember.vue index e27416a45f..93f1e6f912 100644 --- a/frontend/src/performance/components/settings/OrganizationMember.vue +++ b/frontend/src/performance/components/settings/OrganizationMember.vue @@ -16,6 +16,14 @@ + + + +