소스 검색

!109 现有 ExcelUtil无法读取公式计算的值
Merge pull request !109 from 厚积薄发/master

若依 6 년 전
부모
커밋
d67ff9bf2c
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))