Quellcode durchsuchen

优化导出数据LocalDateTime类型无数据问题

RuoYi vor 4 Jahren
Ursprung
Commit
0b08933a8c

+ 2 - 2
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java

@@ -284,7 +284,7 @@ public class ExcelUtil<T>
284 284
                             String dateFormat = field.getAnnotation(Excel.class).dateFormat();
285 285
                             if (StringUtils.isNotEmpty(dateFormat))
286 286
                             {
287
-                                val = parseDateToStr(dateFormat, (Date) val);
287
+                                val = parseDateToStr(dateFormat, val);
288 288
                             }
289 289
                             else
290 290
                             {
@@ -703,7 +703,7 @@ public class ExcelUtil<T>
703 703
                 String separator = attr.separator();
704 704
                 if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
705 705
                 {
706
-                    cell.setCellValue(parseDateToStr(dateFormat, (Date) value));
706
+                    cell.setCellValue(parseDateToStr(dateFormat, value));
707 707
                 }
708 708
                 else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
709 709
                 {