From 2ad0299493c4f3e580c0cc47be6358f6146f99eb Mon Sep 17 00:00:00 2001 From: yueye <768242801@qq.com> Date: Mon, 15 May 2023 17:12:20 +0800 Subject: [PATCH] =?UTF-8?q?excel=E5=AF=BC=E5=87=BA=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E9=A1=B9=E6=97=B6=EF=BC=8C=E5=9C=A8=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E7=B1=BB=E6=97=B6=E8=BF=9B=E8=A1=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=9A=84=E5=A4=84=E7=90=86=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/excel/CellMergeStrategy.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/excel/CellMergeStrategy.java b/ruoyi-common/src/main/java/com/ruoyi/common/excel/CellMergeStrategy.java index dead983af..2e8b6ae7b 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/excel/CellMergeStrategy.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/excel/CellMergeStrategy.java @@ -28,20 +28,19 @@ import java.util.Map; @Slf4j public class CellMergeStrategy extends AbstractMergeStrategy { - private final List list; + private final List cellList; private final boolean hasTitle; private int rowIndex; public CellMergeStrategy(List list, boolean hasTitle) { - this.list = list; this.hasTitle = hasTitle; // 行合并开始下标 this.rowIndex = hasTitle ? 1 : 0; + this.cellList = handle(list, hasTitle); } @Override protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) { - List cellList = handle(list, hasTitle); // judge the list is not null if (CollUtil.isNotEmpty(cellList)) { // the judge is necessary