admin
2021-01-04 aa6ef62aef83e277d4171df1d9f0803f91738216
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.newvideo.job;
 
import javax.annotation.Resource;
 
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
import com.newvideo.log.LogHelper;
import com.newvideo.service.imp.StatisticsService;
import com.newvideo.util.Constant;
 
/**
 * 
 * 
 * @author Administrator
 *
 */
@Component
public class StatisticsJob {
    
    @Resource
    private StatisticsService statisticsService;
 
    @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.secondCategoryPlayStatistic();
            }
        }).start();
 
    }
    
    @Scheduled(cron = "0 1 0 * * ?")
    public void run(){
        if (!Constant.JobTasker)
            return;
        statisticsService.categoryPlayStatistic();
    }
}