From ba1855ccd90500d2a2e8607948fa7f7b925dd4a9 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 11 May 2022 14:39:35 +0800 Subject: [PATCH 1/9] =?UTF-8?q?REPORT-70857=20=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E5=90=8E=E7=8B=AC=E7=AB=8B=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E5=8C=B9=E9=85=8D?= =?UTF-8?q?TableData=E6=97=B6=EF=BC=8C=E7=94=A8=E7=9A=84equals=E6=AF=94?= =?UTF-8?q?=E8=BE=83=EF=BC=8C=E4=BD=86=E6=98=AF=E5=90=8C=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1equals=E4=B8=BAfalse=EF=BC=8C=E7=9B=AE?= =?UTF-8?q?=E5=89=8D=E5=B7=B2=E7=9F=A5=E7=9A=84=E6=98=AF=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E8=BF=87=E7=A8=8BTableData=EF=BC=8C=E5=B7=B2=E7=BB=8F=E8=B7=9F?= =?UTF-8?q?rinoux=E6=B2=9F=E9=80=9A=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D?= =?UTF-8?q?=E8=B7=AF=E3=80=91=E7=9B=B4=E6=8E=A5=E6=8D=A2=E6=88=90=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E6=AF=94=E8=BE=83=20=E3=80=90review=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E3=80=91=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/tabledata/paste/TableDataFollowingPasteUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 9c604aa724..80ac3e6142 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 @@ -163,7 +163,8 @@ public class TableDataFollowingPasteUtils { for (Map.Entry dataWrapperEntry : dataWrapperMap.entrySet()) { String tdName = dataWrapperEntry.getKey(); TableData td = dataWrapperEntry.getValue().getTableData(); - if (td.equals(tableData)) { + // 有些数据集的equals方法有问题,这里直接判断对象地址 + if (td == tableData) { return tdName; } } From 8811cfb6bd297cff2ed571bfa698273967f7acee Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 10 May 2022 21:55:39 +0800 Subject: [PATCH 2/9] =?UTF-8?q?REPORT-70446=20mac=E4=B8=8B=E6=82=AC?= =?UTF-8?q?=E6=B5=AE=E5=BC=B9=E7=AA=97=E9=9A=90=E8=97=8F=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E6=97=B6=E5=81=B6=E7=8E=B0=E7=99=BD=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/alphafine/question/QuestionWindow.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java index 079eecadb8..c69b6c468e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java @@ -55,6 +55,7 @@ public class QuestionWindow extends JWindow { @Override public void windowDeactivated(WindowEvent e) { + QuestionWindow.getInstance().dispose(); QuestionWindow.getInstance().setVisible(false); } }); From 5d7ce0e012222ce8b45e979fdfea2d4923951b47 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 10 May 2022 21:54:05 +0800 Subject: [PATCH 3/9] =?UTF-8?q?REPORT-71213=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/exit/ConfigToPropMigrator.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/designer-base/src/main/java/com/fr/exit/ConfigToPropMigrator.java b/designer-base/src/main/java/com/fr/exit/ConfigToPropMigrator.java index 909768beef..ec77559856 100644 --- a/designer-base/src/main/java/com/fr/exit/ConfigToPropMigrator.java +++ b/designer-base/src/main/java/com/fr/exit/ConfigToPropMigrator.java @@ -40,7 +40,14 @@ public class ConfigToPropMigrator { } public void execute() { + try { + _execute(); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().warn(throwable.getMessage(), throwable); + } + } + private void _execute() { if (WorkContext.getCurrent().isLocal()) { String url = "jdbc:hsqldb:file://" + WorkContext.getCurrent().getPath() + "/" + ProjectConstants.EMBED_DB_DIRECTORY + "/finedb/db;hsqldb.tx=mvcc"; From fd62632d3c4c5943dbb2faa703a328e2020c283b Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 11 May 2022 14:58:17 +0800 Subject: [PATCH 4/9] =?UTF-8?q?REPORT-71213=20=E4=BA=A4=E4=BA=92=E7=82=B9?= =?UTF-8?q?=E8=A1=A5=E5=85=85=EF=BC=9A=E5=85=B3=E9=97=AD=E4=BA=86=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E5=8A=A8=E6=80=81=E6=97=B6,=E6=82=AC=E6=B5=AE?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=9C=89=E6=96=B0?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/alphafine/question/QuestionPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java index 0d0d9ab633..b2c186a9ea 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.alphafine.question; import com.fr.base.svg.SVGLoader; import com.fr.base.svg.SystemScaleUtils; +import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.alphafine.AlphaFineUtil; import com.fr.design.utils.SvgPaintUtils; import java.awt.Color; @@ -37,7 +38,7 @@ public class QuestionPane extends JPanel { int width = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getWidth() * SVGLoader.SYSTEM_SCALE) : getWidth(); int height = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getHeight() * SVGLoader.SYSTEM_SCALE) : getHeight(); - if (AlphaFineUtil.unread()) { + if (AlphaFineUtil.unread() && DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isProductDynamics()) { g2.drawImage(NEW_MESSAGE_IMAGE, 0, 0, this); } else { g2.drawImage(QUESTION_BACKGROUND_IMAGE, 0, 0, this); From 43f7b03a3e98c98bda1b93019031c7732cba91aa Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 11 May 2022 15:21:49 +0800 Subject: [PATCH 5/9] =?UTF-8?q?REPORT-71309=20&&=20REPORT-71298=20?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=B1=95=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/AlphaFineUtil.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java index 0d23a6fc97..d0efa84351 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java @@ -32,6 +32,10 @@ public class AlphaFineUtil { private static String getReplacedString(String modelName, String string) { + // 如果是直接包含了高亮字符 返回 + if (modelName.contains(string)) { + return string; + } //需要考虑modelName有空格的情况 //比如现在是work boo k 搜索词是workb,应该要替换的部分是work b //先去掉已经匹配替换过的部分,因为考虑到分词的情况,可能会进行多次替换 @@ -53,6 +57,18 @@ public class AlphaFineUtil { return result.toString(); } + public static String escapeExprSpecialWord(String keyword) { + if (StringUtils.isNotBlank(keyword)) { + String[] fbsArr = { "\\", "$", "(", ")", "*", "+", ".", "[", "]", "?", "^", "{", "}", "|" }; + for (String key : fbsArr) { + if (keyword.contains(key)) { + keyword = keyword.replace(key, "\\" + key); + } + } + } + return keyword; + } + public static boolean unread() { Set readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet(); Set idSet = ProductNewsSearchManager.getInstance().getIdSet(); From 95d467ea38fb937961d73f7ce3bac7d0085f2265 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 11 May 2022 15:22:17 +0800 Subject: [PATCH 6/9] =?UTF-8?q?REPORT-71213=20=E6=8B=86=E5=88=86=E4=B8=8B?= =?UTF-8?q?=E5=A4=A7=E6=96=B9=E6=B3=95=20&&=20=E5=A4=84=E7=90=86=E7=A9=BA?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/component/AlphaFineFrame.java | 157 +++++++++--------- 1 file changed, 83 insertions(+), 74 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java index d93a7b2964..b6763f8cff 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java @@ -367,6 +367,87 @@ public class AlphaFineFrame extends JFrame { JPanel tabPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 20, 10)); tabPane.setBackground(Color.WHITE); + List selectedLabelList = createSelectedLabelList(); + selectedType = selectedLabelList.get(0).getCellType(); + // 第一个tab 非产品动态 + if (selectedType != CellType.PRODUCT_NEWS) { + tabLabel.setText(selectedLabelList.get(0).getText()); + readLabel.setVisible(false); + } + for (SelectedLabel selectedLabel : selectedLabelList) { + selectedLabel.addMouseListener(createMouseListener(selectedLabelList, selectedLabel, tabPane, tabLabel, readLabel)); + tabPane.add(selectedLabel); + } + showPane.add(tabPane, BorderLayout.NORTH); + showPane.add(labelPane, BorderLayout.CENTER); + showPane.add(resultPane, BorderLayout.SOUTH); + return showPane; + } + + private MouseAdapter createMouseListener(List selectedLabelList, SelectedLabel selectedLabel, + JPanel tabPane, UILabel tabLabel, UILabel readLabel) { + return new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + for (SelectedLabel label : selectedLabelList) { + label.setSelected(false); + label.setForeground(AlphaFineConstants.FOREGROUND_COLOR_8); + } + selectedLabel.setSelected(true); + // 处理产品动态 tab与下方文字展示不一致 + if (ComparatorUtils.equals(selectedLabel.getText().trim(), PRODUCT_NEWS)) { + tabLabel.setText(PRODUCT_DYNAMICS); + } else { + tabLabel.setText(selectedLabel.getText()); + } + readLabel.setVisible(false); + tabPane.repaint(); + switch (selectedLabel.getCellType()) { + case PRODUCT_NEWS: + readLabel.setVisible(true); + switchType(CellType.PRODUCT_NEWS); + break; + case ACTION: + currentSearchWorkerManager = settingSearchWorkerManager; + switchType(CellType.ACTION); + break; + case FILE: + currentSearchWorkerManager = fileSearchWorkerManager; + switchType(CellType.FILE); + break; + case DOCUMENT: + currentSearchWorkerManager = documentWorkerManager; + switchType(CellType.DOCUMENT); + break; + case PLUGIN: + currentSearchWorkerManager = pluginSearchWorkerManager; + switchType(CellType.PLUGIN); + break; + } + if (currentSearchWorkerManager != null) { + AlphaFineList alphaFineList = currentSearchWorkerManager.getSearchResultList(); + if (alphaFineList != null) { + alphaFineList.setSelectedIndex(0); + } + } + } + + private Color defaultColor; + + @Override + public void mouseEntered(MouseEvent e) { + defaultColor = selectedLabel.getForeground(); + selectedLabel.setForeground(AlphaFineConstants.SUSPENDED_COLOR); + } + + @Override + public void mouseExited(MouseEvent e) { + selectedLabel.setForeground(defaultColor); + } + }; + } + + private List createSelectedLabelList() { List selectedLabelList = new ArrayList<>(); AlphaFineConfigManager alphaFineConfigManager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager(); if (alphaFineConfigManager.isProductDynamics()) { @@ -384,79 +465,7 @@ public class AlphaFineFrame extends JFrame { if (alphaFineConfigManager.isContainPlugin()) { selectedLabelList.add(new SelectedLabel(PLUGIN, CellType.PLUGIN)); } - selectedType = selectedLabelList.get(0).getCellType(); - // 第一个tab 非产品动态 - if (selectedType != CellType.PRODUCT_NEWS) { - tabLabel.setText(selectedLabelList.get(0).getText()); - readLabel.setVisible(false); - } - for (SelectedLabel selectedLabel : selectedLabelList) { - - selectedLabel.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent e) { - for (SelectedLabel label : selectedLabelList) { - label.setSelected(false); - label.setForeground(AlphaFineConstants.FOREGROUND_COLOR_8); - } - selectedLabel.setSelected(true); - // 处理产品动态 tab与下方文字展示不一致 - if (ComparatorUtils.equals(selectedLabel.getText().trim(), PRODUCT_NEWS)) { - tabLabel.setText(PRODUCT_DYNAMICS); - } else { - tabLabel.setText(selectedLabel.getText()); - } - readLabel.setVisible(false); - tabPane.repaint(); - switch (selectedLabel.getCellType()) { - case PRODUCT_NEWS: - readLabel.setVisible(true); - switchType(CellType.PRODUCT_NEWS); - break; - case ACTION: - currentSearchWorkerManager = settingSearchWorkerManager; - switchType(CellType.ACTION); - break; - case FILE: - currentSearchWorkerManager = fileSearchWorkerManager; - switchType(CellType.FILE); - break; - case DOCUMENT: - currentSearchWorkerManager = documentWorkerManager; - switchType(CellType.DOCUMENT); - break; - case PLUGIN: - currentSearchWorkerManager = pluginSearchWorkerManager; - switchType(CellType.PLUGIN); - break; - } - if (currentSearchWorkerManager != null) { - AlphaFineList alphaFineList = currentSearchWorkerManager.getSearchResultList(); - if (alphaFineList != null) { - alphaFineList.setSelectedIndex(0); - } - } - } - - private Color defaultColor; - - @Override - public void mouseEntered(MouseEvent e) { - defaultColor = selectedLabel.getForeground(); - selectedLabel.setForeground(AlphaFineConstants.SUSPENDED_COLOR); - } - - @Override - public void mouseExited(MouseEvent e) { - selectedLabel.setForeground(defaultColor); - } - }); - tabPane.add(selectedLabel); - } - showPane.add(tabPane, BorderLayout.NORTH); - showPane.add(labelPane, BorderLayout.CENTER); - showPane.add(resultPane, BorderLayout.SOUTH); - return showPane; + return selectedLabelList; } private void fireOneClickRead() { @@ -699,7 +708,7 @@ public class AlphaFineFrame extends JFrame { } else if (searchText.startsWith(DS_MARK)) { return new SearchTextBean(getStoreText(searchText), new String[]{DS_NAME + getStoreText(searchText)}); } else { - return new SearchTextBean(searchText, segmentationResult); + return new SearchTextBean(searchText, segmentationResult == null ? new String[]{} : segmentationResult); } } From 239d754fd3b2e23073e07cdc8b206e9a286852a5 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 11 May 2022 15:54:36 +0800 Subject: [PATCH 7/9] =?UTF-8?q?REPORT-71309=20fix=20=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E7=9A=84npe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java index d0efa84351..814bc3530d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java @@ -33,7 +33,7 @@ public class AlphaFineUtil { private static String getReplacedString(String modelName, String string) { // 如果是直接包含了高亮字符 返回 - if (modelName.contains(string)) { + if (StringUtils.contains(modelName, string)) { return string; } //需要考虑modelName有空格的情况 From a350e241b70a05d06d08225ceb078047013973e3 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 12 May 2022 10:01:05 +0800 Subject: [PATCH 8/9] =?UTF-8?q?REPORT-71449=20=E3=80=90=E5=86=92=E7=83=9F?= =?UTF-8?q?=E3=80=91=E4=B8=8D=E5=A4=8D=E5=88=B6=E6=96=B0=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=EF=BC=8C=E2=80=9C=E5=89=AA=E8=B4=B4=E7=89=88?= =?UTF-8?q?=E2=80=9D=E7=9A=84=E6=95=B0=E6=8D=AE=E9=9B=86=E4=BC=9A=E5=8F=98?= =?UTF-8?q?=E5=8C=96=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E3=80=91=E5=A4=8D=E5=88=B6=E5=88=B0=E5=89=AA=E5=88=87=E6=9D=BF?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=95=B0=E6=8D=AE=E9=9B=86=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?=E7=B2=98=E8=B4=B4=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8CTableData?= =?UTF-8?q?=E6=B2=A1=E5=81=9Aclone=E5=A4=84=E7=90=86=EF=BC=8C=E5=BD=93?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B2=98=E8=B4=B4=E5=87=BA=E6=9D=A5=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=97=B6=EF=BC=8C=E4=BC=9A=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E5=BD=B1=E5=93=8D=E5=89=AA=E5=88=87=E6=9D=BF=E9=87=8C?= =?UTF-8?q?=E7=9A=84TableData=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D?= =?UTF-8?q?=E8=B7=AF=E3=80=91=E7=B2=98=E8=B4=B4=E6=97=B6=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?clone=E5=A4=84=E7=90=86=20=E3=80=90review=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E3=80=91=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/tabledata/paste/TableDataFollowingPasteUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 80ac3e6142..a9b3b70ad7 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 @@ -375,8 +375,10 @@ public class TableDataFollowingPasteUtils { * @return AbstractTableDataPane */ public static AbstractTableDataPane generateTableDataPaneWhenPaste(AbstractTableDataWrapper tableDataWrapper) { - AbstractTableDataPane tableDataPane = tableDataWrapper.creatTableDataPane(); - TableData tableData = tableDataWrapper.getTableData(); + // 粘贴时再做一次TableData的clone + AbstractTableDataWrapper clonedWrapper = new TemplateTableDataWrapper(cloneTableData(tableDataWrapper.getTableData())); + AbstractTableDataPane tableDataPane = clonedWrapper.creatTableDataPane(); + TableData tableData = clonedWrapper.getTableData(); if (tableData instanceof StoreProcedure) { StoreProcedure storeProcedure = (StoreProcedure) tableData; ((ProcedureDataPane) tableDataPane).populateParameters(storeProcedure.getParameters()); From 66cea01ce10a57fb4de4fa1cf1eb05fe4a38645b Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 12 May 2022 10:45:39 +0800 Subject: [PATCH 9/9] =?UTF-8?q?REPORT-71449=20=E3=80=90=E5=86=92=E7=83=9F?= =?UTF-8?q?=E3=80=91=E4=B8=8D=E5=A4=8D=E5=88=B6=E6=96=B0=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=EF=BC=8C=E2=80=9C=E5=89=AA=E8=B4=B4=E7=89=88?= =?UTF-8?q?=E2=80=9D=E7=9A=84=E6=95=B0=E6=8D=AE=E9=9B=86=E4=BC=9A=E5=8F=98?= =?UTF-8?q?=E5=8C=96=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E3=80=91=E7=B2=98=E8=B4=B4=E7=9A=84=E6=97=B6=E5=80=99=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=81=9Aclone=E5=A4=84=E7=90=86=EF=BC=8C=E5=81=87?= =?UTF-8?q?=E5=A6=82=E4=BF=AE=E6=94=B9=E7=B2=98=E8=B4=B4=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=EF=BC=8C=E4=BC=9A=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=89=E5=89=AA=E5=88=87=E6=9D=BF=E9=87=8C?= =?UTF-8?q?=E5=AD=98=E7=9A=84Tableda=20=E3=80=90=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=80=9D=E8=B7=AF=E3=80=91=E6=B7=BB=E5=8A=A0=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E6=97=B6TableData=E7=9A=84clone=E9=80=BB=E8=BE=91=20=E3=80=90r?= =?UTF-8?q?eview=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/TableDataTreePane.java | 5 ++++- .../paste/TableDataFollowingPasteUtils.java | 14 +++++++++++--- 2 files changed, 15 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 e425751772..112adff560 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 @@ -1133,7 +1133,10 @@ public class TableDataTreePane extends BasicTableDataTreePane { // 处理数据集名称 String dsName = getNoRepeatedDsName4Paste(dataWrapperEntry.getKey()); AbstractTableDataWrapper wrapper = dataWrapperEntry.getValue(); - addDataPane(TableDataFollowingPasteUtils.generateTableDataPaneWhenPaste(wrapper), dsName); + AbstractTableDataPane tableDataPane = TableDataFollowingPasteUtils.generateTableDataPaneWhenPaste(wrapper); + if (tableDataPane != null) { + addDataPane(tableDataPane, 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 a9b3b70ad7..4c39e28545 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 @@ -66,7 +66,10 @@ public class TableDataFollowingPasteUtils { continue; } AbstractTableDataWrapper tableDataWrapper = new TemplateTableDataWrapper(dataWrapperEntry.getValue(), dsName); - tableDataTreePane.addDataPane(generateTableDataPaneWhenPaste(tableDataWrapper), dsName); + AbstractTableDataPane tableDataPane = generateTableDataPaneWhenPaste(tableDataWrapper); + if (tableDataPane != null) { + tableDataTreePane.addDataPane(tableDataPane, dsName); + } } } @@ -372,11 +375,16 @@ public class TableDataFollowingPasteUtils { * 生成粘贴(新建)时使用的AbstractTableDataPane * 主要是为了处理StoreProcedure,它在远程情况下,无法及时获取参数。这边因为是复制粘贴,所以直接用原TableData的参数即可 * @param tableDataWrapper wrapper - * @return AbstractTableDataPane + * @return AbstractTableDataPane,当TableData clone失败时,方法返回null */ + @Nullable public static AbstractTableDataPane generateTableDataPaneWhenPaste(AbstractTableDataWrapper tableDataWrapper) { // 粘贴时再做一次TableData的clone - AbstractTableDataWrapper clonedWrapper = new TemplateTableDataWrapper(cloneTableData(tableDataWrapper.getTableData())); + TableData clonedTableData = cloneTableData(tableDataWrapper.getTableData()); + if (clonedTableData == null) { + return null; + } + AbstractTableDataWrapper clonedWrapper = new TemplateTableDataWrapper(clonedTableData); AbstractTableDataPane tableDataPane = clonedWrapper.creatTableDataPane(); TableData tableData = clonedWrapper.getTableData(); if (tableData instanceof StoreProcedure) {