From d220cb5992b4b81bae53a38a06aa50f0bcf460d2 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Thu, 26 Aug 2021 11:47:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E6=8A=A5=E5=91=8A=E7=9A=84=E5=BC=80=E5=A7=8B=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=8F=96=E5=80=BC=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复测试计划执行报告的开始时间取值错误的问题 --- .../io/metersphere/track/service/TestPlanReportService.java | 3 +++ .../java/io/metersphere/track/service/TestPlanService.java | 1 - .../api/definition/components/EditCompleteContainer.vue | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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 7995a92d43..91c009d528 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java @@ -558,6 +558,9 @@ public class TestPlanReportService { testPlanLog.info("ReportId[" + testPlanReport.getId() + "] COUNT OVER. COUNT RESULT :" + JSONObject.toJSONString(testPlanExecuteResult)); TestPlanSimpleReportDTO reportDTO = testPlanService.buildPlanReport(executeInfo, testPlanReport.getTestPlanId(),false); + //更新执行时间 + reportDTO.setStartTime(testPlanReport.getStartTime()); + reportDTO.setEndTime(System.currentTimeMillis()); testPlanReportContentMapper.updateByPrimaryKeySelective(parseReportDaoToReportContent(reportDTO, reportContent)); String testPlanStatus = this.getTestPlanReportStatus(testPlanReport, reportDTO); 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 637294ad1d..e4673922a0 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -1646,7 +1646,6 @@ public class TestPlanService { buildApiReport(report, config, executeInfo, planId, saveResponse); buildLoadReport(report, config, executeInfo, planId, saveResponse); - report.setEndTime(System.currentTimeMillis()); return report; }else { return null; diff --git a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue index fecaf8749c..fc1aa4fef7 100644 --- a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue +++ b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue @@ -155,7 +155,7 @@ export default { }, created() { this.refreshButtonActiveClass(this.activeDom); - if (this.currentApi.id !== null && (this.currentProtocol === "HTTP" || this.currentProtocol === "TCP")) { + if (this.currentApi.id && (this.currentProtocol === "HTTP" || this.currentProtocol === "TCP")) { this.mockSetting(); } },