From 205d24734b2017e8f22b4b2f8f3c2c4aa4e0deb8 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Thu, 16 Dec 2021 11:22:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9C=BA=E6=99=AF=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=AD=98=E5=82=A8):=20=E6=9B=B4=E6=94=B9=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E5=AD=98=E5=82=A8=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更改场景报告存储的逻辑,完善日志输出的内容 --- .../api/service/ApiScenarioReportService.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java index b381288873..9fb99478ad 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java @@ -321,6 +321,7 @@ public class ApiScenarioReportService { if (CollectionUtils.isNotEmpty(scenarioResult.getRequestResults())) { startTime = scenarioResult.getRequestResults().get(0).getStartTime(); } + String resultReportId = scenarioResult.getName(); ApiScenarioReport report = editReport(scenarioResult, startTime); if (report != null) { TestResult newResult = createTestResult(result.getTestId(), scenarioResult); @@ -383,12 +384,13 @@ public class ApiScenarioReportService { if (StringUtils.isNotEmpty(report.getTriggerMode()) && report.getTriggerMode().equals("CASE")) { report.setTriggerMode(TriggerMode.MANUAL.name()); } - if (StringUtils.equalsIgnoreCase(report.getId(), scenarioResult.getName())) { + if (StringUtils.equalsIgnoreCase(report.getId(), resultReportId)) { detail.setReportId(report.getId()); } else { - detail.setReportId(scenarioResult.getName()); - LogUtil.info("ReportId" + scenarioResult.getName() + " has changed!"); - LogUtil.error("ReportId was changed. ScenarioResultData:" + JSON.toJSONString(scenarioResult) + "; ApiScenarioReport:" + JSON.toJSONString(report)); + detail.setReportId(resultReportId); + LogUtil.info("ReportId" + resultReportId + " has changed!"); + LogUtil.error("ReportId was changed. ScenarioResultData:" + JSON.toJSONString(scenarioResult) + ";\r\n " + + "ApiScenarioReport:" + JSON.toJSONString(report)); } try {