| | |
| | | private void loadVocSync() { |
| | | logger.info("***************** 开始全域CSV入库 *****************" + "\n"); |
| | | vocValsService.deleteLastYear(); |
| | | Calendar calendar = getCalendar(96); |
| | | Calendar calendar = getCalendar(vocMax); |
| | | for (int i = 0; i < vocMax; i++) { |
| | | calendar.add(Calendar.HOUR, -1); |
| | | String time = format.format(calendar.getTime()); |
| | |
| | | continue; |
| | | } |
| | | |
| | | String md5 = FileUtils.getFileMd5(filePath); |
| | | if (null != md5 && md5List.contains(md5)) { |
| | | continue; // csv已入库 |
| | | } |
| | | //String md5 = FileUtils.getFileMd5(filePath); |
| | | //if (null != md5 && md5List.contains(md5)) { |
| | | // continue; // csv已入库 |
| | | //} |
| | | |
| | | int count = vocValsService.countByTime(time); |
| | | if (count > 0) { |
| | | vocValsService.deleteByTime(time); // 删除已入库 |
| | | //vocValsService.deleteByTime(time); // 删除已入库 |
| | | continue; |
| | | } |
| | | |
| | | try { |
| | | addFileMd5(md5); |
| | | //addFileMd5(md5); |
| | | logger.info("loadVocSync: " + filePath); |
| | | Date date = (Date) calendar.getTime().clone(); |
| | | EasyCsv.read(filePath, VocVals.class, new VocParser(vocValsService, date)).doRead(); |