From 015596d07b3f507744bfa6b96e172bffdda39daa Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Wed, 26 Jul 2023 10:33:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E9=82=AE=E4=BB=B6=E9=80=9A=E7=9F=A5=E6=B5=8B=E8=AF=95=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E9=98=B6=E6=AE=B5=E8=B0=83=E6=95=B4=E4=B8=BA=E4=B8=AD?= =?UTF-8?q?=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --story=1012490 --user=宋昌昌 【BUG转需求】【富国基金】邮件发送模板,希望测试计划阶段调整为中文的。目前是(smoke,system) 英文显示的 https://www.tapd.cn/55049933/s/1397512 --- .../sender/AfterReturningNoticeSendService.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/sender/AfterReturningNoticeSendService.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/sender/AfterReturningNoticeSendService.java index 223952e5fb..eee24216fb 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/sender/AfterReturningNoticeSendService.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/sender/AfterReturningNoticeSendService.java @@ -3,6 +3,7 @@ package io.metersphere.notice.sender; import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.user.SessionUser; import io.metersphere.dto.BaseSystemConfigDTO; +import io.metersphere.log.vo.StatusReference; import io.metersphere.notice.annotation.SendNotice; import io.metersphere.notice.service.NoticeSendService; import io.metersphere.service.SystemParameterService; @@ -35,6 +36,8 @@ public class AfterReturningNoticeSendService { paramMap.putIfAbsent("projectId", currentProjectId); // 占位符 handleDefaultValues(paramMap); + // 处理resource中特殊值 + handleSpecialValues(paramMap); String context = getContext(sendNotice, paramMap); @@ -58,6 +61,14 @@ public class AfterReturningNoticeSendService { paramMap.put("planShareUrl", StringUtils.EMPTY); // 占位符 } + private void handleSpecialValues(Map paramMap) { + // 翻译${stage}占位符 + String key = "stage"; + if (paramMap.containsKey(key) && paramMap.get(key) != null) { + paramMap.put(key, StatusReference.statusMap.get(paramMap.get("stage").toString())); + } + } + private String getContext(SendNotice sendNotice, Map paramMap) { String operation = ""; switch (sendNotice.event()) {