Update DataListWrapper.java

This commit is contained in:
RB 2024-09-07 00:52:40 +08:00
parent c3003d201a
commit 85bf168632

View file

@ -33,6 +33,7 @@ import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -58,6 +59,8 @@ public class DataListWrapper {
private boolean mixWrapper = true;
private Map<ID, Object> cacheRefValue = new HashMap<>();
/**
* @param total
* @param data
@ -175,6 +178,11 @@ public class DataListWrapper {
final DisplayType dt = easyField.getDisplayType();
final Object originValue = value;
final boolean isCacheRefValue = dt == DisplayType.REFERENCE && value instanceof ID;
if (isCacheRefValue) {
if (cacheRefValue.containsKey((ID) value)) return cacheRefValue.get(value);
}
boolean unpack = dt == DisplayType.CLASSIFICATION || dt == DisplayType.PICKLIST
|| dt == DisplayType.STATE || dt == DisplayType.BOOL;
@ -248,6 +256,7 @@ public class DataListWrapper {
}
}
if (isCacheRefValue) cacheRefValue.put((ID) originValue, value);
return value;
}