From ba6015ca19e73d94416676b6f773b19218f7744d Mon Sep 17 00:00:00 2001 From: chengliejian <284067032@qq.com> Date: Thu, 7 Aug 2025 16:57:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=81=BF=E5=85=8D=E6=AF=8F?= =?UTF-8?q?=E4=B8=AA=E5=AD=97=E6=AE=B5=E9=83=BD=E8=BF=9B=E8=A1=8CExcelIgno?= =?UTF-8?q?reUnannotated.class=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/dromara/common/excel/core/CellMergeStrategy.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 39697e186..3e1ccfd67 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 @@ -73,6 +73,7 @@ public class CellMergeStrategy extends AbstractMergeStrategy implements Workbook return cellList; } Class clazz = list.get(0).getClass(); + boolean annotationPresent = clazz.isAnnotationPresent(ExcelIgnoreUnannotated.class); Field[] fields = ReflectUtils.getFields(clazz, field -> { if ("serialVersionUID".equals(field.getName())) { return false; @@ -80,7 +81,7 @@ public class CellMergeStrategy extends AbstractMergeStrategy implements Workbook if (field.isAnnotationPresent(ExcelIgnore.class)) { return false; } - return !clazz.isAnnotationPresent(ExcelIgnoreUnannotated.class) || field.isAnnotationPresent(ExcelProperty.class); + return !annotationPresent || field.isAnnotationPresent(ExcelProperty.class); }); // 有注解的字段