package com.yeshi.buwan.job;
|
|
import javax.annotation.Resource;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
|
import com.yeshi.buwan.log.LogHelper;
|
import com.yeshi.buwan.service.imp.HolmesService;
|
import com.yeshi.buwan.service.imp.StatisticsService;
|
import com.yeshi.buwan.service.imp.VideoService;
|
import com.yeshi.buwan.util.Constant;
|
|
/**
|
*
|
*
|
* @author Administrator
|
*
|
*/
|
@Component
|
public class StatisticsJob {
|
@Resource
|
private VideoService videoService;
|
@Resource
|
private StatisticsService statisticsService;
|
@Resource
|
private HolmesService holmesService;
|
|
private static int count=1;
|
|
@Scheduled(cron = "0 0 0,3 * * ?")
|
public void doJob() {
|
if (!Constant.JobTasker)
|
return;
|
|
new Thread(new Runnable() {
|
|
public void run() {
|
statisticsService.areaPlayStatistic();
|
}
|
}).start();
|
|
new Thread(new Runnable() {
|
|
public void run() {
|
statisticsService.hotSearchStatistics();
|
}
|
}).start();
|
//
|
// new Thread(new Runnable() {
|
//
|
// public void run() {
|
// statisticsService.categoryPlayStatistic();
|
// }
|
// }).start();
|
|
// new Thread(new Runnable() {
|
//
|
// public void run() {
|
// statisticsService.secondCategoryPlayStatistic();
|
// }
|
// }).start();
|
|
}
|
|
@Scheduled(cron = "0 0 0 * * ?")
|
public void run(){
|
if (!Constant.JobTasker)
|
return;
|
LogHelper.print("执行统计时间:"+System.currentTimeMillis()+",执行次数:"+count);
|
++count;
|
statisticsService.categoryPlayStatistic();
|
}
|
|
}
|