jiangping
2025-02-27 10c28ce3d0b384584c77ce9111a66a0641250752
server/system_service/src/main/java/com/doumee/dao/timer/scheduler/QuartzManage.java
@@ -41,9 +41,11 @@
    public CronTrigger getCronTrigger (Integer jobId){
        try {
            return (CronTrigger) this.scheduler.getTrigger(getTriggerKey(jobId)) ;
        } catch (SchedulerException e){
            throw new RuntimeException("getCronTrigger Fail",e) ;
        }catch (Exception e){
            e.printStackTrace();
//            throw new RuntimeException("createJob Fail",e) ;
        }
        return null;
    }
    /**
@@ -69,8 +71,9 @@
            scheduler.scheduleJob(jobDetail,trigger) ;
            // 状态校验
            checkStop(quartzJob) ;
        } catch (SchedulerException e){
            throw new RuntimeException("createJob Fail",e) ;
        } catch (Exception e){
            e.printStackTrace();
//            throw new RuntimeException("createJob Fail",e) ;
        }
    }
@@ -93,8 +96,9 @@
            scheduler.rescheduleJob(triggerKey, trigger);
            // 状态校验
            checkStop(quartzJob) ;
        } catch (SchedulerException e) {
            throw new RuntimeException("updateJob Fail",e) ;
        }catch (Exception e){
            e.printStackTrace();
//            throw new RuntimeException("createJob Fail",e) ;
        }
    }
@@ -128,8 +132,9 @@
            JobDataMap dataMap = new JobDataMap() ;
            dataMap.put(QuartzJob.JOB_PARAM_KEY,quartzJob);
            this.scheduler.triggerJob(getJobKey(quartzJob.getId()),dataMap);
        } catch (SchedulerException e){
            throw new RuntimeException("run Fail",e) ;
        } catch (Exception e){
            e.printStackTrace();
//            throw new RuntimeException("createJob Fail",e) ;
        }
    }
@@ -141,8 +146,9 @@
            if(quartzJob.getState() != JobState.JOB_RUN.getStatus()){
                this.scheduler.pauseJob(getJobKey(quartzJob.getId()));
            }
        } catch (SchedulerException e){
            throw new RuntimeException("pauseJob Fail",e) ;
        } catch (Exception e){
            e.printStackTrace();
//            throw new RuntimeException("createJob Fail",e) ;
        }
    }