Commit c4ed7c77 by 张祺

修改excel导入数据处理空值情况

parent a529dbbd
...@@ -15,6 +15,7 @@ public class ExcelUtil { ...@@ -15,6 +15,7 @@ public class ExcelUtil {
*/ */
public static String getXSSFCellValue(XSSFCell xssfCell) { public static String getXSSFCellValue(XSSFCell xssfCell) {
String cellValue = null; String cellValue = null;
if (xssfCell != null) {
CellType cellType = xssfCell.getCellType(); CellType cellType = xssfCell.getCellType();
if (CellType.STRING.equals(cellType)) { if (CellType.STRING.equals(cellType)) {
cellValue = xssfCell.getStringCellValue(); cellValue = xssfCell.getStringCellValue();
...@@ -25,6 +26,7 @@ public class ExcelUtil { ...@@ -25,6 +26,7 @@ public class ExcelUtil {
} else if (CellType.FORMULA.equals(cellType)) { } else if (CellType.FORMULA.equals(cellType)) {
cellValue = String.valueOf(xssfCell.getCellFormula()); cellValue = String.valueOf(xssfCell.getCellFormula());
} }
}
return cellValue; return cellValue;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment