Browse Source

REPORT-114391 【微服务适配】远程&本地设计器能够正常启动 完善数据集与数据连接

mss/2.0
Destiny.Lin 4 months ago
parent
commit
d078e947dd
  1. 8
      designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
  2. 4
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

8
designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java

@ -22,6 +22,8 @@ import com.fr.esd.event.DsNameTarget;
import com.fr.esd.event.StrategyEventsNotifier; import com.fr.esd.event.StrategyEventsNotifier;
import com.fr.report.LockItem; import com.fr.report.LockItem;
import com.fr.workspace.server.entity.tabledata.TableDataBean;
import com.fr.workspace.server.repository.tabledata.TableDataRepository;
import javax.swing.KeyStroke; import javax.swing.KeyStroke;
import java.awt.Dimension; import java.awt.Dimension;
@ -75,7 +77,11 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
} }
// 锁定成功,执行后续操作 // 锁定成功,执行后续操作
final DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); final DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final Map<String, TableData> tableDataMap = TableDataConfigProviderFactory.getInstance().getTableDatas(); final TableDataBean[] beans = TableDataRepository.getInstance().getAllTableData();
final Map<String, TableData> tableDataMap = new HashMap<>();
for (TableDataBean bean : beans) {
tableDataMap.put(bean.getTableData().getName() , bean.getTableData());
}
final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() { final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() {
public void complete() { public void complete() {
populate(tableDataMap); populate(tableDataMap);

4
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -295,8 +295,8 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> implemen
private void refreshParameters() { private void refreshParameters() {
String[] paramTexts = new String[2]; String[] paramTexts = new String[2];
paramTexts[0] = SqlUtils.tryPureSqlText(this.sqlTextPane.getText()); paramTexts[0] = SqlUtils.clearSqlComments(this.sqlTextPane.getText());
paramTexts[1] = SqlUtils.tryPureSqlText(this.pageQuery); paramTexts[1] = SqlUtils.clearSqlComments(this.pageQuery);
List<ParameterProvider> existParameterList = this.editorPane.update(); List<ParameterProvider> existParameterList = this.editorPane.update();
Parameter[] ps = (existParameterList == null) ? new Parameter[0] : existParameterList.toArray(new Parameter[0]); Parameter[] ps = (existParameterList == null) ? new Parameter[0] : existParameterList.toArray(new Parameter[0]);

2
designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

@ -161,7 +161,7 @@ public class TableViewList extends UIList {
*/ */
private DefaultListModel processDataInAnotherThread(String databaseName, String searchFilter, String... typesFilter) throws Exception { private DefaultListModel processDataInAnotherThread(String databaseName, String searchFilter, String... typesFilter) throws Exception {
DefaultListModel defaultListModel = new DefaultListModel(); DefaultListModel defaultListModel = new DefaultListModel();
Connection datasource = ConnectionConfigProviderFactory.getConfigProvider().getConnection(databaseName); Connection datasource = ConnectionRepository.getInstance().getByName(databaseName).getConnection();
if (datasource == null) { if (datasource == null) {
return defaultListModel; return defaultListModel;
} }

Loading…
Cancel
Save