From 0de6a730b188cc746dee5ece70ac1537dab69663 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Wed, 26 Jan 2022 10:35:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E9=80=9A=E7=9F=A5=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E4=B8=BA=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1009842 --user=刘瑞斌 【消息通知】github#9634,测试计划执行的返回不正常 https://www.tapd.cn/55049933/s/1098618 Closes #9634 --- .../metersphere/track/service/TestPlanReportService.java | 8 +------- .../track/plan/components/ScheduleNotification.vue | 7 +++++-- 2 files changed, 6 insertions(+), 9 deletions(-) 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; }