From 45ef54268739d2162046a7a53279518bd11bd5b7 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期二, 15 八月 2023 12:17:27 +0800 Subject: [PATCH] 升级fastjson到最新版2.0.39 --- ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java index cbe47b6..bafb9c0 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -461,7 +461,7 @@ } else if (!attr.handler().equals(ExcelHandlerAdapter.class)) { - val = dataFormatHandlerAdapter(val, attr); + val = dataFormatHandlerAdapter(val, attr, null); } else if (ColumnType.IMAGE == attr.cellType() && StringUtils.isNotEmpty(pictures)) { @@ -1052,7 +1052,7 @@ } else if (!attr.handler().equals(ExcelHandlerAdapter.class)) { - cell.setCellValue(dataFormatHandlerAdapter(value, attr)); + cell.setCellValue(dataFormatHandlerAdapter(value, attr, cell)); } else { @@ -1265,13 +1265,13 @@ * @param excel 数据注解 * @return */ - public String dataFormatHandlerAdapter(Object value, Excel excel) + public String dataFormatHandlerAdapter(Object value, Excel excel, Cell cell) { try { Object instance = excel.handler().newInstance(); - Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class }); - value = formatMethod.invoke(instance, value, excel.args()); + Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class, Cell.class, Workbook.class }); + value = formatMethod.invoke(instance, value, excel.args(), cell, this.wb); } catch (Exception e) { -- Gitblit v1.9.2