public String importUser() throws Exception { List<User> list = excelHelperService.excelToUser(excelFile); for (User u : list) { userService.add(u); } setJsonMessage(true, "员工导入成功"); return render(jo.toString()); }
// 添加一个导出用户信息excel表格的方法 public String exportUserRole() throws Exception { String fileName = "考勤系统用户报表"; query = p("queryName"); queryMap.put("roleId", p("roleType")); ListData<User> listData = userService.getListData(query, queryMap, 0, 0); File file = excelHelperService.exportUserRoleExcel(fileName, listData.getList()); byte[] bytes = FileUtils.readFileToByteArray(file); return renderFile(bytes, fileName + ".xls"); }