@GetMapping("/export")
@ApiOperation(value = "导出")
@ApiOperationSupport(order = 4)
public void export(Student stu, HttpServletResponse response) {
if (ObjectUtils.isNotEmpty(stu)) {
// 查询要导出的数据
List stuList = studentService.selectStuList(stu);
List result = new ArrayList<>();
stuList .forEach(item -> {
StudentExcel stuExcel = new StudentExcel();
BeanUtils.copyProperties(item, StudentExcel);
result.add(stuExcel);
});
ExcelUtil.export(response, "学生信息表" + DateUtil.time(), "学生信息", result, StudentExcel.class);
}
}
```