|
|
|
@ -420,7 +420,7 @@ public class ExcelUtil<T>
|
|
|
|
|
}
|
|
|
|
|
else if (!attr.handler().equals(ExcelHandlerAdapter.class))
|
|
|
|
|
{
|
|
|
|
|
val = dataFormatHandlerAdapter(val, attr);
|
|
|
|
|
val = dataFormatHandlerAdapter(val, attr, null);
|
|
|
|
|
}
|
|
|
|
|
ReflectUtils.invokeSetter(entity, propertyName, val);
|
|
|
|
|
}
|
|
|
|
@ -910,7 +910,7 @@ public class ExcelUtil<T>
|
|
|
|
|
}
|
|
|
|
|
else if (!attr.handler().equals(ExcelHandlerAdapter.class))
|
|
|
|
|
{
|
|
|
|
|
cell.setCellValue(dataFormatHandlerAdapter(value, attr));
|
|
|
|
|
cell.setCellValue(dataFormatHandlerAdapter(value, attr, cell));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -1097,13 +1097,13 @@ public class ExcelUtil<T>
|
|
|
|
|
* @param excel 数据注解
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public String dataFormatHandlerAdapter(Object value, Excel excel)
|
|
|
|
|
public String dataFormatHandlerAdapter(Object value, Excel excel, Cell cell)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Object instance = excel.handler().newInstance();
|
|
|
|
|
Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class });
|
|
|
|
|
value = formatMethod.invoke(instance, value, excel.args());
|
|
|
|
|
Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class, Cell.class, Workbook.class });
|
|
|
|
|
value = formatMethod.invoke(instance, value, excel.args(), cell, this.wb);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|