Browse Source

REPORT-53367 复制传参后sql-远程下,新增的转义字符提示失效

feature/10.0
Bruce.Deng 3 years ago
parent
commit
70e34c2117
  1. 6
      designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java

6
designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java

@ -6,6 +6,7 @@ import com.fr.base.ParameterMapNameSpace;
import com.fr.data.impl.DBTableData; import com.fr.data.impl.DBTableData;
import com.fr.data.impl.EscapeSqlHelper; import com.fr.data.impl.EscapeSqlHelper;
import com.fr.data.operator.DataOperator; import com.fr.data.operator.DataOperator;
import com.fr.decision.config.PreventSqlInjConfig;
import com.fr.decision.webservice.v10.config.ConfigService; import com.fr.decision.webservice.v10.config.ConfigService;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.link.MessageWithLink; import com.fr.design.dialog.link.MessageWithLink;
@ -18,6 +19,7 @@ import com.fr.design.parameter.ParameterInputPane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.invoke.Reflect;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.injectable.PluginModule;
import com.fr.script.Calculator; import com.fr.script.Calculator;
@ -180,6 +182,10 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener {
calculator.pushNameSpace(ns); calculator.pushNameSpace(ns);
Parameter[] paras = processParameters(tableData, calculator); Parameter[] paras = processParameters(tableData, calculator);
// 所有被转义参数的集合 // 所有被转义参数的集合
//这里比较恶心。方法1是通过在DataOperatorProvider新增rpc接口,交由服务器去获取转义字符。但是要考虑兼容问题:
//新设计器jar远程老服务器jar,需要提供Compatible实现,但是这个实现能做什么呢?目前没有老的接口可以去获取服务器的转义字符,仍然啥也做不了;
//现在采用方法2,通过反射调用PreventSqlInjConfig的刷新方法(因为这个方法是private,直接改成public仍然有兼容问题)
Reflect.on(PreventSqlInjConfig.class).call("refreshPreventSqlInjConfig");
Set<String> specialCharParam = EscapeSqlHelper.getInstance().getSpecialCharParam(paras); Set<String> specialCharParam = EscapeSqlHelper.getInstance().getSpecialCharParam(paras);
// 将参数转义等 // 将参数转义等
Set<TableDataProvider> tableDataProviders = getTableDataProviders(); Set<TableDataProvider> tableDataProviders = getTableDataProviders();

Loading…
Cancel
Save