mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-04 04:37:59 +08:00
修复ExcelWriter导出List<Map>引起的个数混乱问题
This commit is contained in:
parent
8d348b539d
commit
f51df24970
@ -18,6 +18,7 @@
|
|||||||
* 【core 】 修复PunyCode处理域名的问题(pr#2620@Github)
|
* 【core 】 修复PunyCode处理域名的问题(pr#2620@Github)
|
||||||
* 【core 】 修复ObjectUtil.defaultIfNull去掉误加的deprecated(issue#I5SIZT@Gitee)
|
* 【core 】 修复ObjectUtil.defaultIfNull去掉误加的deprecated(issue#I5SIZT@Gitee)
|
||||||
* 【core 】 修复ReflectUtil 反射方法中桥接判断问题(issue#2625@Github)
|
* 【core 】 修复ReflectUtil 反射方法中桥接判断问题(issue#2625@Github)
|
||||||
|
* 【poi 】 修复ExcelWriter导出List<Map>引起的个数混乱问题(issue#2627@Github)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -1005,9 +1005,6 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public ExcelWriter writeRow(Object rowBean, boolean isWriteKeyAsHead) {
|
public ExcelWriter writeRow(Object rowBean, boolean isWriteKeyAsHead) {
|
||||||
if (rowBean instanceof Iterable) {
|
|
||||||
return writeRow((Iterable<?>) rowBean);
|
|
||||||
}
|
|
||||||
Map rowMap;
|
Map rowMap;
|
||||||
if (rowBean instanceof Map) {
|
if (rowBean instanceof Map) {
|
||||||
if (MapUtil.isNotEmpty(this.headerAlias)) {
|
if (MapUtil.isNotEmpty(this.headerAlias)) {
|
||||||
@ -1015,6 +1012,10 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
|||||||
} else {
|
} else {
|
||||||
rowMap = (Map) rowBean;
|
rowMap = (Map) rowBean;
|
||||||
}
|
}
|
||||||
|
}else if(rowBean instanceof Iterable){
|
||||||
|
// issue#2398@Github
|
||||||
|
// MapWrapper由于实现了Iterable接口,应该优先按照Map处理
|
||||||
|
return writeRow((Iterable<?>) rowBean);
|
||||||
} else if (rowBean instanceof Hyperlink) {
|
} else if (rowBean instanceof Hyperlink) {
|
||||||
// Hyperlink当成一个值
|
// Hyperlink当成一个值
|
||||||
return writeRow(CollUtil.newArrayList(rowBean), isWriteKeyAsHead);
|
return writeRow(CollUtil.newArrayList(rowBean), isWriteKeyAsHead);
|
||||||
|
Loading…
Reference in New Issue
Block a user