From 98ce08f1fb3c96fa41558ec650c7e17170bee907 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 9 Jan 2024 12:04:56 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=94=A8=E4=BE=8B=E8=AF=84=E5=AE=A1):?= =?UTF-8?q?=20=E8=8E=B7=E5=8F=96=E6=9F=90=E4=B8=AA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=8B=E7=9A=84=E5=9B=BA=E5=AE=9A=E6=9D=83=E9=99=90=E7=9A=84?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E5=A4=B4?= =?UTF-8?q?=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functional/controller/CaseReviewController.java | 6 +++--- .../functional/controller/FunctionalCaseController.java | 2 +- .../metersphere/functional/service/CaseReviewService.java | 4 ++-- .../java/io/metersphere/system/mapper/ExtUserMapper.java | 3 ++- .../java/io/metersphere/system/mapper/ExtUserMapper.xml | 5 +++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/CaseReviewController.java b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/CaseReviewController.java index 294ae76dec..772d8661a4 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/CaseReviewController.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/CaseReviewController.java @@ -9,8 +9,8 @@ import io.metersphere.functional.service.CaseReviewLogService; import io.metersphere.functional.service.CaseReviewNoticeService; import io.metersphere.functional.service.CaseReviewService; import io.metersphere.sdk.constants.PermissionConstants; -import io.metersphere.system.domain.User; import io.metersphere.system.dto.sdk.request.PosRequest; +import io.metersphere.system.dto.user.UserDTO; import io.metersphere.system.log.annotation.Log; import io.metersphere.system.log.constants.OperationLogType; import io.metersphere.system.notice.annotation.SendNotice; @@ -51,7 +51,7 @@ public class CaseReviewController { } @PostMapping("/module/count") - @Operation(summary = "用例管理-用例评审-获取模块树统计数量") + @Operation(summary = "用例管理-用例评审-统计模块数量") @RequiresPermissions(PermissionConstants.CASE_REVIEW_READ) @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") public Map moduleCount(@Validated @RequestBody CaseReviewPageRequest request) { @@ -92,7 +92,7 @@ public class CaseReviewController { @Operation(summary = "用例管理-用例评审-获取具有评审权限的用户") @RequiresPermissions(value = {PermissionConstants.CASE_REVIEW_READ_ADD,PermissionConstants.CASE_REVIEW_READ_UPDATE}, logical = Logical.OR) @CheckOwner(resourceId = "#projectId", resourceType = "project") - public List getReviewUserList(@PathVariable String projectId, @Schema(description = "查询关键字,根据邮箱和用户名查询") + public List getReviewUserList(@PathVariable String projectId, @Schema(description = "查询关键字,根据邮箱和用户名查询") @RequestParam(value = "keyword", required = false) String keyword) { return caseReviewService.getReviewUserList(projectId, keyword); } diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseController.java b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseController.java index d216f43bfe..c6b1d1e063 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseController.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseController.java @@ -139,7 +139,7 @@ public class FunctionalCaseController { } @PostMapping("/module/count") - @Operation(summary = "用例管理-功能用例-表格分页查询文件") + @Operation(summary = "用例管理-功能用例-统计模块数量") @RequiresPermissions(PermissionConstants.FUNCTIONAL_CASE_READ) @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") public Map moduleCount(@Validated @RequestBody FunctionalCasePageRequest request) { diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewService.java index 49122f6bce..ca800139c4 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewService.java @@ -17,8 +17,8 @@ import io.metersphere.sdk.constants.ApplicationNumScope; import io.metersphere.sdk.constants.PermissionConstants; import io.metersphere.sdk.exception.MSException; import io.metersphere.sdk.util.BeanUtils; -import io.metersphere.system.domain.User; import io.metersphere.system.dto.sdk.request.PosRequest; +import io.metersphere.system.dto.user.UserDTO; import io.metersphere.system.mapper.ExtUserMapper; import io.metersphere.system.uid.IDGenerator; import io.metersphere.system.uid.NumGenerator; @@ -317,7 +317,7 @@ public class CaseReviewService { * @param keyword 查询关键字,根据邮箱和用户名查询 * @return List */ - public List getReviewUserList(String projectId, String keyword) { + public List getReviewUserList(String projectId, String keyword) { return extUserMapper.getUserByPermission(projectId, keyword, PermissionConstants.CASE_REVIEW_REVIEW); } diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.java b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.java index 546b9d243e..c45c0e8351 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.java @@ -1,6 +1,7 @@ package io.metersphere.system.mapper; import io.metersphere.system.domain.User; +import io.metersphere.system.dto.user.UserDTO; import io.metersphere.system.dto.user.UserExtendDTO; import org.apache.ibatis.annotations.Param; @@ -30,7 +31,7 @@ public interface ExtUserMapper { * @param permission 权限 * @return 用户列表 */ - ListgetUserByPermission(@Param("projectId") String projectId, @Param("keyword") String keyword, @Param("permission") String permission); + ListgetUserByPermission(@Param("projectId") String projectId, @Param("keyword") String keyword, @Param("permission") String permission); long countByIdAndPassword(@Param("userId") String id, @Param("password") String password); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.xml index 9c19d13794..8e9a4c73c4 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.xml +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserMapper.xml @@ -58,9 +58,10 @@ - + SELECT u.id as id, u.name as name, u.email as email, ue.avatar as avatar FROM user u + LEFT JOIN user_extend ue ON u.id = ue.id LEFT JOIN user_role_relation urr ON u.id = urr.user_id WHERE urr.role_id IN (SELECT urp.role_id FROM user_role_permission urp WHERE urp.permission_id = #{permission}) AND urr.source_id = #{projectId}