From cc443521b029a0cd94f86da624f958800d44c1c4 Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Wed, 22 May 2024 14:06:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E5=AF=BC=E5=85=A5=E5=A4=B1=E8=B4=A5=E5=90=8E?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=BB=A7=E7=BB=AD=E5=AF=BC=E5=85=A5=EF=BC=8C?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=B0=86=E5=90=88=E8=A7=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1040765 --user=陈建星 [测试跟踪] github#30910导入用例时报失败(模板字段写的有问题),然后再点继续导入会提示导入成功 https://www.tapd.cn/55049933/s/1518238 --- .../java/io/metersphere/service/TestCaseService.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java b/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java index c26b4159fa..17bd57a398 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/TestCaseService.java @@ -1142,12 +1142,16 @@ public class TestCaseService { return extTestCaseMapper.getTestCaseNames(queryTestCaseRequest); } - private ExcelResponse getImportResponse(List> errList, boolean isUpdated) { + private ExcelResponse getImportResponse(List> errList, boolean isUpdated, boolean isIgnore) { ExcelResponse excelResponse = new ExcelResponse(); excelResponse.setIsUpdated(isUpdated); //如果包含错误信息就导出错误信息 if (!errList.isEmpty()) { - excelResponse.setSuccess(false); + if (isIgnore) { + excelResponse.setSuccess(true); + } else { + excelResponse.setSuccess(false); + } excelResponse.setErrList(errList); } else { excelResponse.setSuccess(true); @@ -1243,7 +1247,7 @@ public class TestCaseService { errData.setRowNum(errorNum++); } } - return getImportResponse(errList, true); + return getImportResponse(errList, true, request.isIgnore()); } private ExcelResponse testCaseExcelImport(MultipartFile multipartFile, TestCaseImportRequest request, @@ -1303,7 +1307,7 @@ public class TestCaseService { LogUtil.error(e.getMessage(), e); MSException.throwException(e.getMessage()); } - return getImportResponse(errList, isUpdated); + return getImportResponse(errList, isUpdated, request.isIgnore()); } private static List getProjectCustomFields(String projectId) {