diff --git a/test/src/main/java/ExcelUtils.java b/test/src/main/java/ExcelUtils.java index cdc3fc337..ff901438b 100644 --- a/test/src/main/java/ExcelUtils.java +++ b/test/src/main/java/ExcelUtils.java @@ -394,10 +394,17 @@ public class ExcelUtils { //判断cell类型 switch (cell.getCellType()) { case Cell.CELL_TYPE_NUMERIC: { - if (cellType != null && cellType.toString().contains("float")){ - cellValue = cell.getNumericCellValue(); - }else{ + + if(cellType==null){ cellValue = (int) cell.getNumericCellValue(); + }else{ + if(cellType.toString().contains("float")){ + cellValue = cell.getNumericCellValue(); + }else if(cellType.toString().contains("long")){ + cellValue = (long)cell.getNumericCellValue(); + }else{ + cellValue = (int) cell.getNumericCellValue(); + } } break; }