From b62498e7b4b5e5a57d7f5079911849e97f009d85 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 2 Aug 2024 14:55:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E8=AE=A1=E5=88=92=E7=BC=BA=E5=B0=91=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1044677 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001044677 --- .../main/resources/i18n/project.properties | 11 +++ .../resources/i18n/project_en_US.properties | 11 +++ .../resources/i18n/project_zh_CN.properties | 11 +++ .../resources/i18n/project_zh_TW.properties | 11 +++ .../service/NoticeTemplateService.java | 8 +- .../system/dto/sdk/TestPlanMessageDTO.java | 84 +++++++++++++++++++ .../notice/utils/MessageTemplateUtils.java | 8 +- 7 files changed, 132 insertions(+), 12 deletions(-) create mode 100644 backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/TestPlanMessageDTO.java diff --git a/backend/framework/sdk/src/main/resources/i18n/project.properties b/backend/framework/sdk/src/main/resources/i18n/project.properties index 93c0595ba6..5f729cba5d 100644 --- a/backend/framework/sdk/src/main/resources/i18n/project.properties +++ b/backend/framework/sdk/src/main/resources/i18n/project.properties @@ -423,6 +423,17 @@ message.domain.test_plan_actualStartTime=实际开始时间 message.domain.test_plan_actualEndTime=实际结束时间 message.domain.test_plan_num=编号 message.domain.test_plan_type=类型 +message.domain.test_plan_reportName=报告名称 +message.domain.test_plan_reportUrl=报告链接 +message.domain.test_plan_reportShareUrl=分享报告链接 +message.domain.test_plan_startTime=开始时间;计划开始执行的时间 +message.domain.test_plan_endTime=结束时间;计划结束执行的时间 +message.domain.test_plan_execStatus=执行状态 +message.domain.test_plan_resultStatus=结果状态 +message.domain.test_plan_passRate=通过率 +message.domain.test_plan_passThreshold=通过阈值 +message.domain.test_plan_executeRate=执行率 + # 用例评审 message.domain.case_review_name=名称 message.domain.case_review_num=ID diff --git a/backend/framework/sdk/src/main/resources/i18n/project_en_US.properties b/backend/framework/sdk/src/main/resources/i18n/project_en_US.properties index db1a108546..1dbed8f1b9 100644 --- a/backend/framework/sdk/src/main/resources/i18n/project_en_US.properties +++ b/backend/framework/sdk/src/main/resources/i18n/project_en_US.properties @@ -463,6 +463,17 @@ message.domain.test_plan_actualStartTime=Actual start time message.domain.test_plan_actualEndTime=Actual end time message.domain.test_plan_num=Num message.domain.test_plan_type=Type +message.domain.test_plan_reportName=Report name +message.domain.test_plan_reportUrl=Report link +message.domain.test_plan_reportShareUrl=Share report link +message.domain.test_plan_startTime=Start time; the time when the plan starts execution +message.domain.test_plan_endTime=End time; the time when the plan ends execution +message.domain.test_plan_execStatus=Execution status +message.domain.test_plan_resultStatus=Result status +message.domain.test_plan_passRate=Passing rate +message.domain.test_plan_passThreshold=Pass threshold +message.domain.test_plan_executeRate=Exacutive rate + # case Review message.domain.case_review_name=Name message.domain.case_review_num=ID diff --git a/backend/framework/sdk/src/main/resources/i18n/project_zh_CN.properties b/backend/framework/sdk/src/main/resources/i18n/project_zh_CN.properties index 95c31987e2..9848b89157 100644 --- a/backend/framework/sdk/src/main/resources/i18n/project_zh_CN.properties +++ b/backend/framework/sdk/src/main/resources/i18n/project_zh_CN.properties @@ -462,6 +462,17 @@ message.domain.test_plan_actualStartTime=实际开始时间 message.domain.test_plan_actualEndTime=实际结束时间 message.domain.test_plan_num=编号 message.domain.test_plan_type=类型 +message.domain.test_plan_reportName=报告名称 +message.domain.test_plan_reportUrl=报告链接 +message.domain.test_plan_reportShareUrl=分享报告链接 +message.domain.test_plan_startTime=开始时间;计划开始执行的时间 +message.domain.test_plan_endTime=结束时间;计划结束执行的时间 +message.domain.test_plan_execStatus=执行状态 +message.domain.test_plan_resultStatus=结果状态 +message.domain.test_plan_passRate=通过率 +message.domain.test_plan_passThreshold=通过阈值 +message.domain.test_plan_executeRate=执行率 + # 用例评审 message.domain.case_review_name=名称 message.domain.case_review_num=ID diff --git a/backend/framework/sdk/src/main/resources/i18n/project_zh_TW.properties b/backend/framework/sdk/src/main/resources/i18n/project_zh_TW.properties index 2dc4beeb8a..bc7e3df350 100644 --- a/backend/framework/sdk/src/main/resources/i18n/project_zh_TW.properties +++ b/backend/framework/sdk/src/main/resources/i18n/project_zh_TW.properties @@ -463,6 +463,17 @@ message.domain.test_plan_actualStartTime=實際開始時間 message.domain.test_plan_actualEndTime=實際結束時間 message.domain.test_plan_num=編號 message.domain.test_plan_type=類型 +message.domain.test_plan_reportName=報告名稱 +message.domain.test_plan_reportUrl=報告連結 +message.domain.test_plan_reportShareUrl=分享報告链接 +message.domain.test_plan_startTime=開始時間;計劃開始執行的時間 +message.domain.test_plan_endTime=結束時間;計畫結束執行的時間 +message.domain.test_plan_execStatus=執行狀態 +message.domain.test_plan_resultStatus=結果狀態 +message.domain.test_plan_passRate=通過率 +message.domain.test_plan_passThreshold=透過閾值 +message.domain.test_plan_executeRate=執行率 + # 用例評審 message.domain.case_review_name=名稱 message.domain.case_review_num=ID diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/NoticeTemplateService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/NoticeTemplateService.java index 41614067ff..b1c4141997 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/service/NoticeTemplateService.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/NoticeTemplateService.java @@ -1,7 +1,6 @@ package io.metersphere.project.service; import io.metersphere.functional.domain.CaseReview; -import io.metersphere.plan.domain.TestPlan; import io.metersphere.project.dto.MessageTemplateFieldDTO; import io.metersphere.project.dto.MessageTemplateResultDTO; import io.metersphere.sdk.constants.TemplateScene; @@ -52,12 +51,10 @@ public class NoticeTemplateService { case NoticeConstants.TaskType.API_REPORT_TASK -> { Field[] allFields = FieldUtils.getAllFields(ApiReportMessageDTO.class); addOptionDto(messageTemplateFieldDTOList, allFields, null); - //TODO:获取报告 } case NoticeConstants.TaskType.TEST_PLAN_TASK -> { - Field[] allFields = FieldUtils.getAllFields(TestPlan.class); - addOptionDto(messageTemplateFieldDTOList, allFields, "test_plan_"); - //TODO:获取报告 + Field[] allFields = FieldUtils.getAllFields(TestPlanMessageDTO.class); + addOptionDto(messageTemplateFieldDTOList, allFields, null); } case NoticeConstants.TaskType.CASE_REVIEW_TASK -> { Field[] allFields = FieldUtils.getAllFields(CaseReview.class); @@ -158,7 +155,6 @@ public class NoticeTemplateService { messageTemplateFieldOperator.setFieldSource(NoticeConstants.FieldSource.CASE_FIELD); messageTemplateFieldOperator.setName(Translator.get("message.operator")); messageTemplateFieldDTOS.add(messageTemplateFieldOperator); - } public MessageTemplateResultDTO getTemplateFields(String projectId, String taskType) { diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/TestPlanMessageDTO.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/TestPlanMessageDTO.java new file mode 100644 index 0000000000..089dc02dee --- /dev/null +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/TestPlanMessageDTO.java @@ -0,0 +1,84 @@ +package io.metersphere.system.dto.sdk; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@NoArgsConstructor +public class TestPlanMessageDTO { + @Schema(description = "message.domain.test_plan_num") + private String num; + + @Schema(description = "message.domain.test_plan_name") + private String name; + + @Schema(description = "message.domain.test_plan_status") + private String status; + + @Schema(description = "message.domain.api_scenario_status") + private String type; + + @Schema(description = "message.domain.test_plan_tags") + private List tags; + + @Schema(description = "message.domain.test_plan_createUser") + private String createUser; + + @Schema(description = "message.domain.test_plan_createTime") + private Long createTime; + + @Schema(description = "message.domain.test_plan_updateUser") + private String updateUser; + + @Schema(description = "message.domain.test_plan_updateTime") + private Long updateTime; + + @Schema(description = "message.domain.test_plan_plannedStartTime") + private Long plannedStartTime; + + @Schema(description = "message.domain.test_plan_plannedEndTime") + private Long plannedEndTime; + + @Schema(description = "message.domain.test_plan_actualStartTime") + private Long actualStartTime; + + @Schema(description = "message.domain.test_plan_actualEndTime") + private Long actualEndTime; + + @Schema(description = "message.domain.test_plan_description") + private String description; + + @Schema(description = "message.domain.test_plan_reportName") + private String reportName; + + @Schema(description = "message.domain.test_plan_reportUrl") + private String reportUrl; + + @Schema(description = "message.domain.test_plan_reportShareUrl") + private String reportShareUrl; + + @Schema(description = "message.domain.test_plan_startTime") + private Long startTime; + + @Schema(description = "message.domain.test_plan_endTime") + private Long endTime; + + @Schema(description = "message.domain.test_plan_execStatus") + private String execStatus; + + @Schema(description = "message.domain.test_plan_resultStatus") + private String resultStatus; + + @Schema(description = "message.domain.test_plan_passRate") + private Double passRate; + + @Schema(description = "message.domain.test_plan_passThreshold") + private Double passThreshold; + + @Schema(description = "message.domain.test_plan_executeRate") + private Double executeRate; + +} diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/utils/MessageTemplateUtils.java b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/utils/MessageTemplateUtils.java index fbed97aee9..f95c713373 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/utils/MessageTemplateUtils.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/utils/MessageTemplateUtils.java @@ -1,7 +1,6 @@ package io.metersphere.system.notice.utils; import io.metersphere.functional.domain.CaseReview; -import io.metersphere.plan.domain.TestPlan; import io.metersphere.sdk.constants.TemplateScene; import io.metersphere.sdk.util.CommonBeanFactory; import io.metersphere.sdk.util.Translator; @@ -9,10 +8,7 @@ import io.metersphere.system.domain.CustomField; import io.metersphere.system.domain.Schedule; import io.metersphere.system.domain.User; import io.metersphere.system.dto.BugMessageDTO; -import io.metersphere.system.dto.sdk.ApiDefinitionCaseDTO; -import io.metersphere.system.dto.sdk.ApiReportMessageDTO; -import io.metersphere.system.dto.sdk.ApiScenarioMessageDTO; -import io.metersphere.system.dto.sdk.FunctionalCaseMessageDTO; +import io.metersphere.system.dto.sdk.*; import io.metersphere.system.mapper.UserMapper; import io.metersphere.system.notice.constants.NoticeConstants; import io.swagger.v3.oas.annotations.media.Schema; @@ -144,7 +140,7 @@ public class MessageTemplateUtils { case NoticeConstants.TaskType.API_DEFINITION_TASK -> FieldUtils.getAllFields(ApiDefinitionCaseDTO.class); case NoticeConstants.TaskType.API_SCENARIO_TASK -> FieldUtils.getAllFields(ApiScenarioMessageDTO.class); case NoticeConstants.TaskType.API_REPORT_TASK -> FieldUtils.getAllFields(ApiReportMessageDTO.class); - case NoticeConstants.TaskType.TEST_PLAN_TASK -> FieldUtils.getAllFields(TestPlan.class); + case NoticeConstants.TaskType.TEST_PLAN_TASK -> FieldUtils.getAllFields(TestPlanMessageDTO.class); case NoticeConstants.TaskType.CASE_REVIEW_TASK -> FieldUtils.getAllFields(CaseReview.class); case NoticeConstants.TaskType.FUNCTIONAL_CASE_TASK -> FieldUtils.getAllFields(FunctionalCaseMessageDTO.class); case NoticeConstants.TaskType.BUG_TASK -> FieldUtils.getAllFields(BugMessageDTO.class);