!447 优化:解决导出数据时,LocalDateTime类型数据导出没数据问题

Merge pull request !447 from 黄严/dev
master
若依 3 years ago committed by Gitee
commit 526957e0ac
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
  1. 4
      ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java

@ -316,7 +316,7 @@ public class ExcelUtil<T>
String dateFormat = field.getAnnotation(Excel.class).dateFormat(); String dateFormat = field.getAnnotation(Excel.class).dateFormat();
if (StringUtils.isNotEmpty(dateFormat)) if (StringUtils.isNotEmpty(dateFormat))
{ {
val = parseDateToStr(dateFormat, (Date) val); val = parseDateToStr(dateFormat, val);
} }
else else
{ {
@ -823,7 +823,7 @@ public class ExcelUtil<T>
String dictType = attr.dictType(); String dictType = attr.dictType();
if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value)) if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
{ {
cell.setCellValue(parseDateToStr(dateFormat, (Date) value)); cell.setCellValue(parseDateToStr(dateFormat, value));
} }
else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value)) else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
{ {

Loading…
Cancel
Save