From 834044d06b066c4d9344117810ce303e7daaa857 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 11 May 2022 11:40:07 +0800 Subject: [PATCH] =?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=A4=84=E7=90=86?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E4=BB=A3=E7=A0=81=E9=97=AE=E9=A2=98=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=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=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 a9483bf89e..9c604aa724 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); }