Browse Source

Merge pull request #3186 from gongxuanzhang/column_field

parameter mistake
pull/2510/merge
gongxuanzhang 2 years ago committed by GitHub
parent
commit
5c91f90635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      easyexcel-core/src/main/java/com/alibaba/excel/util/ClassUtils.java
  2. 3
      easyexcel-core/src/main/java/com/alibaba/excel/write/builder/AbstractExcelWriterParameterBuilder.java

13
easyexcel-core/src/main/java/com/alibaba/excel/util/ClassUtils.java

@ -341,13 +341,11 @@ public class ClassUtils {
// The current field needs to be ignored
if (writeHolder.ignore(field.getFieldName(), entry.getKey())) {
if (ignoreSet != null) {
ignoreSet.add(field.getFieldName());
}
ignoreSet.add(field.getFieldName());
indexFieldMap.remove(index);
} else {
// Mandatory sorted fields
if (ignoreSet.contains(key)) {
if (indexFieldMap.containsKey(key)) {
tempSortedFieldMapp.put(key, field);
} else {
// Need to reorder automatically
@ -367,9 +365,9 @@ public class ClassUtils {
}
/**
* it only works when {@link WriteHolder#getIncludeColumnFieldNames()} or
* {@link WriteHolder#getIncludeColumnIndexes()} ()} has value
* and {@link WriteHolder#getOrderByIncludeColumn()} ()} is true
* it only works when {@link WriteHolder#includeColumnFieldNames()} or
* {@link WriteHolder#includeColumnIndexes()} has value
* and {@link WriteHolder#orderByIncludeColumn()} is true
**/
private static void resortField(WriteHolder writeHolder, FieldCache fieldCache) {
if (!writeHolder.orderByIncludeColumn()) {
@ -559,3 +557,4 @@ public class ClassUtils {
CONTENT_THREAD_LOCAL.remove();
}
}

3
easyexcel-core/src/main/java/com/alibaba/excel/write/builder/AbstractExcelWriterParameterBuilder.java

@ -106,8 +106,9 @@ public abstract class AbstractExcelWriterParameterBuilder<T extends AbstractExce
/**
* Only output the custom columns.
*
* @deprecated use {@link #includeColumnFieldNames(Collection)}
* @deprecated use {@link #includeColumnFieldNames(Collection)} spelling mistake
*/
@Deprecated
public T includeColumnFiledNames(Collection<String> includeColumnFieldNames) {
parameter().setIncludeColumnFieldNames(includeColumnFieldNames);
return self();

Loading…
Cancel
Save