diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java index d1df9d7f92..da73ca14ba 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java @@ -622,7 +622,7 @@ public class TestPlanReportService { BaseSystemConfigDTO baseSystemConfigDTO = systemParameterService.getBaseInfo(); String url = baseSystemConfigDTO.getUrl() + "/#/track/testPlan/reportList"; String subject = ""; - String event = ""; + String event = NoticeConstants.Event.COMPLETE; String successContext = "${operator}执行的 ${name} 测试计划运行成功, 报告: ${planShareUrl}"; String failedContext = "${operator}执行的 ${name} 测试计划运行失败, 报告: ${planShareUrl}"; String context = "${operator}完成了测试计划: ${name}"; @@ -632,11 +632,6 @@ public class TestPlanReportService { 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(); UserDTO userDTO = userService.getUserDTO(creator); @@ -671,7 +666,6 @@ public class TestPlanReportService { .build(); if (StringUtils.equals(testPlanReport.getTriggerMode(), ReportTriggerMode.MANUAL.name())) { - noticeModel.setEvent(NoticeConstants.Event.COMPLETE); noticeSendService.send(projectService.getProjectById(projectId), NoticeConstants.TaskType.TEST_PLAN_TASK, noticeModel); } diff --git a/frontend/src/business/components/track/plan/components/ScheduleNotification.vue b/frontend/src/business/components/track/plan/components/ScheduleNotification.vue index ba504eb1c4..0e4ac25bb0 100644 --- a/frontend/src/business/components/track/plan/components/ScheduleNotification.vue +++ b/frontend/src/business/components/track/plan/components/ScheduleNotification.vue @@ -172,8 +172,7 @@ export default { testId: this.testId, }], scheduleEventOptions: [ - {value: 'EXECUTE_SUCCESSFUL', label: this.$t('schedule.event_success')}, - {value: 'EXECUTE_FAILED', label: this.$t('schedule.event_failed')} + {value: 'COMPLETE', label: this.$t('commons.run_completed')}, ], receiveTypeOptions: [ {value: 'EMAIL', label: this.$t('organization.message.mail')}, @@ -366,6 +365,10 @@ export default { htmlTemplate = this.title.replace('成功', '失败'); robotTemplate = this.robotTitle.replace('成功', '失败'); break; + case 'COMPLETE': + htmlTemplate = this.title.replace('成功', '完成'); + robotTemplate = this.robotTitle.replace('成功', '完成'); + break; default: break; }