From 155b585ae516dbcb90bc7b65eb922cc376a36321 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 13 Sep 2020 12:05:49 +0800 Subject: [PATCH] =?UTF-8?q?Excel=E5=AF=BC=E5=87=BA=E7=B1=BB=E5=9E=8BNUMERI?= =?UTF-8?q?C=E6=94=AF=E6=8C=81=E7=B2=BE=E5=BA=A6=E6=B5=AE=E7=82=B9?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= 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 | 2 +- 1 file changed, 1 insertion(+), 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 3f70ea6c..ca53349f 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 @@ -494,7 +494,7 @@ public class ExcelUtil else if (ColumnType.NUMERIC == attr.cellType()) { cell.setCellType(CellType.NUMERIC); - cell.setCellValue(Integer.parseInt(value + "")); + cell.setCellValue(StringUtils.contains(Convert.toStr(value), ".") ? Convert.toDouble(value) : Convert.toInt(value)); } }