From 0ef5e7a6bfe86dec6303be3a3e299b1385b93d35 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Mon, 8 Jan 2024 18:47:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3=E8=BF=9E=E8=B0=83=E5=8F=91?= =?UTF-8?q?=E7=8E=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CaseReviewController.java | 4 +- .../functional/dto/CaseReviewDTO.java | 6 ++- .../functional/dto/CaseReviewUserDTO.java | 3 ++ .../dto/FunctionalCaseReviewDTO.java | 2 +- .../ExtCaseReviewFunctionalCaseMapper.xml | 2 +- .../functional/mapper/ExtCaseReviewMapper.xml | 4 +- .../mapper/ExtCaseReviewUserMapper.xml | 3 +- .../request/CaseReviewCopyRequest.java | 13 ++++++ .../functional/service/CaseReviewService.java | 43 ++++++++++++------- .../controller/CaseReviewControllerTests.java | 9 ++-- 10 files changed, 61 insertions(+), 28 deletions(-) create mode 100644 backend/services/case-management/src/main/java/io/metersphere/functional/request/CaseReviewCopyRequest.java 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 9c9127a52e..294ae76dec 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 @@ -74,8 +74,8 @@ public class CaseReviewController { @SendNotice(taskType = NoticeConstants.TaskType.CASE_REVIEW_TASK, event = NoticeConstants.Event.CREATE, target = "#targetClass.getMainCaseReview(#request)", targetClass = CaseReviewNoticeService.class) @RequiresPermissions(PermissionConstants.CASE_REVIEW_READ_ADD) @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") - public void copyCaseReview(@Validated @RequestBody CaseReviewRequest request) { - caseReviewService.addCaseReview(request, SessionUtils.getUserId()); + public String copyCaseReview(@Validated @RequestBody CaseReviewCopyRequest request) { + return caseReviewService.copyCaseReview(request, SessionUtils.getUserId()); } @PostMapping("/edit") diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/CaseReviewDTO.java b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/CaseReviewDTO.java index feb51016d9..19c2cd2278 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/CaseReviewDTO.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/CaseReviewDTO.java @@ -10,7 +10,7 @@ import java.util.List; public class CaseReviewDTO extends CaseReview { @Schema(description = "评审人") - private List reviewers; + private List reviewers; @Schema(description = "通过数") private int passCount; @@ -29,4 +29,8 @@ public class CaseReviewDTO extends CaseReview { @Schema(description = "关注标识") private Boolean followFlag; + + @Schema(description = "所属模块名称") + private String moduleName; + } diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/CaseReviewUserDTO.java b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/CaseReviewUserDTO.java index 6d6e5003f5..15ac9baf7f 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/CaseReviewUserDTO.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/CaseReviewUserDTO.java @@ -9,4 +9,7 @@ public class CaseReviewUserDTO extends CaseReviewUser { @Schema(description = "用户名") private String userName; + + @Schema(description = "头像") + private String avatar; } diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseReviewDTO.java b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseReviewDTO.java index c1a01e447a..d11dcc1459 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseReviewDTO.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseReviewDTO.java @@ -16,7 +16,7 @@ public class FunctionalCaseReviewDTO extends CaseReviewFunctionalCase { @NotBlank(message = "{case_review_functional_case.review_name.not_blank}") private String reviewName; - @Schema(description = "用例评审状态", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "用例评审状态:未开始(PREPARED)/进行中(UNDERWAY)/已完成(COMPLETED)/已归档(ARCHIVED)", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{case_review_functional_case.review_status.not_blank}") private String reviewStatus; diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewFunctionalCaseMapper.xml b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewFunctionalCaseMapper.xml index a7c8728e7c..d93c9d95b7 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewFunctionalCaseMapper.xml +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewFunctionalCaseMapper.xml @@ -4,7 +4,7 @@ SELECT - * + case_review.* , case_review_module.name as moduleName FROM - case_review + case_review left join case_review_module on case_review.module_id = case_review_module.id where case_review.project_id = #{request.projectId} diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewUserMapper.xml b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewUserMapper.xml index b458291791..0e7b882eff 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewUserMapper.xml +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewUserMapper.xml @@ -4,9 +4,10 @@