diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/CellMergeHandler.java b/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/CellMergeHandler.java index dd37b6795..d54e12855 100644 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/CellMergeHandler.java +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/CellMergeHandler.java @@ -73,7 +73,7 @@ public class CellMergeHandler { Object val = ReflectUtils.invokeGetter(rowObj, field.getName()); int colNum = mergeFieldsIndex.get(j); - if (!map.containsKey(field)) { + if (!map.containsKey(field) || (map.get(field).value() == null && val != null)) { map.put(field, new RepeatCell(val, i)); } else { RepeatCell repeatCell = map.get(field);