Browse Source

feature: REPORT-106900【远程设计性能】远程设计协议重构

- 处理残留的 tabledata\connection
new-design
Harrison 11 months ago
parent
commit
d585184ad2
  1. 7
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
  2. 9
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

7
designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java

@ -14,8 +14,9 @@ import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.file.ProcedureConfig; import com.fr.file.ProcedureConfig;
import com.fr.file.ServerTableDataService;
import com.fr.file.TableDataChanges;
import com.fr.file.TableDataConfig; import com.fr.file.TableDataConfig;
import com.fr.file.TableDataOperator;
import com.fr.file.TableDataOperatorImpl; import com.fr.file.TableDataOperatorImpl;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject; import com.fr.general.NameObject;
@ -238,13 +239,13 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
public void update(TableDataConfig tableDataConfig) { public void update(TableDataConfig tableDataConfig) {
List<TableDataBean> tableDataBeans = getUpdateTableDataBeans(); List<TableDataBean> tableDataBeans = getUpdateTableDataBeans();
try { try {
WorkContext.getCurrent().get(TableDataOperator.class, new ExceptionHandler() { WorkContext.getCurrent().get(ServerTableDataService.class, new ExceptionHandler() {
@Override @Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) { public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
// 走老的方式 // 走老的方式
return saveByOldWay(tableDataBeans); return saveByOldWay(tableDataBeans);
} }
}).saveTableData(new ArrayList<>(tableDataConfig.getTableDatas().keySet()), tableDataBeans); }).apply(new TableDataChanges(new ArrayList<>(tableDataConfig.getTableDatas().keySet()), tableDataBeans));
if (!WorkContext.getCurrent().isLocal()) { if (!WorkContext.getCurrent().isLocal()) {
EventDispatcher.fire(RemoteConfigEvent.EDIT, TableDataConfig.getInstance().getNameSpace()); EventDispatcher.fire(RemoteConfigEvent.EDIT, TableDataConfig.getInstance().getNameSpace());
} }

9
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -9,7 +9,6 @@ import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.data.metric.utils.DatabaseConnectionMetricHandler; import com.fr.data.metric.utils.DatabaseConnectionMetricHandler;
import com.fr.data.operator.DataOperator; import com.fr.data.operator.DataOperator;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.general.MapCompareUtils;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.fun.ConnectionProvider; import com.fr.design.fun.ConnectionProvider;
import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.JListControlPane;
@ -19,7 +18,9 @@ import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionConfig;
import com.fr.file.ConnectionOperator; import com.fr.file.ConnectionService;
import com.fr.file.ConnectionsChange;
import com.fr.general.MapCompareUtils;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.license.database.DBTypes; import com.fr.license.database.DBTypes;
import com.fr.license.database.DataBaseTypePointManager; import com.fr.license.database.DataBaseTypePointManager;
@ -332,8 +333,8 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
private void alterConnections(List<String> removedConnNames, List<ConnectionBean> addedOrUpdatedConnections) { private void alterConnections(List<String> removedConnNames, List<ConnectionBean> addedOrUpdatedConnections) {
try { try {
WorkContext.getCurrent().get(ConnectionOperator.class, exceptionInfo -> saveByOldWay(removedConnNames, addedOrUpdatedConnections)) WorkContext.getCurrent().get(ConnectionService.class, exceptionInfo -> saveByOldWay(removedConnNames, addedOrUpdatedConnections))
.saveConnection(removedConnNames, addedOrUpdatedConnections); .apply(new ConnectionsChange(removedConnNames, addedOrUpdatedConnections));
// hades:远程环境时,由于时直接RPC调用远程修改,因此设计器本地配置需要失效 // hades:远程环境时,由于时直接RPC调用远程修改,因此设计器本地配置需要失效
if (!WorkContext.getCurrent().isLocal()) { if (!WorkContext.getCurrent().isLocal()) {

Loading…
Cancel
Save