From f7a59f1b5ffcee3ec533ff9e66d4a212edaa6d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E6=B2=90?= Date: Mon, 18 Sep 2023 14:37:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=20easytrans=202.2.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/net/maku/framework/common/utils/ExcelUtils.java | 12 ++++++------ pom.xml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/maku-framework/src/main/java/net/maku/framework/common/utils/ExcelUtils.java b/maku-framework/src/main/java/net/maku/framework/common/utils/ExcelUtils.java index 03cbe6d..6228e95 100644 --- a/maku-framework/src/main/java/net/maku/framework/common/utils/ExcelUtils.java +++ b/maku-framework/src/main/java/net/maku/framework/common/utils/ExcelUtils.java @@ -105,7 +105,7 @@ public class ExcelUtils { * @param data 数据 */ public static void excelExport(Class head, File file, List data) { - excelExport(head, file, "sheet1", data); + excelExport(head, file, "sheet1" , data); } /** @@ -137,11 +137,11 @@ public class ExcelUtils { public static void excelExport(Class head, String excelName, String sheetName, List data) { try { HttpServletResponse response = HttpContextUtils.getHttpServletResponse(); - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setCharacterEncoding("utf-8"); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ); + response.setCharacterEncoding("utf-8" ); // 这里URLEncoder.encode可以防止中文乱码 当然和easy excel没有关系 - String fileName = URLUtil.encode(excelName).replaceAll("\\+", "%20"); - response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); + String fileName = URLUtil.encode(excelName).replaceAll("\\+" , "%20" ); + response.setHeader("Content-disposition" , "attachment;filename*=utf-8''" + fileName + ".xlsx" ); EasyExcel.write(response.getOutputStream(), head).sheet(StringUtils.isBlank(sheetName) ? "sheet1" : sheetName).doWrite(data); } catch (IOException e) { throw new RuntimeException(e); @@ -174,7 +174,7 @@ public class ExcelUtils { Field ref = ReflectUtils.getDeclaredField(clazz, trans.ref()); ref.setAccessible(true); // 获取字典反向值 - String value = dictionaryTransService.getUnTransMap().get(trans.key() + "_" + ref.get(data)); + String value = dictionaryTransService.getDictionaryTransMap().get(trans.key() + "_" + ref.get(data)); if (StringUtils.isBlank(value)) { continue; } diff --git a/pom.xml b/pom.xml index 46c9e8c..454fad7 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ 3.22.3 3.2.1 3.3.0 - 2.1.11 + 2.2.7 2.14.2