Package com.thinkgem.jeesite.common.utils.excel

Examples of com.thinkgem.jeesite.common.utils.excel.ExportExcel


    public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
    try {
      String fileName = "用户数据导入模板.xlsx";
      List<User> list = Lists.newArrayList();
      list.add(UserUtils.getUser());
      new ExportExcel("用户数据", User.class, 2).setDataList(list).write(response, fileName).dispose();
      return null;
    } catch (Exception e) {
      addMessage(redirectAttributes, "导入模板下载失败!失败信息:" + e.getMessage());
    }
    return "redirect:" + Global.getAdminPath() + "/sys/user/?repage";
View Full Code Here


    @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";
View Full Code Here

TOP

Related Classes of com.thinkgem.jeesite.common.utils.excel.ExportExcel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.