优化参数

This commit is contained in:
RuoYi 2020-07-23 21:45:22 +08:00
parent 5d89d0b36a
commit 388e36ed4d
3 changed files with 12 additions and 14 deletions

View File

@ -41,8 +41,8 @@ public class DictUtils
Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key)); Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
if (StringUtils.isNotNull(cacheObj)) if (StringUtils.isNotNull(cacheObj))
{ {
List<SysDictData> DictDatas = StringUtils.cast(cacheObj); List<SysDictData> dictDatas = StringUtils.cast(cacheObj);
return DictDatas; return dictDatas;
} }
return null; return null;
} }

View File

@ -201,8 +201,9 @@ public class ExcelUtil<T>
// 设置类的私有字段属性可访问. // 设置类的私有字段属性可访问.
field.setAccessible(true); field.setAccessible(true);
Integer column = cellMap.get(attr.name()); Integer column = cellMap.get(attr.name());
if(column !=null ) { // 字段在excel 中没有那么就不需要设置值 if (column != null)
fieldsMap.put(column, field); {
fieldsMap.put(column, field);
} }
} }
} }
@ -897,15 +898,7 @@ public class ExcelUtil<T>
} }
else else
{ {
/* if ((Double) val % 1 > 0) val = new BigDecimal(val.toString()); // 浮点格式处理
{
val = new DecimalFormat("0.00").format(val);
}
else
{
val = new DecimalFormat("0").format(val);
}*/
val = new BigDecimal(val.toString()); // 导入的数据保证原汁原味不做处理
} }
} }
else if (cell.getCellTypeEnum() == CellType.STRING) else if (cell.getCellTypeEnum() == CellType.STRING)

View File

@ -11,6 +11,11 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.generator.domain.GenTable; import com.ruoyi.generator.domain.GenTable;
import com.ruoyi.generator.domain.GenTableColumn; import com.ruoyi.generator.domain.GenTableColumn;
/**
* 模板处理工具类
*
* @author ruoyi
*/
public class VelocityUtils public class VelocityUtils
{ {
/** 项目空间路径 */ /** 项目空间路径 */