wukai пре 1 месец
родитељ
комит
f8627d1f85

+ 2 - 0
jjt-admin/src/main/java/com/jjt/JjtApplication.java

@@ -5,6 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
 
 /**
  * 启动程序
@@ -14,6 +15,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
 @EnableAsync
 @EnableDiscoveryClient
+@EnableScheduling
 public class JjtApplication {
     public static void main(String[] args) {
         // System.setProperty("spring.devtools.restart.enabled", "false");

+ 0 - 1
jjt-biz/src/main/java/com/jjt/ripa/mapper/RipaMetricsAnalyMapper.java

@@ -68,6 +68,5 @@ public interface RipaMetricsAnalyMapper extends BaseMapper<RipaMetricsAnaly>
      * 插入告警记录
      * @param alarmRecord 告警记录
      */
-    @DataSource(value = DataSourceType.SLAVE)
     void insertRipaAlarmRecord(AlarmRecord alarmRecord);
 }

+ 0 - 2
jjt-biz/src/main/java/com/jjt/ripa/mapper/RipaMetricsMapper.java

@@ -71,7 +71,6 @@ public interface RipaMetricsMapper extends BaseMapper<RipaMetrics> {
      * @param objMetrics 指标模型
      * @return 模型指标配置集合
      */
-    @DataSource(value = DataSourceType.SLAVE)
     List<ObjMetrics> selectRiskMetricsList(ObjMetrics objMetrics);
 
     /**
@@ -81,6 +80,5 @@ public interface RipaMetricsMapper extends BaseMapper<RipaMetrics> {
      * @param limit        数据记录数
      * @return 集合
      */
-    @DataSource(value = DataSourceType.SLAVE)
     List<ObjMetricsData> selectDataList(@Param("id") Long objMetricsId, @Param("limit") Long limit);
 }

+ 17 - 0
jjt-biz/src/main/java/com/jjt/ripa/service/impl/RipaMetricsAnalyServiceImpl.java

@@ -15,6 +15,7 @@ import com.jjt.utils.JavaScriptUtil;
 import org.apache.ibatis.session.ExecutorType;
 import org.apache.ibatis.session.SqlSession;
 import org.apache.ibatis.session.SqlSessionFactory;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -202,4 +203,20 @@ public class RipaMetricsAnalyServiceImpl implements IRipaMetricsAnalyService {
         updateRipaMetricsAnaly(vo);
         return result;
     }
+
+    /**
+     * 设置每天晚上2点08分08秒执行一次定时分析任务
+     */
+    @Scheduled(cron = "0 8 02 * * ?")
+    public void scheduled() {
+        System.err.println("开始执行定时任务..." + DateUtils.getNowDate());
+        RipaMetricsAnalyVO vo = new RipaMetricsAnalyVO();
+        vo.setTimeSwitch("Y");
+        List<RipaMetricsAnalyVO> list = selectRipaMetricsAnalyList(vo);
+        for (RipaMetricsAnalyVO ripaMetricsAnaly : list) {
+            if (DateUtils.getNowDate().getTime() - ripaMetricsAnaly.getLastTime().getTime() > ripaMetricsAnaly.getScheduleCycle() * 1000 * 60 * 24) {
+                analy(ripaMetricsAnaly.getAnalyId());
+            }
+        }
+    }
 }

+ 1 - 1
jjt-biz/src/main/java/com/jjt/utils/JavaScriptUtil.java

@@ -28,7 +28,7 @@ public class JavaScriptUtil {
         ScriptEngine engine = manager.getEngineByName("graal.js");
 
         // 替换函数名
-        jsCode = jsCode.replace("function", "let testFun=function");
+        jsCode = "let testFun=" + jsCode;
 
         // 转换所有数组为JavaScript数组
         Object[] jsArrays = new Object[dataArrays.length];

+ 1 - 0
jjt-biz/src/main/resources/mapper/ripa/RipaAlgoMapper.xml

@@ -122,6 +122,7 @@
     </insert>
 
     <update id="updateRipaAlgo" parameterType="RipaAlgo">
+        update ripa_algo
         <trim prefix="SET" suffixOverrides=",">
             <if test="algoName != null">ALGO_NAME =
                 #{algoName},

+ 58 - 58
jjt-quartz/src/main/java/com/jjt/quartz/config/ScheduleConfig.java

@@ -1,58 +1,58 @@
-package com.jjt.quartz.config;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-import org.springframework.scheduling.quartz.SchedulerFactoryBean;
-
-import javax.sql.DataSource;
-import java.util.Properties;
-
-/**
- * 定时任务配置(单机部署建议删除此类和qrtz数据库表,默认走内存会最高效)
- *
- * @author jjt
- */
-@Configuration
-@Profile({"!junit", "!jt"})
-public class ScheduleConfig {
-    @Bean
-    public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) {
-        SchedulerFactoryBean factory = new SchedulerFactoryBean();
-        factory.setDataSource(dataSource);
-
-        // quartz参数
-        Properties prop = new Properties();
-        prop.put("org.quartz.scheduler.instanceName", "JjtScheduler");
-        prop.put("org.quartz.scheduler.instanceId", "AUTO");
-        // 线程池配置
-        prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
-        prop.put("org.quartz.threadPool.threadCount", "20");
-        prop.put("org.quartz.threadPool.threadPriority", "5");
-        // JobStore配置
-        prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore");
-        // 集群配置
-        prop.put("org.quartz.jobStore.isClustered", "true");
-        prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
-        prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "10");
-        prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true");
-
-        // sqlserver 启用
-        // prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
-        prop.put("org.quartz.jobStore.misfireThreshold", "12000");
-        prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
-        factory.setQuartzProperties(prop);
-
-        factory.setSchedulerName("JjtScheduler");
-        // 延时启动
-        factory.setStartupDelay(1);
-        factory.setApplicationContextSchedulerContextKey("applicationContextKey");
-        // 可选,QuartzScheduler
-        // 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
-        factory.setOverwriteExistingJobs(true);
-        // 设置自动启动,默认为true
-        factory.setAutoStartup(true);
-
-        return factory;
-    }
-}
+//package com.jjt.quartz.config;
+//
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.context.annotation.Profile;
+//import org.springframework.scheduling.quartz.SchedulerFactoryBean;
+//
+//import javax.sql.DataSource;
+//import java.util.Properties;
+//
+///**
+// * 定时任务配置(单机部署建议删除此类和qrtz数据库表,默认走内存会最高效)
+// *
+// * @author jjt
+// */
+//@Configuration
+//@Profile({"!junit", "!jt"})
+//public class ScheduleConfig {
+//    @Bean
+//    public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) {
+//        SchedulerFactoryBean factory = new SchedulerFactoryBean();
+//        factory.setDataSource(dataSource);
+//
+//        // quartz参数
+//        Properties prop = new Properties();
+//        prop.put("org.quartz.scheduler.instanceName", "JjtScheduler");
+//        prop.put("org.quartz.scheduler.instanceId", "AUTO");
+//        // 线程池配置
+//        prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
+//        prop.put("org.quartz.threadPool.threadCount", "20");
+//        prop.put("org.quartz.threadPool.threadPriority", "5");
+//        // JobStore配置
+//        prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore");
+//        // 集群配置
+//        prop.put("org.quartz.jobStore.isClustered", "true");
+//        prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
+//        prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "10");
+//        prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true");
+//
+//        // sqlserver 启用
+//        // prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
+//        prop.put("org.quartz.jobStore.misfireThreshold", "12000");
+//        prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
+//        factory.setQuartzProperties(prop);
+//
+//        factory.setSchedulerName("JjtScheduler");
+//        // 延时启动
+//        factory.setStartupDelay(1);
+//        factory.setApplicationContextSchedulerContextKey("applicationContextKey");
+//        // 可选,QuartzScheduler
+//        // 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
+//        factory.setOverwriteExistingJobs(true);
+//        // 设置自动启动,默认为true
+//        factory.setAutoStartup(true);
+//
+//        return factory;
+//    }
+//}

+ 148 - 148
jjt-quartz/src/main/java/com/jjt/quartz/controller/SysJobController.java

@@ -1,148 +1,148 @@
-package com.jjt.quartz.controller;
-
-import com.jjt.common.annotation.Log;
-import com.jjt.common.constant.Constants;
-import com.jjt.common.core.controller.BaseController;
-import com.jjt.common.core.domain.AjaxResult;
-import com.jjt.common.core.page.TableDataInfo;
-import com.jjt.common.enums.BusinessType;
-import com.jjt.common.exception.job.TaskException;
-import com.jjt.common.utils.StringUtils;
-import com.jjt.common.utils.poi.ExcelUtil;
-import com.jjt.quartz.domain.SysJob;
-import com.jjt.quartz.service.ISysJobService;
-import com.jjt.quartz.util.CronUtils;
-import com.jjt.quartz.util.ScheduleUtils;
-import org.quartz.SchedulerException;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
-
-/**
- * 调度任务信息操作处理
- *
- * @author jjt
- */
-@RestController
-@RequestMapping("/monitor/job")
-public class SysJobController extends BaseController {
-    @Resource
-    private ISysJobService jobService;
-
-    /**
-     * 查询定时任务列表
-     */
-    //@PreAuthorize("@ss.hasPermi('monitor:job:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(SysJob sysJob) {
-        startPage();
-        List<SysJob> list = jobService.selectJobList(sysJob);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出定时任务列表
-     */
-    //@PreAuthorize("@ss.hasPermi('monitor:job:export')")
-    @Log(title = "定时任务", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, SysJob sysJob) {
-        List<SysJob> list = jobService.selectJobList(sysJob);
-        ExcelUtil<SysJob> util = new ExcelUtil<SysJob>(SysJob.class);
-        util.exportExcel(response, list, "定时任务");
-    }
-
-    /**
-     * 获取定时任务详细信息
-     */
-    //@PreAuthorize("@ss.hasPermi('monitor:job:query')")
-    @GetMapping(value = "/detail")
-    public AjaxResult getInfo(Long jobId) {
-        return success(jobService.selectJobById(jobId));
-    }
-
-    /**
-     * 新增定时任务
-     */
-    //@PreAuthorize("@ss.hasPermi('monitor:job:add')")
-    @Log(title = "定时任务", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody SysJob job) throws SchedulerException, TaskException {
-        if (!CronUtils.isValid(job.getCronExpression())) {
-            return error("新增任务'" + job.getJobName() + "'失败,Cron表达式不正确");
-        } else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) {
-            return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi'调用");
-        } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[]{Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS})) {
-            return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap(s)'调用");
-        } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[]{Constants.HTTP, Constants.HTTPS})) {
-            return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)'调用");
-        } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) {
-            return error("新增任务'" + job.getJobName() + "'失败,目标字符串存在违规");
-        } else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) {
-            return error("新增任务'" + job.getJobName() + "'失败,目标字符串不在白名单内");
-        }
-        job.setCreateBy("admin");
-        return toAjax(jobService.insertJob(job));
-    }
-
-    /**
-     * 修改定时任务
-     */
-    //@PreAuthorize("@ss.hasPermi('monitor:job:edit')")
-    @Log(title = "定时任务", businessType = BusinessType.UPDATE)
-    @PostMapping("/edit")
-   public AjaxResult edit(@RequestBody SysJob job) throws SchedulerException, TaskException {
-        if (!CronUtils.isValid(job.getCronExpression())) {
-            return error("修改任务'" + job.getJobName() + "'失败,Cron表达式不正确");
-        } else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) {
-            return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi'调用");
-        } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[]{Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS})) {
-            return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap(s)'调用");
-        } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[]{Constants.HTTP, Constants.HTTPS})) {
-            return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)'调用");
-        } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) {
-            return error("修改任务'" + job.getJobName() + "'失败,目标字符串存在违规");
-        } else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) {
-            return error("修改任务'" + job.getJobName() + "'失败,目标字符串不在白名单内");
-        }
-        job.setUpdateBy("admin");
-        return toAjax(jobService.updateJob(job));
-    }
-
-    /**
-     * 定时任务状态修改
-     */
-    //@PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')")
-    @Log(title = "定时任务", businessType = BusinessType.UPDATE)
-    @PostMapping("/changeStatus")
-    public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException {
-        SysJob newJob = jobService.selectJobById(job.getJobId());
-        newJob.setStatus(job.getStatus());
-        return toAjax(jobService.changeStatus(newJob));
-    }
-
-    /**
-     * 定时任务立即执行一次
-     */
-    //@PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')")
-    @Log(title = "定时任务", businessType = BusinessType.UPDATE)
-    @PostMapping("/run")
-    public AjaxResult run(@RequestBody SysJob job) throws SchedulerException {
-        boolean result = jobService.run(job);
-        return result ? success() : error("任务不存在或已过期!");
-    }
-
-    /**
-     * 删除定时任务
-     */
-    //@PreAuthorize("@ss.hasPermi('monitor:job:remove')")
-    @Log(title = "定时任务", businessType = BusinessType.DELETE)
-    @GetMapping("/del")
-    public AjaxResult remove(Long[] jobIds) throws SchedulerException, TaskException {
-        jobService.deleteJobByIds(jobIds);
-        return success();
-    }
-}
+//package com.jjt.quartz.controller;
+//
+//import com.jjt.common.annotation.Log;
+//import com.jjt.common.constant.Constants;
+//import com.jjt.common.core.controller.BaseController;
+//import com.jjt.common.core.domain.AjaxResult;
+//import com.jjt.common.core.page.TableDataInfo;
+//import com.jjt.common.enums.BusinessType;
+//import com.jjt.common.exception.job.TaskException;
+//import com.jjt.common.utils.StringUtils;
+//import com.jjt.common.utils.poi.ExcelUtil;
+//import com.jjt.quartz.domain.SysJob;
+//import com.jjt.quartz.service.ISysJobService;
+//import com.jjt.quartz.util.CronUtils;
+//import com.jjt.quartz.util.ScheduleUtils;
+//import org.quartz.SchedulerException;
+//import org.springframework.security.access.prepost.PreAuthorize;
+//import org.springframework.web.bind.annotation.*;
+//
+//import javax.annotation.Resource;
+//import javax.servlet.http.HttpServletResponse;
+//import java.util.List;
+//
+///**
+// * 调度任务信息操作处理
+// *
+// * @author jjt
+// */
+//@RestController
+//@RequestMapping("/monitor/job")
+//public class SysJobController extends BaseController {
+//    @Resource
+//    private ISysJobService jobService;
+//
+//    /**
+//     * 查询定时任务列表
+//     */
+//    //@PreAuthorize("@ss.hasPermi('monitor:job:list')")
+//    @GetMapping("/list")
+//    public TableDataInfo list(SysJob sysJob) {
+//        startPage();
+//        List<SysJob> list = jobService.selectJobList(sysJob);
+//        return getDataTable(list);
+//    }
+//
+//    /**
+//     * 导出定时任务列表
+//     */
+//    //@PreAuthorize("@ss.hasPermi('monitor:job:export')")
+//    @Log(title = "定时任务", businessType = BusinessType.EXPORT)
+//    @PostMapping("/export")
+//    public void export(HttpServletResponse response, SysJob sysJob) {
+//        List<SysJob> list = jobService.selectJobList(sysJob);
+//        ExcelUtil<SysJob> util = new ExcelUtil<SysJob>(SysJob.class);
+//        util.exportExcel(response, list, "定时任务");
+//    }
+//
+//    /**
+//     * 获取定时任务详细信息
+//     */
+//    //@PreAuthorize("@ss.hasPermi('monitor:job:query')")
+//    @GetMapping(value = "/detail")
+//    public AjaxResult getInfo(Long jobId) {
+//        return success(jobService.selectJobById(jobId));
+//    }
+//
+//    /**
+//     * 新增定时任务
+//     */
+//    //@PreAuthorize("@ss.hasPermi('monitor:job:add')")
+//    @Log(title = "定时任务", businessType = BusinessType.INSERT)
+//    @PostMapping
+//    public AjaxResult add(@RequestBody SysJob job) throws SchedulerException, TaskException {
+//        if (!CronUtils.isValid(job.getCronExpression())) {
+//            return error("新增任务'" + job.getJobName() + "'失败,Cron表达式不正确");
+//        } else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) {
+//            return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi'调用");
+//        } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[]{Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS})) {
+//            return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap(s)'调用");
+//        } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[]{Constants.HTTP, Constants.HTTPS})) {
+//            return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)'调用");
+//        } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) {
+//            return error("新增任务'" + job.getJobName() + "'失败,目标字符串存在违规");
+//        } else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) {
+//            return error("新增任务'" + job.getJobName() + "'失败,目标字符串不在白名单内");
+//        }
+//        job.setCreateBy("admin");
+//        return toAjax(jobService.insertJob(job));
+//    }
+//
+//    /**
+//     * 修改定时任务
+//     */
+//    //@PreAuthorize("@ss.hasPermi('monitor:job:edit')")
+//    @Log(title = "定时任务", businessType = BusinessType.UPDATE)
+//    @PostMapping("/edit")
+//   public AjaxResult edit(@RequestBody SysJob job) throws SchedulerException, TaskException {
+//        if (!CronUtils.isValid(job.getCronExpression())) {
+//            return error("修改任务'" + job.getJobName() + "'失败,Cron表达式不正确");
+//        } else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) {
+//            return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi'调用");
+//        } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[]{Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS})) {
+//            return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap(s)'调用");
+//        } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[]{Constants.HTTP, Constants.HTTPS})) {
+//            return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)'调用");
+//        } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) {
+//            return error("修改任务'" + job.getJobName() + "'失败,目标字符串存在违规");
+//        } else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) {
+//            return error("修改任务'" + job.getJobName() + "'失败,目标字符串不在白名单内");
+//        }
+//        job.setUpdateBy("admin");
+//        return toAjax(jobService.updateJob(job));
+//    }
+//
+//    /**
+//     * 定时任务状态修改
+//     */
+//    //@PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')")
+//    @Log(title = "定时任务", businessType = BusinessType.UPDATE)
+//    @PostMapping("/changeStatus")
+//    public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException {
+//        SysJob newJob = jobService.selectJobById(job.getJobId());
+//        newJob.setStatus(job.getStatus());
+//        return toAjax(jobService.changeStatus(newJob));
+//    }
+//
+//    /**
+//     * 定时任务立即执行一次
+//     */
+//    //@PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')")
+//    @Log(title = "定时任务", businessType = BusinessType.UPDATE)
+//    @PostMapping("/run")
+//    public AjaxResult run(@RequestBody SysJob job) throws SchedulerException {
+//        boolean result = jobService.run(job);
+//        return result ? success() : error("任务不存在或已过期!");
+//    }
+//
+//    /**
+//     * 删除定时任务
+//     */
+//    //@PreAuthorize("@ss.hasPermi('monitor:job:remove')")
+//    @Log(title = "定时任务", businessType = BusinessType.DELETE)
+//    @GetMapping("/del")
+//    public AjaxResult remove(Long[] jobIds) throws SchedulerException, TaskException {
+//        jobService.deleteJobByIds(jobIds);
+//        return success();
+//    }
+//}

+ 82 - 82
jjt-quartz/src/main/java/com/jjt/quartz/controller/SysJobLogController.java

@@ -1,82 +1,82 @@
-package com.jjt.quartz.controller;
-
-import com.jjt.common.annotation.Log;
-import com.jjt.common.core.controller.BaseController;
-import com.jjt.common.core.domain.AjaxResult;
-import com.jjt.common.core.page.TableDataInfo;
-import com.jjt.common.enums.BusinessType;
-import com.jjt.common.utils.poi.ExcelUtil;
-import com.jjt.quartz.domain.SysJobLog;
-import com.jjt.quartz.service.ISysJobLogService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
-
-/**
- * 调度日志操作处理
- *
- * @author jjt
- */
-@RestController
-@RequestMapping("/monitor/jobLog")
-public class SysJobLogController extends BaseController {
-    @Resource
-    private ISysJobLogService jobLogService;
-
-    /**
-     * 查询定时任务调度日志列表
-     */
-    //@PreAuthorize("@ss.hasPermi('monitor:job:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(SysJobLog sysJobLog) {
-        startPage();
-        List<SysJobLog> list = jobLogService.selectJobLogList(sysJobLog);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出定时任务调度日志列表
-     */
-    //@PreAuthorize("@ss.hasPermi('monitor:job:export')")
-    @Log(title = "任务调度日志", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, SysJobLog sysJobLog) {
-        List<SysJobLog> list = jobLogService.selectJobLogList(sysJobLog);
-        ExcelUtil<SysJobLog> util = new ExcelUtil<SysJobLog>(SysJobLog.class);
-        util.exportExcel(response, list, "调度日志");
-    }
-
-    /**
-     * 根据调度编号获取详细信息
-     */
-    //@PreAuthorize("@ss.hasPermi('monitor:job:query')")
-    @GetMapping(value = "/{jobLogId}")
-    public AjaxResult getInfo(@PathVariable Long jobLogId) {
-        return success(jobLogService.selectJobLogById(jobLogId));
-    }
-
-
-    /**
-     * 删除定时任务调度日志
-     */
-    //@PreAuthorize("@ss.hasPermi('monitor:job:remove')")
-    @Log(title = "定时任务调度日志", businessType = BusinessType.DELETE)
-    @GetMapping("/del/{jobLogIds}")
-    public AjaxResult remove(@PathVariable Long[] jobLogIds) {
-        return toAjax(jobLogService.deleteJobLogByIds(jobLogIds));
-    }
-
-    /**
-     * 清空定时任务调度日志
-     */
-    //@PreAuthorize("@ss.hasPermi('monitor:job:remove')")
-    @Log(title = "调度日志", businessType = BusinessType.CLEAN)
-    @GetMapping("/clean")
-    public AjaxResult clean() {
-        jobLogService.cleanJobLog();
-        return success();
-    }
-}
+//package com.jjt.quartz.controller;
+//
+//import com.jjt.common.annotation.Log;
+//import com.jjt.common.core.controller.BaseController;
+//import com.jjt.common.core.domain.AjaxResult;
+//import com.jjt.common.core.page.TableDataInfo;
+//import com.jjt.common.enums.BusinessType;
+//import com.jjt.common.utils.poi.ExcelUtil;
+//import com.jjt.quartz.domain.SysJobLog;
+//import com.jjt.quartz.service.ISysJobLogService;
+//import org.springframework.security.access.prepost.PreAuthorize;
+//import org.springframework.web.bind.annotation.*;
+//
+//import javax.annotation.Resource;
+//import javax.servlet.http.HttpServletResponse;
+//import java.util.List;
+//
+///**
+// * 调度日志操作处理
+// *
+// * @author jjt
+// */
+//@RestController
+//@RequestMapping("/monitor/jobLog")
+//public class SysJobLogController extends BaseController {
+//    @Resource
+//    private ISysJobLogService jobLogService;
+//
+//    /**
+//     * 查询定时任务调度日志列表
+//     */
+//    //@PreAuthorize("@ss.hasPermi('monitor:job:list')")
+//    @GetMapping("/list")
+//    public TableDataInfo list(SysJobLog sysJobLog) {
+//        startPage();
+//        List<SysJobLog> list = jobLogService.selectJobLogList(sysJobLog);
+//        return getDataTable(list);
+//    }
+//
+//    /**
+//     * 导出定时任务调度日志列表
+//     */
+//    //@PreAuthorize("@ss.hasPermi('monitor:job:export')")
+//    @Log(title = "任务调度日志", businessType = BusinessType.EXPORT)
+//    @PostMapping("/export")
+//    public void export(HttpServletResponse response, SysJobLog sysJobLog) {
+//        List<SysJobLog> list = jobLogService.selectJobLogList(sysJobLog);
+//        ExcelUtil<SysJobLog> util = new ExcelUtil<SysJobLog>(SysJobLog.class);
+//        util.exportExcel(response, list, "调度日志");
+//    }
+//
+//    /**
+//     * 根据调度编号获取详细信息
+//     */
+//    //@PreAuthorize("@ss.hasPermi('monitor:job:query')")
+//    @GetMapping(value = "/{jobLogId}")
+//    public AjaxResult getInfo(@PathVariable Long jobLogId) {
+//        return success(jobLogService.selectJobLogById(jobLogId));
+//    }
+//
+//
+//    /**
+//     * 删除定时任务调度日志
+//     */
+//    //@PreAuthorize("@ss.hasPermi('monitor:job:remove')")
+//    @Log(title = "定时任务调度日志", businessType = BusinessType.DELETE)
+//    @GetMapping("/del/{jobLogIds}")
+//    public AjaxResult remove(@PathVariable Long[] jobLogIds) {
+//        return toAjax(jobLogService.deleteJobLogByIds(jobLogIds));
+//    }
+//
+//    /**
+//     * 清空定时任务调度日志
+//     */
+//    //@PreAuthorize("@ss.hasPermi('monitor:job:remove')")
+//    @Log(title = "调度日志", businessType = BusinessType.CLEAN)
+//    @GetMapping("/clean")
+//    public AjaxResult clean() {
+//        jobLogService.cleanJobLog();
+//        return success();
+//    }
+//}

+ 1 - 1
jjt-quartz/src/main/java/com/jjt/quartz/service/impl/SysJobLogServiceImpl.java

@@ -13,7 +13,7 @@ import java.util.List;
  *
  * @author jjt
  */
-@Service
+//@Service
 public class SysJobLogServiceImpl implements ISysJobLogService {
     @Resource
     private SysJobLogMapper jobLogMapper;

+ 1 - 1
jjt-quartz/src/main/java/com/jjt/quartz/service/impl/SysJobServiceImpl.java

@@ -23,7 +23,7 @@ import java.util.List;
  *
  * @author jjt
  */
-@Service
+//@Service
 public class SysJobServiceImpl implements ISysJobService {
     @Resource
     private Scheduler scheduler;