From 6f7708e2b14526ca929c8784376c6db912411e30 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 18 Oct 2022 16:40:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E5=85=B3=E9=97=AD=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1018354 --user=陈建星 【测试跟踪】测试计划设置定时任务,首页关闭后继续执行 https://www.tapd.cn/55049933/s/1266270 --- .../io/metersphere/controller/TestPlanController.java | 8 ++++---- .../java/io/metersphere/plan/service/TestPlanService.java | 2 +- .../plan/service/remote/api/PlanApiAutomationService.java | 7 ------- test-track/frontend/src/api/remote/plan/test-plan.js | 4 ++-- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java b/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java index b0a4027524..93f1ade633 100644 --- a/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java +++ b/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java @@ -251,20 +251,20 @@ public class TestPlanController { testPlanService.editReport(testPlanWithBLOBs); } - @PostMapping(value = "/schedule/updateEnableByPrimyKey") + @PostMapping(value = "/schedule/update/enable") public Schedule updateScheduleEnableByPrimyKey(@RequestBody ScheduleInfoRequest request) { Schedule schedule = baseScheduleService.getSchedule(request.getTaskID()); schedule.setEnable(request.isEnable()); - planApiAutomationService.updateSchedule(schedule); + testPlanService.updateSchedule(schedule); return schedule; } - @PostMapping(value = "/schedule/updateEnableByPrimyKey/disable") + @PostMapping(value = "/schedule/update/disable") @SendNotice(taskType = NoticeConstants.TaskType.TRACK_HOME_TASK, event = NoticeConstants.Event.CLOSE_SCHEDULE, subject = "测试跟踪通知") public Schedule disableSchedule(@RequestBody ScheduleInfoRequest request) { Schedule schedule = baseScheduleService.getSchedule(request.getTaskID()); schedule.setEnable(false); - planApiAutomationService.updateSchedule(schedule); + testPlanService.updateSchedule(schedule); return schedule; } diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java index 709bdbf371..a65c5bbe05 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java @@ -1578,7 +1578,7 @@ public class TestPlanService { for (String id : scheduleIds) { Schedule schedule = baseScheduleService.getSchedule(id); schedule.setEnable(request.isEnable()); - planApiAutomationService.updateSchedule(schedule); + updateSchedule(schedule); } } diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/remote/api/PlanApiAutomationService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/remote/api/PlanApiAutomationService.java index fc62226909..fa9d772a36 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/remote/api/PlanApiAutomationService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/remote/api/PlanApiAutomationService.java @@ -1,12 +1,9 @@ package io.metersphere.plan.service.remote.api; import io.metersphere.base.domain.ApiScenarioWithBLOBs; -import io.metersphere.base.domain.Schedule; import io.metersphere.dto.MsExecResponseDTO; import io.metersphere.plan.reuest.api.RunScenarioRequest; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.PathVariable; import java.util.List; @@ -21,10 +18,6 @@ public class PlanApiAutomationService extends ApiTestService { return microService.postForDataArray(serviceName, BASE_UEL + "/plan/run", request, MsExecResponseDTO.class); } - public void updateSchedule(Schedule request) { - microService.postForData(serviceName, BASE_UEL + "/schedule/update", request); - } - public ApiScenarioWithBLOBs get(@PathVariable String id) { return microService.getForData(serviceName, BASE_UEL + "/get/" + id, ApiScenarioWithBLOBs.class); } diff --git a/test-track/frontend/src/api/remote/plan/test-plan.js b/test-track/frontend/src/api/remote/plan/test-plan.js index b8916a1fcd..ba72d5d5d8 100644 --- a/test-track/frontend/src/api/remote/plan/test-plan.js +++ b/test-track/frontend/src/api/remote/plan/test-plan.js @@ -250,11 +250,11 @@ export function getPlanUiScenarioAllCase(planId, param) { } export function updatePlanSchedule(param) { - return post(BASE_URL + 'schedule/updateEnableByPrimyKey/disable', param); + return post(BASE_URL + 'schedule/update/disable', param); } export function updateScheduleEnableByPrimyKey(param) { - return post(BASE_URL + 'schedule/updateEnableByPrimyKey', param); + return post(BASE_URL + 'schedule/update/enable', param); }