系统中常用到的批量导入功能,根据Excel内容批量插入,这里实现获取上传的Excel内容,由于offer2003前和2007后的版本所使用的API不一样,这里也做了兼容处理
1.引入maven包
<!-- poi office -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.16</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.16</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.16</version>
</dependency>