燕山石化溯源三维电子沙盘-【后端】-服务
13693261870
2023-04-25 ecd0ef5c6a78ac091b3fc2d42035cd0582c93a3f
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
package com.yssh.run;
 
 
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
 
import com.yssh.service.ICommonService;
import com.yssh.service.IDictRecordService;
 
 
@Component
public class InitDataRunner implements ApplicationRunner{
 
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
    
    @Autowired
    private ICommonService commonService;
    
    @Autowired
    private IDictRecordService dictRecordService;
    
    @Override
    public void run(ApplicationArguments args) throws Exception {
        boolean tableExists = commonService.checkTableExists("dict_record");
        if (!tableExists) {
            dictRecordService.createDictRecoTable();
        }
        //读取dat数据
        commonService.readDatData();
    }
}