燕山石化溯源三维电子沙盘-【后端】-服务
13693261870
2023-06-06 ec3e7326246b5543089b14e53275e2aca8e39f96
src/main/java/com/yssh/scheduled/ReadCsvTask.java
@@ -10,9 +10,8 @@
import com.yssh.entity.VocVals;
import com.yssh.service.VocValsService;
import com.yssh.utils.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -28,21 +27,21 @@
@Component
public class ReadCsvTask {
   protected final Log logger = LogFactory.getLog(this.getClass());
   protected final Logger logger = LoggerFactory.getLogger(this.getClass());
   @Resource
   private VocValsService vocValsService;
   @Autowired
   @Resource
   private SuYuanServiceImpl suYuanService;
   @Autowired
   @Resource
   private CsvFilePathConfig csvFilePathConfig;
   @Autowired
   @Resource
   private IDictRecordService dictRecordService;
   @Autowired
   @Resource
   private IWarningAnalyseService warningAnalyseService;
   private final static List<String> md5List = new ArrayList<>();
@@ -65,7 +64,7 @@
         File file = new File(filePath);
         if (!file.exists()) {
            logger.error(file.getAbsolutePath() + " is not exist !");
            logger.info(file.getAbsolutePath() + " is not exist !");
            continue;
         }
@@ -83,7 +82,7 @@
         try {
            EasyCsv.read(filePath, VocVals.class, new VocParser(vocValsService, calendar.getTime())).doRead();
         } catch (Exception e) {
            logger.error(e);
            logger.error(e.getMessage(), e);
         }
      }
   }
@@ -105,7 +104,7 @@
         File file = new File(filePath);
         if (!file.exists()) {
            logger.error(file.getAbsolutePath() + " is not exist !");
            logger.info(file.getAbsolutePath() + " is not exist !");
            continue;
         }
@@ -150,7 +149,7 @@
      String filePath = csvFilePathConfig.getFilePath() + "\\\\" + time + ".csv";
      File file = new File(filePath);
      if (!file.exists()) {
         logger.error(file.getAbsolutePath() + " is not exist !");
         logger.info(file.getAbsolutePath() + " is not exist !");
         return;
      }
      //创建表