|
|
@@ -420,7 +420,7 @@ public class ExcelUtil<T>
|
|
420
|
420
|
}
|
|
421
|
421
|
else if (!attr.handler().equals(ExcelHandlerAdapter.class))
|
|
422
|
422
|
{
|
|
423
|
|
- val = dataFormatHandlerAdapter(val, attr);
|
|
|
423
|
+ val = dataFormatHandlerAdapter(val, attr, null);
|
|
424
|
424
|
}
|
|
425
|
425
|
ReflectUtils.invokeSetter(entity, propertyName, val);
|
|
426
|
426
|
}
|
|
|
@@ -910,7 +910,7 @@ public class ExcelUtil<T>
|
|
910
|
910
|
}
|
|
911
|
911
|
else if (!attr.handler().equals(ExcelHandlerAdapter.class))
|
|
912
|
912
|
{
|
|
913
|
|
- cell.setCellValue(dataFormatHandlerAdapter(value, attr));
|
|
|
913
|
+ cell.setCellValue(dataFormatHandlerAdapter(value, attr, cell));
|
|
914
|
914
|
}
|
|
915
|
915
|
else
|
|
916
|
916
|
{
|
|
|
@@ -1097,13 +1097,13 @@ public class ExcelUtil<T>
|
|
1097
|
1097
|
* @param excel 数据注解
|
|
1098
|
1098
|
* @return
|
|
1099
|
1099
|
*/
|
|
1100
|
|
- public String dataFormatHandlerAdapter(Object value, Excel excel)
|
|
|
1100
|
+ public String dataFormatHandlerAdapter(Object value, Excel excel, Cell cell)
|
|
1101
|
1101
|
{
|
|
1102
|
1102
|
try
|
|
1103
|
1103
|
{
|
|
1104
|
1104
|
Object instance = excel.handler().newInstance();
|
|
1105
|
|
- Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class });
|
|
1106
|
|
- value = formatMethod.invoke(instance, value, excel.args());
|
|
|
1105
|
+ Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class, Cell.class, Workbook.class });
|
|
|
1106
|
+ value = formatMethod.invoke(instance, value, excel.args(), cell, this.wb);
|
|
1107
|
1107
|
}
|
|
1108
|
1108
|
catch (Exception e)
|
|
1109
|
1109
|
{
|