Browse Source

时间字符串处理

pull/146/head
厚积薄发 5 years ago committed by Gitee
parent
commit
868edbc88c
  1. 8
      ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java

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

@ -223,10 +223,18 @@ public class ExcelUtil<T>
val = StringUtils.substringBefore(s, ".0");
}
else
{
String dateFormat = field.getAnnotation(Excel.class).dateFormat();
if(StringUtils.isNotEmpty(dateFormat))
{
val=DateUtils.parseDateToStr(dateFormat,(Date) val);
}
else
{
val = Convert.toStr(val);
}
}
}
else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType))
{
val = Convert.toInt(val);

Loading…
Cancel
Save