|
@@ -1,90 +1,90 @@
|
|
|
-package com.hz.employmentsite.config;
|
|
|
-
|
|
|
-import com.hz.employmentsite.util.CronUtil;
|
|
|
-import org.quartz.*;
|
|
|
-import org.springframework.context.annotation.Bean;
|
|
|
-import org.springframework.context.annotation.Configuration;
|
|
|
-
|
|
|
-@Configuration
|
|
|
-public class QuartzConfig {
|
|
|
- private static final String CREDIT_RECORD_TASK_IDENTITY = "Credit_Record_Quartz";
|
|
|
- private static final String COMPANY_SYNC_TASK_IDENTITY = "Company_Sync_Quartz";
|
|
|
- private static final String POST_SYNC_TASK_IDENTITY = "Post_Sync_Quartz";
|
|
|
- private static final String JOBUSER_SYNC_TASK_IDENTITY = "JobUser_Sync_Quartz";
|
|
|
- private static final String JOBHUNT_SYNC_TASK_IDENTITY = "JobHun_Sync_Quartz";
|
|
|
-
|
|
|
- @Bean
|
|
|
- public JobDetail CreditRecordQuartzDetail() {
|
|
|
- return JobBuilder.newJob(CronUtil.class).withIdentity(CREDIT_RECORD_TASK_IDENTITY).storeDurably().build();
|
|
|
- }
|
|
|
-
|
|
|
- @Bean
|
|
|
- public Trigger CreditRecordQuartzTrigger() {
|
|
|
-
|
|
|
- CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.dailyAtHourAndMinute(0, 5);
|
|
|
- return TriggerBuilder.newTrigger().forJob(CreditRecordQuartzDetail())
|
|
|
- .withIdentity(CREDIT_RECORD_TASK_IDENTITY)
|
|
|
- .withSchedule(scheduleBuilder)
|
|
|
- .build();
|
|
|
- }
|
|
|
-
|
|
|
- @Bean
|
|
|
- public JobDetail CompanySyncQuartzDetail() {
|
|
|
- return JobBuilder.newJob(CronUtil.class).withIdentity(COMPANY_SYNC_TASK_IDENTITY).storeDurably().build();
|
|
|
- }
|
|
|
-
|
|
|
- @Bean
|
|
|
- public Trigger CompanySyncQuartzTrigger() {
|
|
|
-
|
|
|
- CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.dailyAtHourAndMinute(1, 0);
|
|
|
- return TriggerBuilder.newTrigger().forJob(CompanySyncQuartzDetail())
|
|
|
- .withIdentity(COMPANY_SYNC_TASK_IDENTITY)
|
|
|
- .withSchedule(scheduleBuilder)
|
|
|
- .build();
|
|
|
- }
|
|
|
-
|
|
|
- @Bean
|
|
|
- public JobDetail PostSyncQuartzDetail() {
|
|
|
- return JobBuilder.newJob(CronUtil.class).withIdentity(POST_SYNC_TASK_IDENTITY).storeDurably().build();
|
|
|
- }
|
|
|
-
|
|
|
- @Bean
|
|
|
- public Trigger PostSyncQuartzTrigger() {
|
|
|
-
|
|
|
- CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.dailyAtHourAndMinute(2, 0);
|
|
|
- return TriggerBuilder.newTrigger().forJob(PostSyncQuartzDetail())
|
|
|
- .withIdentity(POST_SYNC_TASK_IDENTITY)
|
|
|
- .withSchedule(scheduleBuilder)
|
|
|
- .build();
|
|
|
- }
|
|
|
-
|
|
|
- @Bean
|
|
|
- public JobDetail JobUserSyncQuartzDetail() {
|
|
|
- return JobBuilder.newJob(CronUtil.class).withIdentity(JOBUSER_SYNC_TASK_IDENTITY).storeDurably().build();
|
|
|
- }
|
|
|
-
|
|
|
- @Bean
|
|
|
- public Trigger JobUserSyncQuartzTrigger() {
|
|
|
-
|
|
|
- CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.dailyAtHourAndMinute(3, 0);
|
|
|
- return TriggerBuilder.newTrigger().forJob(JobUserSyncQuartzDetail())
|
|
|
- .withIdentity(JOBUSER_SYNC_TASK_IDENTITY)
|
|
|
- .withSchedule(scheduleBuilder)
|
|
|
- .build();
|
|
|
- }
|
|
|
-
|
|
|
- @Bean
|
|
|
- public JobDetail JobHuntSyncQuartzDetail() {
|
|
|
- return JobBuilder.newJob(CronUtil.class).withIdentity(JOBHUNT_SYNC_TASK_IDENTITY).storeDurably().build();
|
|
|
- }
|
|
|
-
|
|
|
- @Bean
|
|
|
- public Trigger JobHuntSyncQuartzTrigger() {
|
|
|
-
|
|
|
- CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.dailyAtHourAndMinute(4, 0);
|
|
|
- return TriggerBuilder.newTrigger().forJob(JobUserSyncQuartzDetail())
|
|
|
- .withIdentity(JOBHUNT_SYNC_TASK_IDENTITY)
|
|
|
- .withSchedule(scheduleBuilder)
|
|
|
- .build();
|
|
|
- }
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|