【修改】文件导出新增文件名称编写

This commit is contained in:
nmy 2023-12-05 16:13:13 +08:00
parent c6da517c99
commit a1e49464af
1 changed files with 0 additions and 5 deletions

View File

@ -494,13 +494,8 @@ public class ExcelUtil<T>
*/ */
public void exportExcel(HttpServletResponse response, List<T> list, String sheetName, String title) public void exportExcel(HttpServletResponse response, List<T> list, String sheetName, String title)
{ {
String fileName = "物料主数据导入模板.xlsx";
String encodedFileName = null;
encodedFileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment; filename=\"" + encodedFileName + "\"");
this.init(list, sheetName, title, Excel.Type.EXPORT); this.init(list, sheetName, title, Excel.Type.EXPORT);
exportExcel(response); exportExcel(response);
} }