From 8dbe6879d57ed14f7e3831a4b64413be6859b4f2 Mon Sep 17 00:00:00 2001 From: zhaofs Date: Thu, 1 May 2025 12:55:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=AF=BC=E5=87=BA=E5=B8=A6?= =?UTF-8?q?=E6=9C=89=E5=AD=97=E5=85=B8=E9=80=89=E6=8B=A9=E5=88=97=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=97=B6=E5=AD=97=E5=85=B8=E5=88=97=E9=94=99?= =?UTF-8?q?=E4=BD=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/handler/SelectSheetWriteHandler.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/handler/SelectSheetWriteHandler.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/handler/SelectSheetWriteHandler.java index ef1eb65bcd4..eecce293fb9 100644 --- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/handler/SelectSheetWriteHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/handler/SelectSheetWriteHandler.java @@ -57,14 +57,16 @@ public SelectSheetWriteHandler(Class head) { // 解析下拉数据 int colIndex = 0; for (Field field : head.getDeclaredFields()) { - if (field.isAnnotationPresent(ExcelColumnSelect.class)) { - ExcelProperty excelProperty = field.getAnnotation(ExcelProperty.class); - if (excelProperty != null && excelProperty.index() != -1) { - colIndex = excelProperty.index(); + if(field.isAnnotationPresent(ExcelProperty.class)){ + if (field.isAnnotationPresent(ExcelColumnSelect.class)) { + ExcelProperty excelProperty = field.getAnnotation(ExcelProperty.class); + if (excelProperty != null && excelProperty.index() != -1) { + colIndex = excelProperty.index(); + } + getSelectDataList(colIndex, field); } - getSelectDataList(colIndex, field); + colIndex++; } - colIndex++; } }