From 7ad91ed466cca3ec4864eb8bdb29de6ccae06511 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 9 May 2022 19:05:29 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-69725=20=E8=BF=9C=E7=A8=8B=E9=9B=86?= =?UTF-8?q?=E7=BE=A4=E7=8E=AF=E5=A2=83=EF=BC=8C=E5=AD=98=E5=82=A8=E8=BF=87?= =?UTF-8?q?=E7=A8=8B=E6=95=B0=E6=8D=AE=E9=9B=86=E7=9A=84=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=A4=8D=E5=88=B6=E8=BF=87=E6=9D=A5=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E7=B2=98?= =?UTF-8?q?=E8=B4=B4=E6=95=B0=E6=8D=AE=E9=9B=86=E7=9A=84=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E6=98=AF=E4=BD=BF=E7=94=A8TableDataWrapper=E7=94=9F=E6=88=90Ta?= =?UTF-8?q?bleDataPane=20+=20=E4=BD=BF=E7=94=A8=E5=BD=93=E4=BD=BF=E7=94=A8?= =?UTF-8?q?TableDataPane=E7=94=9F=E6=88=90=E6=96=B0=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=EF=BC=9B=E5=9C=A8=E7=94=9F=E6=88=90TableData?= =?UTF-8?q?Pane=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E4=BC=9A=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E5=AF=B9=E5=BA=94Class=E7=B1=BB=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E6=9E=84=E9=80=A0=E6=96=B9=E6=B3=95=EF=BC=8C=E5=B9=B6populateB?= =?UTF-8?q?ean=E4=B8=80=E4=B8=8B=EF=BC=9B=E5=AF=B9=E4=BA=8E=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E8=BF=87=E7=A8=8B=EF=BC=8CProcedureDataPane=E5=9C=A8p?= =?UTF-8?q?opulateBean=E7=9A=84=E6=97=B6=E5=80=99=E4=BC=9A=E5=9C=A8SwingWo?= =?UTF-8?q?rker=E7=9A=84doInBackground()=E4=B8=AD=E5=8E=BB=E5=81=9A?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E6=9F=A5=E8=AF=A2=EF=BC=8C=E7=84=B6=E5=90=8E?= =?UTF-8?q?=E5=9C=A8done()=E6=9B=B4=E6=96=B0=E5=8F=82=E6=95=B0=EF=BC=9B?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E8=BF=9E=E6=8E=A5=E4=B8=8B=EF=BC=8C=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=9A=84=E8=BF=87=E7=A8=8B=E5=8F=98=E9=95=BF=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E8=BF=98=E6=B2=A1=E6=9D=A5=E5=BE=97=E5=8F=8A?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=8A=E5=8F=82=E6=95=B0=EF=BC=8C=E5=90=8E?= =?UTF-8?q?=E7=BB=AD=E4=BD=BF=E7=94=A8TableDataPane=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E6=95=B0=E6=8D=AE=E9=9B=86=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=B8=BA=E7=A9=BA=EF=BC=8C=E5=9B=A0=E6=AD=A4?= =?UTF-8?q?=E5=88=9B=E5=BB=BADataModel=E7=9A=84=E6=97=B6=E5=80=99=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E6=8A=A5=E9=94=99=E7=BC=BA=E5=A4=B1=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E5=89=8D=E7=AB=AF=E8=A1=A8=E7=8E=B0=E4=B8=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E7=BC=96=E8=BE=91=E9=9D=A2=E6=9D=BF=E4=B8=8A?= =?UTF-8?q?=E6=B2=A1=E5=8F=82=E6=95=B0=20=E3=80=90=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=96=B9=E6=A1=88=E3=80=911.=E4=B8=93=E5=B1=9E=E4=BA=8E?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E8=BF=87=E7=A8=8B=E7=9A=84ProcedureDataPane?= =?UTF-8?q?=E4=B8=AD=E6=8F=90=E4=BE=9B=E5=8F=AF=E4=BB=A5=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=9A=84=E6=96=B9=E6=B3=95=EF=BC=9B2.?= =?UTF-8?q?=E5=AF=B9=E5=A4=8D=E5=88=B6=E7=B2=98=E8=B4=B4=E6=97=B6=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E7=94=9F=E6=88=90TableDataPane=E7=9A=84?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=8C=85=E4=BA=86=E4=B8=80=E5=B1=82=EF=BC=8C?= =?UTF-8?q?=E7=84=B6=E5=90=8E=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E4=B8=BA?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E8=BF=87=E7=A8=8B=EF=BC=8C=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E6=98=AF=E7=9A=84=E8=AF=9D=EF=BC=8C=E5=B0=86=E6=BA=90TableData?= =?UTF-8?q?=E7=9A=84=E5=8F=82=E6=95=B0=E7=9B=B4=E6=8E=A5=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=BF=9B=E5=8E=BB=EF=BC=8C=E4=BF=9D=E8=AF=81=E5=90=8E=E9=9D=A2?= =?UTF-8?q?=E8=BF=99=E4=B8=AAPane=E9=87=8C=E6=98=AF=E4=B8=80=E7=9B=B4?= =?UTF-8?q?=E6=9C=89=E5=8F=82=E6=95=B0=E7=9A=84=20=E3=80=90review=E5=BB=BA?= =?UTF-8?q?=E8=AE=AE=E3=80=91=E5=8F=AF=E8=83=BD=E6=9C=89=E6=9B=B4=E5=A5=BD?= =?UTF-8?q?=E7=9A=84=E6=94=B9=E6=B3=95=EF=BC=8C=E8=BF=99=E9=87=8C=E8=BF=99?= =?UTF-8?q?=E4=B9=88=E6=94=B9=E4=B8=BB=E8=A6=81=E6=98=AF=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E7=94=9F=E6=88=90TableDataPane=E5=92=8CpopulateBean=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=83=BD=E6=AF=94=E8=BE=83=E5=8F=A4=E8=80=81?= =?UTF-8?q?=EF=BC=8C=E9=80=BB=E8=BE=91=E4=B9=9F=E4=B8=8D=E7=86=9F=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=A4=AA=E6=95=A2=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/TableDataTreePane.java | 4 ++-- .../paste/TableDataFollowingPasteUtils.java | 20 +++++++++++++++++-- .../tabledatapane/ProcedureDataPane.java | 8 ++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java index 8f03b1cfc4..e425751772 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java @@ -19,6 +19,7 @@ import com.fr.design.data.datapane.management.search.pane.TreeSearchToolbarPane; import com.fr.design.data.datapane.management.search.searcher.TableDataSearchMode; import com.fr.design.data.datapane.management.search.TableDataTreeSearchManager; import com.fr.design.data.tabledata.StoreProcedureWorkerListener; +import com.fr.design.data.tabledata.paste.TableDataFollowingPasteUtils; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; import com.fr.design.data.tabledata.tabledatapane.DBTableDataPane; import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper; @@ -1132,8 +1133,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { // 处理数据集名称 String dsName = getNoRepeatedDsName4Paste(dataWrapperEntry.getKey()); AbstractTableDataWrapper wrapper = dataWrapperEntry.getValue(); - AbstractTableDataPane tableDataPane = wrapper.creatTableDataPane(); - addDataPane(tableDataPane, dsName); + addDataPane(TableDataFollowingPasteUtils.generateTableDataPaneWhenPaste(wrapper), dsName); } } } diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/paste/TableDataFollowingPasteUtils.java b/designer-base/src/main/java/com/fr/design/data/tabledata/paste/TableDataFollowingPasteUtils.java index f69312d47f..e90b8a4208 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/paste/TableDataFollowingPasteUtils.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/paste/TableDataFollowingPasteUtils.java @@ -3,10 +3,12 @@ package com.fr.design.data.tabledata.paste; import com.fr.base.TableData; import com.fr.base.chart.BaseChartCollection; import com.fr.data.TableDataSource; +import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.design.DesignModelAdapter; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; +import com.fr.design.data.tabledata.tabledatapane.ProcedureDataPane; import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; @@ -63,8 +65,7 @@ public class TableDataFollowingPasteUtils { continue; } AbstractTableDataWrapper tableDataWrapper = new TemplateTableDataWrapper(dataWrapperEntry.getValue(), dsName); - AbstractTableDataPane tableDataPane = tableDataWrapper.creatTableDataPane(); - tableDataTreePane.addDataPane(tableDataPane, dsName); + tableDataTreePane.addDataPane(generateTableDataPaneWhenPaste(tableDataWrapper), dsName); } } @@ -337,4 +338,19 @@ public class TableDataFollowingPasteUtils { return templeteDataSet; } + /** + * 生成粘贴(新建)时使用的AbstractTableDataPane + * 主要是为了处理StoreProcedure,它在远程情况下,无法及时获取参数。这边因为是复制粘贴,所以直接用原TableData的参数即可 + * @param tableDataWrapper wrapper + * @return AbstractTableDataPane + */ + public static AbstractTableDataPane generateTableDataPaneWhenPaste(AbstractTableDataWrapper tableDataWrapper) { + AbstractTableDataPane tableDataPane = tableDataWrapper.creatTableDataPane(); + TableData tableData = tableDataWrapper.getTableData(); + if (tableData instanceof StoreProcedure) { + StoreProcedure storeProcedure = (StoreProcedure) tableData; + ((ProcedureDataPane) tableDataPane).populateParameters(storeProcedure.getParameters()); + } + return tableDataPane; + } } diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java index d2a1918d4f..a2a279b60e 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java @@ -225,6 +225,14 @@ public class ProcedureDataPane extends AbstractTableDataPane imp } + /** + * 手动更新参数,用于上面populateBean方法中SwingWorker查询来不及的情况 + * @param procedureParameters + */ + public void populateParameters(StoreProcedureParameter[] procedureParameters) { + this.editorPane.populate(procedureParameters); + } + /** * 增加存储过程监听器 *