Commit 97698bc7 authored by fangxinjiang's avatar fangxinjiang

BUG修复

parent 15ffb2a3
...@@ -153,7 +153,7 @@ public @interface ExcelAttribute { ...@@ -153,7 +153,7 @@ public @interface ExcelAttribute {
* 日期格式化字符串 * 日期格式化字符串
* @return * @return
*/ */
public abstract String dateFormat() default "YYYY-MM-dd"; public abstract String dateFormat() default "yyyy-MM-dd";
/** /**
* 日期格式化字符串 * 日期格式化字符串
......
...@@ -278,7 +278,7 @@ public class ExcelUtil <T> implements Serializable { ...@@ -278,7 +278,7 @@ public class ExcelUtil <T> implements Serializable {
c = c.indexOf('%') != -1 ? c.replace("%", "") : c; c = c.indexOf('%') != -1 ? c.replace("%", "") : c;
field.set(data, BigDecimal.valueOf(Double.valueOf(c))); field.set(data, BigDecimal.valueOf(Double.valueOf(c)));
} else if (Date.class == fieldType && Common.isNotNull(c.trim())) { } else if (Date.class == fieldType && Common.isNotNull(c.trim())) {
field.set(data, DateUtil.stringToDate(c.trim(), Common.isEmpty(attr.dateFormat()) ? DateUtil.ISO_EXPANDED_DATE_FORMAT : attr.dateFormat())); field.set(data, DateUtil.parseDate(c.trim(), Common.isEmpty(attr.dateFormat()) ? DateUtil.ISO_EXPANDED_DATE_FORMAT : attr.dateFormat()));
} else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType)) { } else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType)) {
field.set(data, Integer.parseInt(c)); field.set(data, Integer.parseInt(c));
} else if ((Long.TYPE == fieldType) || (Long.class == fieldType)) { } else if ((Long.TYPE == fieldType) || (Long.class == fieldType)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment