diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java index c6489e286..12a63688f 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -98,6 +98,11 @@ public class ExcelUtil public static final String[] FORMULA_STR = { "=", "-", "+", "@" }; + /** + * 用于dictType属性数据存储,避免重复查缓存 + */ + public Map sysDictMap = new HashMap(); + /** * Excel sheet最大行数,默认65536 */ @@ -1034,7 +1039,12 @@ public class ExcelUtil } else if (StringUtils.isNotEmpty(dictType) && StringUtils.isNotNull(value)) { - cell.setCellValue(convertDictByExp(Convert.toStr(value), dictType, separator)); + if (!sysDictMap.containsKey(dictType + value)) + { + String lable = convertDictByExp(Convert.toStr(value), dictType, separator); + sysDictMap.put(dictType + value, lable); + } + cell.setCellValue(sysDictMap.get(dictType + value)); } else if (value instanceof BigDecimal && -1 != attr.scale()) {