mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 09:35:29 +08:00
Pre Merge pull request !751 from 雨伦/dev
This commit is contained in:
commit
a4082e2315
@ -73,12 +73,13 @@ public class CellMergeHandler {
|
||||
Object val = ReflectUtils.invokeGetter(rowObj, field.getName());
|
||||
|
||||
int colNum = mergeFieldsIndex.get(j);
|
||||
if (!map.containsKey(field)) {
|
||||
Object cellValue = map.containsKey(field) ? map.get(field).value() : null;
|
||||
|
||||
if (!map.containsKey(field) || (isEmpty(cellValue) && val != null)) {
|
||||
map.put(field, new RepeatCell(val, i));
|
||||
} else {
|
||||
RepeatCell repeatCell = map.get(field);
|
||||
Object cellValue = repeatCell.value();
|
||||
if (cellValue == null || "".equals(cellValue)) {
|
||||
if (isEmpty(cellValue)) {
|
||||
// 空值跳过不合并
|
||||
continue;
|
||||
}
|
||||
@ -110,6 +111,10 @@ public class CellMergeHandler {
|
||||
return cellList;
|
||||
}
|
||||
|
||||
private boolean isEmpty(Object value) {
|
||||
return value == null || "".equals(value);
|
||||
}
|
||||
|
||||
private boolean isMerge(List<?> list, int i, Field field) {
|
||||
boolean isMerge = true;
|
||||
CellMerge cm = field.getAnnotation(CellMerge.class);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user