导入相关POI maven
<!--poi-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.0.1</version>
</dependency>
xls和xlsx获取图片方式是不同的所以判断一下后缀
String type = file.getOriginalFilename();
if (type.endsWith(".xls")){
maplist = getPictures1((HSSFSheet) s);
} if (type.endsWith(".xlsx")){
maplist = getPictures2((XSSFSheet) s);
}
获取图片和位置(xls)