Quellcode durchsuchen

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

RuoYi vor 5 Jahren
Ursprung
Commit
28b8f3e36f

+ 3 - 3
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);
                             }