|
|
|
@ -21,6 +21,8 @@ import com.fr.stable.StringUtils;
|
|
|
|
|
import com.fr.stable.js.WidgetName; |
|
|
|
|
|
|
|
|
|
import com.fr.util.ParameterApplyHelper; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.Iterator; |
|
|
|
|
import java.util.List; |
|
|
|
@ -309,13 +311,13 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
|
|
|
|
|
} else { |
|
|
|
|
parameterProviders = entry.getValue(); |
|
|
|
|
} |
|
|
|
|
updateParaMap(map, parameterProviders, filter); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (filter != null) { |
|
|
|
|
ParameterApplyHelper.addPara2Map(map, parameterProviders, filter); |
|
|
|
|
} else { |
|
|
|
|
ParameterApplyHelper.addPara2Map(map, parameterProviders); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 处理非初始化(已存在数据集参数)时 添加逻辑
|
|
|
|
|
if (!tableDataParametersMap.containsKey(tdName)) { |
|
|
|
|
providers = DataOperator.getInstance().getTableDataParameters(tableData); |
|
|
|
|
updateParaMap(map, providers, filter); |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
@ -327,6 +329,33 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 更新全部参数中的数据集参数 |
|
|
|
|
*/ |
|
|
|
|
private void updateParaMap(Map<String, ParameterProvider> map, ParameterProvider[] parameterProviders, Filter<ParameterProvider> filter) { |
|
|
|
|
if (filter != null) { |
|
|
|
|
ParameterApplyHelper.addPara2Map(map, parameterProviders, filter); |
|
|
|
|
} else { |
|
|
|
|
ParameterApplyHelper.addPara2Map(map, parameterProviders); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void removeTableDataParameters(String tdName) { |
|
|
|
|
ParameterProvider[] tableDataParameters = tableDataParametersMap.remove(tdName); |
|
|
|
|
List<Parameter> allParameterList = new ArrayList<>(Arrays.asList(parameters)); |
|
|
|
|
List<Parameter> tableDataParameterList = new ArrayList<>(); |
|
|
|
|
for (ParameterProvider parameterProvider : tableDataParameters) { |
|
|
|
|
tableDataParameterList.add((Parameter) parameterProvider); |
|
|
|
|
} |
|
|
|
|
allParameterList.removeAll(tableDataParameterList); |
|
|
|
|
parameters = allParameterList.toArray(new Parameter[0]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void updateAllParameters() { |
|
|
|
|
parameters = getLatestParameters(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void addGlobalParameters(Map<String, ParameterProvider> map) { |
|
|
|
|
// 添加全局参数
|
|
|
|
|
Parameter[] glbParas = ParameterConfig.getInstance().getGlobalParameters(); |
|
|
|
|