From 0687387326bc43c75ad397ca0ed0c5070f93054a Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Fri, 25 Mar 2022 15:14:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=BC=BA=E9=99=B7=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E5=86=99=E5=85=A5=E6=97=A0=E6=95=88=E7=9A=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?id=E8=BF=9B=E5=85=A5=E5=88=9B=E5=BB=BA=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010673 --user=李玉号 【项目设置】-zentao/tapd 编辑项目 写入无效的项目id ,进入缺陷管理,创建缺陷会报错 https://www.tapd.cn/55049933/s/1126132 --- .../io/metersphere/track/issue/ZentaoPlatform.java | 10 ++++++++-- .../src/main/resources/i18n/messages_en_US.properties | 1 + .../src/main/resources/i18n/messages_zh_CN.properties | 1 + .../src/main/resources/i18n/messages_zh_TW.properties | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java b/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java index bf54d1b6ca..3205b7becc 100644 --- a/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java @@ -10,6 +10,7 @@ import io.metersphere.commons.constants.IssuesStatus; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.utils.LogUtil; import io.metersphere.dto.UserDTO; +import io.metersphere.i18n.Translator; import io.metersphere.track.dto.DemandDTO; import io.metersphere.track.issue.client.ZentaoClient; import io.metersphere.track.issue.domain.PlatformUser; @@ -338,9 +339,14 @@ public class ZentaoPlatform extends AbstractIssuePlatform { } public List getBuilds() { - Map builds = zentaoClient.getBuildsByCreateMetaData(getProjectId(projectId)); + String relateProjectId = getProjectId(projectId); + Boolean exist = checkProjectExist(relateProjectId); + if (!exist) { + MSException.throwException(Translator.get("zentao_project_id_not_exist")); + } + Map builds = zentaoClient.getBuildsByCreateMetaData(relateProjectId); if (builds == null || builds.isEmpty()) { - builds = zentaoClient.getBuilds(getProjectId(projectId)); + builds = zentaoClient.getBuilds(relateProjectId); } List res = new ArrayList<>(); builds.forEach((k, v) -> { diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index e7d5b692ea..9e70b2ce43 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -165,6 +165,7 @@ step_model_tip=Step description fill in STEP, text description please fill in TE case_status_not_exist=The use case status must be Prepare, Underway way and Completed issue_project_not_exist=ID does not exist or other errors tapd_project_not_exist=The associated TAPD item ID does not exist +zentao_project_id_not_exist=The associated Zen Tao ID does not exist or other errors #ldap ldap_url_is_null=LDAP address is empty ldap_dn_is_null=LDAP binding DN is empty diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 578568e42f..7dde1c5302 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -165,6 +165,7 @@ step_model_tip=步骤描述填写 STEP,文本描述请填写 TEXT (非必填) case_status_not_exist=用例状态必须为未开始(Prepare)、进行中(Underway)、已完成(Completed) issue_project_not_exist=ID不存在或其它错误 tapd_project_not_exist=关联的TAPD项目ID不存在 +zentao_project_id_not_exist=关联的禅道ID不存在或其它错误 #ldap ldap_url_is_null=LDAP地址为空 ldap_dn_is_null=LDAP绑定DN为空 diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 4200718eac..b1de0dd95f 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -165,6 +165,7 @@ step_model_tip=步驟描述填寫 STEP,文本描述請填寫 TEXT (非必填) case_status_not_exist=用例狀態必須為未開始(Prepare)、進行中(Underway)、已完成(Completed) issue_project_not_exist=ID不存在或其它錯誤 tapd_project_not_exist=關聯的TAPD項目ID不存在 +zentao_project_id_not_exist=關聯的禪道ID不存在或其它錯誤 #ldap ldap_url_is_null=LDAP地址為空 ldap_dn_is_null=LDAP綁定DN為空