From 3aed2f00a98fe52b4e4cb322da6b882bec6f22ed Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Sun, 8 Oct 2023 15:17:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E5=A4=84=E7=90=86=E4=BF=AE=E6=94=B9=E7=94=A8=E4=BE=8B=E7=8A=B6?= =?UTF-8?q?=E6=80=81=EF=BC=8C=E5=8F=98=E6=9B=B4=E8=AE=B0=E5=BD=95=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=9B=BD=E9=99=85=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1031034 --user=王旭 【测试跟踪】英文模式-修改Case Status-查看变更记录-还是中文 https://www.tapd.cn/55049933/s/1423108 --- .../metersphere/log/service/OperatingLogService.java | 10 ++++++---- .../src/main/resources/i18n/commons_en_US.properties | 5 ++++- .../src/main/resources/i18n/commons_zh_CN.properties | 5 ++++- .../src/main/resources/i18n/commons_zh_TW.properties | 5 ++++- .../java/io/metersphere/service/TestCaseService.java | 6 ++++++ 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/log/service/OperatingLogService.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/log/service/OperatingLogService.java index 1b800fabeb..6caa351235 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/log/service/OperatingLogService.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/log/service/OperatingLogService.java @@ -10,10 +10,8 @@ import io.metersphere.commons.utils.BeanUtils; import io.metersphere.commons.utils.JSON; import io.metersphere.i18n.Translator; import io.metersphere.log.constants.OperatorLevel; -import io.metersphere.log.vo.DetailColumn; -import io.metersphere.log.vo.OperatingLogDTO; -import io.metersphere.log.vo.OperatingLogDetails; -import io.metersphere.log.vo.OperatingLogRequest; +import io.metersphere.log.vo.*; +import io.metersphere.log.vo.track.TestCaseReference; import io.metersphere.service.ServiceUtils; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -136,6 +134,10 @@ public class OperatingLogService { List columns = logWithBLOB.getDetails().getColumns(); columns.stream().forEach(column -> { if (StringUtils.isNotEmpty(column.getColumnTitle())) { + if (StringUtils.equalsIgnoreCase(TestCaseReference.testCaseColumns.get(column.getColumnName()), column.getColumnTitle())) { + column.setOriginalValue(Translator.get(column.getOriginalValue().toString()).replace("Not Support Key:", "")); + column.setNewValue(Translator.get(column.getNewValue().toString()).replace("Not Support Key:", "")); + } String columnsTitle = Translator.get(column.getColumnTitle()); column.setColumnTitle(columnsTitle.replace("Not Support Key:", "")); } diff --git a/framework/sdk-parent/sdk/src/main/resources/i18n/commons_en_US.properties b/framework/sdk-parent/sdk/src/main/resources/i18n/commons_en_US.properties index 34515d8469..5f13bd6487 100644 --- a/framework/sdk-parent/sdk/src/main/resources/i18n/commons_en_US.properties +++ b/framework/sdk-parent/sdk/src/main/resources/i18n/commons_en_US.properties @@ -405,4 +405,7 @@ select_resource_error_and_check=Select the resource error, check it please load_test_file_not_have_jmx=Load test not have jmx file load_test_file_is_not_jmx=Load test JMX file is illegal version_name_is_null=Version name is not null -current_version_already_exists=Current version already exists \ No newline at end of file +current_version_already_exists=Current version already exists +Prepare=Prepare +Underway=Underway +Completed=Completed \ No newline at end of file diff --git a/framework/sdk-parent/sdk/src/main/resources/i18n/commons_zh_CN.properties b/framework/sdk-parent/sdk/src/main/resources/i18n/commons_zh_CN.properties index e62c450203..605d089f42 100644 --- a/framework/sdk-parent/sdk/src/main/resources/i18n/commons_zh_CN.properties +++ b/framework/sdk-parent/sdk/src/main/resources/i18n/commons_zh_CN.properties @@ -402,4 +402,7 @@ select_resource_error_and_check=查找资源出错,请检查资源是否存在 load_test_file_not_have_jmx=性能测试里的JMX文件不存在 load_test_file_is_not_jmx=性能测试里的JMX文件不合法 version_name_is_null=版本名称不能为空 -current_version_already_exists=当前版本已存在 \ No newline at end of file +current_version_already_exists=当前版本已存在 +Prepare=未开始 +Underway=进行中 +Completed=已完成 \ No newline at end of file diff --git a/framework/sdk-parent/sdk/src/main/resources/i18n/commons_zh_TW.properties b/framework/sdk-parent/sdk/src/main/resources/i18n/commons_zh_TW.properties index 614bd0116b..cb3ccc2522 100644 --- a/framework/sdk-parent/sdk/src/main/resources/i18n/commons_zh_TW.properties +++ b/framework/sdk-parent/sdk/src/main/resources/i18n/commons_zh_TW.properties @@ -401,4 +401,7 @@ select_resource_error_and_check=查找資源出錯,請檢查資源是否存在 load_test_file_not_have_jmx=性能測試文件中不包含JMX文件 load_test_file_is_not_jmx=性能測試里的JMX文件不合法 version_name_is_null=版本名稱不能為空 -current_version_already_exists=當前版本已存在 \ No newline at end of file +current_version_already_exists=當前版本已存在 +Prepare=未開始 +Underway=進行中 +Completed=已完成 \ No newline at end of file diff --git a/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java b/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java index ee17bad81c..fe6f84194e 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java @@ -2699,6 +2699,12 @@ public class TestCaseService { DetailColumn detailColumn = new DetailColumn("comment", "comment", String.join(StringUtils.LF, names), null); columns.add(detailColumn); + columns.stream().forEach(item -> { + if ("status".equals(item.getColumnName())) { + item.setOriginalValue(bloBs.getStatus()); + } + }); + OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(id), bloBs.getProjectId(), bloBs.getName(), bloBs.getCreateUser(), columns); return JSON.toJSONString(details); }