use of cn.afterturn.easypoi.excel.entity.ExportParams in project my_curd by qinyou.
the class SysVisitLogController method exportExcel.
/**
* 导出excel
*/
@RequirePermission("sysVisitLog:export")
@Before(SearchSql.class)
public void exportExcel() {
String where = getAttr(Constant.SEARCH_SQL);
if (SysVisitLog.dao.findCountByWhere(where) > 50000) {
setAttr("msg", "一次导出数据不可大于 5W 条,请修改查询条件。");
render("common/card.ftl");
return;
}
// 测试大数据量导出
List<SysVisitLog> list = SysVisitLog.dao.findByWhere(where);
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("访问日志", "访问日志"), SysVisitLog.class, list);
render(ExcelRender.me(workbook).fileName("访问日志.xls"));
}
use of cn.afterturn.easypoi.excel.entity.ExportParams in project my_curd by qinyou.
the class ExSingleTableController method exportExcel.
/**
* 导出excel
*/
@Before(SearchSql.class)
public void exportExcel() {
String where = getAttr(Constant.SEARCH_SQL);
if (ExSingleTable.dao.findCountByWhere(where) > 50000) {
setAttr("msg", "一次导出数据不可大于 5W 条,请修改查询条件。");
render("common/card.ftl");
return;
}
List<ExSingleTable> list = ExSingleTable.dao.findByWhere(where);
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("例子单表结构", "例子单表结构"), ExSingleTable.class, list);
render(ExcelRender.me(workbook).fileName("例子单表结构.xls"));
}
use of cn.afterturn.easypoi.excel.entity.ExportParams in project my_curd by qinyou.
the class SysSettingController method exportExcel.
/**
* 导出excel
*/
@Before(SearchSql.class)
public void exportExcel() {
String where = getAttr(Constant.SEARCH_SQL);
if (SysSetting.dao.findCountByWhere(where) > 50000) {
setAttr("msg", "一次导出数据不可大于 5W 条,请修改查询条件。");
render("common/card.ftl");
return;
}
List<SysSetting> list = SysSetting.dao.findByWhere(where);
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("系统设置项", "系统设置项"), SysSetting.class, list);
render(ExcelRender.me(workbook).fileName("系统设置项.xls"));
}
Aggregations