Commit 388e36ed4dc5024195fbc2a60fa1be64be89d65f
1 parent
5d89d0b3
优化参数
Showing
3 changed files
with
12 additions
and
14 deletions
ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java
| ... | ... | @@ -41,8 +41,8 @@ public class DictUtils |
| 41 | 41 | Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key)); |
| 42 | 42 | if (StringUtils.isNotNull(cacheObj)) |
| 43 | 43 | { |
| 44 | - List<SysDictData> DictDatas = StringUtils.cast(cacheObj); | |
| 45 | - return DictDatas; | |
| 44 | + List<SysDictData> dictDatas = StringUtils.cast(cacheObj); | |
| 45 | + return dictDatas; | |
| 46 | 46 | } |
| 47 | 47 | return null; |
| 48 | 48 | } | ... | ... |
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
| ... | ... | @@ -201,8 +201,9 @@ public class ExcelUtil<T> |
| 201 | 201 | // 设置类的私有字段属性可访问. |
| 202 | 202 | field.setAccessible(true); |
| 203 | 203 | Integer column = cellMap.get(attr.name()); |
| 204 | - if(column !=null ) { // 字段在excel 中没有,那么就不需要设置值 | |
| 205 | - fieldsMap.put(column, field); | |
| 204 | + if (column != null) | |
| 205 | + { | |
| 206 | + fieldsMap.put(column, field); | |
| 206 | 207 | } |
| 207 | 208 | } |
| 208 | 209 | } |
| ... | ... | @@ -695,7 +696,7 @@ public class ExcelUtil<T> |
| 695 | 696 | } |
| 696 | 697 | return StringUtils.stripEnd(propertyString.toString(), separator); |
| 697 | 698 | } |
| 698 | - | |
| 699 | + | |
| 699 | 700 | /** |
| 700 | 701 | * 解析字典值 |
| 701 | 702 | * |
| ... | ... | @@ -897,15 +898,7 @@ public class ExcelUtil<T> |
| 897 | 898 | } |
| 898 | 899 | else |
| 899 | 900 | { |
| 900 | - /* if ((Double) val % 1 > 0) | |
| 901 | - { | |
| 902 | - val = new DecimalFormat("0.00").format(val); | |
| 903 | - } | |
| 904 | - else | |
| 905 | - { | |
| 906 | - val = new DecimalFormat("0").format(val); | |
| 907 | - }*/ | |
| 908 | - val = new BigDecimal(val.toString()); // 导入的数据保证原汁原味,不做处理 | |
| 901 | + val = new BigDecimal(val.toString()); // 浮点格式处理 | |
| 909 | 902 | } |
| 910 | 903 | } |
| 911 | 904 | else if (cell.getCellTypeEnum() == CellType.STRING) | ... | ... |
ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java
| ... | ... | @@ -11,6 +11,11 @@ import com.ruoyi.common.utils.StringUtils; |
| 11 | 11 | import com.ruoyi.generator.domain.GenTable; |
| 12 | 12 | import com.ruoyi.generator.domain.GenTableColumn; |
| 13 | 13 | |
| 14 | +/** | |
| 15 | + * 模板处理工具类 | |
| 16 | + * | |
| 17 | + * @author ruoyi | |
| 18 | + */ | |
| 14 | 19 | public class VelocityUtils |
| 15 | 20 | { |
| 16 | 21 | /** 项目空间路径 */ | ... | ... |