Browse Source

Pull request #14803: REPORT-134268 【FBP】连接本地数据库测试连接成功 使用时连接错误 & REPORT-134376 【fr-fbp回归】偶现保存模板,提示模板锁定信息不一致

Merge in DESIGN/design from ~DESTINY.LIN/design:fbp/release to fbp/release

* commit '8e51c3860b43d979bd0bc0b8040d322cd76a6e40':
  REPORT-134376 【fr-fbp回归】偶现保存模板,提示模板锁定信息不一致
  REPORT-134268 【FBP】连接本地数据库测试连接成功 使用时连接错误
fbp/release
Destiny.Lin-林锦龙 2 months ago
parent
commit
c7e298ca9d
  1. 3
      designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
  2. 10
      designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java
  3. 3
      designer-base/src/main/java/com/fr/design/data/datapane/preview/TableDataBeanHelper.java
  4. 3
      designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java

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

@ -87,14 +87,11 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll()); final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());
final Map<String, TableData> tableDataMap = new HashMap<>(); final Map<String, TableData> tableDataMap = new HashMap<>();
try { try {
TransmissionEncryptionManager.setTransEncryptionLevel(1);
for (ServerDataSetBean bean : beans) { for (ServerDataSetBean bean : beans) {
tableDataMap.put(bean.getDatasetName() , TableDataBeanHelper.getTableDataSet(connectionMap, bean.getDatasetType(), bean.getDatasetData())); tableDataMap.put(bean.getDatasetName() , TableDataBeanHelper.getTableDataSet(connectionMap, bean.getDatasetType(), bean.getDatasetData()));
} }
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
TransmissionEncryptionManager.removeTransEncryptionLevel();
} }
final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() { final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() {

10
designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java

@ -52,26 +52,19 @@ public class LocalConnectionSource extends BaseConnectionSource {
@Override @Override
public String[] testConnection(ConnectionInfoBean database) throws Exception { public String[] testConnection(ConnectionInfoBean database) throws Exception {
try { try {
// 暂时这么处理,后续最好拉到外层包装一下
TransmissionEncryptionManager.setTransEncryptionLevel(1);
return ConnectionProcessorFactory.testConnectionWithSchemaReturn(database); return ConnectionProcessorFactory.testConnectionWithSchemaReturn(database);
} catch (DriverNotFoundException e) { } catch (DriverNotFoundException e) {
throw new DriverUnExistException(); throw new DriverUnExistException();
} finally {
TransmissionEncryptionManager.removeTransEncryptionLevel();
} }
} }
@Override @Override
public void add(ConnectionInfoBean bean) throws Exception { public void add(ConnectionInfoBean bean) throws Exception {
try { try {
TransmissionEncryptionManager.setTransEncryptionLevel(1);
Connection connection = ConnectionProcessorFactory.createConnection(bean); Connection connection = ConnectionProcessorFactory.createConnection(bean);
validate(bean.getConnectionName(), connection); validate(bean.getConnectionName(), connection);
ConnectionProcessorFactory.addConnection(bean); ConnectionProcessorFactory.addConnection(bean);
} catch (DriverNotFoundException e) { } catch (DriverNotFoundException e) {
throw new DriverUnExistException(); throw new DriverUnExistException();
} finally {
TransmissionEncryptionManager.removeTransEncryptionLevel();
} }
} }
@ -84,14 +77,11 @@ public class LocalConnectionSource extends BaseConnectionSource {
@Override @Override
public void update(ConnectionInfoBean bean) throws Exception { public void update(ConnectionInfoBean bean) throws Exception {
try { try {
TransmissionEncryptionManager.setTransEncryptionLevel(1);
Connection connection = ConnectionProcessorFactory.createConnection(bean); Connection connection = ConnectionProcessorFactory.createConnection(bean);
validate(bean.getConnectionName(), connection); validate(bean.getConnectionName(), connection);
ConnectionProcessorFactory.updateConnection(bean.getConnectionName(), bean); ConnectionProcessorFactory.updateConnection(bean.getConnectionName(), bean);
} catch (DriverNotFoundException e) { } catch (DriverNotFoundException e) {
throw new DriverUnExistException(); throw new DriverUnExistException();
} finally {
TransmissionEncryptionManager.removeTransEncryptionLevel();
} }
} }

3
designer-base/src/main/java/com/fr/design/data/datapane/preview/TableDataBeanHelper.java

@ -52,14 +52,11 @@ public class TableDataBeanHelper {
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll()); final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());
final Map<String, TableData> tableDataMap = new HashMap<>(); final Map<String, TableData> tableDataMap = new HashMap<>();
try { try {
TransmissionEncryptionManager.setTransEncryptionLevel(1);
for (ServerDataSetBean bean : beans) { for (ServerDataSetBean bean : beans) {
tableDataMap.put(bean.getDatasetName() , TableDataBeanHelper.getTableDataSet(connectionMap, bean.getDatasetType(), bean.getDatasetData())); tableDataMap.put(bean.getDatasetName() , TableDataBeanHelper.getTableDataSet(connectionMap, bean.getDatasetType(), bean.getDatasetData()));
} }
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
TransmissionEncryptionManager.removeTransEncryptionLevel();
} }
return tableDataMap; return tableDataMap;
} }

3
designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java vendored

@ -60,6 +60,7 @@ import com.fr.design.javascript.EmailPane;
import com.fr.design.javascript.JavaScriptImplPane; import com.fr.design.javascript.JavaScriptImplPane;
import com.fr.design.javascript.ParameterJavaScriptPane; import com.fr.design.javascript.ParameterJavaScriptPane;
import com.fr.design.javascript.ProcessTransitionAdapter; import com.fr.design.javascript.ProcessTransitionAdapter;
import com.fr.design.lock.TemplateLockInfoReSave;
import com.fr.design.login.DesignerLoginType; import com.fr.design.login.DesignerLoginType;
import com.fr.design.login.guide.DesignerGuideHelper; import com.fr.design.login.guide.DesignerGuideHelper;
import com.fr.design.login.message.DesignerMessageHelper; import com.fr.design.login.message.DesignerMessageHelper;
@ -221,6 +222,7 @@ public class DesignComponent {
DesignerWorkspaceLoader.init(); DesignerWorkspaceLoader.init();
storePassport(); storePassport();
AlphaFineHelper.switchConfig4Locale(); AlphaFineHelper.switchConfig4Locale();
TemplateLockInfoReSave.startListener();
RPCConnectHandlerCenter.startListener(); RPCConnectHandlerCenter.startListener();
RecoverManager.register(new RecoverForDesigner()); RecoverManager.register(new RecoverForDesigner());
} }
@ -534,6 +536,7 @@ public class DesignComponent {
public void stop() { public void stop() {
unloadLogAppender(); unloadLogAppender();
DesignerSocketIO.close(); DesignerSocketIO.close();
TemplateLockInfoReSave.stopListener();
} }
/** /**

Loading…
Cancel
Save