@RequestMapping(value = "export", method=RequestMethod.POST)
public String exportFile(User user, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
String fileName = "用户数据" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
Page<User> page = systemService.findUser(new Page<User>(request, response, -1), user);
new ExportExcel("用户数据", User.class).setDataList(page.getList()).write(response, fileName).dispose();
return null;
} catch (Exception e) {
addMessage(redirectAttributes, "导出用户失败!失败信息:"+e.getMessage());
}
return "redirect:" + Global.getAdminPath() + "/sys/user/?repage";