From 33d4a429af45250f4e9c1bcf1fa2ce54e276f22f Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Sat, 6 Aug 2022 17:50:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=BD=95?= =?UTF-8?q?=E5=85=A5XXL-JOB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skyeye/sys/quartz/AnnualLeaveStatisticsQuartz.java | 2 -- .../java/com/skyeye/sys/quartz/CalcStaffWaitPayWages.java | 4 ++-- .../main/java/com/skyeye/sys/quartz/CheckWorkQuartz.java | 4 ++-- .../main/java/com/skyeye/sys/quartz/HotForumQuartz.java | 4 ++-- .../com/skyeye/sys/quartz/ShopStoreIntercourseQuartz.java | 4 ++-- .../com/skyeye/sys/quartz/StaffWagesPaymentQuartz.java | 4 ++-- .../main/java/com/skyeye/sys/quartz/StaffWagesQuartz.java | 8 +++++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/AnnualLeaveStatisticsQuartz.java b/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/AnnualLeaveStatisticsQuartz.java index 856c907c..e4f6b93b 100644 --- a/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/AnnualLeaveStatisticsQuartz.java +++ b/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/AnnualLeaveStatisticsQuartz.java @@ -14,7 +14,6 @@ import com.xxl.job.core.handler.annotation.XxlJob; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import org.springframework.util.ObjectUtils; @@ -75,7 +74,6 @@ public class AnnualLeaveStatisticsQuartz { /** * 每个季度的第一天零点开始执行员工年假计算任务 */ - @Scheduled(cron = "0 00 00 1 1,4,7,10 ?") @XxlJob("annualLeaveStatisticsQuartz") public void annualLeaveStatistics() { LOGGER.info("annualLeaveStatistics start."); diff --git a/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/CalcStaffWaitPayWages.java b/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/CalcStaffWaitPayWages.java index 043a8f2d..86b1898b 100644 --- a/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/CalcStaffWaitPayWages.java +++ b/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/CalcStaffWaitPayWages.java @@ -12,10 +12,10 @@ import com.skyeye.eve.rest.checkwork.CheckWorkTimeService; import com.skyeye.eve.service.SysEveUserStaffCapitalService; import com.skyeye.eve.service.WagesStaffMationService; import com.skyeye.wages.constant.WagesConstant; +import com.xxl.job.core.handler.annotation.XxlJob; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.HashMap; @@ -55,7 +55,7 @@ public class CalcStaffWaitPayWages { /** * 定时统计员工待结算其他奖金的数据 凌晨一点半执行 */ - @Scheduled(cron = "0 30 1 * * ?") + @XxlJob("calcStaffWaitPayWages") public void handler() { log.info("定时统计员工待结算薪资的数据定时任务开始执行"); try { diff --git a/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/CheckWorkQuartz.java b/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/CheckWorkQuartz.java index 9203c63c..c1caa9f1 100644 --- a/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/CheckWorkQuartz.java +++ b/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/CheckWorkQuartz.java @@ -14,10 +14,10 @@ import com.skyeye.eve.rest.checkwork.CheckWorkLeaveService; import com.skyeye.eve.rest.checkwork.CheckWorkService; import com.skyeye.eve.rest.checkwork.CheckWorkTimeService; import com.skyeye.eve.service.IScheduleDayService; +import com.xxl.job.core.handler.annotation.XxlJob; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.ArrayList; @@ -54,7 +54,7 @@ public class CheckWorkQuartz { /** * 定时器填充打卡信息,每天凌晨一点执行一次 */ - @Scheduled(cron = "0 0 1 * * ?") + @XxlJob("checkWorkQuartz") public void editCheckWorkMation() { log.info("填充打卡信息定时任务执行"); try { diff --git a/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/HotForumQuartz.java b/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/HotForumQuartz.java index d49dce6c..da789d9f 100644 --- a/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/HotForumQuartz.java +++ b/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/HotForumQuartz.java @@ -10,10 +10,10 @@ import com.skyeye.common.util.DateUtil; import com.skyeye.common.util.ToolUtil; import com.skyeye.eve.dao.MainPageDao; import com.skyeye.jedis.JedisClientService; +import com.xxl.job.core.handler.annotation.XxlJob; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.text.DecimalFormat; @@ -43,7 +43,7 @@ public class HotForumQuartz { /** * 定时器计算每日热门贴 */ - @Scheduled(cron = "0 0 2 * * ?") //每天凌晨两点执行一次 + @XxlJob("hotForumQuartz") public void editHotForumMation() { try { String yestoday = DateAfterSpacePointTime.getSpecifiedTime( diff --git a/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/ShopStoreIntercourseQuartz.java b/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/ShopStoreIntercourseQuartz.java index b581b853..ee0d1a10 100644 --- a/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/ShopStoreIntercourseQuartz.java +++ b/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/ShopStoreIntercourseQuartz.java @@ -14,10 +14,10 @@ import com.skyeye.eve.entity.shop.store.ShopStoreIntercourseMation; import com.skyeye.eve.entity.shop.store.ShopStoreIntercourseMationRest; import com.skyeye.eve.rest.shop.store.ShopStoreService; import com.skyeye.jedis.util.RedisLock; +import com.xxl.job.core.handler.annotation.XxlJob; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; @@ -45,7 +45,7 @@ public class ShopStoreIntercourseQuartz { /** * 定时器计算门店昨日支出/收入往来信息,每天凌晨两点执行一次 */ - @Scheduled(cron = "0 0 2 * * ?") + @XxlJob("shopStoreIntercourseQuartz") public void calcShopStoreIntercourse() { log.info("定时器计算门店昨日支出/收入往来信息执行 start"); RedisLock lock = new RedisLock(LOCK_KEY); diff --git a/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/StaffWagesPaymentQuartz.java b/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/StaffWagesPaymentQuartz.java index cf25348e..0ab8fe8e 100644 --- a/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/StaffWagesPaymentQuartz.java +++ b/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/StaffWagesPaymentQuartz.java @@ -8,10 +8,10 @@ import cn.hutool.json.JSONUtil; import com.skyeye.common.util.DateUtil; import com.skyeye.eve.dao.WagesPaymentHistoryDao; import com.skyeye.jedis.JedisClientService; +import com.xxl.job.core.handler.annotation.XxlJob; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.ArrayList; @@ -46,7 +46,7 @@ public class StaffWagesPaymentQuartz { /** * 定时发放薪资功能,每月15日上午10:15触发 */ - @Scheduled(cron = "0 15 10 15 * ?") + @XxlJob("staffWagesPaymentQuartz") public void staffWagesPayment() { LOGGER.info("staff wagesPayment month is start"); try { diff --git a/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/StaffWagesQuartz.java b/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/StaffWagesQuartz.java index 1cdaf9dd..d1396043 100644 --- a/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/StaffWagesQuartz.java +++ b/skyeye-promote/skyeye-web/src/main/java/com/skyeye/sys/quartz/StaffWagesQuartz.java @@ -15,10 +15,10 @@ import com.skyeye.eve.service.WagesModelService; import com.skyeye.eve.service.WagesStaffMationService; import com.skyeye.jedis.JedisClientService; import com.skyeye.wages.constant.WagesConstant; +import com.xxl.job.core.handler.annotation.XxlJob; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.*; @@ -99,8 +99,10 @@ public class StaffWagesQuartz { */ private static final String IN_STATISTICS_STAFF_REDIS_KEY = "inStatisticsWagesStaff"; - // 每月十号的凌晨两点开始执行薪资统计任务 - @Scheduled(cron = "0 0 2 10 * ?") + /** + * 每月十号的凌晨两点开始执行薪资统计任务 + */ + @XxlJob("staffWagesQuartz") public void statisticsStaffWages() { try { // 获取上个月的年月