|
|
@ -3,6 +3,7 @@ package com.lzbi.bi.controller; |
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.io.IoUtil; |
|
|
|
import cn.hutool.poi.excel.BigExcelWriter; |
|
|
|
import cn.hutool.poi.excel.ExcelUtil; |
|
|
|
import cn.hutool.poi.excel.ExcelWriter; |
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
@ -244,10 +245,11 @@ public class DcBusiHisReportController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
private void toExcel(HttpServletResponse response,List<Map<String, Object>> mapList) throws IOException { |
|
|
|
String fileName ="report"+DateUtil.now() + ".xls"; |
|
|
|
String fileName ="report"+DateUtil.now() + ".xlsx"; |
|
|
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
|
|
|
response.setCharacterEncoding("utf-8"); |
|
|
|
ExcelWriter writer = ExcelUtil.getWriter(true); |
|
|
|
//ExcelWriter writer = ExcelUtil.getWriter(true);
|
|
|
|
BigExcelWriter writer= ExcelUtil.getBigWriter(); |
|
|
|
writer.write(mapList, true); |
|
|
|
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
|
|
|
|
//response.setHeader("Content-Disposition", "attachment;filename="+fileName);
|
|
|
|