| @@ -8,6 +8,8 @@ import org.springframework.boot.SpringApplication; | |||||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | import org.springframework.boot.autoconfigure.SpringBootApplication; | ||||
| import org.springframework.context.annotation.Bean; | import org.springframework.context.annotation.Bean; | ||||
| import org.springframework.context.annotation.EnableAspectJAutoProxy; | import org.springframework.context.annotation.EnableAspectJAutoProxy; | ||||
| import org.springframework.scheduling.annotation.EnableAsync; | |||||
| import org.springframework.scheduling.annotation.EnableScheduling; | |||||
| import springfox.documentation.swagger2.annotations.EnableSwagger2; | import springfox.documentation.swagger2.annotations.EnableSwagger2; | ||||
| @@ -21,6 +23,8 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; | |||||
| @EnableRocketMQ | @EnableRocketMQ | ||||
| @EnableEncryptableProperties | @EnableEncryptableProperties | ||||
| @EnableAspectJAutoProxy(exposeProxy = true) | @EnableAspectJAutoProxy(exposeProxy = true) | ||||
| @EnableScheduling | |||||
| @EnableAsync | |||||
| public class ScheduleApplication { | public class ScheduleApplication { | ||||
| @Value("${fm.exception}") | @Value("${fm.exception}") | ||||
| @@ -6,14 +6,14 @@ import org.springframework.scheduling.annotation.SchedulingConfigurer; | |||||
| import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; | import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; | ||||
| import org.springframework.scheduling.config.ScheduledTaskRegistrar; | import org.springframework.scheduling.config.ScheduledTaskRegistrar; | ||||
| @Configuration | |||||
| @EnableScheduling | |||||
| public class SchedulingConfig implements SchedulingConfigurer { | |||||
| @Override | |||||
| public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { | |||||
| } | |||||
| } | |||||
| //@Configuration | |||||
| //@EnableScheduling | |||||
| //public class SchedulingConfig implements SchedulingConfigurer { | |||||
| // | |||||
| // @Override | |||||
| // public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { | |||||
| // | |||||
| // | |||||
| // } | |||||
| // | |||||
| //} | |||||
| @@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -47,6 +48,7 @@ public class ActivitySchedule { | |||||
| /** | /** | ||||
| * 每天12点执行 | * 每天12点执行 | ||||
| */ | */ | ||||
| @Async | |||||
| @Scheduled(cron = "0 0 12 * * ?") | @Scheduled(cron = "0 0 12 * * ?") | ||||
| public void sendMsg() { | public void sendMsg() { | ||||
| logger.info("限时活动参与提醒任务启动"); | logger.info("限时活动参与提醒任务启动"); | ||||
| @@ -91,6 +93,7 @@ public class ActivitySchedule { | |||||
| /** | /** | ||||
| * 5分钟一次 | * 5分钟一次 | ||||
| */ | */ | ||||
| @Async | |||||
| @Scheduled(cron = "0 */5 * * * ?") | @Scheduled(cron = "0 */5 * * * ?") | ||||
| public void activityExipred() { | public void activityExipred() { | ||||
| logger.info("活动报名结束任务"); | logger.info("活动报名结束任务"); | ||||
| @@ -11,6 +11,7 @@ import org.apache.commons.collections.map.HashedMap; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -40,6 +41,7 @@ public class BillNotificationSchedule { | |||||
| /** | /** | ||||
| * 每天9点执行 | * 每天9点执行 | ||||
| */ | */ | ||||
| @Async | |||||
| @Scheduled(cron = "0 0 14 * * ?") | @Scheduled(cron = "0 0 14 * * ?") | ||||
| public void sendMsgFromBill() { | public void sendMsgFromBill() { | ||||
| logger.info("账单通知任务启动"); | logger.info("账单通知任务启动"); | ||||
| @@ -8,6 +8,7 @@ import com.iformall.service.WxBillAllService; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -30,6 +31,7 @@ public class BillStatusSchedule { | |||||
| /** | /** | ||||
| * 每天1点执行 | * 每天1点执行 | ||||
| */ | */ | ||||
| @Async | |||||
| @Scheduled(cron = "0 0 1 * * ?") | @Scheduled(cron = "0 0 1 * * ?") | ||||
| public void updateBillStatus() { | public void updateBillStatus() { | ||||
| logger.info("账单状态更新开始"); | logger.info("账单状态更新开始"); | ||||
| @@ -22,6 +22,7 @@ import com.iformall.service.pay.service.cashout.entity.CashOutAdapterResult; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| import org.springframework.transaction.annotation.Propagation; | import org.springframework.transaction.annotation.Propagation; | ||||
| @@ -56,7 +57,8 @@ public class CashOutSchedule { | |||||
| return wxMallMapper.findList(wxMall); | return wxMallMapper.findList(wxMall); | ||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05 | @Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05 | ||||
| public void merchantCountSchedule() { | public void merchantCountSchedule() { | ||||
| List<WxMall> malls = getMalls(); | List<WxMall> malls = getMalls(); | ||||
| @@ -75,6 +77,7 @@ public class CashOutSchedule { | |||||
| } | } | ||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 0 0/6 * * ?") // 执行一次 | @Scheduled(cron = "0 0 0/6 * * ?") // 执行一次 | ||||
| public void cashOutFailSchedule() { | public void cashOutFailSchedule() { | ||||
| List<WxMall> malls = getMalls(); | List<WxMall> malls = getMalls(); | ||||
| @@ -14,6 +14,7 @@ import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -56,6 +57,7 @@ public class ChartDataSchedule { | |||||
| /** | /** | ||||
| * 每天7点执行 | * 每天7点执行 | ||||
| */ | */ | ||||
| @Async | |||||
| @Scheduled(cron = "0 0 7 * * ?") | @Scheduled(cron = "0 0 7 * * ?") | ||||
| public void createData() { | public void createData() { | ||||
| createCarData(); | createCarData(); | ||||
| @@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -37,6 +38,7 @@ public class ContractSchedule { | |||||
| /** | /** | ||||
| * 凌晨5分 | * 凌晨5分 | ||||
| */ | */ | ||||
| @Async | |||||
| @Scheduled(cron = "0 5 0 * * ?") | @Scheduled(cron = "0 5 0 * * ?") | ||||
| public void updateContractStatus() { | public void updateContractStatus() { | ||||
| //更新合同状态,正常到期 | //更新合同状态,正常到期 | ||||
| @@ -10,6 +10,7 @@ import com.iformall.mapper.*; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| import org.springframework.transaction.annotation.Propagation; | import org.springframework.transaction.annotation.Propagation; | ||||
| @@ -46,6 +47,7 @@ public class CouponExpiringSchedule { | |||||
| return wxMallMapper.findList(wxMall); | return wxMallMapper.findList(wxMall); | ||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05 作废过期券,商户禁用券 | @Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05 作废过期券,商户禁用券 | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void couponExpiringSchedule() { | public void couponExpiringSchedule() { | ||||
| @@ -63,6 +65,7 @@ public class CouponExpiringSchedule { | |||||
| } | } | ||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 10 0 * * ?") // 每天凌晨00:10 下架定向发放 | @Scheduled(cron = "0 10 0 * * ?") // 每天凌晨00:10 下架定向发放 | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void couponSendExpiringSchedule() { | public void couponSendExpiringSchedule() { | ||||
| @@ -76,6 +79,7 @@ public class CouponExpiringSchedule { | |||||
| } | } | ||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 10 0 * * ?") // 每天凌晨00:10 下架主动领取 | @Scheduled(cron = "0 10 0 * * ?") // 每天凌晨00:10 下架主动领取 | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void couponChannelExpiringSchedule() { | public void couponChannelExpiringSchedule() { | ||||
| @@ -91,12 +95,14 @@ public class CouponExpiringSchedule { | |||||
| } | } | ||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 15 0 * * ?") // 每天凌晨00:15 下架券广告 | @Scheduled(cron = "0 15 0 * * ?") // 每天凌晨00:15 下架券广告 | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void screenAdExpiringSchedule() { | public void screenAdExpiringSchedule() { | ||||
| wxScreenAdMapper.offScreeAdByCouponChannelStatus(); | wxScreenAdMapper.offScreeAdByCouponChannelStatus(); | ||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 0,1,2,3 0/1 * * ?") // 每小时 0, 1 ,2 ,3 分钟(整点)执行//限时抢购 | @Scheduled(cron = "0 0,1,2,3 0/1 * * ?") // 每小时 0, 1 ,2 ,3 分钟(整点)执行//限时抢购 | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void couponChannel2ExpiringSchedule() { | public void couponChannel2ExpiringSchedule() { | ||||
| @@ -110,6 +116,7 @@ public class CouponExpiringSchedule { | |||||
| } | } | ||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 20 0 * * ?") // 每天凌晨00:20 下架游戏 | @Scheduled(cron = "0 20 0 * * ?") // 每天凌晨00:20 下架游戏 | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void gameExpiringSchedule() { | public void gameExpiringSchedule() { | ||||
| @@ -15,6 +15,7 @@ import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.aop.framework.AopContext; | import org.springframework.aop.framework.AopContext; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| import org.springframework.transaction.annotation.Propagation; | import org.springframework.transaction.annotation.Propagation; | ||||
| @@ -57,7 +58,6 @@ public class CouponOrderExpiringSchedule { | |||||
| return wxMallMapper.findList(wxMall); | return wxMallMapper.findList(wxMall); | ||||
| } | } | ||||
| @Scheduled(cron = "0 0 5 * * ?") // 每天凌晨00:05 | @Scheduled(cron = "0 0 5 * * ?") // 每天凌晨00:05 | ||||
| // @Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | // @Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void couponOrderExpiringSchedule() { | public void couponOrderExpiringSchedule() { | ||||
| @@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -74,7 +75,7 @@ public class CouponSendSchedule { | |||||
| @Autowired | @Autowired | ||||
| private PushLimitService pushLimitService; | private PushLimitService pushLimitService; | ||||
| @Async | |||||
| //@Scheduled(cron = "0 0 6 1 * ?") // 每月1号发放会员的权益券 | //@Scheduled(cron = "0 0 6 1 * ?") // 每月1号发放会员的权益券 | ||||
| @Scheduled(cron = "0 0 6 * * ?") // 测试每天6点发券 | @Scheduled(cron = "0 0 6 * * ?") // 测试每天6点发券 | ||||
| //@Scheduled(cron = "*/30 * * * * ?") // 测试30秒中一次 | //@Scheduled(cron = "*/30 * * * * ?") // 测试30秒中一次 | ||||
| @@ -219,6 +220,7 @@ public class CouponSendSchedule { | |||||
| /** | /** | ||||
| * 生日券发放 | * 生日券发放 | ||||
| */ | */ | ||||
| @Async | |||||
| @Scheduled(cron = "0 30 8 * * ?") // 测试每天8:30点发券 | @Scheduled(cron = "0 30 8 * * ?") // 测试每天8:30点发券 | ||||
| public void birthdayCouponSendSchedule() { | public void birthdayCouponSendSchedule() { | ||||
| logger.info("生日发券: 任务开始"); | logger.info("生日发券: 任务开始"); | ||||
| @@ -9,6 +9,7 @@ import com.iformall.service.WxDateAmountRecordService; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| import org.springframework.transaction.annotation.Propagation; | import org.springframework.transaction.annotation.Propagation; | ||||
| @@ -94,7 +95,7 @@ public class DaliyAmountSchedule { | |||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 0 1 * * ?") // 每天凌晨1点盘点前一天的数据 | @Scheduled(cron = "0 0 1 * * ?") // 每天凌晨1点盘点前一天的数据 | ||||
| //@Scheduled(cron = "0 0 1 * * ?") // 测试10秒中一次 | //@Scheduled(cron = "0 0 1 * * ?") // 测试10秒中一次 | ||||
| public void daliyAmountSchedule() { | public void daliyAmountSchedule() { | ||||
| @@ -10,6 +10,7 @@ import com.iformall.mapper.WxDeviceMapper; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -32,6 +33,7 @@ public class DeviceHbCheckSchedule { | |||||
| @Autowired | @Autowired | ||||
| KwMeterMapper kwMeterMapper; | KwMeterMapper kwMeterMapper; | ||||
| @Async | |||||
| @Scheduled(cron = "0 */5 * * * *?") // 每5分钟检查一次 | @Scheduled(cron = "0 */5 * * * *?") // 每5分钟检查一次 | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void offlineCheckSchedule() { | public void offlineCheckSchedule() { | ||||
| @@ -4,6 +4,7 @@ import com.iformall.mapper.WxCuserFloatingLayerMapper; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -22,6 +23,7 @@ public class FloatingLayerSchedule { | |||||
| /** | /** | ||||
| * 每天23点执行 | * 每天23点执行 | ||||
| */ | */ | ||||
| @Async | |||||
| @Scheduled(cron = "0 0 23 * * ?") | @Scheduled(cron = "0 0 23 * * ?") | ||||
| public void sendMsg() { | public void sendMsg() { | ||||
| logger.info("删除浮层用户数据开始"); | logger.info("删除浮层用户数据开始"); | ||||
| @@ -19,6 +19,7 @@ import org.apache.commons.collections.CollectionUtils; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.core.env.Environment; | import org.springframework.core.env.Environment; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -59,6 +60,7 @@ public class InvestSchedule { | |||||
| private static final String TAG_REMIND = "招商定时任务-提醒"; | private static final String TAG_REMIND = "招商定时任务-提醒"; | ||||
| @Async | |||||
| @Scheduled(cron = "0 0 14 * * ?") // 每天下午两点执行定时任务 | @Scheduled(cron = "0 0 14 * * ?") // 每天下午两点执行定时任务 | ||||
| //@Scheduled(cron = "0 */30 * * * *?") // 测试,每30分钟执行 | //@Scheduled(cron = "0 */30 * * * *?") // 测试,每30分钟执行 | ||||
| public void messageSchedule() { | public void messageSchedule() { | ||||
| @@ -70,6 +72,7 @@ public class InvestSchedule { | |||||
| log.info("{}: 结束", TAG_MESSAGE); | log.info("{}: 结束", TAG_MESSAGE); | ||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 */5 * * * *?") | @Scheduled(cron = "0 */5 * * * *?") | ||||
| public void remindSchedule() { | public void remindSchedule() { | ||||
| log.info("{}: 开始", TAG_REMIND); | log.info("{}: 开始", TAG_REMIND); | ||||
| @@ -5,6 +5,7 @@ import com.iformall.mapper.WxBillRentMapper; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -21,6 +22,7 @@ public class LatePayBillActionSchedule { | |||||
| /** | /** | ||||
| * 每天凌晨1点执行 | * 每天凌晨1点执行 | ||||
| */ | */ | ||||
| @Async | |||||
| @Scheduled(cron = "0 0 1 * * ?") | @Scheduled(cron = "0 0 1 * * ?") | ||||
| public void updateBillStatus() { | public void updateBillStatus() { | ||||
| try { | try { | ||||
| @@ -14,6 +14,7 @@ import com.iformall.utils.DateUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -43,6 +44,7 @@ public class MsgSendingSchedule { | |||||
| /** | /** | ||||
| * 每小时第一分钟执行 | * 每小时第一分钟执行 | ||||
| */ | */ | ||||
| @Async | |||||
| @Scheduled(cron = "0 1 */1 * * ?") | @Scheduled(cron = "0 1 */1 * * ?") | ||||
| public void sendmsgschedule() { | public void sendmsgschedule() { | ||||
| logger.info("sendmsg定时任务启动"); | logger.info("sendmsg定时任务启动"); | ||||
| @@ -11,6 +11,7 @@ import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.aop.framework.AopContext; | import org.springframework.aop.framework.AopContext; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| import org.springframework.transaction.annotation.Propagation; | import org.springframework.transaction.annotation.Propagation; | ||||
| @@ -95,7 +96,6 @@ public class OrderExpiringSchedule { | |||||
| return wxMallMapper.findList(wxMall); | return wxMallMapper.findList(wxMall); | ||||
| } | } | ||||
| @Scheduled(cron = "0 */5 * * * *?") // 每5分钟检查一次 | @Scheduled(cron = "0 */5 * * * *?") // 每5分钟检查一次 | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void orderExpireSchedule() { | public void orderExpireSchedule() { | ||||
| @@ -17,6 +17,7 @@ import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -60,6 +61,7 @@ public class PowerBillAutoBuildSchedule { | |||||
| /** | /** | ||||
| * 每天5点执行 | * 每天5点执行 | ||||
| */ | */ | ||||
| @Async | |||||
| @Scheduled(cron = "0 0 5 * * ?") | @Scheduled(cron = "0 0 5 * * ?") | ||||
| public void powerBillAutoConfigStart() { | public void powerBillAutoConfigStart() { | ||||
| logger.info("自动生成电费账单开始...."); | logger.info("自动生成电费账单开始...."); | ||||
| @@ -15,6 +15,7 @@ import com.iformall.service.WxProfitSharingOrderService; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -40,6 +41,7 @@ public class SharingOrderRedoSchedule { | |||||
| return wxMallMapper.findList(wxMall); | return wxMallMapper.findList(wxMall); | ||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 0 2 * * ?") // 每天凌晨02:00分账重试 | @Scheduled(cron = "0 0 2 * * ?") // 每天凌晨02:00分账重试 | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void sharingOrderResultSchedule() { | public void sharingOrderResultSchedule() { | ||||
| @@ -15,6 +15,7 @@ import com.iformall.service.WxProfitSharingOrderService; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -39,6 +40,7 @@ public class SharingOrderRedoScheduletttttttttttttttttttttttttt { | |||||
| return wxMallMapper.findList(wxMall); | return wxMallMapper.findList(wxMall); | ||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 5 0 * * ?") // 每天凌晨02:00分账重试 | @Scheduled(cron = "0 5 0 * * ?") // 每天凌晨02:00分账重试 | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void sharingOrderResultSchedule() { | public void sharingOrderResultSchedule() { | ||||
| @@ -9,6 +9,7 @@ import com.iformall.service.WxProfitSharingOrderService; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -33,6 +34,7 @@ public class SharingOrderResultSchedule { | |||||
| return wxMallMapper.findList(wxMall); | return wxMallMapper.findList(wxMall); | ||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 15 0 * * ?") // 每天凌晨00:15更新分账结果 | @Scheduled(cron = "0 15 0 * * ?") // 每天凌晨00:15更新分账结果 | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void sharingOrderResultSchedule() { | public void sharingOrderResultSchedule() { | ||||
| @@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -31,6 +32,7 @@ public class SysMonitorSchedule { | |||||
| @Autowired | @Autowired | ||||
| private SysMonitorMapper sysMonitorMapper; | private SysMonitorMapper sysMonitorMapper; | ||||
| @Async | |||||
| @Scheduled(cron = "0 */5 * * * *?") // 每隔5分钟检查一下各个网址 | @Scheduled(cron = "0 */5 * * * *?") // 每隔5分钟检查一下各个网址 | ||||
| public void checkUrls() { | public void checkUrls() { | ||||
| if(isFmMonitor) { | if(isFmMonitor) { | ||||
| @@ -8,6 +8,7 @@ import me.chanjar.weixin.common.error.WxErrorException; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -28,7 +29,7 @@ public class WeChatAccessTokenSchedule { | |||||
| @Autowired | @Autowired | ||||
| MaUtil maUtil; | MaUtil maUtil; | ||||
| @Async | |||||
| @Scheduled(cron = "0 1 * * * ?") // 每小时第一分钟执行 | @Scheduled(cron = "0 1 * * * ?") // 每小时第一分钟执行 | ||||
| public void getAccessTokens() { | public void getAccessTokens() { | ||||
| @@ -15,6 +15,7 @@ import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -48,7 +49,7 @@ public class WxAppVisitSchedule { | |||||
| @Autowired | @Autowired | ||||
| MaUtil maUtil; | MaUtil maUtil; | ||||
| @Async | |||||
| @Scheduled(cron = "0 0 9/1 * * ? ") //早晨9点开始每小时取一次,获取前一日,微信时间为GMT | @Scheduled(cron = "0 0 9/1 * * ? ") //早晨9点开始每小时取一次,获取前一日,微信时间为GMT | ||||
| public void daliyVisitRetrive() { | public void daliyVisitRetrive() { | ||||
| try { | try { | ||||
| @@ -80,7 +81,7 @@ public class WxAppVisitSchedule { | |||||
| } | } | ||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 0 2 * * ? ") //2点做一次补录 | @Scheduled(cron = "0 0 2 * * ? ") //2点做一次补录 | ||||
| public void completeVisitRetrive() { | public void completeVisitRetrive() { | ||||
| try { | try { | ||||
| @@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -34,6 +35,7 @@ public class WxCUserTagsSchedule { | |||||
| @Autowired | @Autowired | ||||
| WxMallService wxMallService; | WxMallService wxMallService; | ||||
| @Async | |||||
| // TODO 先不执行打标签操作了, 数据量太大,导致数据库CPU 100% | // TODO 先不执行打标签操作了, 数据量太大,导致数据库CPU 100% | ||||
| //@Scheduled(cron = "0 0 0 25 * ?") // 每月25日凌晨01:00对会员列表扫描补录标签 | //@Scheduled(cron = "0 0 0 25 * ?") // 每月25日凌晨01:00对会员列表扫描补录标签 | ||||
| @Scheduled(cron = "0 0 2 * * ?") // 测试1分钟一次 | @Scheduled(cron = "0 0 2 * * ?") // 测试1分钟一次 | ||||
| @@ -2,6 +2,7 @@ package com.iformall.schedule; | |||||
| import com.iformall.service.WxMsgRecordService; | import com.iformall.service.WxMsgRecordService; | ||||
| import org.springframework.beans.factory.annotation.Value; | import org.springframework.beans.factory.annotation.Value; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -16,6 +17,7 @@ public class WxMsgRecordSchedule { | |||||
| @Value("${fm.clear_data_before_msg_record}") | @Value("${fm.clear_data_before_msg_record}") | ||||
| private int monthBefore; | private int monthBefore; | ||||
| @Async | |||||
| @Scheduled(cron = "0 0 1 1 * ?") // 每月1日凌晨01:00清理过期的wx_msg_record表 | @Scheduled(cron = "0 0 1 1 * ?") // 每月1日凌晨01:00清理过期的wx_msg_record表 | ||||
| public void clearOldData() { | public void clearOldData() { | ||||
| msgRecordService.clearOldData(monthBefore); | msgRecordService.clearOldData(monthBefore); | ||||