在父工程的pom文件下导入包
<!--导出excel -->
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-annotation</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-web</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>3.0.3</version>
</dependency>
然后在pojo下,另加一个包,在里面写用来接收要在Excel表格中显示的那些字段
在TabOrderExcel.java中。要加上注解,也要实现set、get方法,实现序列化接口
在前端,点击"导出”,就会去访问我的产生Excel接口。
<button type="button" class="btn btn-default" title="导出" ng-click="findAll()"><i class="fa fa-refresh"></i> 导出</button>
去 访问接口