燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-05-25 9759578e92fa6d736d7e95487be0138c714b4668
src/main/java/com/yssh/run/InitDataRunner.java
@@ -1,6 +1,8 @@
package com.yssh.run;
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;
@@ -11,25 +13,28 @@
import com.yssh.service.ICommonService;
import com.yssh.service.IDictRecordService;
@Component
public class InitDataRunner implements ApplicationRunner{
public class InitDataRunner implements ApplicationRunner {
    //protected final Log logger = LogFactory.getLog(this.getClass());
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
   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();
   }
    @Autowired
    private ICommonService commonService;
    @Autowired
    private IDictRecordService dictRecordService;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        CacheUtils.init();
        boolean tableExists = commonService.checkTableExists("dict_record");
        if (!tableExists) {
            dictRecordService.createDictRecoTable();
        }
        //读取dat数据
        commonService.readDatData();
        logger.info("***************** 系统启动完毕 *****************" + "\n");
    }
}