fix(测试跟踪): 修复接口用例为空时表格数据加载报错的问题

修复接口用例为空时表格数据加载报错的问题
This commit is contained in:
song-tianyang 2022-04-04 18:31:12 +08:00 committed by 刘瑞斌
parent 4098c3ab54
commit ed37d3e21a
1 changed files with 38 additions and 38 deletions

View File

@ -648,6 +648,7 @@ public class TestCaseService {
}
private List<TestCaseDTO> parseStatus(List<TestCaseDTO> returnList) {
if (CollectionUtils.isNotEmpty(returnList)) {
TestCaseExcelData excelData = new TestCaseExcelDataFactory().getTestCaseExcelDataLocal();
List<String> testCaseIdList = new ArrayList<>();
returnList.forEach(item -> {
@ -668,7 +669,6 @@ public class TestCaseService {
data.setLastExecuteResult(null);
}
String dataStatus = excelData.parseStatus(data.getStatus());
if (StringUtils.equalsAnyIgnoreCase(data.getStatus(), "Trash")) {
try {
JSONArray arr = JSONArray.parseArray(data.getCustomFields());
@ -685,12 +685,12 @@ public class TestCaseService {
}
data.setCustomFields(newArr.toJSONString());
} catch (Exception e) {
LogUtil.error("Parse case exec status error:" + e.getMessage());
}
}
data.setStatus(dataStatus);
}
}
return returnList;
}