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); }