From 5de1ffff9008fa949e175c8bbaf716268e58ef25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 21 Mar 2025 13:53:23 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20excel=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=20=E4=B8=8B=E6=8B=89=E6=A1=86=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/dromara/common/excel/core/ExcelDownHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/ExcelDownHandler.java b/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/ExcelDownHandler.java index 32fee7a6c..e8752653f 100644 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/ExcelDownHandler.java +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/ExcelDownHandler.java @@ -16,6 +16,7 @@ import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.util.CellRangeAddressList; import org.apache.poi.ss.util.WorkbookUtil; import org.apache.poi.xssf.usermodel.XSSFDataValidation; +import org.dromara.common.core.domain.dto.DictDataDTO; import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.service.DictService; import org.dromara.common.core.utils.SpringUtils; @@ -102,9 +103,9 @@ public class ExcelDownHandler implements SheetWriteHandler { String converterExp = format.readConverterExp(); if (StringUtils.isNotBlank(dictType)) { // 如果传递了字典名,则依据字典建立下拉 - Collection values = Optional.ofNullable(dictService.getAllDictByDictType(dictType)) + Collection values = Optional.ofNullable(dictService.getDictData(dictType)) .orElseThrow(() -> new ServiceException(String.format("字典 %s 不存在", dictType))) - .values(); + .stream().map(DictDataDTO::getDictLabel).toList(); options = new ArrayList<>(values); } else if (StringUtils.isNotBlank(converterExp)) { // 如果指定了确切的值,则直接解析确切的值