燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-07-06 ce0aaddd0fc04e69c530a545de25a7a4d7f6fab3
src/main/java/com/yssh/run/InitDataRunner.java
@@ -1,8 +1,8 @@
package com.yssh.run;
import com.yssh.scheduled.ReadCsvTask;
import com.yssh.service.impl.WarningAnalyseServiceImpl;
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.beans.factory.annotation.Autowired;
@@ -13,15 +13,25 @@
import com.yssh.service.ICommonService;
import com.yssh.service.IDictRecordService;
import javax.annotation.Resource;
import java.util.Calendar;
@Component
public class InitDataRunner implements ApplicationRunner {
    protected final Log logger = LogFactory.getLog(this.getClass());
    //protected final Log logger = LogFactory.getLog(this.getClass());
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private ICommonService commonService;
    @Autowired
    private IDictRecordService dictRecordService;
    @Resource
    WarningAnalyseServiceImpl warningAnalyseService;
    @Resource
    ReadCsvTask task;
    @Override
    public void run(ApplicationArguments args) throws Exception {
@@ -31,9 +41,24 @@
        if (!tableExists) {
            dictRecordService.createDictRecoTable();
        }
        //读取dat数据
        // 读取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());
    }
}