diff --git a/backend/src/main/java/io/metersphere/service/ScheduleService.java b/backend/src/main/java/io/metersphere/service/ScheduleService.java index 8bab658061..1239049e99 100644 --- a/backend/src/main/java/io/metersphere/service/ScheduleService.java +++ b/backend/src/main/java/io/metersphere/service/ScheduleService.java @@ -23,6 +23,7 @@ import io.metersphere.log.utils.ReflexObjectUtil; import io.metersphere.log.vo.DetailColumn; import io.metersphere.log.vo.OperatingLogDetails; import io.metersphere.log.vo.schedule.ScheduleReference; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.quartz.JobKey; import org.quartz.SchedulerException; @@ -91,9 +92,9 @@ public class ScheduleService { return null; } - public List getScheduleByResourceIds(ListresourceIds, String group) { + public List getScheduleByResourceIds(List resourceIds, String group) { ScheduleExample example = new ScheduleExample(); - if(resourceIds.size()==0){ + if (CollectionUtils.isEmpty(resourceIds)) { return new ArrayList<>(); } example.createCriteria().andResourceIdIn(resourceIds).andGroupEqualTo(group); @@ -194,7 +195,7 @@ public class ScheduleService { LogUtil.error(e); MSException.throwException("重置定时任务-删除旧定时任务时出现异常"); } - if(!request.getEnable()){ + if (!request.getEnable()) { return; } try { @@ -315,6 +316,12 @@ public class ScheduleService { clazz = TestPlanTestJob.class; request.setJob(TestPlanTestJob.class.getName()); needResetJob = true; + } else if (ScheduleGroup.SWAGGER_IMPORT.name().equals(request.getGroup())) { + jobKey = SwaggerUrlImportJob.getJobKey(request.getResourceId()); + triggerKey = SwaggerUrlImportJob.getTriggerKey(request.getResourceId()); + clazz = SwaggerUrlImportJob.class; + request.setJob(SwaggerUrlImportJob.class.getName()); + needResetJob = true; } else { //默认为情景 jobKey = ApiScenarioTestJob.getJobKey(request.getResourceId()); diff --git a/frontend/src/business/components/api/homepage/components/ApiRunningTaskList.vue b/frontend/src/business/components/api/homepage/components/ApiRunningTaskList.vue index d5b8327336..b6e91be526 100644 --- a/frontend/src/business/components/api/homepage/components/ApiRunningTaskList.vue +++ b/frontend/src/business/components/api/homepage/components/ApiRunningTaskList.vue @@ -141,7 +141,6 @@ export default { }, updateTask(taskRow) { - this.result = this.$post('/api/schedule/updateEnableByPrimyKey/disable', taskRow, response => { this.search(); });