mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 17:38:48 +08:00
优化避免每个字段都进行ExcelIgnoreUnannotated.class判断
This commit is contained in:
parent
0bc9097f18
commit
ba6015ca19
@ -73,6 +73,7 @@ public class CellMergeStrategy extends AbstractMergeStrategy implements Workbook
|
||||
return cellList;
|
||||
}
|
||||
Class<?> clazz = list.get(0).getClass();
|
||||
boolean annotationPresent = clazz.isAnnotationPresent(ExcelIgnoreUnannotated.class);
|
||||
Field[] fields = ReflectUtils.getFields(clazz, field -> {
|
||||
if ("serialVersionUID".equals(field.getName())) {
|
||||
return false;
|
||||
@ -80,7 +81,7 @@ public class CellMergeStrategy extends AbstractMergeStrategy implements Workbook
|
||||
if (field.isAnnotationPresent(ExcelIgnore.class)) {
|
||||
return false;
|
||||
}
|
||||
return !clazz.isAnnotationPresent(ExcelIgnoreUnannotated.class) || field.isAnnotationPresent(ExcelProperty.class);
|
||||
return !annotationPresent || field.isAnnotationPresent(ExcelProperty.class);
|
||||
});
|
||||
|
||||
// 有注解的字段
|
||||
|
||||
Loading…
Reference in New Issue
Block a user