fix(缺陷管理): 写入无效的项目id进入创建缺陷页面报错

--bug=1010673 --user=李玉号 【项目设置】-zentao/tapd 编辑项目
写入无效的项目id
,进入缺陷管理,创建缺陷会报错 https://www.tapd.cn/55049933/s/1126132
This commit is contained in:
shiziyuan9527 2022-03-25 15:14:24 +08:00 committed by shiziyuan9527
parent 2aab6796d4
commit 0687387326
4 changed files with 11 additions and 2 deletions

View File

@ -10,6 +10,7 @@ import io.metersphere.commons.constants.IssuesStatus;
import io.metersphere.commons.exception.MSException; import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.LogUtil; import io.metersphere.commons.utils.LogUtil;
import io.metersphere.dto.UserDTO; import io.metersphere.dto.UserDTO;
import io.metersphere.i18n.Translator;
import io.metersphere.track.dto.DemandDTO; import io.metersphere.track.dto.DemandDTO;
import io.metersphere.track.issue.client.ZentaoClient; import io.metersphere.track.issue.client.ZentaoClient;
import io.metersphere.track.issue.domain.PlatformUser; import io.metersphere.track.issue.domain.PlatformUser;
@ -338,9 +339,14 @@ public class ZentaoPlatform extends AbstractIssuePlatform {
} }
public List<ZentaoBuild> getBuilds() { public List<ZentaoBuild> getBuilds() {
Map<String, Object> 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<String, Object> builds = zentaoClient.getBuildsByCreateMetaData(relateProjectId);
if (builds == null || builds.isEmpty()) { if (builds == null || builds.isEmpty()) {
builds = zentaoClient.getBuilds(getProjectId(projectId)); builds = zentaoClient.getBuilds(relateProjectId);
} }
List<ZentaoBuild> res = new ArrayList<>(); List<ZentaoBuild> res = new ArrayList<>();
builds.forEach((k, v) -> { builds.forEach((k, v) -> {

View File

@ -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 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 issue_project_not_exist=ID does not exist or other errors
tapd_project_not_exist=The associated TAPD item ID does not exist 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
ldap_url_is_null=LDAP address is empty ldap_url_is_null=LDAP address is empty
ldap_dn_is_null=LDAP binding DN is empty ldap_dn_is_null=LDAP binding DN is empty

View File

@ -165,6 +165,7 @@ step_model_tip=步骤描述填写 STEP,文本描述请填写 TEXT (非必填)
case_status_not_exist=用例状态必须为未开始(Prepare)、进行中(Underway)、已完成(Completed) case_status_not_exist=用例状态必须为未开始(Prepare)、进行中(Underway)、已完成(Completed)
issue_project_not_exist=ID不存在或其它错误 issue_project_not_exist=ID不存在或其它错误
tapd_project_not_exist=关联的TAPD项目ID不存在 tapd_project_not_exist=关联的TAPD项目ID不存在
zentao_project_id_not_exist=关联的禅道ID不存在或其它错误
#ldap #ldap
ldap_url_is_null=LDAP地址为空 ldap_url_is_null=LDAP地址为空
ldap_dn_is_null=LDAP绑定DN为空 ldap_dn_is_null=LDAP绑定DN为空

View File

@ -165,6 +165,7 @@ step_model_tip=步驟描述填寫 STEP,文本描述請填寫 TEXT (非必填)
case_status_not_exist=用例狀態必須為未開始Prepare、進行中Underway、已完成Completed case_status_not_exist=用例狀態必須為未開始Prepare、進行中Underway、已完成Completed
issue_project_not_exist=ID不存在或其它錯誤 issue_project_not_exist=ID不存在或其它錯誤
tapd_project_not_exist=關聯的TAPD項目ID不存在 tapd_project_not_exist=關聯的TAPD項目ID不存在
zentao_project_id_not_exist=關聯的禪道ID不存在或其它錯誤
#ldap #ldap
ldap_url_is_null=LDAP地址為空 ldap_url_is_null=LDAP地址為空
ldap_dn_is_null=LDAP綁定DN為空 ldap_dn_is_null=LDAP綁定DN為空