From 4b036fa8c387564f6a2d9bcc8bab62e45d6e3205 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 13 Sep 2022 18:44:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=A6=96=E9=A1=B5=E5=81=9C=E6=AD=A2=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001016708 --- .../io/metersphere/service/ScheduleService.java | 13 ++++++++++--- .../api/homepage/components/ApiRunningTaskList.vue | 1 - 2 files changed, 10 insertions(+), 4 deletions(-) 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(); });