Browse Source

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

release/11.0
John.Ying 2 years ago
parent
commit
2148c6a830
  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