コード例 #1
0
 /**
  * 导出系统
  *
  * @return
  * @throws Exception
  */
 public String exportFuncGroup() throws Exception {
   HttpServletResponse response = ServletActionContext.getResponse();
   response.reset();
   response.setContentType("application/x-download");
   response.addHeader(
       "Content-Disposition",
       "attachment;filename=" + URLEncoder.encode("acs-func-group.xls", "UTF-8"));
   dataHandle.exportFunGroup(response.getOutputStream(), systemId, funcGroupIds);
   return null;
 }
コード例 #2
0
 /**
  * 导入系统
  *
  * @return
  * @throws Exception
  */
 public String importFuncGroup() throws Exception {
   if (fileName == null || !fileName.endsWith(".xls")) {
     this.addActionMessage("请选择excel文件格式");
     return "show-import";
   }
   boolean success = true;
   try {
     dataHandle.importFunGroup(file, systemId);
   } catch (Exception e) {
     success = false;
   }
   if (success) {
     this.addActionMessage("导入成功");
   } else {
     this.addActionMessage("导入失败,请检查excel文件格式");
   }
   return "show-import";
 }