优化ExcelUtil空值处理

2.X
Ricky 4 years ago committed by 疯狂的狮子li
parent 64227e874d
commit 2449f714d2

@ -528,7 +528,10 @@ public class ExcelUtil<T>
} }
else if (ColumnType.NUMERIC == attr.cellType()) else if (ColumnType.NUMERIC == attr.cellType())
{ {
cell.setCellValue(StringUtils.contains(Convert.toStr(value), ".") ? Convert.toDouble(value) : Convert.toInt(value)); if (StringUtils.isNotNull(value))
{
cell.setCellValue(StringUtils.contains(Convert.toStr(value), ".") ? Convert.toDouble(value) : Convert.toInt(value));
}
} }
else if (ColumnType.IMAGE == attr.cellType()) else if (ColumnType.IMAGE == attr.cellType())
{ {

Loading…
Cancel
Save