|
|
|
@@ -404,7 +404,19 @@ public class AsyncTask { |
|
|
|
} |
|
|
|
|
|
|
|
private void exportExcel(HttpServletRequest request, HttpServletResponse response,List successList, Class dataClass, String fileName) throws Exception { |
|
|
|
excelService.exportExcel(successList, null, "sheet1", dataClass, fileName, response, false); |
|
|
|
ExportParams exportParams = new ExportParams(); |
|
|
|
exportParams.setType(ExcelType.XSSF); |
|
|
|
Workbook workBook = ExcelExportUtil.exportExcel(exportParams, dataClass, successList); |
|
|
|
response.setContentType("application/octet-stream;charset=UTF-8"); |
|
|
|
//response.setHeader("Content-Type", "application/vnd.ms-excel");//xls |
|
|
|
response.setHeader("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");//xlsx |
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes("GB2312"), "8859_1")); |
|
|
|
response.addHeader("Pargam", "no-cache"); |
|
|
|
response.addHeader("Cache-Control", "no-cache"); |
|
|
|
OutputStream out = response.getOutputStream(); |
|
|
|
workBook.write(out); |
|
|
|
out.flush(); |
|
|
|
out.close(); |
|
|
|
} |
|
|
|
|
|
|
|
private String uploadErrorExcel(List successList, Class dataClass, String fileName) throws Exception { |
|
|
|
|