admin
2024-10-17 b30fb8afd3cd6228bda9b182dc412bb3c8daf69c
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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();
    }
    
}