Browse Source

Pull request #10878: KERNEL-13706 保存数据集时,不需要对每一个数据集都去请求数据

Merge in DESIGN/design from ~JOHN.YING/design:release/11.0 to release/11.0

* commit '32a6d935392c78fbb2f406e2d3ef95a446de04e4':
  KERNEL-13706 保存数据集时,不需要对每一个数据集都去请求数据
newui
John.Ying-应志浩 2 years ago
parent
commit
55eedddca7
  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) { protected void addTableDataParameters(Map<String, ParameterProvider> map, Filter<ParameterProvider> filter) {
Iterator<String> it = this.getBook().getTableDataNameIterator(); Iterator<String> it = this.getBook().getTableDataNameIterator();
List<String> names = new ArrayList<>();
try { try {
// 清空下缓存 List<TableData> tableDatas = new ArrayList<>();
tableDataParametersMap.clear();
while (it.hasNext()) { while (it.hasNext()) {
String name = it.next(); String name = it.next();
TableData tableData = this.getBook().getTableData(name); 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) { if (filter != null) {
ParameterApplyHelper.addPara2Map(map, parameterProviders, filter, null, ParameterSource.DEFAULT_SOURCE); ParameterApplyHelper.addPara2Map(map, parameterProviders, filter, null, ParameterSource.DEFAULT_SOURCE);
} else { } else {
ParameterApplyHelper.addPara2Map(map, parameterProviders, null, ParameterSource.TEMPLATE_SOURCE); ParameterApplyHelper.addPara2Map(map, parameterProviders, null, ParameterSource.TEMPLATE_SOURCE);
} }
tableDataParametersMap.put(name, parameterProviders); tableDataParametersMap.put(names.get(i), parameterProviders);
} }
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e, e.getMessage());
} }
} }

Loading…
Cancel
Save