From 14594e492e62e966521650b974e1470f3196119e Mon Sep 17 00:00:00 2001 From: xingyu Date: Fri, 22 Jul 2022 11:07:54 +0800 Subject: [PATCH] update: springboot 2.6.8 ==> 2.6.9 --- yudao-dependencies/pom.xml | 6 +++--- .../excel/core/convert/DictConvert.java | 17 +++++++++-------- .../excel/core/convert/JsonConvert.java | 13 ++++--------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index bec606f3d..52fc7d5bc 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -16,7 +16,7 @@ 1.6.2-snapshot - 2.6.8 + 2.6.9 3.0.3 1.6.6 @@ -26,7 +26,7 @@ 3.5.2 3.5.2 3.5.0 - 3.17.3 + 3.17.4 1.9.2 @@ -49,7 +49,7 @@ 1.18.20 1.4.1.Final 5.6.1 - 2.2.7 + 3.1.1 2.2 1.0.5 2.0.5 diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java index 7698cf4a6..182c83a72 100644 --- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java +++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java @@ -5,8 +5,9 @@ import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils; import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; import com.alibaba.excel.converters.Converter; import com.alibaba.excel.enums.CellDataTypeEnum; -import com.alibaba.excel.metadata.CellData; import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.data.ReadCellData; +import com.alibaba.excel.metadata.data.WriteCellData; import com.alibaba.excel.metadata.property.ExcelContentProperty; import lombok.extern.slf4j.Slf4j; @@ -29,11 +30,11 @@ public class DictConvert implements Converter { } @Override - public Object convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, + public Object convertToJavaData(ReadCellData readCellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { // 使用字典解析 String type = getType(contentProperty); - String label = cellData.getStringValue(); + String label = readCellData.getStringValue(); String value = DictFrameworkUtils.parseDictDataValue(type, label); if (value == null) { log.error("[convertToJavaData][type({}) 解析不掉 label({})]", type, label); @@ -45,11 +46,11 @@ public class DictConvert implements Converter { } @Override - public CellData convertToExcelData(Object object, ExcelContentProperty contentProperty, - GlobalConfiguration globalConfiguration) { + public WriteCellData convertToExcelData(Object object, ExcelContentProperty contentProperty, + GlobalConfiguration globalConfiguration) { // 空时,返回空 if (object == null) { - return new CellData<>(""); + return new WriteCellData<>(""); } // 使用字典格式化 @@ -58,10 +59,10 @@ public class DictConvert implements Converter { String label = DictFrameworkUtils.getDictDataLabel(type, value); if (label == null) { log.error("[convertToExcelData][type({}) 转换不了 label({})]", type, value); - return new CellData<>(""); + return new WriteCellData<>(""); } // 生成 Excel 小表格 - return new CellData<>(label); + return new WriteCellData<>(label); } private static String getType(ExcelContentProperty contentProperty) { diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/JsonConvert.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/JsonConvert.java index f0a577c0a..0d4794e5f 100644 --- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/JsonConvert.java +++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/JsonConvert.java @@ -3,8 +3,8 @@ package cn.iocoder.yudao.framework.excel.core.convert; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import com.alibaba.excel.converters.Converter; import com.alibaba.excel.enums.CellDataTypeEnum; -import com.alibaba.excel.metadata.CellData; import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.data.WriteCellData; import com.alibaba.excel.metadata.property.ExcelContentProperty; /** @@ -25,15 +25,10 @@ public class JsonConvert implements Converter { } @Override - public Object convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { - throw new UnsupportedOperationException("暂不支持,也不需要"); - } - - @Override - public CellData convertToExcelData(Object value, ExcelContentProperty contentProperty, - GlobalConfiguration globalConfiguration) { + public WriteCellData convertToExcelData(Object value, ExcelContentProperty contentProperty, + GlobalConfiguration globalConfiguration) { // 生成 Excel 小表格 - return new CellData<>(JsonUtils.toJsonString(value)); + return new WriteCellData<>(JsonUtils.toJsonString(value)); } }