mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-26 11:51:55 +08:00
修复ExcelUtil查找对象的子列表属性fields 没有判断当前是导入还是导出的问题
This commit is contained in:
@@ -1290,9 +1290,6 @@ public class ExcelUtil<T>
|
|||||||
Excel attr = field.getAnnotation(Excel.class);
|
Excel attr = field.getAnnotation(Excel.class);
|
||||||
if (attr != null && (attr.type() == Type.ALL || attr.type() == type))
|
if (attr != null && (attr.type() == Type.ALL || attr.type() == type))
|
||||||
{
|
{
|
||||||
field.setAccessible(true);
|
|
||||||
fields.add(new Object[] { field, attr });
|
|
||||||
}
|
|
||||||
if (Collection.class.isAssignableFrom(field.getType()))
|
if (Collection.class.isAssignableFrom(field.getType()))
|
||||||
{
|
{
|
||||||
subMethod = getSubMethod(field.getName(), clazz);
|
subMethod = getSubMethod(field.getName(), clazz);
|
||||||
@@ -1300,6 +1297,14 @@ public class ExcelUtil<T>
|
|||||||
Class<?> subClass = (Class<?>) pt.getActualTypeArguments()[0];
|
Class<?> subClass = (Class<?>) pt.getActualTypeArguments()[0];
|
||||||
this.subFields = FieldUtils.getFieldsListWithAnnotation(subClass, Excel.class);
|
this.subFields = FieldUtils.getFieldsListWithAnnotation(subClass, Excel.class);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
field.setAccessible(true);
|
||||||
|
fields.add(new Object[] { field, attr });
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多注解
|
// 多注解
|
||||||
|
|||||||
Reference in New Issue
Block a user