From 1e355322dab4f10696cd1240dfd3b9a9fcfe4863 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Thu, 18 Apr 2024 18:10:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=8E=E6=9D=83=E9=99=90=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1039710 --user=宋昌昌 【项目管理】项目与权限-成员-全选所有页-切换用户组/搜索框搜索-所选择数量错误 https://www.tapd.cn/55049933/s/1501228 --- .../controller/ProjectMemberController.java | 7 ++-- .../mapper/ExtProjectUserRoleMapper.java | 9 +++-- .../mapper/ExtProjectUserRoleMapper.xml | 2 +- .../request/ProjectMemberAddRoleRequest.java | 27 +++++++++++++++ .../project/service/ProjectMemberService.java | 33 ++++++++++++++----- .../ProjectMemberControllerTests.java | 23 ++++++++----- 6 files changed, 76 insertions(+), 25 deletions(-) create mode 100644 backend/services/project-management/src/main/java/io/metersphere/project/request/ProjectMemberAddRoleRequest.java diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectMemberController.java b/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectMemberController.java index 99db476e0b..f7443b6237 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectMemberController.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectMemberController.java @@ -3,10 +3,7 @@ package io.metersphere.project.controller; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.project.dto.ProjectUserDTO; -import io.metersphere.project.request.ProjectMemberAddRequest; -import io.metersphere.project.request.ProjectMemberBatchDeleteRequest; -import io.metersphere.project.request.ProjectMemberEditRequest; -import io.metersphere.project.request.ProjectMemberRequest; +import io.metersphere.project.request.*; import io.metersphere.project.service.ProjectMemberService; import io.metersphere.sdk.constants.PermissionConstants; import io.metersphere.system.dto.CommentUserInfo; @@ -98,7 +95,7 @@ public class ProjectMemberController { @Operation(summary = "项目管理-成员-批量添加至用户组") @RequiresPermissions(PermissionConstants.PROJECT_USER_UPDATE) @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") - public void addMemberRole(@RequestBody ProjectMemberAddRequest request) { + public void addMemberRole(@RequestBody ProjectMemberAddRoleRequest request) { projectMemberService.addRole(request, SessionUtils.getUserId()); } diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectUserRoleMapper.java b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectUserRoleMapper.java index 14b840a355..a0c6b90c45 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectUserRoleMapper.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectUserRoleMapper.java @@ -1,12 +1,12 @@ package io.metersphere.project.mapper; import io.metersphere.project.dto.ProjectUserRoleDTO; -import io.metersphere.project.request.ProjectMemberBatchDeleteRequest; import io.metersphere.project.request.ProjectUserRoleMemberRequest; import io.metersphere.project.request.ProjectUserRoleRequest; import io.metersphere.system.domain.User; import io.metersphere.system.domain.UserRoleRelation; import io.metersphere.system.dto.sdk.OptionDTO; +import io.metersphere.system.dto.table.TableBatchProcessDTO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -57,5 +57,10 @@ public interface ExtProjectUserRoleMapper { */ List getProjectUserSelectList(@Param("projectId") String projectId, @Param("keyword") String keyword); - ListgetProjectRoleMemberIds(@Param("request") ProjectMemberBatchDeleteRequest request); + /** + * 根据列表参数获取选中的用户ID集合 + * @param request 列表请求参数 + * @return 用户ID集合 + */ + List getProjectRoleMemberIds(@Param("request") TableBatchProcessDTO request); } diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectUserRoleMapper.xml b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectUserRoleMapper.xml index c561598bc6..5c691d6d5f 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectUserRoleMapper.xml +++ b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectUserRoleMapper.xml @@ -65,7 +65,7 @@