|
@@ -1,5 +1,6 @@
|
|
|
package com.fdkankan.manage.util;
|
|
|
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
@@ -33,7 +34,7 @@ public class ExcelUtil {
|
|
|
//转换为List数组
|
|
|
for (int cellNum=0;cellNum<= row.getLastCellNum();cellNum++){
|
|
|
Cell cell = row.getCell(cellNum);
|
|
|
- if (cell != null && cell.getCellTypeEnum() != CellType.STRING && HSSFDateUtil.isCellDateFormatted(cell))
|
|
|
+ if (cell != null && ObjectUtils.isNotEmpty(cell.getStringCellValue()) && cell.getCellTypeEnum() != CellType.STRING && HSSFDateUtil.isCellDateFormatted(cell))
|
|
|
{
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
Date date = HSSFDateUtil.getJavaDate(cell.getNumericCellValue());
|