Browse Source

Pull request #15161: REPORT-137667 【fr-fbp冒烟】【数据源】服务器数据集设置分页查询sql不生效

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

* commit '46ab19f9f167f5f0cc0aeb2f218b58f155943312':
  REPORT-137667 【fr-fbp冒烟】【数据源】服务器数据集设置分页查询sql不生效
fbp/master
Destiny.Lin-林锦龙 2 months ago
parent
commit
52b671861c
  1. 14
      designer-base/src/main/java/com/fr/design/data/datapane/preview/TableDataBeanHelper.java

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

@ -156,7 +156,12 @@ public class TableDataBeanHelper {
if (dataSet.getDatabase() instanceof NameDatabaseConnection) {
bean.setDatabase(((NameDatabaseConnection) dataSet.getDatabase()).getName());
}
bean.setQuery(DataEncryptionHelper.encrypt(dataSet.getQuery()));
if (dataSet.getQuery() != null) {
bean.setQuery(DataEncryptionHelper.encrypt(dataSet.getQuery()));
}
if (dataSet.getPageQuerySql() != null) {
bean.setPageQuery(DataEncryptionHelper.encrypt(dataSet.getPageQuerySql()));
}
List<ParameterBean> parameterBeans = new ArrayList<>();
ParameterProvider[] parameters = dataSet.getParameters(Calculator.createCalculator());
for (ParameterProvider parameter : parameters) {
@ -186,7 +191,12 @@ public class TableDataBeanHelper {
private static TableData deserialize4SQL(Map<String, Connection> connectionMap, DBTableData oldDataSet, JSONObject object) {
DBTableData tableData = new DBTableData();
SQLDataSetBean bean = object.mapTo(SQLDataSetBean.class);
tableData.setQuery(DataEncryptionHelper.decrypt(bean.getQuery()));
if (bean.getQuery() != null) {
tableData.setQuery(DataEncryptionHelper.decrypt(bean.getQuery()));
}
if (bean.getPageQuery() != null) {
tableData.setPageQuerySql(DataEncryptionHelper.decrypt(bean.getPageQuery()));
}
Connection connection = connectionMap.get(bean.getDatabase());
if (connection != null) {
tableData.setDatabase(new NameDatabaseConnection(bean.getDatabase()));

Loading…
Cancel
Save