From 83c915b265cc4b9ccdb01589c8c4a8d6c53f3dad Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Fri, 16 Aug 2024 17:50:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B):=20?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=A8=A1=E6=9D=BF=E5=8F=96=E6=B6=88id&?= =?UTF-8?q?=E5=AF=BC=E5=87=BAid=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1044592 --user=王旭 【测试用例】excel导入功能用例-未按用户录入的ID导入-仍是系统生成ID https://www.tapd.cn/55049933/s/1564371 --- .../sdk/src/main/resources/i18n/commons_en_US.properties | 2 +- .../sdk/src/main/resources/i18n/commons_zh_CN.properties | 2 +- .../sdk/src/main/resources/i18n/commons_zh_TW.properties | 2 +- .../functional/excel/domain/FunctionalCaseExcelData.java | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/framework/sdk/src/main/resources/i18n/commons_en_US.properties b/backend/framework/sdk/src/main/resources/i18n/commons_en_US.properties index f02f350bd2..84d136b030 100644 --- a/backend/framework/sdk/src/main/resources/i18n/commons_en_US.properties +++ b/backend/framework/sdk/src/main/resources/i18n/commons_en_US.properties @@ -542,7 +542,7 @@ permission.test_plan.name=Test plan permission.test_plan=Plan permission.test_plan_report=Report -excel.template.id=Non mandatory, add a new use case when the ID is empty or does not exist; +excel.template.id=Non mandatory, ID is automatically generated by the system; When importing use cases, you can choose whether to cover use cases with the same ID; When the ID is empty or does not exist, it defaults to adding a new use case;; excel.template.case_edit_type=Not mandatory, fill in STEP for step description, fill in Text for text description, default to Text if not filled in excel.template.tag=Not mandatory labels should be separated by semicolons or commas excel.template.text_description=Not mandatory, when the editing mode is STEP, the step description will be based on the identifier [1] [2] [3] To determine whether to split a cell into multiple steps, if not, it is a single step diff --git a/backend/framework/sdk/src/main/resources/i18n/commons_zh_CN.properties b/backend/framework/sdk/src/main/resources/i18n/commons_zh_CN.properties index fc01fccc8e..04faa522a4 100644 --- a/backend/framework/sdk/src/main/resources/i18n/commons_zh_CN.properties +++ b/backend/framework/sdk/src/main/resources/i18n/commons_zh_CN.properties @@ -539,7 +539,7 @@ permission.test_plan.name=测试计划 permission.test_plan=计划 permission.test_plan_report=报告 -excel.template.id=非必填,ID为空或不存在时新增用例; +excel.template.id=非必填,ID为系统自动生成;导入用例时,可选择择是否覆盖相同ID的用例;当ID为空或不存在时默认为新增用例; excel.template.case_edit_type=非必填,步骤描述填写STEP,文本描述填写TEXT,未填写默认为TEXT excel.template.tag=非必填,标签之间以分号或者逗号隔开 excel.template.text_description=非必填,编辑模式为STEP时,步骤描述会根据标识[1] [2] [3]...来判断是否将单元格拆分为多个步骤,没有则为一个步骤 diff --git a/backend/framework/sdk/src/main/resources/i18n/commons_zh_TW.properties b/backend/framework/sdk/src/main/resources/i18n/commons_zh_TW.properties index 2a13d07c2e..3fbc33c567 100644 --- a/backend/framework/sdk/src/main/resources/i18n/commons_zh_TW.properties +++ b/backend/framework/sdk/src/main/resources/i18n/commons_zh_TW.properties @@ -540,7 +540,7 @@ permission.test_plan.name=測試計劃 permission.test_plan=計劃 permission.test_plan_report=報告 -excel.template.id=非必填,ID為空時或不存在時新增用例 +excel.template.id=非必填,ID為系統自動生成;導入用例時,可選擇是否覆蓋相同ID的用例;儅ID為空或不存在時默認為新增用例 excel.template.case_edit_type=非必填,步驟描述填寫STEP,文本描述填寫TEXT,為填寫默認為TEXT excel.template.tag=非必填,標簽之間以分號或者逗號隔開 excel.template.text_description=非必填,編輯模式為STEP時,步驟描述會根據標識[1] [2] [3]...來判斷是否將單元格拆分為多個步驟,沒有則為一個步驟 diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/excel/domain/FunctionalCaseExcelData.java b/backend/services/case-management/src/main/java/io/metersphere/functional/excel/domain/FunctionalCaseExcelData.java index e0052a455d..9975c3b439 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/excel/domain/FunctionalCaseExcelData.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/excel/domain/FunctionalCaseExcelData.java @@ -7,6 +7,7 @@ import io.metersphere.system.dto.sdk.TemplateCustomFieldDTO; import lombok.Getter; import lombok.Setter; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import java.util.*; @@ -64,7 +65,9 @@ public class FunctionalCaseExcelData { List> heads = new ArrayList<>(); FunctionalCaseImportFiled[] fields = FunctionalCaseImportFiled.values(); for (FunctionalCaseImportFiled field : fields) { - heads.add(Arrays.asList(field.getFiledLangMap().get(lang))); + if (!StringUtils.equalsIgnoreCase(field.name(), "ID")) { + heads.add(Arrays.asList(field.getFiledLangMap().get(lang))); + } } if (CollectionUtils.isNotEmpty(customFields)) {