Commit 14594e492e62e966521650b974e1470f3196119e
1 parent
f4217fe4
update: springboot 2.6.8 ==> 2.6.9
Showing
3 changed files
with
16 additions
and
20 deletions
yudao-dependencies/pom.xml
| @@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
| 16 | <properties> | 16 | <properties> |
| 17 | <revision>1.6.2-snapshot</revision> | 17 | <revision>1.6.2-snapshot</revision> |
| 18 | <!-- 统一依赖管理 --> | 18 | <!-- 统一依赖管理 --> |
| 19 | - <spring.boot.version>2.6.8</spring.boot.version> | 19 | + <spring.boot.version>2.6.9</spring.boot.version> |
| 20 | <!-- Web 相关 --> | 20 | <!-- Web 相关 --> |
| 21 | <knife4j.version>3.0.3</knife4j.version> | 21 | <knife4j.version>3.0.3</knife4j.version> |
| 22 | <swagger-annotations.version>1.6.6</swagger-annotations.version> | 22 | <swagger-annotations.version>1.6.6</swagger-annotations.version> |
| @@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
| 26 | <mybatis-plus.version>3.5.2</mybatis-plus.version> | 26 | <mybatis-plus.version>3.5.2</mybatis-plus.version> |
| 27 | <mybatis-plus-generator.version>3.5.2</mybatis-plus-generator.version> | 27 | <mybatis-plus-generator.version>3.5.2</mybatis-plus-generator.version> |
| 28 | <dynamic-datasource.version>3.5.0</dynamic-datasource.version> | 28 | <dynamic-datasource.version>3.5.0</dynamic-datasource.version> |
| 29 | - <redisson.version>3.17.3</redisson.version> | 29 | + <redisson.version>3.17.4</redisson.version> |
| 30 | <!-- Config 配置中心相关 --> | 30 | <!-- Config 配置中心相关 --> |
| 31 | <apollo.version>1.9.2</apollo.version> | 31 | <apollo.version>1.9.2</apollo.version> |
| 32 | <!-- Job 定时任务相关 --> | 32 | <!-- Job 定时任务相关 --> |
| @@ -49,7 +49,7 @@ | @@ -49,7 +49,7 @@ | ||
| 49 | <lombok.version>1.18.20</lombok.version> | 49 | <lombok.version>1.18.20</lombok.version> |
| 50 | <mapstruct.version>1.4.1.Final</mapstruct.version> | 50 | <mapstruct.version>1.4.1.Final</mapstruct.version> |
| 51 | <hutool.version>5.6.1</hutool.version> | 51 | <hutool.version>5.6.1</hutool.version> |
| 52 | - <easyexcel.verion>2.2.7</easyexcel.verion> | 52 | + <easyexcel.verion>3.1.1</easyexcel.verion> |
| 53 | <velocity.version>2.2</velocity.version> | 53 | <velocity.version>2.2</velocity.version> |
| 54 | <screw.version>1.0.5</screw.version> | 54 | <screw.version>1.0.5</screw.version> |
| 55 | <fastjson.version>2.0.5</fastjson.version> | 55 | <fastjson.version>2.0.5</fastjson.version> |
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; | @@ -5,8 +5,9 @@ import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils; | ||
| 5 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 5 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 6 | import com.alibaba.excel.converters.Converter; | 6 | import com.alibaba.excel.converters.Converter; |
| 7 | import com.alibaba.excel.enums.CellDataTypeEnum; | 7 | import com.alibaba.excel.enums.CellDataTypeEnum; |
| 8 | -import com.alibaba.excel.metadata.CellData; | ||
| 9 | import com.alibaba.excel.metadata.GlobalConfiguration; | 8 | import com.alibaba.excel.metadata.GlobalConfiguration; |
| 9 | +import com.alibaba.excel.metadata.data.ReadCellData; | ||
| 10 | +import com.alibaba.excel.metadata.data.WriteCellData; | ||
| 10 | import com.alibaba.excel.metadata.property.ExcelContentProperty; | 11 | import com.alibaba.excel.metadata.property.ExcelContentProperty; |
| 11 | import lombok.extern.slf4j.Slf4j; | 12 | import lombok.extern.slf4j.Slf4j; |
| 12 | 13 | ||
| @@ -29,11 +30,11 @@ public class DictConvert implements Converter<Object> { | @@ -29,11 +30,11 @@ public class DictConvert implements Converter<Object> { | ||
| 29 | } | 30 | } |
| 30 | 31 | ||
| 31 | @Override | 32 | @Override |
| 32 | - public Object convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, | 33 | + public Object convertToJavaData(ReadCellData readCellData, ExcelContentProperty contentProperty, |
| 33 | GlobalConfiguration globalConfiguration) { | 34 | GlobalConfiguration globalConfiguration) { |
| 34 | // 使用字典解析 | 35 | // 使用字典解析 |
| 35 | String type = getType(contentProperty); | 36 | String type = getType(contentProperty); |
| 36 | - String label = cellData.getStringValue(); | 37 | + String label = readCellData.getStringValue(); |
| 37 | String value = DictFrameworkUtils.parseDictDataValue(type, label); | 38 | String value = DictFrameworkUtils.parseDictDataValue(type, label); |
| 38 | if (value == null) { | 39 | if (value == null) { |
| 39 | log.error("[convertToJavaData][type({}) 解析不掉 label({})]", type, label); | 40 | log.error("[convertToJavaData][type({}) 解析不掉 label({})]", type, label); |
| @@ -45,11 +46,11 @@ public class DictConvert implements Converter<Object> { | @@ -45,11 +46,11 @@ public class DictConvert implements Converter<Object> { | ||
| 45 | } | 46 | } |
| 46 | 47 | ||
| 47 | @Override | 48 | @Override |
| 48 | - public CellData<String> convertToExcelData(Object object, ExcelContentProperty contentProperty, | ||
| 49 | - GlobalConfiguration globalConfiguration) { | 49 | + public WriteCellData<String> convertToExcelData(Object object, ExcelContentProperty contentProperty, |
| 50 | + GlobalConfiguration globalConfiguration) { | ||
| 50 | // 空时,返回空 | 51 | // 空时,返回空 |
| 51 | if (object == null) { | 52 | if (object == null) { |
| 52 | - return new CellData<>(""); | 53 | + return new WriteCellData<>(""); |
| 53 | } | 54 | } |
| 54 | 55 | ||
| 55 | // 使用字典格式化 | 56 | // 使用字典格式化 |
| @@ -58,10 +59,10 @@ public class DictConvert implements Converter<Object> { | @@ -58,10 +59,10 @@ public class DictConvert implements Converter<Object> { | ||
| 58 | String label = DictFrameworkUtils.getDictDataLabel(type, value); | 59 | String label = DictFrameworkUtils.getDictDataLabel(type, value); |
| 59 | if (label == null) { | 60 | if (label == null) { |
| 60 | log.error("[convertToExcelData][type({}) 转换不了 label({})]", type, value); | 61 | log.error("[convertToExcelData][type({}) 转换不了 label({})]", type, value); |
| 61 | - return new CellData<>(""); | 62 | + return new WriteCellData<>(""); |
| 62 | } | 63 | } |
| 63 | // 生成 Excel 小表格 | 64 | // 生成 Excel 小表格 |
| 64 | - return new CellData<>(label); | 65 | + return new WriteCellData<>(label); |
| 65 | } | 66 | } |
| 66 | 67 | ||
| 67 | private static String getType(ExcelContentProperty contentProperty) { | 68 | private static String getType(ExcelContentProperty contentProperty) { |
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; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.framework.excel.core.convert; | ||
| 3 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | 3 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 4 | import com.alibaba.excel.converters.Converter; | 4 | import com.alibaba.excel.converters.Converter; |
| 5 | import com.alibaba.excel.enums.CellDataTypeEnum; | 5 | import com.alibaba.excel.enums.CellDataTypeEnum; |
| 6 | -import com.alibaba.excel.metadata.CellData; | ||
| 7 | import com.alibaba.excel.metadata.GlobalConfiguration; | 6 | import com.alibaba.excel.metadata.GlobalConfiguration; |
| 7 | +import com.alibaba.excel.metadata.data.WriteCellData; | ||
| 8 | import com.alibaba.excel.metadata.property.ExcelContentProperty; | 8 | import com.alibaba.excel.metadata.property.ExcelContentProperty; |
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| @@ -25,15 +25,10 @@ public class JsonConvert implements Converter<Object> { | @@ -25,15 +25,10 @@ public class JsonConvert implements Converter<Object> { | ||
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | @Override | 27 | @Override |
| 28 | - public Object convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { | ||
| 29 | - throw new UnsupportedOperationException("暂不支持,也不需要"); | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | - @Override | ||
| 33 | - public CellData<String> convertToExcelData(Object value, ExcelContentProperty contentProperty, | ||
| 34 | - GlobalConfiguration globalConfiguration) { | 28 | + public WriteCellData<String> convertToExcelData(Object value, ExcelContentProperty contentProperty, |
| 29 | + GlobalConfiguration globalConfiguration) { | ||
| 35 | // 生成 Excel 小表格 | 30 | // 生成 Excel 小表格 |
| 36 | - return new CellData<>(JsonUtils.toJsonString(value)); | 31 | + return new WriteCellData<>(JsonUtils.toJsonString(value)); |
| 37 | } | 32 | } |
| 38 | 33 | ||
| 39 | } | 34 | } |