| | |
| | | |
| | | //String md5 = FileUtils.getFileMd5(filePath); |
| | | //if (null != md5 && md5List.contains(md5)) { |
| | | // continue; // csv已入库 |
| | | // continue; |
| | | //} |
| | | |
| | | int count = vocValsService.countByTime(time); |
| | | if (count > 0) { |
| | | //vocValsService.deleteByTime(time); // 删除已入库 |
| | | //vocValsService.deleteByTime(time); |
| | | continue; |
| | | } |
| | | |
| | |
| | | logger.info(file.getAbsolutePath() + " is not exist !"); |
| | | return; |
| | | } |
| | | //创建表 |
| | | |
| | | String newTableName = TableStrategy.getTableStrategy(time); |
| | | suYuanService.createNewTable(newTableName); |
| | | dictRecordService.insertDictRecord(new DictRecord(1L, newTableName, Long.parseLong(time), "")); |
| | | EasyCsv.read(filePath, SuYuan.class, new CsvParser(suYuanService, time)).doRead(); |
| | | //计算预警/报警,并且进行入库操作 |
| | | |
| | | try { |
| | | Thread.sleep(60 * 1000); |
| | | } catch (InterruptedException e) { |
| | |
| | | warningAnalyseService.warningOperationStorage(date); |
| | | } |
| | | |
| | | /** |
| | | * 创建日报:每日0时1分 |
| | | */ |
| | | @Scheduled(cron = "0 1 0 * * ?") |
| | | public void createDayReport() { |
| | | Calendar calendar = getCalendar(1); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建周报:每周一0时5分 |
| | | */ |
| | | @Scheduled(cron = "0 5 0 ? * MON") |
| | | public void createWeekReport() { |
| | | Calendar calendar = getCalendar(7 * 24); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建月报:每月1日0时9分 |
| | | */ |
| | | @Scheduled(cron = "0 9 0 1 * ?") |
| | | public void createMonthReport() { |
| | | Calendar calendar = Calendar.getInstance(); |