Browse Source

Merge pull request #10899 in DESIGN/design from release/11.0 to bugfix/11.0

* commit '55eedddca7bf72500716c6755da6c6f352e6db42':
  KERNEL-13706 保存数据集时,不需要对每一个数据集都去请求数据
bugfix/11.0
superman 2 years ago
parent
commit
1fd0d1a15f
  1. 16
      designer-base/src/main/java/com/fr/design/DesignModelAdapter.java

16
designer-base/src/main/java/com/fr/design/DesignModelAdapter.java

@ -276,22 +276,28 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
protected void addTableDataParameters(Map<String, ParameterProvider> map, Filter<ParameterProvider> filter) {
Iterator<String> it = this.getBook().getTableDataNameIterator();
List<String> names = new ArrayList<>();
try {
// 清空下缓存
tableDataParametersMap.clear();
List<TableData> tableDatas = new ArrayList<>();
while (it.hasNext()) {
String name = it.next();
TableData tableData = this.getBook().getTableData(name);
ParameterProvider[] parameterProviders = DataOperator.getInstance().getTableDataParameters(tableData);
tableDatas.add(tableData);
names.add(name);
}
ParameterProvider[][] totalParameterProviders = DataOperator.getInstance().getTotalTableDataParameters(tableDatas);
tableDataParametersMap.clear();
for (int i = 0; i < totalParameterProviders.length; i++) {
ParameterProvider[] parameterProviders = totalParameterProviders[i];
if (filter != null) {
ParameterApplyHelper.addPara2Map(map, parameterProviders, filter, null, ParameterSource.DEFAULT_SOURCE);
} else {
ParameterApplyHelper.addPara2Map(map, parameterProviders, null, ParameterSource.TEMPLATE_SOURCE);
}
tableDataParametersMap.put(name, parameterProviders);
tableDataParametersMap.put(names.get(i), parameterProviders);
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e, e.getMessage());
}
}

Loading…
Cancel
Save