Browse Source

REPORT-70857 数据集复制后独立

【问题原因】跟随复制的时候需要处理存储过程名称问题,其中有匹配TableData的操作,而复制本身还需要处理TableData的clone,如果先clone,再去匹配TableData,对象就不相等了
【改动思路】将匹配TableData的操作放在clone处理之前
【review建议】无
final/11.0
Yvan 2 years ago
parent
commit
db44cbdb55
  1. 14
      designer-base/src/main/java/com/fr/design/data/tabledata/paste/TableDataFollowingPasteUtils.java

14
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<String, TableDataWrapper> 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);
}

Loading…
Cancel
Save