From 1637dd53cfc9f1439ed49faec457e9023831147f Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 23 Jul 2020 09:57:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=97=B6=E5=88=A0=E9=99=A4=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/api/service/APITestService.java | 1 + .../performance/service/PerformanceTestService.java | 3 +++ .../main/java/io/metersphere/service/ScheduleService.java | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/backend/src/main/java/io/metersphere/api/service/APITestService.java b/backend/src/main/java/io/metersphere/api/service/APITestService.java index 1f7705a64a..1c166238e4 100644 --- a/backend/src/main/java/io/metersphere/api/service/APITestService.java +++ b/backend/src/main/java/io/metersphere/api/service/APITestService.java @@ -140,6 +140,7 @@ public class APITestService { testCaseService.checkIsRelateTest(testId); deleteFileByTestId(testId); apiReportService.deleteByTestId(testId); + scheduleService.deleteByResourceId(testId); apiTestMapper.deleteByPrimaryKey(testId); } diff --git a/backend/src/main/java/io/metersphere/performance/service/PerformanceTestService.java b/backend/src/main/java/io/metersphere/performance/service/PerformanceTestService.java index cd25530458..29c3a51090 100644 --- a/backend/src/main/java/io/metersphere/performance/service/PerformanceTestService.java +++ b/backend/src/main/java/io/metersphere/performance/service/PerformanceTestService.java @@ -100,6 +100,9 @@ public class PerformanceTestService { }); } + //delete schedule + scheduleService.deleteByResourceId(testId); + // delete load_test loadTestMapper.deleteByPrimaryKey(request.getId()); diff --git a/backend/src/main/java/io/metersphere/service/ScheduleService.java b/backend/src/main/java/io/metersphere/service/ScheduleService.java index 4ddb050080..6d9ddc9af4 100644 --- a/backend/src/main/java/io/metersphere/service/ScheduleService.java +++ b/backend/src/main/java/io/metersphere/service/ScheduleService.java @@ -55,6 +55,12 @@ public class ScheduleService { return scheduleMapper.deleteByPrimaryKey(scheduleId); } + public int deleteByResourceId(String resourceId) { + ScheduleExample scheduleExample = new ScheduleExample(); + scheduleExample.createCriteria().andResourceIdEqualTo(resourceId); + return scheduleMapper.deleteByExample(scheduleExample); + } + public List listSchedule() { ScheduleExample example = new ScheduleExample(); return scheduleMapper.selectByExample(example);