diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java index ae59a0e3c2..f446743e5e 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanReportController.java @@ -93,6 +93,7 @@ public class TestPlanReportController { String reportId = UUID.randomUUID().toString(); TestPlanReportSaveRequest saveRequest = new TestPlanReportSaveRequest(reportId, planId, userId, triggerMode); TestPlanScheduleReportInfoDTO report = testPlanReportService.genTestPlanReport(saveRequest); + testPlanReportService.genTestPlanReportContent(report); testPlanReportService.countReportByTestPlanReportId(report.getTestPlanReport().getId(), null, triggerMode); return "success"; } diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java index 9c0dfeb60b..18f4310147 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java @@ -222,6 +222,19 @@ public class TestPlanReportService { return returnDTO; } + public void genTestPlanReportContent(TestPlanScheduleReportInfoDTO returnDTO) { + TestPlanReportContentWithBLOBs testPlanReportContent = new TestPlanReportContentWithBLOBs(); + testPlanReportContent.setId(UUID.randomUUID().toString()); + testPlanReportContent.setTestPlanReportId(returnDTO.getTestPlanReport().getId()); + if (testPlanReportContent.getStartTime() == null) { + testPlanReportContent.setStartTime(System.currentTimeMillis()); + } + if (testPlanReportContent.getEndTime() == null) { + testPlanReportContent.setEndTime(System.currentTimeMillis()); + } + testPlanReportContentMapper.insert(testPlanReportContent); + } + public TestPlanReportDTO getMetric(String reportId) { TestPlanReportDTO returnDTO = new TestPlanReportDTO(); TestPlanReport report = testPlanReportMapper.selectByPrimaryKey(reportId);