From db44cbdb55f519f339617de2bf6be6e52282bcb6 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 11 May 2022 11:25:20 +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=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E7=9A=84=E6=97=B6=E5=80=99=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=AD=98=E5=82=A8=E8=BF=87=E7=A8=8B=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E9=97=AE=E9=A2=98=EF=BC=8C=E5=85=B6=E4=B8=AD=E6=9C=89?= =?UTF-8?q?=E5=8C=B9=E9=85=8DTableData=E7=9A=84=E6=93=8D=E4=BD=9C=EF=BC=8C?= =?UTF-8?q?=E8=80=8C=E5=A4=8D=E5=88=B6=E6=9C=AC=E8=BA=AB=E8=BF=98=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=A4=84=E7=90=86TableData=E7=9A=84clone=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E5=85=88clone=EF=BC=8C=E5=86=8D=E5=8E=BB?= =?UTF-8?q?=E5=8C=B9=E9=85=8DTableData=EF=BC=8C=E5=AF=B9=E8=B1=A1=E5=B0=B1?= =?UTF-8?q?=E4=B8=8D=E7=9B=B8=E7=AD=89=E4=BA=86=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=B0=86=E5=8C=B9=E9=85=8D?= =?UTF-8?q?TableData=E7=9A=84=E6=93=8D=E4=BD=9C=E6=94=BE=E5=9C=A8clone?= =?UTF-8?q?=E5=A4=84=E7=90=86=E4=B9=8B=E5=89=8D=20=E3=80=90review=E5=BB=BA?= =?UTF-8?q?=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 d9892c7637..6ebfdca0e8 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); }