Browse Source

REPORT-53157 值一样 对象地址不一样的对象同样需要被返回处理

feature/10.0
hades 3 years ago
parent
commit
a64ace980a
  1. 8
      designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java
  2. 10
      designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java

8
designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java

@ -24,6 +24,7 @@ import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.cell.cellattr.core.group.FunctionGrouper;
import com.fr.report.cell.cellattr.core.group.SelectCount;
import com.fr.stable.Filter;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@ -48,7 +49,7 @@ public class ContentObjectManager {
/**
* 放置所有需要替换内容的对象
*/
private Map<String, Set<Object>> objectMap;
private Map<String, Collection<Object>> objectMap;
private final Set<String> set = new HashSet<>();
@ -98,14 +99,13 @@ public class ContentObjectManager {
}
@Nullable
public Map<String, Set<Object>> getObjectMap() {
public Map<String, Collection<Object>> getObjectMap() {
return objectMap;
}
public boolean needContentTip(Object ob, Set<String> nameSet) {
long start = System.currentTimeMillis();
objectMap = ClassHelper.searchObject(ob, set, ModClassFilter.getInstance());
for (Map.Entry<String, Set<Object>> entry : objectMap.entrySet()) {
for (Map.Entry<String, Collection<Object>> entry : objectMap.entrySet()) {
for (Object o : entry.getValue()) {
for (String name : nameSet) {
ContentReplacer contentReplacer = map.get(entry.getKey());

10
designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java

@ -29,9 +29,9 @@ import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.fr.log.FineLoggerFactory;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 默认联动内容替换器实现
@ -106,14 +106,14 @@ public class ContentReplacerCenter {
}
private void onRename(List<ContentChangeItem> contentChangeItemList, List<ContentChange> contentChangeList) {
Map<String, Set<Object>> objectMap = ContentObjectManager.getInstance().getObjectMap();
Map<String, Collection<Object>> objectMap = ContentObjectManager.getInstance().getObjectMap();
if (objectMap != null) {
long start = System.currentTimeMillis();
for (ContentChange contentChange : contentChangeList) {
Set<Object> set = objectMap.get(contentChange.type());
Collection<Object> objects = objectMap.get(contentChange.type());
// 所有需要处理的js等对象
if (set != null) {
for (Object ob : set) {
if (objects != null) {
for (Object ob : objects) {
fireChange(ob, contentChange, contentChangeItemList);
}
}

Loading…
Cancel
Save