From 46ab19f9f167f5f0cc0aeb2f218b58f155943312 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 23 Oct 2024 15:57:48 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-137667=20=E3=80=90fr-fbp=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E3=80=90=E6=95=B0=E6=8D=AE=E6=BA=90=E3=80=91?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E6=95=B0=E6=8D=AE=E9=9B=86=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=88=86=E9=A1=B5=E6=9F=A5=E8=AF=A2sql=E4=B8=8D?= =?UTF-8?q?=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/preview/TableDataBeanHelper.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/TableDataBeanHelper.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/TableDataBeanHelper.java index 6884df268d..5efe1c8908 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/TableDataBeanHelper.java +++ b/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 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 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()));