Quellcode durchsuchen

支持自定义隐藏属性列过滤子对象

RuoYi vor 3 Jahren
Ursprung
Commit
f8ad7ea3ce

+ 2 - 1
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java

@@ -1257,7 +1257,8 @@ public class ExcelUtil<T>
1257 1257
                     Excel[] excels = attrs.value();
1258 1258
                     for (Excel attr : excels)
1259 1259
                     {
1260
-                        if (attr != null && (attr.type() == Type.ALL || attr.type() == type))
1260
+                        if (!ArrayUtils.contains(this.excludeFields, field.getName() + "." + attr.targetAttr())
1261
+                                && (attr != null && (attr.type() == Type.ALL || attr.type() == type)))
1261 1262
                         {
1262 1263
                             field.setAccessible(true);
1263 1264
                             fields.add(new Object[] { field, attr });