|
|
@@ -6,7 +6,6 @@ import java.io.OutputStream;
|
|
6
|
6
|
import java.lang.reflect.Field;
|
|
7
|
7
|
import java.lang.reflect.Method;
|
|
8
|
8
|
import java.math.BigDecimal;
|
|
9
|
|
-import java.text.DecimalFormat;
|
|
10
|
9
|
import java.util.ArrayList;
|
|
11
|
10
|
import java.util.Arrays;
|
|
12
|
11
|
import java.util.Comparator;
|
|
|
@@ -194,7 +193,10 @@ public class ExcelUtil<T>
|
|
194
|
193
|
// 设置类的私有字段属性可访问.
|
|
195
|
194
|
field.setAccessible(true);
|
|
196
|
195
|
Integer column = cellMap.get(attr.name());
|
|
197
|
|
- fieldsMap.put(column, field);
|
|
|
196
|
+ if (column != null)
|
|
|
197
|
+ {
|
|
|
198
|
+ fieldsMap.put(column, field);
|
|
|
199
|
+ }
|
|
198
|
200
|
}
|
|
199
|
201
|
}
|
|
200
|
202
|
for (int i = 1; i < rows; i++)
|
|
|
@@ -829,14 +831,7 @@ public class ExcelUtil<T>
|
|
829
|
831
|
}
|
|
830
|
832
|
else
|
|
831
|
833
|
{
|
|
832
|
|
- if ((Double) val % 1 > 0)
|
|
833
|
|
- {
|
|
834
|
|
- val = new DecimalFormat("0.00").format(val);
|
|
835
|
|
- }
|
|
836
|
|
- else
|
|
837
|
|
- {
|
|
838
|
|
- val = new DecimalFormat("0").format(val);
|
|
839
|
|
- }
|
|
|
834
|
+ val = new BigDecimal(val.toString()); // 浮点格式处理
|
|
840
|
835
|
}
|
|
841
|
836
|
}
|
|
842
|
837
|
else if (cell.getCellTypeEnum() == CellType.STRING)
|