1、直接将文件读取成Map,标题就是key,
2、如果要读取成对象,则需要对象的属性名和标题设置成一样
<!--hutool-->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>${hutool.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>RELEASE</version>
</dependency>
<hutool.version>4.5.0</hutool.version>
File file = new File("C:\\Users\\Administrator\\Documents\\WeChat Files\\wxid_ysvz2oyxbush21\\FileStorage\\File\\2021-09\\123.xlsx"); ExcelReader reader = ExcelUtil.getReader(file); List<Account> list = reader.readAll(Account.class);
原文:https://www.cnblogs.com/qq376324789/p/15303088.html