Browse Source

Merge pull request #3912 in DESIGN/design from bugfix/10.0 to release/10.0

* commit 'dc90fc88da3ccd3e98b458edb8abacb50e8dee2f':
  REPORT-50788 【10.0.15】参数面板不会自动生成第二个数据集设置的参数
  CHART-18772  frm下初始化需要选中gisButton
  REPORT-50096 fix 预防npe
  REPORT-50096 FR远程BI,未改动配置,确认保存后配置发生变化
zheng-1641779399395
superman 4 years ago
parent
commit
61bd80c8b0
  1. 21
      designer-base/src/main/java/com/fr/design/DesignModelAdapter.java
  2. 8
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java
  3. 1
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java

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

@ -309,13 +309,13 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
} else { } else {
parameterProviders = entry.getValue(); 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) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
@ -327,6 +327,17 @@ 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);
}
}
protected void addGlobalParameters(Map<String, ParameterProvider> map) { protected void addGlobalParameters(Map<String, ParameterProvider> map) {
// 添加全局参数 // 添加全局参数
Parameter[] glbParas = ParameterConfig.getInstance().getGlobalParameters(); Parameter[] glbParas = ParameterConfig.getInstance().getGlobalParameters();

8
designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java

@ -99,6 +99,8 @@ public class JDBCDefPane extends JPanel {
private IntegerEditor DBCP_NUMTESTSPEREVICTIONRUN = new IntegerEditor(); private IntegerEditor DBCP_NUMTESTSPEREVICTIONRUN = new IntegerEditor();
private IntegerEditor DBCP_MINEVICTABLEIDLETIMEMILLIS = new IntegerEditor(); private IntegerEditor DBCP_MINEVICTABLEIDLETIMEMILLIS = new IntegerEditor();
private JDBCDatabaseConnection jdbcDatabase;
public JDBCDefPane() { public JDBCDefPane() {
this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":")); this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":"));
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
@ -202,6 +204,7 @@ public class JDBCDefPane extends JPanel {
if (jdbcDatabase == null) { if (jdbcDatabase == null) {
jdbcDatabase = new JDBCDatabaseConnection(); jdbcDatabase = new JDBCDatabaseConnection();
} }
this.jdbcDatabase = jdbcDatabase;
if (ComparatorUtils.equals(jdbcDatabase.getDriver(), "sun.jdbc.odbc.JdbcOdbcDriver") if (ComparatorUtils.equals(jdbcDatabase.getDriver(), "sun.jdbc.odbc.JdbcOdbcDriver")
&& jdbcDatabase.getURL().startsWith("jdbc:odbc:Driver={Microsoft")) { && jdbcDatabase.getURL().startsWith("jdbc:odbc:Driver={Microsoft")) {
this.dbtypeComboBox.setSelectedItem("Access"); this.dbtypeComboBox.setSelectedItem("Access");
@ -235,6 +238,7 @@ public class JDBCDefPane extends JPanel {
if (dbcpAttr == null) { if (dbcpAttr == null) {
dbcpAttr = new DBCPConnectionPoolAttr(); dbcpAttr = new DBCPConnectionPoolAttr();
jdbcDatabase.setDbcpAttr(dbcpAttr); jdbcDatabase.setDbcpAttr(dbcpAttr);
this.jdbcDatabase.setDbcpAttr(dbcpAttr);
} }
this.DBCP_INITIAL_SIZE.setValue(dbcpAttr.getInitialSize()); this.DBCP_INITIAL_SIZE.setValue(dbcpAttr.getInitialSize());
this.DBCP_MAX_ACTIVE.setValue(dbcpAttr.getMaxActive()); this.DBCP_MAX_ACTIVE.setValue(dbcpAttr.getMaxActive());
@ -251,7 +255,9 @@ public class JDBCDefPane extends JPanel {
} }
public JDBCDatabaseConnection update() { public JDBCDatabaseConnection update() {
JDBCDatabaseConnection jdbcDatabase = new JDBCDatabaseConnection(); if (jdbcDatabase == null) {
jdbcDatabase = new JDBCDatabaseConnection();
}
Object driveItem = this.driverComboBox.getSelectedItem(); Object driveItem = this.driverComboBox.getSelectedItem();
jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString()); jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString());
jdbcDatabase.setURL(this.urlTextField.getText().trim()); jdbcDatabase.setURL(this.urlTextField.getText().trim());

1
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java

@ -79,6 +79,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
private JPanel createGISLayerPane() { private JPanel createGISLayerPane() {
gisButton = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Form_Widget_Style_Standard"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); gisButton = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Form_Widget_Style_Standard"), Toolkit.i18nText("Fine-Design_Chart_Custom")});
gisButton.setSelectedIndex(0);
gisGaoDeLayer = new UIComboBox(MapLayerConfigManager.getGaoDeLayerItems()); gisGaoDeLayer = new UIComboBox(MapLayerConfigManager.getGaoDeLayerItems());
gisButton.addActionListener(event -> { gisButton.addActionListener(event -> {
refreshZoomLevel(); refreshZoomLevel();

Loading…
Cancel
Save