From 9482b3b220e628f7713ff8ab04575b436ff60ee5 Mon Sep 17 00:00:00 2001 From: weir <1261174789@qq.com> Date: Sun, 25 Jul 2021 18:59:20 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97=202.?= =?UTF-8?q?=E5=9B=9E=E9=80=80=E6=8F=90=E4=BA=A4=E6=B5=8B=E8=AF=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=203.=20=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 7 ++++ .../controller/job/InfJobController.java | 37 ++++--------------- .../src/main/resources/logback-spring.xml | 2 +- 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 318d4cb92..bf5ad821a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,6 +36,13 @@ pipeline { stage('构建') { steps { + // TODO 解决多环境链接、密码不同配置临时方案 + sh 'if [ ! -d "' + "${env.HOME}" + '/resources" ];then\n' + + ' echo "配置文件不存在无需修改"\n' + + 'else\n' + + ' cp -rf /home/pi/resources/*.yaml ' + "${env.APP_NAME}" + '/src/main/resources\n' + + ' echo "配置文件替换"\n' + + 'fi' sh 'mvn clean package -Dmaven.test.skip=true' } } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/infra/controller/job/InfJobController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/infra/controller/job/InfJobController.java index 2fe29304d..1cd3c8dc7 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/infra/controller/job/InfJobController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/infra/controller/job/InfJobController.java @@ -1,25 +1,19 @@ package cn.iocoder.yudao.adminserver.modules.infra.controller.job; -import cn.iocoder.yudao.adminserver.modules.infra.controller.job.vo.job.*; -import cn.iocoder.yudao.adminserver.modules.infra.convert.job.InfJobConvert; -import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.job.InfJobDO; -import cn.iocoder.yudao.adminserver.modules.infra.service.job.InfJobService; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.framework.quartz.core.util.CronUtils; +import cn.iocoder.yudao.adminserver.modules.infra.controller.job.vo.job.*; +import cn.iocoder.yudao.adminserver.modules.infra.convert.job.InfJobConvert; +import cn.iocoder.yudao.adminserver.modules.infra.dal.dataobject.job.InfJobDO; +import cn.iocoder.yudao.adminserver.modules.infra.service.job.InfJobService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; -import org.quartz.Scheduler; import org.quartz.SchedulerException; -import org.quartz.impl.StdScheduler; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor; -import org.springframework.scheduling.config.ScheduledTask; -import org.springframework.scheduling.quartz.SchedulerFactoryBean; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -28,7 +22,10 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; -import java.util.*; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; @@ -42,15 +39,6 @@ public class InfJobController { @Resource private InfJobService jobService; - @Autowired - private SchedulerFactoryBean schedulerFactoryBean; - - @Autowired - private StdScheduler stdScheduler; - - @Autowired - private ScheduledAnnotationBeanPostProcessor scheduledAnnotationBeanPostProcessor; - @PostMapping("/create") @ApiOperation("创建定时任务") @PreAuthorize("@ss.hasPermission('infra:job:create')") @@ -123,15 +111,6 @@ public class InfJobController { @PreAuthorize("@ss.hasPermission('infra:job:query')") public CommonResult> getJobPage(@Valid InfJobPageReqVO pageVO) { PageResult pageResult = jobService.getJobPage(pageVO); - Scheduler scheduler = schedulerFactoryBean.getScheduler(); - Set scheduledTasks = scheduledAnnotationBeanPostProcessor.getScheduledTasks(); - Iterator scheduledTaskIterator = scheduledTasks.iterator(); - while (scheduledTaskIterator.hasNext()) { - System.err.println("================================="); - ScheduledTask scheduledTask = scheduledTaskIterator.next(); - scheduledAnnotationBeanPostProcessor.postProcessAfterInitialization(scheduledTask, scheduledTask.toString()); - System.err.println("================================="); - } return success(InfJobConvert.INSTANCE.convertPage(pageResult)); } diff --git a/yudao-admin-server/src/main/resources/logback-spring.xml b/yudao-admin-server/src/main/resources/logback-spring.xml index 5bc181fd2..8c85ad493 100644 --- a/yudao-admin-server/src/main/resources/logback-spring.xml +++ b/yudao-admin-server/src/main/resources/logback-spring.xml @@ -65,7 +65,7 @@ - +