poi导入excel表格 ,老版本excel用HSSFWorkbook 新版本用XSSFWorkbook
File excelFile = new File("v:\\工作簿1.xlsx");
XSSFWorkbook wb = new XSSFWorkbook(new FileInputStream(excelFile));
XSSFSheet sheet = wb.getSheetAt(0);
System.out.println(sheet.getLastRowNum());
for (Row row : sheet) {
System.out.println("-------");
if (row.getCell(0).toString() == null)
break;
stringRedisTemplate.opsForValue().set(row.getCell(0).toString(),"0"+row.getCell(1).toString());
}