From 497f98ba902b6d694ff1d3908d2aa7a1639265ed Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 17 Sep 2020 18:22:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5excel=E6=95=B4=E5=BD=A2?= =?UTF-8?q?=E5=80=BC=E6=A0=A1=E9=AA=8C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/utils/poi/ExcelUtil.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 43e52daf..6d57f22a 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 @@ -243,19 +243,19 @@ public class ExcelUtil val = Convert.toStr(val); } } - else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType)) + else if ((Integer.TYPE == fieldType || Integer.class == fieldType) && StringUtils.isNumeric(Convert.toStr(val))) { val = Convert.toInt(val); } - else if ((Long.TYPE == fieldType) || (Long.class == fieldType)) + else if (Long.TYPE == fieldType || Long.class == fieldType) { val = Convert.toLong(val); } - else if ((Double.TYPE == fieldType) || (Double.class == fieldType)) + else if (Double.TYPE == fieldType || Double.class == fieldType) { val = Convert.toDouble(val); } - else if ((Float.TYPE == fieldType) || (Float.class == fieldType)) + else if (Float.TYPE == fieldType || Float.class == fieldType) { val = Convert.toFloat(val); }