Browse Source

Excel注解dateFormat属性为字符串时间时格式处理

pull/149/head
RuoYi 5 years ago
parent
commit
28b8f3e36f
  1. 6
      ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java

6
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java

@ -225,11 +225,11 @@ public class ExcelUtil<T>
else
{
String dateFormat = field.getAnnotation(Excel.class).dateFormat();
if(StringUtils.isNotEmpty(dateFormat))
if (StringUtils.isNotEmpty(dateFormat))
{
val=DateUtils.parseDateToStr(dateFormat,(Date) val);
val = DateUtils.parseDateToStr(dateFormat, (Date) val);
}
else
else
{
val = Convert.toStr(val);
}

Loading…
Cancel
Save