소스 검색

更新 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))