浏览代码

更新 ExcelUtil.java
读取单元格公式的值

厚积薄发 5 年之前
父节点
当前提交
75d1872b02
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java

+ 1 - 1
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java

@@ -782,7 +782,7 @@ public class ExcelUtil<T>
             Cell cell = row.getCell(column);
             if (cell != null)
             {
-                if (cell.getCellTypeEnum() == CellType.NUMERIC)
+                if (cell.getCellTypeEnum() == CellType.NUMERIC || cell.getCellTypeEnum() == CellType.FORMULA)
                 {
                     val = cell.getNumericCellValue();
                     if (HSSFDateUtil.isCellDateFormatted(cell))