From 93b493a7f4849922e42df52fd3d100a7e988b578 Mon Sep 17 00:00:00 2001 From: songshuang Date: Wed, 17 Jan 2024 15:01:44 +0800 Subject: [PATCH] =?UTF-8?q?excel=E6=8F=92=E4=BB=B6=20=E5=85=8D=E9=99=A4?= =?UTF-8?q?=E9=9D=9E=E5=BF=85=E8=A6=81=E7=9A=84=E5=BE=AA=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/dromara/common/excel/core/CellMergeStrategy.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/CellMergeStrategy.java b/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/CellMergeStrategy.java index 6bd69d2d5..6388a9dcd 100644 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/CellMergeStrategy.java +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/CellMergeStrategy.java @@ -92,16 +92,14 @@ public class CellMergeStrategy extends AbstractMergeStrategy { // 空值跳过不合并 continue; } - //附加基于注解的合并条件 - boolean isMerge = isMerge(list, i, field); if (!cellValue.equals(val)) { - if ((i - repeatCell.getCurrent() > 1) && isMerge) { + if ((i - repeatCell.getCurrent() > 1) && isMerge(list, i, field)) { cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum)); } map.put(field, new RepeatCell(val, i)); } else if (i == list.size() - 1) { - if (i > repeatCell.getCurrent() && isMerge) { + if (i > repeatCell.getCurrent() && isMerge(list, i, field)) { cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex, colNum, colNum)); } }