mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复ExcelWriter导出List<Map>引起的个数混乱问题
This commit is contained in:
@@ -1005,9 +1005,6 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
||||
*/
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
public ExcelWriter writeRow(Object rowBean, boolean isWriteKeyAsHead) {
|
||||
if (rowBean instanceof Iterable) {
|
||||
return writeRow((Iterable<?>) rowBean);
|
||||
}
|
||||
Map rowMap;
|
||||
if (rowBean instanceof Map) {
|
||||
if (MapUtil.isNotEmpty(this.headerAlias)) {
|
||||
@@ -1015,6 +1012,10 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
||||
} else {
|
||||
rowMap = (Map) rowBean;
|
||||
}
|
||||
}else if(rowBean instanceof Iterable){
|
||||
// issue#2398@Github
|
||||
// MapWrapper由于实现了Iterable接口,应该优先按照Map处理
|
||||
return writeRow((Iterable<?>) rowBean);
|
||||
} else if (rowBean instanceof Hyperlink) {
|
||||
// Hyperlink当成一个值
|
||||
return writeRow(CollUtil.newArrayList(rowBean), isWriteKeyAsHead);
|
||||
|
Reference in New Issue
Block a user