fix(测试跟踪): 用例导入失败后点击继续导入,没有将合规数据导入

--bug=1040765 --user=陈建星 [测试跟踪] github#30910导入用例时报失败(模板字段写的有问题),然后再点继续导入会提示导入成功 https://www.tapd.cn/55049933/s/1518238
This commit is contained in:
AgAngle 2024-05-22 14:06:13 +08:00 committed by 刘瑞斌
parent f84e8e00f8
commit cc443521b0
1 changed files with 8 additions and 4 deletions

View File

@ -1142,12 +1142,16 @@ public class TestCaseService {
return extTestCaseMapper.getTestCaseNames(queryTestCaseRequest); return extTestCaseMapper.getTestCaseNames(queryTestCaseRequest);
} }
private ExcelResponse getImportResponse(List<ExcelErrData<TestCaseExcelData>> errList, boolean isUpdated) { private ExcelResponse getImportResponse(List<ExcelErrData<TestCaseExcelData>> errList, boolean isUpdated, boolean isIgnore) {
ExcelResponse excelResponse = new ExcelResponse(); ExcelResponse excelResponse = new ExcelResponse();
excelResponse.setIsUpdated(isUpdated); excelResponse.setIsUpdated(isUpdated);
//如果包含错误信息就导出错误信息 //如果包含错误信息就导出错误信息
if (!errList.isEmpty()) { if (!errList.isEmpty()) {
if (isIgnore) {
excelResponse.setSuccess(true);
} else {
excelResponse.setSuccess(false); excelResponse.setSuccess(false);
}
excelResponse.setErrList(errList); excelResponse.setErrList(errList);
} else { } else {
excelResponse.setSuccess(true); excelResponse.setSuccess(true);
@ -1243,7 +1247,7 @@ public class TestCaseService {
errData.setRowNum(errorNum++); errData.setRowNum(errorNum++);
} }
} }
return getImportResponse(errList, true); return getImportResponse(errList, true, request.isIgnore());
} }
private ExcelResponse testCaseExcelImport(MultipartFile multipartFile, TestCaseImportRequest request, private ExcelResponse testCaseExcelImport(MultipartFile multipartFile, TestCaseImportRequest request,
@ -1303,7 +1307,7 @@ public class TestCaseService {
LogUtil.error(e.getMessage(), e); LogUtil.error(e.getMessage(), e);
MSException.throwException(e.getMessage()); MSException.throwException(e.getMessage());
} }
return getImportResponse(errList, isUpdated); return getImportResponse(errList, isUpdated, request.isIgnore());
} }
private static List<CustomFieldDao> getProjectCustomFields(String projectId) { private static List<CustomFieldDao> getProjectCustomFields(String projectId) {