燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-07-20 ef3b1b5570ca8b73cffde8be68387dc68c7c3990
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
package com.yssh.config;
 
import com.yssh.service.WarningAnalyseService;
import com.yssh.utils.CacheUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
 
import com.yssh.service.CommonService;
import com.yssh.service.DictRecordService;
 
import javax.annotation.Resource;
import java.util.Calendar;
 
@Component
public class InitConfig implements ApplicationRunner {
    //protected final Log logger = LogFactory.getLog(this.getClass());
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
 
    @Resource
    private CommonService commonService;
 
    @Resource
    private DictRecordService dictRecordService;
 
    @Resource
    WarningAnalyseService warningAnalyseService;
 
    @Resource
    ScheduleConfig task;
 
    @Override
    public void run(ApplicationArguments args) throws Exception {
        CacheUtils.init();
 
        boolean tableExists = commonService.checkTableExists("dict_record");
        if (!tableExists) dictRecordService.createDictRecoTable();
 
        // 读取dat数据
        commonService.readDatData();
 
        //test();
        logger.info("***************** 系统启动完毕 *****************" + "\n");
    }
 
    private void test() {
        //task.corpReserveDataSync();
 
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.MONTH, 5);
        calendar.set(Calendar.DAY_OF_MONTH, 8);
        calendar.set(Calendar.HOUR_OF_DAY, 16);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
 
        //warningAnalyseService.warningOperationStorage(calendar.getTime());
    }
}