From 2185496cb52d7a101ea66adde1a34b20229fc835 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 12 Apr 2022 11:23:31 +0800 Subject: [PATCH 01/15] =?UTF-8?q?REPORT-68987=20=E6=8A=8A=E9=AB=98?= =?UTF-8?q?=E7=BA=A7=E7=BC=96=E8=BE=91=E5=BD=93=E4=BD=9C=E5=8F=AF=E9=80=89?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/javascript/JSContentPane.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java index 65bec03a8..c9344f5ca 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java @@ -63,7 +63,9 @@ public class JSContentPane extends BasicPane { initFunctionTitle(args); JPanel jsParaPane = createJSParaPane(); - addNewPaneLabel(); + if (needAdvancedEditor()) { + addNewPaneLabel(); + } this.add(jsParaPane, BorderLayout.NORTH); UIScrollPane sp = createContentTextAreaPanel(); @@ -323,4 +325,8 @@ public class JSContentPane extends BasicPane { return provider; } + + protected boolean needAdvancedEditor() { + return true; + } } \ No newline at end of file From f47fda9a9f9c14fb7db424e87369c10816194d02 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 10 May 2022 14:15:39 +0800 Subject: [PATCH 02/15] =?UTF-8?q?REPORT-71217=20alphafine=E4=BB=85?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E6=A8=A1=E7=89=88=E6=97=B6=EF=BC=8C=E8=BF=98?= =?UTF-8?q?=E4=BC=9A=E5=87=BA=E7=8E=B0=E4=BA=A7=E5=93=81=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=B8=80=E9=94=AE=E5=A4=84=E7=90=86=E7=9A=84=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/alphafine/component/AlphaFineFrame.java | 5 +++++ 1 file changed, 5 insertions(+) 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 100e58cd3..bb5d6d060 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 @@ -385,6 +385,11 @@ public class AlphaFineFrame extends JFrame { 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() { From 163293d50a11745b183a2217acc688bd21735ee7 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 10 May 2022 14:18:37 +0800 Subject: [PATCH 03/15] =?UTF-8?q?REPORT-71221=20=E4=BD=BF=E7=94=A8alt+=20f?= =?UTF-8?q?4=20,=20alphafine=E9=9D=A2=E6=9D=BF=E4=BB=8D=E4=BC=9A=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E4=B8=8A=E4=B8=80=E6=AC=A1=E6=90=9C=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/alphafine/component/AlphaFineFrame.java | 3 +++ 1 file changed, 3 insertions(+) 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 bb5d6d060..d93a7b296 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 @@ -808,6 +808,9 @@ public class AlphaFineFrame extends JFrame { public void setVisible(boolean b) { super.setVisible(b); QuestionWindow.getInstance().setVisible(!b); + if (!b) { + AlphaFineHelper.resetAlphaFineDialog(); + } } @Override From 781c00e627cbceeb0f09edbf73242ddf3fdea5a3 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 10 May 2022 14:19:47 +0800 Subject: [PATCH 04/15] =?UTF-8?q?REPORT-67417=20=E5=A4=84=E7=90=86?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=A9=BA=E5=80=BC=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../help/alphafine/AlphaFineConfigManager.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java index 892c57ff8..1dd08c526 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java @@ -192,9 +192,12 @@ public class AlphaFineConfigManager implements XMLable { if (tmpVal != null) { tmpVal = tmpVal.replace("[",StringUtils.EMPTY).replace("]",StringUtils.EMPTY); Stack stack = new SizedStack<>(3); - List historyList = Arrays.asList(tmpVal.split(",")); + String[] historyList = tmpVal.split(","); for (String history : historyList) { - stack.add(history.trim()); + String value = history.trim(); + if (StringUtils.isNotEmpty(value)) { + stack.add(value); + } } historySearchMap.put(reader.getAttrAsString("user", StringUtils.EMPTY), stack); } @@ -215,7 +218,10 @@ public class AlphaFineConfigManager implements XMLable { String[] idArr = tmpVal.split(","); Set setId = new HashSet<>(); for (String id : idArr) { - setId.add(Long.parseLong(id.trim())); + String value = id.trim(); + if (StringUtils.isNotEmpty(value)) { + setId.add(Long.parseLong(value)); + } } readSetMap.put(reader.getAttrAsString("user", StringUtils.EMPTY), setId); } From f57f3b1fe15c8e892c96ff2312e60b304054a9be Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 10 May 2022 14:20:48 +0800 Subject: [PATCH 05/15] =?UTF-8?q?REPORT-71160=20=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/alphafine/component/AlphaFineList.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java index 665af5665..f4ffe50e3 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java @@ -49,6 +49,10 @@ public class AlphaFineList extends JList { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { + AlphaCellModel selectedValue = getSelectedValue(); + if (selectedValue.hasAction() && !(selectedValue instanceof DocumentModel)) { + AlphaFineHelper.getAlphaFineDialog().toBack(); + } dealWithSearchResult(); } } From 4b04d52fdc79ec317519be42b32bc0dfc90b572d Mon Sep 17 00:00:00 2001 From: pengda Date: Tue, 10 May 2022 14:46:45 +0800 Subject: [PATCH 06/15] =?UTF-8?q?REPORT-70955=20=E8=AE=B8=E5=A4=9A?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E4=B8=8D=E6=94=AF=E6=8C=81=E5=8D=83=E5=88=86?= =?UTF-8?q?=E6=AF=94=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/gui/style/TextFormatPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java b/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java index a53235cf2..a477cb16c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java @@ -58,7 +58,7 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName private static final Integer[] TYPES = new Integer[]{ FormatContents.NULL, FormatContents.NUMBER, FormatContents.CURRENCY, FormatContents.PERCENT, - FormatContents.THOUSANDTHS,FormatContents.SCIENTIFIC, + FormatContents.SCIENTIFIC, FormatContents.DATE, FormatContents.TIME, FormatContents.TEXT}; From bb4279b19c0d109f6e96d87d0b82c3326e0d46c8 Mon Sep 17 00:00:00 2001 From: wtianye <10320502+wtianye@user.noreply.gitee.com> Date: Tue, 10 May 2022 15:37:09 +0800 Subject: [PATCH 07/15] =?UTF-8?q?REPORT-71207=20=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=88=A0=E9=99=A4=E8=B6=85=E9=93=BE=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=E7=9A=84=E2=80=9C=E5=8F=96=E6=B6=88=E2=80=9D=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/designer/component/VanChartUIListControlPane.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java index bfa8b43e9..ba66c0392 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java @@ -173,12 +173,8 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem JPanel buttonsPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0)); controlPane.add(buttonsPane, BorderLayout.EAST); - //确定 addOkButton(buttonsPane); - //取消 - addCancelButton(buttonsPane); - controlPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); return controlPane; From 03d61df45ca7181e5aac4e989ff23c37bde92780 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 10 May 2022 16:03:16 +0800 Subject: [PATCH 08/15] =?UTF-8?q?REPORT-71062=20=E3=80=90=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=8A=A5=E9=94=99=20=E4=B8=8D=E5=BD=B1=E5=93=8D=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E7=9A=84=E6=8A=A5=E9=94=99=E6=97=A5=E5=BF=97=20?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/login/socketio/LoginAuthServer.java | 2 +- .../com/fr/design/record/analyzer/DesignerAnalyzerListener.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/login/socketio/LoginAuthServer.java b/designer-base/src/main/java/com/fr/design/login/socketio/LoginAuthServer.java index 0340fc3de..235396558 100644 --- a/designer-base/src/main/java/com/fr/design/login/socketio/LoginAuthServer.java +++ b/designer-base/src/main/java/com/fr/design/login/socketio/LoginAuthServer.java @@ -74,7 +74,7 @@ public class LoginAuthServer { try { server.start(); } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().warn(e.getMessage(), e); } } diff --git a/designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAnalyzerListener.java b/designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAnalyzerListener.java index 8db3a395f..cd52cec38 100644 --- a/designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAnalyzerListener.java +++ b/designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAnalyzerListener.java @@ -18,6 +18,6 @@ public class DesignerAnalyzerListener extends AgentBuilder.Listener.Adapter { @Override public void onError(String typeName, ClassLoader classLoader, JavaModule module, boolean loaded, Throwable throwable) { - FineLoggerFactory.getLogger().error("Designer-Analyzer transform error:" + typeName); + FineLoggerFactory.getLogger().warn("Designer-Analyzer transform error:" + typeName); } } From 04435927b963c0fd63af039fd671a5aa59431fd5 Mon Sep 17 00:00:00 2001 From: rinoux Date: Tue, 10 May 2022 16:45:14 +0800 Subject: [PATCH 09/15] =?UTF-8?q?REPORT-69285=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=AE=89=E5=85=A8=E5=85=B3=E9=94=AE=E5=AD=97?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E6=8B=A6=E6=88=AA=EF=BC=8C=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ConnectionListDialogActionAdapter.java | 12 +++++++++- .../datapane/connect/ConnectionListPane.java | 23 +++++++++++++++++-- .../connect/ConnectionManagerPane.java | 7 +++--- .../datapane/connect/ConnectionShowPane.java | 2 +- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListDialogActionAdapter.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListDialogActionAdapter.java index 2428c9a00..947cb6e75 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListDialogActionAdapter.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListDialogActionAdapter.java @@ -2,11 +2,15 @@ package com.fr.design.data.datapane.connect; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.editlock.EditLockUtils; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.file.ConnectionConfig; import com.fr.report.LockItem; +import javax.swing.JOptionPane; + /** * @author hades * @version 11.0 @@ -32,7 +36,13 @@ public class ConnectionListDialogActionAdapter extends DialogActionAdapter { connectionListDialog.setDoOKSucceed(false); return; } - connectionManagerPane.update(connectionConfig); + try { + connectionManagerPane.update(connectionConfig); + } catch (Exception e) { + connectionListDialog.setDoOKSucceed(false); + FineJOptionPane.showMessageDialog(connectionManagerPane, e.getMessage(), Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE); + return; + } DesignerContext.getDesignerBean("databasename").refreshBeanElement(); // 关闭定义数据连接页面,为其解锁 EditLockUtils.unlock(LockItem.CONNECTION); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java index 12c62b435..e4deae04b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -1,6 +1,7 @@ package com.fr.design.data.datapane.connect; import com.fr.config.RemoteConfigEvent; +import com.fr.data.core.db.JDBCSecurityChecker; import com.fr.data.impl.Connection; import com.fr.data.impl.ConnectionBean; import com.fr.data.impl.JDBCDatabaseConnection; @@ -28,6 +29,7 @@ import com.fr.transaction.WorkerFacade; import com.fr.workspace.WorkContext; import java.awt.Window; +import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -166,7 +168,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh /** * Update. */ - public void update(ConnectionConfig connectionConfig) { + public void update(ConnectionConfig connectionConfig) throws Exception { // Nameable[]居然不能强转成NameObject[],一定要这么写... Nameable[] res = this.update(); Map updatedMap = new LinkedHashMap<>(); @@ -188,10 +190,27 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh } }); - + this.checkSecurity(addedOrUpdatedConnections); this.alterConnections(removedConnNames, addedOrUpdatedConnections); } + + private void checkSecurity(List addedOrUpdatedConnections) throws Exception { + + for (ConnectionBean connectionBean : addedOrUpdatedConnections) { + Connection connection = connectionBean.getConnection(); + if (connection instanceof JDBCDatabaseConnection) { + try { + JDBCSecurityChecker.checkURL(((JDBCDatabaseConnection) connection).getURL()); + JDBCSecurityChecker.checkValidationQuery(((JDBCDatabaseConnection) connection).getDbcpAttr().getValidationQuery()); + } catch (SQLException e) { + throw new SQLException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Invalid_Config", connectionBean.getName()) + ", " + e.getMessage(), e.getCause()); + } + } + } + + } + private void alterConnections(List removedConnNames, List addedOrUpdatedConnections) { try { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java index 6c768145f..eadf456e0 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java @@ -4,9 +4,8 @@ import com.fr.design.gui.frpane.LoadingBasicPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.file.ConnectionConfig; - -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import java.awt.BorderLayout; import java.util.HashMap; public class ConnectionManagerPane extends LoadingBasicPane implements ConnectionShowPane { @@ -39,7 +38,7 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio this.connectionListPane.populate(datasourceManager); } - public void update(ConnectionConfig datasourceManager) { + public void update(ConnectionConfig datasourceManager) throws Exception { this.connectionListPane.update(datasourceManager); } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionShowPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionShowPane.java index b5ae09be8..2b74ddcf9 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionShowPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionShowPane.java @@ -7,7 +7,7 @@ import com.fr.file.ConnectionConfig; * 数据链接显示面板 */ public interface ConnectionShowPane { - void update(ConnectionConfig connectionConfig); + void update(ConnectionConfig connectionConfig) throws Exception; void populate(ConnectionConfig connectionConfig); From 00a9347e5f2981beea40e098b608afea55c153ba Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 10 May 2022 18:26:12 +0800 Subject: [PATCH 10/15] =?UTF-8?q?REPORT-70857=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=A4=8D=E5=88=B6=E5=90=8E=E7=8B=AC=E7=AB=8B=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=9C=A8=E5=81=9A=E5=A4=8D=E5=88=B6=E7=B2=98?= =?UTF-8?q?=E8=B4=B4=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?clone=E6=95=B0=E6=8D=AE=E6=BA=90=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E8=AE=B8=E5=A4=9A=E5=8F=98=E9=87=8F=E9=83=BD=E5=85=B1=E7=94=A8?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E4=BA=8E=E6=98=AF=E4=BC=9A=E6=94=B9=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=3D=E6=94=B9=E4=B8=80=E7=89=87=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=96=B9=E6=A1=88=E3=80=91=E6=B7=BB=E5=8A=A0clone?= =?UTF-8?q?=E5=A4=84=E7=90=86=20=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91?= =?UTF-8?q?=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../clip/TableDataTreeClipboard.java | 8 +++- .../paste/TableDataFollowingPasteUtils.java | 37 +++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/clip/TableDataTreeClipboard.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/clip/TableDataTreeClipboard.java index 44ae90b2c..3094df145 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/clip/TableDataTreeClipboard.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/clip/TableDataTreeClipboard.java @@ -1,6 +1,9 @@ package com.fr.design.data.datapane.management.clip; +import com.fr.base.TableData; +import com.fr.design.data.tabledata.paste.TableDataFollowingPasteUtils; import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper; +import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.general.NameObject; import java.util.HashMap; @@ -45,7 +48,10 @@ public class TableDataTreeClipboard { return resultMap; } for (NameObject selectedNameObject : selectedNameObjects) { - resultMap.put(selectedNameObject.getName(), (AbstractTableDataWrapper) selectedNameObject.getObject()); + TableData cloned = TableDataFollowingPasteUtils.cloneTableData(((AbstractTableDataWrapper) selectedNameObject.getObject()).getTableData()); + if (cloned != null) { + resultMap.put(selectedNameObject.getName(), new TemplateTableDataWrapper(cloned)); + } } return resultMap; } 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 e90b8a420..d9892c763 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 @@ -28,6 +28,7 @@ import com.fr.report.cell.FloatElement; import com.fr.report.cell.tabledata.ElementUsedTableDataProvider; import com.fr.report.worksheet.FormElementCase; import com.fr.stable.StringUtils; +import org.jetbrains.annotations.Nullable; import java.util.Arrays; import java.util.HashMap; @@ -97,6 +98,8 @@ public class TableDataFollowingPasteUtils { } } } + // 对TableData做clone处理 + tempMap = dealWithTableData4Clone(tempMap); // 处理存储过程名称问题 return dealWithStoreProcedure(tempMap); } catch (Exception e) { @@ -179,6 +182,8 @@ public class TableDataFollowingPasteUtils { collectTableDataInChartCollection(templateTableData, tempMap, widget); collectTableDataInElementCaseEditor(templateTableData, tempMap, widget); } + // 对TableData做clone处理 + tempMap = dealWithTableData4Clone(tempMap); // 处理存储过程名称问题 return dealWithStoreProcedure(tempMap); } catch (Exception e) { @@ -187,6 +192,23 @@ public class TableDataFollowingPasteUtils { return new HashMap<>(); } + /** + * 对Map中所有的TableData做clone处理 + * @param tempMap + */ + private static Map dealWithTableData4Clone(Map tempMap) { + Map resultMap = new HashMap<>(); + for (Map.Entry entry : tempMap.entrySet()) { + String name = entry.getKey(); + TableData tableData = entry.getValue(); + TableData clonedTableData = cloneTableData(tableData); + if (clonedTableData != null) { + resultMap.put(name, clonedTableData); + } + } + return resultMap; + } + /** * 收集控件-报表块中使用的数据集 * @@ -353,4 +375,19 @@ public class TableDataFollowingPasteUtils { } return tableDataPane; } + + /** + * clone数据源,如果失败,打印日志,并返回null,谨慎使用 + * @param tableData + * @return + */ + @Nullable + public static TableData cloneTableData(TableData tableData) { + try { + return (TableData) tableData.clone(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e, "clone table data {} failed", tableData.getName()); + } + return null; + } } From b1d773ab502fa6a6c35c734910b7efeabc0be7b4 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 10 May 2022 21:54:05 +0800 Subject: [PATCH 11/15] =?UTF-8?q?REPORT-71213=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=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 909768bee..ec7755985 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 65413b2db67980e26b50a8d147eac711c0eb183d Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 10 May 2022 21:55:39 +0800 Subject: [PATCH 12/15] =?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 079eecadb..c69b6c468 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 db44cbdb55f519f339617de2bf6be6e52282bcb6 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 11 May 2022 11:25:20 +0800 Subject: [PATCH 13/15] =?UTF-8?q?REPORT-70857=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=A4=8D=E5=88=B6=E5=90=8E=E7=8B=AC=E7=AB=8B=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E8=B7=9F?= =?UTF-8?q?=E9=9A=8F=E5=A4=8D=E5=88=B6=E7=9A=84=E6=97=B6=E5=80=99=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=A4=84=E7=90=86=E5=AD=98=E5=82=A8=E8=BF=87=E7=A8=8B?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E9=97=AE=E9=A2=98=EF=BC=8C=E5=85=B6=E4=B8=AD?= =?UTF-8?q?=E6=9C=89=E5=8C=B9=E9=85=8DTableData=E7=9A=84=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=EF=BC=8C=E8=80=8C=E5=A4=8D=E5=88=B6=E6=9C=AC=E8=BA=AB=E8=BF=98?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=A4=84=E7=90=86TableData=E7=9A=84clone?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E5=85=88clone=EF=BC=8C=E5=86=8D?= =?UTF-8?q?=E5=8E=BB=E5=8C=B9=E9=85=8DTableData=EF=BC=8C=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E5=B0=B1=E4=B8=8D=E7=9B=B8=E7=AD=89=E4=BA=86=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=B0=86=E5=8C=B9?= =?UTF-8?q?=E9=85=8DTableData=E7=9A=84=E6=93=8D=E4=BD=9C=E6=94=BE=E5=9C=A8?= =?UTF-8?q?clone=E5=A4=84=E7=90=86=E4=B9=8B=E5=89=8D=20=E3=80=90review?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E3=80=91=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../paste/TableDataFollowingPasteUtils.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 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 d9892c763..6ebfdca0e 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 @@ -28,6 +28,7 @@ import com.fr.report.cell.FloatElement; import com.fr.report.cell.tabledata.ElementUsedTableDataProvider; import com.fr.report.worksheet.FormElementCase; import com.fr.stable.StringUtils; +import com.fr.third.org.apache.commons.lang3.ObjectUtils; import org.jetbrains.annotations.Nullable; import java.util.Arrays; @@ -98,10 +99,11 @@ public class TableDataFollowingPasteUtils { } } } + // 处理存储过程名称问题,名称问题需要优先处理,否则就找不到匹配的TableData了 + tempMap = dealWithStoreProcedure(tempMap); // 对TableData做clone处理 tempMap = dealWithTableData4Clone(tempMap); - // 处理存储过程名称问题 - return dealWithStoreProcedure(tempMap); + return tempMap; } catch (Exception e) { FineLoggerFactory.getLogger().error("transfer widget tabledata failed", e); } @@ -153,7 +155,8 @@ public class TableDataFollowingPasteUtils { for (Map.Entry dataWrapperEntry : dataWrapperMap.entrySet()) { String tdName = dataWrapperEntry.getKey(); TableData td = dataWrapperEntry.getValue().getTableData(); - if (ComparatorUtils.equals(td, tableData)) { + // 用TableData自己重写的equals方法来比较,实际上直接用"="号也行 + if (tableData.equals(td)) { return tdName; } } @@ -182,10 +185,11 @@ public class TableDataFollowingPasteUtils { collectTableDataInChartCollection(templateTableData, tempMap, widget); collectTableDataInElementCaseEditor(templateTableData, tempMap, widget); } + // 处理存储过程名称问题,名称问题需要优先处理,否则就找不到匹配的TableData了 + tempMap = dealWithStoreProcedure(tempMap); // 对TableData做clone处理 tempMap = dealWithTableData4Clone(tempMap); - // 处理存储过程名称问题 - return dealWithStoreProcedure(tempMap); + return tempMap; } catch (Exception e) { FineLoggerFactory.getLogger().error("transfer widget tabledata failed", e); } From e4249c6256994f1397c05fd1adbfff6d3012a9a4 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 11 May 2022 11:26:49 +0800 Subject: [PATCH 14/15] =?UTF-8?q?REPORT-70857=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=A4=8D=E5=88=B6=E5=90=8E=E7=8B=AC=E7=AB=8B=20?= =?UTF-8?q?=E5=88=A0=E5=8E=BB=E5=A4=9A=E4=BD=99import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/tabledata/paste/TableDataFollowingPasteUtils.java | 1 - 1 file changed, 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 6ebfdca0e..a9483bf89 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 @@ -28,7 +28,6 @@ import com.fr.report.cell.FloatElement; import com.fr.report.cell.tabledata.ElementUsedTableDataProvider; import com.fr.report.worksheet.FormElementCase; import com.fr.stable.StringUtils; -import com.fr.third.org.apache.commons.lang3.ObjectUtils; import org.jetbrains.annotations.Nullable; import java.util.Arrays; From 834044d06b066c4d9344117810ce303e7daaa857 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 11 May 2022 11:40:07 +0800 Subject: [PATCH 15/15] =?UTF-8?q?REPORT-70857=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=A4=8D=E5=88=B6=E5=90=8E=E7=8B=AC=E7=AB=8B=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=87=8D=E5=A4=8D=E4=BB=A3=E7=A0=81=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=87=8D=E5=A4=8D=E4=BB=A3=E7=A0=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../paste/TableDataFollowingPasteUtils.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 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 a9483bf89..9c604aa72 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 @@ -98,23 +98,32 @@ public class TableDataFollowingPasteUtils { } } } - // 处理存储过程名称问题,名称问题需要优先处理,否则就找不到匹配的TableData了 - tempMap = dealWithStoreProcedure(tempMap); - // 对TableData做clone处理 - tempMap = dealWithTableData4Clone(tempMap); - return tempMap; + return dealWithTableDataMap(tempMap); } catch (Exception e) { FineLoggerFactory.getLogger().error("transfer widget tabledata failed", e); } return new HashMap<>(); } + /** + * 处理结果集 + * @param tableDataMap + * @return + */ + private static Map dealWithTableDataMap(Map tableDataMap) { + // 处理存储过程名称问题,名称问题需要优先处理,否则就找不到匹配的TableData了 + tableDataMap = dealWithStoreProcedure(tableDataMap); + // 对TableData做clone处理 + tableDataMap = dealWithTableData4Clone(tableDataMap); + return tableDataMap; + } + /** * 处理结果集,将结果集中的存储过程子表替换为原本的存储过程,否则跟随粘贴过去的存储过程名称有问题 * * @param tableDataMap */ - public static Map dealWithStoreProcedure(Map tableDataMap) { + private static Map dealWithStoreProcedure(Map tableDataMap) { Map resultMap = new HashMap<>(); if (tableDataMap == null) { return resultMap; @@ -154,8 +163,7 @@ public class TableDataFollowingPasteUtils { for (Map.Entry dataWrapperEntry : dataWrapperMap.entrySet()) { String tdName = dataWrapperEntry.getKey(); TableData td = dataWrapperEntry.getValue().getTableData(); - // 用TableData自己重写的equals方法来比较,实际上直接用"="号也行 - if (tableData.equals(td)) { + if (td.equals(tableData)) { return tdName; } } @@ -184,11 +192,7 @@ public class TableDataFollowingPasteUtils { collectTableDataInChartCollection(templateTableData, tempMap, widget); collectTableDataInElementCaseEditor(templateTableData, tempMap, widget); } - // 处理存储过程名称问题,名称问题需要优先处理,否则就找不到匹配的TableData了 - tempMap = dealWithStoreProcedure(tempMap); - // 对TableData做clone处理 - tempMap = dealWithTableData4Clone(tempMap); - return tempMap; + return dealWithTableDataMap(tempMap); } catch (Exception e) { FineLoggerFactory.getLogger().error("transfer widget tabledata failed", e); }