ZhjTask.java
1.03 KB
package com.pashanhoo.common;
import com.pashanhoo.zhj.service.ZhjDatasSynService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
@Configuration
@EnableScheduling
public class ZhjTask {
@Autowired
private ZhjDatasSynService zhjDatasSynService;
@Scheduled(cron="0 0 21 * * ? ")
public void execute() {
System.out.println("===========每天晚上九点定时任务进来了=========");
zhjDatasSynService.send_bdcYwInfo();
System.out.println("===========每天晚上九点定时任务走了=========");
}
@Scheduled(cron="0 0 20 15 * ? ")
public void executeQyInfo() {
System.out.println("===========每天晚上九点定时任务进来了=========");
zhjDatasSynService.synQyInfo();
System.out.println("===========每天晚上九点定时任务走了=========");
}
}