From 388e36ed4dc5024195fbc2a60fa1be64be89d65f Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 23 Jul 2020 21:45:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/utils/DictUtils.java | 4 ++-- .../com/ruoyi/common/utils/poi/ExcelUtil.java | 17 +++++------------ .../com/ruoyi/generator/util/VelocityUtils.java | 5 +++++ 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java index e40b0c008..0d3a23d51 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java @@ -41,8 +41,8 @@ public class DictUtils Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key)); if (StringUtils.isNotNull(cacheObj)) { - List DictDatas = StringUtils.cast(cacheObj); - return DictDatas; + List dictDatas = StringUtils.cast(cacheObj); + return dictDatas; } return null; } 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 51dbcd703..13af48617 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 @@ -201,8 +201,9 @@ public class ExcelUtil // 设置类的私有字段属性可访问. field.setAccessible(true); Integer column = cellMap.get(attr.name()); - if(column !=null ) { // 字段在excel 中没有,那么就不需要设置值 - fieldsMap.put(column, field); + if (column != null) + { + fieldsMap.put(column, field); } } } @@ -695,7 +696,7 @@ public class ExcelUtil } return StringUtils.stripEnd(propertyString.toString(), separator); } - + /** * 解析字典值 * @@ -897,15 +898,7 @@ public class ExcelUtil } else { - /* if ((Double) val % 1 > 0) - { - val = new DecimalFormat("0.00").format(val); - } - else - { - val = new DecimalFormat("0").format(val); - }*/ - val = new BigDecimal(val.toString()); // 导入的数据保证原汁原味,不做处理 + val = new BigDecimal(val.toString()); // 浮点格式处理 } } else if (cell.getCellTypeEnum() == CellType.STRING) diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java index ba0da0742..15c23d0f4 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java @@ -11,6 +11,11 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.generator.domain.GenTable; import com.ruoyi.generator.domain.GenTableColumn; +/** + * 模板处理工具类 + * + * @author ruoyi + */ public class VelocityUtils { /** 项目空间路径 */