fix(测试跟踪): 用例导入最后一条数据是合并单元格并且最后一行是空内容,该用例导入失败
--bug=1022350 --user=陈建星 【测试跟踪】功能用例导入-当只有一个步骤时-第二个步骤为空不填写-导入失败 https://www.tapd.cn/55049933/s/1351497
This commit is contained in:
parent
5022f61ede
commit
b724e5d838
|
@ -182,6 +182,16 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener<Map<Integ
|
||||||
testCaseExcelData = this.parseDataToModel(data);
|
testCaseExcelData = this.parseDataToModel(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildUpdateOrErrorList(rowIndex, testCaseExcelData);
|
||||||
|
|
||||||
|
if (list.size() > BATCH_COUNT || updateList.size() > BATCH_COUNT) {
|
||||||
|
saveData();
|
||||||
|
list.clear();
|
||||||
|
updateList.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buildUpdateOrErrorList(Integer rowIndex, TestCaseExcelData testCaseExcelData) {
|
||||||
StringBuilder errMsg;
|
StringBuilder errMsg;
|
||||||
try {
|
try {
|
||||||
//根据excel数据实体中的javax.validation + 正则表达式来校验excel数据
|
//根据excel数据实体中的javax.validation + 正则表达式来校验excel数据
|
||||||
|
@ -214,11 +224,6 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener<Map<Integ
|
||||||
list.add(testCaseExcelData);
|
list.add(testCaseExcelData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (list.size() > BATCH_COUNT || updateList.size() > BATCH_COUNT) {
|
|
||||||
saveData();
|
|
||||||
list.clear();
|
|
||||||
updateList.clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -856,6 +861,10 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener<Map<Integ
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||||
|
// 如果文件最后一行是没有内容的步骤,这里处理最后一条合并单元格的数据
|
||||||
|
if (this.currentMergeData != null) {
|
||||||
|
buildUpdateOrErrorList(firstMergeRowIndex, currentMergeData);
|
||||||
|
}
|
||||||
saveData();
|
saveData();
|
||||||
list.clear();
|
list.clear();
|
||||||
customFieldsMap.clear();
|
customFieldsMap.clear();
|
||||||
|
|
Loading…
Reference in New Issue