1.首先在responsity中找到easy所需要的jar包,完成下載並導入到項目所需的lib中
<!-- https://mvnrepository.com/artifact/com.alibaba/easyexcel -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>1.0.4</version> //此處是easyexcel的版本
</dependency>
2.自己新建一個excel工具類,一個excelListener(繼承自analysiseventListener),處理從表格中讀取的數據。
3.所有的實體都繼承自baseRowModel,來自表格的屬性前面加上@ExcelProperty(index=xxx),xxx從0開始遞增