fix(测试计划): 修复导入更新报错的问题

修复导入更新报错的问题
This commit is contained in:
song-tianyang 2021-07-02 11:23:27 +08:00 committed by 刘瑞斌
parent 7598b2b33a
commit 17277c8990
5 changed files with 20 additions and 4 deletions

View File

@ -133,7 +133,16 @@ public class TestCaseDataListener extends EasyExcelListener<TestCaseExcelData> {
if(isUseCustomId){
checkResult = testCaseService.checkCustomIdExist(data.getCustomNum().toString(), projectId);
}else {
checkResult = testCaseService.checkIdExist(Integer.parseInt(data.getCustomNum()), projectId);
int customNumId = -1;
try{
customNumId = Integer.parseInt(data.getCustomNum());
}catch (Exception e){
}
if(customNumId < 0){
stringBuilder.append(Translator.get("id_not_rightful") + "["+data.getCustomNum()+"]; ");
}else {
checkResult = testCaseService.checkIdExist(customNumId, projectId);
}
}
if (null != checkResult) { //该ID在当前项目中存在
//如果前面所经过的校验都没报错

View File

@ -68,3 +68,4 @@ id_required=
id_repeat_in_table=
template_already=
expect_name_exists=
id_not_rightful=

View File

@ -262,4 +262,6 @@ auth_title=Auth
# track home
api_case=API
performance_case=PERFORMANCE
scenario_case=SCENARIO
scenario_case=SCENARIO
id_not_rightful=ID is not rightful

View File

@ -261,4 +261,6 @@ auth_title=系统认证
# track home
api_case=接口用例
performance_case=性能用例
scenario_case=场景用例
scenario_case=场景用例
id_not_rightful=ID 不合法

View File

@ -261,4 +261,6 @@ auth_title=系统认证
# track home
api_case=接口用例
performance_case=性能用例
scenario_case=場景用例
scenario_case=場景用例
id_not_rightful=ID 不合法