POI读取excel文件
package com.learn;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.web.multipart.MultipartFile;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 读取excel工具类
* <dependency>
* <groupId>org.apache.poi</groupId>
* <artifactId>poi-ooxml</artifactId>
* <version>3.17</version>
* </dependency>
* <dependency>
* <groupId>org.apache.poi</groupId>
* <artifactId>poi</artifactId>
* <version>3.17</version>
* </dependency>
*/
public class ReadExcel {
public static List<Map<Integer, List<String>>> readExcel(MultipartFile file) {
//存储excel所有sheet信息
List<Map<Integer, List<String>>> totalList = new ArrayList<>();