From 55d36616167cecf79dace78baa668f3c8b09826c Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Wed, 26 May 2021 18:26:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=A1=88=E4=BE=8B?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E7=BB=A7=E7=BB=AD=E5=AF=BC=E5=85=A5=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B=E6=A1=88=E4=BE=8B?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=A8=A1=E6=9D=BF=E5=A2=9E=E5=8A=A0=E6=89=B9?= =?UTF-8?q?=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复案例导入继续导入失败的问题;案例导入模板增加批注 --- .../java/io/metersphere/api/jmeter/TestResult.java | 10 ++++++---- .../handler/FunctionCaseTemplateWriteHandler.java | 2 +- .../track/controller/TestCaseController.java | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java b/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java index 62c5328908..bd6c02183a 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java @@ -90,10 +90,12 @@ public class TestResult { if (StringUtils.isNotEmpty(subItem.getName()) && subItem.getName().indexOf(SEPARATOR) != -1) { String array[] = subItem.getName().split(SEPARATOR); subItem.setName(array[0]); - if (StringUtils.isNotEmpty(subItem.getScenario())) { - List id_names = JSON.parseObject(subItem.getScenario(), List.class); - this.setStatus(id_names, subItem.getError() > 0); - } + try{ + if (StringUtils.isNotEmpty(subItem.getScenario())) { + List id_names = JSON.parseObject(subItem.getScenario(), List.class); + this.setStatus(id_names, subItem.getError() > 0); + } + }catch (Exception e){} } }); } diff --git a/backend/src/main/java/io/metersphere/excel/handler/FunctionCaseTemplateWriteHandler.java b/backend/src/main/java/io/metersphere/excel/handler/FunctionCaseTemplateWriteHandler.java index a8494f1c34..b69eb3b336 100644 --- a/backend/src/main/java/io/metersphere/excel/handler/FunctionCaseTemplateWriteHandler.java +++ b/backend/src/main/java/io/metersphere/excel/handler/FunctionCaseTemplateWriteHandler.java @@ -43,7 +43,7 @@ public class FunctionCaseTemplateWriteHandler extends AbstractRowHeightStyleStra // 在第一行 第1列创建一个批注 Comment comment1 = drawingPatriarch.createCellComment(new XSSFClientAnchor(0, 0, 0, 0, (short) 0, 0, (short) 3, 1)); // 输入批注信息 - comment1.setString(new XSSFRichTextString(Translator.get("do_not_modify_header_order"))); + comment1.setString(new XSSFRichTextString(Translator.get("do_not_modify_header_order")+","+Translator.get("id_required"))); // 在第一行 第3列创建一个批注 Comment comment2 = drawingPatriarch.createCellComment(new XSSFClientAnchor(0, 0, 0, 0, (short) 2, 0, (short) 3, 1)); diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java index 7008c13b9b..055dbb0b9c 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java @@ -160,7 +160,7 @@ public class TestCaseController { return testCaseService.testCaseImport(file, projectId, userId, importType,request); } - @PostMapping("/importIgnoreError/{projectId}/{userId}") + @PostMapping("/importIgnoreError/{projectId}/{userId}/{importType}") @MsAuditLog(module = "track_test_case", type = OperLogConstants.IMPORT, project = "#projectId") public ExcelResponse testCaseImportIgnoreError(MultipartFile file, @PathVariable String projectId, @PathVariable String userId, @PathVariable String importType, HttpServletRequest request) { checkPermissionService.checkProjectOwner(projectId);