fix: 删除测试时删除定时任务

This commit is contained in:
chenjianxing 2020-07-23 09:57:44 +08:00
parent 0b03cd128f
commit 1637dd53cf
3 changed files with 10 additions and 0 deletions

View File

@ -140,6 +140,7 @@ public class APITestService {
testCaseService.checkIsRelateTest(testId); testCaseService.checkIsRelateTest(testId);
deleteFileByTestId(testId); deleteFileByTestId(testId);
apiReportService.deleteByTestId(testId); apiReportService.deleteByTestId(testId);
scheduleService.deleteByResourceId(testId);
apiTestMapper.deleteByPrimaryKey(testId); apiTestMapper.deleteByPrimaryKey(testId);
} }

View File

@ -100,6 +100,9 @@ public class PerformanceTestService {
}); });
} }
//delete schedule
scheduleService.deleteByResourceId(testId);
// delete load_test // delete load_test
loadTestMapper.deleteByPrimaryKey(request.getId()); loadTestMapper.deleteByPrimaryKey(request.getId());

View File

@ -55,6 +55,12 @@ public class ScheduleService {
return scheduleMapper.deleteByPrimaryKey(scheduleId); return scheduleMapper.deleteByPrimaryKey(scheduleId);
} }
public int deleteByResourceId(String resourceId) {
ScheduleExample scheduleExample = new ScheduleExample();
scheduleExample.createCriteria().andResourceIdEqualTo(resourceId);
return scheduleMapper.deleteByExample(scheduleExample);
}
public List<Schedule> listSchedule() { public List<Schedule> listSchedule() {
ScheduleExample example = new ScheduleExample(); ScheduleExample example = new ScheduleExample();
return scheduleMapper.selectByExample(example); return scheduleMapper.selectByExample(example);