mirror of
https://gitee.com/dromara/hutool.git
synced 2025-06-28 13:34:09 +08:00
修复代码逻辑问题。
This commit is contained in:
parent
b6e260a2f0
commit
decda097e2
@ -1106,7 +1106,7 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
|||||||
* @param isWriteKeyAsHead 是否将Map的Key作为表头输出,如果为True第一行为表头,紧接着为values
|
* @param isWriteKeyAsHead 是否将Map的Key作为表头输出,如果为True第一行为表头,紧接着为values
|
||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
public ExcelWriter writeCol(Map<?,?> colMap, boolean isWriteKeyAsHead){
|
public ExcelWriter writeCol(Map<?,? extends Iterable<?>> colMap, boolean isWriteKeyAsHead){
|
||||||
return writeCol(colMap, 0, isWriteKeyAsHead);
|
return writeCol(colMap, 0, isWriteKeyAsHead);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1121,11 +1121,11 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
|||||||
* @param isWriteKeyAsHead 是否将Map的Key作为表头输出,如果为True第一行为表头,紧接着为values
|
* @param isWriteKeyAsHead 是否将Map的Key作为表头输出,如果为True第一行为表头,紧接着为values
|
||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
public ExcelWriter writeCol(Map<?,?> colMap, int startColIndex, boolean isWriteKeyAsHead){
|
public ExcelWriter writeCol(Map<?,? extends Iterable<?>> colMap, int startColIndex, boolean isWriteKeyAsHead){
|
||||||
for (Object k : colMap.keySet()) {
|
for (Object k : colMap.keySet()) {
|
||||||
Object v = colMap.get(k);
|
Iterable<?> v = colMap.get(k);
|
||||||
if(v instanceof Iterable){
|
if(v != null){
|
||||||
writeCol(isWriteKeyAsHead?k:null,startColIndex, (Iterable<?>) v, startColIndex != colMap.size() - 1);
|
writeCol(isWriteKeyAsHead?k:null,startColIndex, v, startColIndex != colMap.size() - 1);
|
||||||
startColIndex ++;
|
startColIndex ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user