| | |
| | | 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; |
| | | |
| | |
| | | |
| | | @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<>(); |
| | |
| | | |
| | | File file = new File(filePath); |
| | | if (!file.exists()) { |
| | | logger.error(file.getAbsolutePath() + " is not exist !"); |
| | | logger.info(file.getAbsolutePath() + " is not exist !"); |
| | | continue; |
| | | } |
| | | |
| | |
| | | try { |
| | | EasyCsv.read(filePath, VocVals.class, new VocParser(vocValsService, calendar.getTime())).doRead(); |
| | | } catch (Exception e) { |
| | | logger.error(e); |
| | | logger.error(e.getMessage(), e); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | File file = new File(filePath); |
| | | if (!file.exists()) { |
| | | logger.error(file.getAbsolutePath() + " is not exist !"); |
| | | logger.info(file.getAbsolutePath() + " is not exist !"); |
| | | continue; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | //创建表 |