Springboot项目结合miniui如何快速实现数据的导出到excel(Springboot项目结合miniui如何快速实现数据的导出到excel)
1.添加依赖
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
2.导出功能控制层实现
@ApiOperation(value=“导出员工信息到excel”,notes="传递参数: ")
@ApiResponses({
@ApiResponse(code = 200, message = “操作成功”),
@ApiResponse(code = 500, message = “服务器错误”),
@ApiResponse(code = 404, message = “请求路径没有或者页面跳转路径错误”)
})
@RequestMapping(value = “/exportRyXxToExcel”,method = {RequestMethod.POST})
public void exportRyXxToExcel(@RequestParam(“columns”)String columns,
@RequestParam(“name”)String name,
@RequestParam(“ygbh”)String ygbh,
@RequestParam(“selectType”)String selectType,
@RequestParam(“selectValue”)String selectValue,
@RequestParam(“bmbh”)String bmbh,
@RequestParam(“bmlb”)String bmlb,
HttpServletResponse response){
uploadSe