fix(测试计划): 统一测试计划定时任务通知成功失败为完成

--bug=1009842 --user=刘瑞斌 【消息通知】github#9634,测试计划执行的返回不正常 https://www.tapd.cn/55049933/s/1098618

Closes #9634
This commit is contained in:
CaptainB 2022-01-26 10:35:28 +08:00 committed by fit2-zhao
parent 32f8fbbfc6
commit 0de6a730b1
2 changed files with 6 additions and 9 deletions

View File

@ -622,7 +622,7 @@ public class TestPlanReportService {
BaseSystemConfigDTO baseSystemConfigDTO = systemParameterService.getBaseInfo(); BaseSystemConfigDTO baseSystemConfigDTO = systemParameterService.getBaseInfo();
String url = baseSystemConfigDTO.getUrl() + "/#/track/testPlan/reportList"; String url = baseSystemConfigDTO.getUrl() + "/#/track/testPlan/reportList";
String subject = ""; String subject = "";
String event = ""; String event = NoticeConstants.Event.COMPLETE;
String successContext = "${operator}执行的 ${name} 测试计划运行成功, 报告: ${planShareUrl}"; String successContext = "${operator}执行的 ${name} 测试计划运行成功, 报告: ${planShareUrl}";
String failedContext = "${operator}执行的 ${name} 测试计划运行失败, 报告: ${planShareUrl}"; String failedContext = "${operator}执行的 ${name} 测试计划运行失败, 报告: ${planShareUrl}";
String context = "${operator}完成了测试计划: ${name}"; String context = "${operator}完成了测试计划: ${name}";
@ -632,11 +632,6 @@ public class TestPlanReportService {
subject = Translator.get("task_notification"); subject = Translator.get("task_notification");
} }
if (StringUtils.equals(TestPlanReportStatus.FAILED.name(), testPlanReport.getStatus())) {
event = NoticeConstants.Event.EXECUTE_FAILED;
} else {
event = NoticeConstants.Event.EXECUTE_SUCCESSFUL;
}
String creator = testPlanReport.getCreator(); String creator = testPlanReport.getCreator();
UserDTO userDTO = userService.getUserDTO(creator); UserDTO userDTO = userService.getUserDTO(creator);
@ -671,7 +666,6 @@ public class TestPlanReportService {
.build(); .build();
if (StringUtils.equals(testPlanReport.getTriggerMode(), ReportTriggerMode.MANUAL.name())) { if (StringUtils.equals(testPlanReport.getTriggerMode(), ReportTriggerMode.MANUAL.name())) {
noticeModel.setEvent(NoticeConstants.Event.COMPLETE);
noticeSendService.send(projectService.getProjectById(projectId), NoticeConstants.TaskType.TEST_PLAN_TASK, noticeModel); noticeSendService.send(projectService.getProjectById(projectId), NoticeConstants.TaskType.TEST_PLAN_TASK, noticeModel);
} }

View File

@ -172,8 +172,7 @@ export default {
testId: this.testId, testId: this.testId,
}], }],
scheduleEventOptions: [ scheduleEventOptions: [
{value: 'EXECUTE_SUCCESSFUL', label: this.$t('schedule.event_success')}, {value: 'COMPLETE', label: this.$t('commons.run_completed')},
{value: 'EXECUTE_FAILED', label: this.$t('schedule.event_failed')}
], ],
receiveTypeOptions: [ receiveTypeOptions: [
{value: 'EMAIL', label: this.$t('organization.message.mail')}, {value: 'EMAIL', label: this.$t('organization.message.mail')},
@ -366,6 +365,10 @@ export default {
htmlTemplate = this.title.replace('成功', '失败'); htmlTemplate = this.title.replace('成功', '失败');
robotTemplate = this.robotTitle.replace('成功', '失败'); robotTemplate = this.robotTitle.replace('成功', '失败');
break; break;
case 'COMPLETE':
htmlTemplate = this.title.replace('成功', '完成');
robotTemplate = this.robotTitle.replace('成功', '完成');
break;
default: default:
break; break;
} }