From 2c9458726368b46bb2ad66ac05a433aec9d76110 Mon Sep 17 00:00:00 2001 From: Ricky Date: Wed, 21 Apr 2021 09:53:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96ExcelUtil=E7=A9=BA=E5=80=BC?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java index 15612b9..f13b866 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -541,7 +541,10 @@ public class ExcelUtil } 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()) {