fix(项目管理): 修复消息通知测试计划缺少报告内容问题

--bug=1044677 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001044677
This commit is contained in:
guoyuqi 2024-08-02 14:55:05 +08:00 committed by Craftsman
parent fcadf129e1
commit b62498e7b4
7 changed files with 132 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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) {

View File

@ -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<String> 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;
}

View File

@ -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);