From 420c4b4ed03440dc861da81f8d444b7eb3a983e8 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 24 Aug 2021 15:06:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E7=BC=BA=E9=99=B7=E7=BB=9F=E8=AE=A1=E4=B8=8D?= =?UTF-8?q?=E5=AE=8C=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/mapper/ext/ExtIssuesMapper.xml | 2 +- .../track/service/TestPlanService.java | 30 ++++++++++--------- .../report/detail/TestPlanReportButtons.vue | 2 +- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml index 9718a5d5dd..3b6e5a6b33 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml @@ -43,7 +43,7 @@ where project_id = #{projectId} and platform != 'Local'; diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index ea41f5a3c1..92108450d5 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -1460,21 +1460,23 @@ public class TestPlanService { allCases.forEach(item -> { LoadCaseReportRequest request = new LoadCaseReportRequest(); String reportId = item.getLoadReportId(); - request.setTestPlanLoadCaseId(item.getId()); - request.setReportId(reportId); - Boolean existReport = testPlanLoadCaseService.isExistReport(request); - if (existReport) { - LoadTestReportWithBLOBs loadTestReport = performanceReportService.getLoadTestReport(reportId); - ReportTimeInfo reportTimeInfo = performanceReportService.getReportTimeInfo(reportId); - TestPlanLoadCaseDTO.ReportDTO reportDTO = new TestPlanLoadCaseDTO.ReportDTO(); - if (loadTestReport != null) { - BeanUtils.copyBean(reportDTO, loadTestReport); + if (StringUtils.isNotBlank(reportId)) { + request.setTestPlanLoadCaseId(item.getId()); + request.setReportId(reportId); + Boolean existReport = testPlanLoadCaseService.isExistReport(request); + if (existReport) { + LoadTestReportWithBLOBs loadTestReport = performanceReportService.getLoadTestReport(reportId); + ReportTimeInfo reportTimeInfo = performanceReportService.getReportTimeInfo(reportId); + TestPlanLoadCaseDTO.ReportDTO reportDTO = new TestPlanLoadCaseDTO.ReportDTO(); + if (loadTestReport != null) { + BeanUtils.copyBean(reportDTO, loadTestReport); + } + if (reportTimeInfo != null) { + BeanUtils.copyBean(reportDTO, reportTimeInfo); + } + item.setResponse(reportDTO); + // todo 报告详情 } - if (reportTimeInfo != null) { - BeanUtils.copyBean(reportDTO, reportTimeInfo); - } - item.setResponse(reportDTO); - // todo 报告详情 } }); } diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportButtons.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportButtons.vue index 2e0ba4ea9d..ab06a3b4e5 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportButtons.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/TestPlanReportButtons.vue @@ -16,7 +16,7 @@ - + {{'保存'}}