Files
intc-cloud/ruoyi-modules/intc-invest/src/main/java/com/ruoyi/task/CampusIMTTask.java
2024-12-07 16:46:33 +08:00

81 lines
1.9 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.ruoyi.task;
import com.ruoyi.invest.service.IMTService;
import com.ruoyi.invest.service.IUserService;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
/**
* i茅台定时任务
*/
@Configuration
@EnableScheduling
@RequiredArgsConstructor
public class CampusIMTTask {
private static final Logger logger = LoggerFactory.getLogger(CampusIMTTask.class);
private final IMTService imtService;
private final IUserService iUserService;
/**
* 110 批量修改用户随机预约的时间
*/
@Async
@Scheduled(cron = "0 10 1 ? * * ")
public void updateUserMinuteBatch() {
iUserService.updateUserMinuteBatch();
}
/**
* 11点期间每分钟执行一次批量获得旅行奖励
*/
@Async
@Scheduled(cron = "0 0/1 11 ? * *")
public void getTravelRewardBatch() {
imtService.getTravelRewardBatch();
}
/**
* 9点期间每分钟执行一次
*/
@Scheduled(cron = "0 0/1 9 ? * *")
public void reservationBatchTask() {
imtService.reservationBatch();
}
@Scheduled(cron = "0 10,55 7,8 ? * * ")
public void refresh() {
logger.info("「刷新数据」开始刷新版本号预约item门店shop列表 ");
try {
imtService.refreshAll();
} catch (Exception e) {
logger.info("「刷新数据执行报错」%s", e.getMessage());
}
}
/**
* 18.05分获取申购结果
*/
@Async
@Scheduled(cron = "0 5 18 ? * * ")
public void appointmentResults() {
imtService.appointmentResults();
}
}