From 2449f714d2a9204775e3aaacc70e2080f7d307f4 Mon Sep 17 00:00:00 2001 From: Ricky Date: Wed, 21 Apr 2021 09:59:06 +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 --- .../main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java index f754a2ca..426d37d8 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java @@ -528,7 +528,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()) {