From 8d52c00e9c984264f8d3e072fa782b2de218ba7f Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Mon, 17 Jun 2024 15:24:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E6=89=A7=E8=A1=8C=E7=8A=B6=E6=80=81=E6=9C=AA?= =?UTF-8?q?=E5=8F=8A=E6=97=B6=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/plan/mapper/ExtTestPlanReportMapper.java | 2 +- .../io/metersphere/plan/mapper/ExtTestPlanReportMapper.xml | 4 ++-- .../io/metersphere/plan/service/TestPlanExecuteService.java | 4 ++-- .../io/metersphere/plan/service/TestPlanReportService.java | 6 ++++++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.java index 891ab9d122..6a6198d884 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.java @@ -60,5 +60,5 @@ public interface ExtTestPlanReportMapper { List getScenarioReports(@Param("ids") List ids); - void batchUpdateExecuteTime(@Param("startTime") long startTime,@Param("ids")List ids); + void batchUpdateExecuteTimeAndStatus(@Param("startTime") long startTime,@Param("ids")List ids); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.xml index c573851315..60ae10d192 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportMapper.xml @@ -217,9 +217,9 @@ - + update test_plan_report - set start_time = #{startTime} + set start_time = #{startTime}, exec_status = 'RUNNING' where id in #{id} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java index 52fe4a0446..21c70db800 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java @@ -253,7 +253,7 @@ public class TestPlanExecuteService { this.setRedisForList(genQueueKey(queueId, queueType), childrenQueue.stream().map(JSON::toJSONString).toList()); // 更新报告的执行时间 - extTestPlanReportMapper.batchUpdateExecuteTime(System.currentTimeMillis(), reportMap.values().stream().toList()); + extTestPlanReportMapper.batchUpdateExecuteTimeAndStatus(System.currentTimeMillis(), reportMap.values().stream().toList()); if (StringUtils.equalsIgnoreCase(executionQueue.getRunMode(), ApiBatchRunMode.SERIAL.name())) { //串行 @@ -271,7 +271,7 @@ public class TestPlanExecuteService { } else { Map reportMap = testPlanReportService.genReportByExecution(executionQueue.getPrepareReportId(), genReportRequest, executionQueue.getCreateUser()); executionQueue.setPrepareReportId(reportMap.get(executionQueue.getSourceID())); - extTestPlanReportMapper.batchUpdateExecuteTime(System.currentTimeMillis(), reportMap.values().stream().toList()); + extTestPlanReportMapper.batchUpdateExecuteTimeAndStatus(System.currentTimeMillis(), reportMap.values().stream().toList()); this.executeTestPlan(executionQueue); return executionQueue.getPrepareReportId(); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java index 893e427f05..a6ff30df27 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java @@ -480,6 +480,12 @@ public class TestPlanReportService { testPlanReportMapper.updateByPrimaryKeySelective(planReport); } + + /** + * 获取报告 + * @param reportId 报告ID + * @return 报告详情 + */ public TestPlanReport selectById(String reportId) { return testPlanReportMapper.selectByPrimaryKey(reportId); }