xm配置文件
xmlns:context=”http://www.springframework.org/schema/context”
xmlns:task=”http://www.springframework.org/schema/task”
xsi:schemaLocation=”
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-4.1.xsd “>
@Component
public class ProductInterestDetailTask {
private static final Logger logger = Logger.getLogger(ProductInterestDetailTask.class);
@Autowired
PtsProductInterestService ptsProductInterestService;
/* @Scheduled(cron=”0/3 * * * * ? “) //每三秒指定一次
public void aTask(){
logger.info(“注解定时任务测试=========================”);
System.out.println(“注解定时任务测试~~”);
}*/
@Scheduled(cron = "0 01 0 ? * WED-THU") //每周四0点1分执行
public void insertProductInterestDetail() {
logger.info("insertProductInterestDetail-定时任务开始");
PayInfoInterest payInfoInterest = new PayInfoInterest();
PtsResResultVo ptsResResultVo = ptsProductInterestService.insertPtsProductInterestDetail(payInfoInterest);
logger.info("insertProductInterestDetail-定时任务结束:" + ptsResResultVo);
}
}