| | |
| | | private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHH"); |
| | | |
| | | //@Transactional |
| | | @Override |
| | | //@Override |
| | | @Async("threadPoolTaskExecutor") |
| | | public void insertSuYuanDatas(List<SuYuan> lists, String time) throws Exception { |
| | | public void insertSuYuanDatasAsync(List<SuYuan> lists, String time) throws Exception { |
| | | //插入数据 |
| | | List<List<SuYuan>> list = Lists.partition(lists, IAsyncService.BATCH_INSERT_NUMBER); |
| | | CountDownLatch countDownLatch = new CountDownLatch(list.size()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void insertSuYuanDatas(List<SuYuan> lists, String time) { |
| | | List<List<SuYuan>> subLists = Lists.partition(lists, IAsyncService.BATCH_INSERT_NUMBER); |
| | | for (List<SuYuan> sub : subLists) { |
| | | suYuanMapper.batchInsert(TableStrategy.getTableStrategy(time), sub); |
| | | } |
| | | |
| | | logger.info("------ " + time + ".csv," + lists.size() + " 条数据已入库 ------"); |
| | | } |
| | | |
| | | @Override |
| | | public Integer isTableExists(String tableName) { |
| | | return suYuanMapper.isTableExists(tableName); |
| | | } |