Browse Source

Merge pull request #8889 in DESIGN/design from final/11.0 to release/11.0

* commit '4fd28c91fbc6dc49e6c881901fb050c2db4b7e5c':
  REPORT-70857 数据集复制后独立 【问题原因】处理重复代码问题 【改动思路】处理重复代码问题 【review建议】无
  REPORT-70857 数据集复制后独立 删去多余import
  REPORT-70857 数据集复制后独立 【问题原因】跟随复制的时候需要处理存储过程名称问题,其中有匹配TableData的操作,而复制本身还需要处理TableData的clone,如果先clone,再去匹配TableData,对象就不相等了 【改动思路】将匹配TableData的操作放在clone处理之前 【review建议】无
release/11.0
superman 2 years ago
parent
commit
3bc226893b
  1. 27
      designer-base/src/main/java/com/fr/design/data/tabledata/paste/TableDataFollowingPasteUtils.java

27
designer-base/src/main/java/com/fr/design/data/tabledata/paste/TableDataFollowingPasteUtils.java

@ -98,22 +98,32 @@ public class TableDataFollowingPasteUtils {
} }
} }
} }
// 对TableData做clone处理 return dealWithTableDataMap(tempMap);
tempMap = dealWithTableData4Clone(tempMap);
// 处理存储过程名称问题
return dealWithStoreProcedure(tempMap);
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error("transfer widget tabledata failed", e); FineLoggerFactory.getLogger().error("transfer widget tabledata failed", e);
} }
return new HashMap<>(); return new HashMap<>();
} }
/**
* 处理结果集
* @param tableDataMap
* @return
*/
private static Map<String, TableData> dealWithTableDataMap(Map<String, TableData> tableDataMap) {
// 处理存储过程名称问题,名称问题需要优先处理,否则就找不到匹配的TableData了
tableDataMap = dealWithStoreProcedure(tableDataMap);
// 对TableData做clone处理
tableDataMap = dealWithTableData4Clone(tableDataMap);
return tableDataMap;
}
/** /**
* 处理结果集将结果集中的存储过程子表替换为原本的存储过程否则跟随粘贴过去的存储过程名称有问题 * 处理结果集将结果集中的存储过程子表替换为原本的存储过程否则跟随粘贴过去的存储过程名称有问题
* *
* @param tableDataMap * @param tableDataMap
*/ */
public static Map<String, TableData> dealWithStoreProcedure(Map<String, TableData> tableDataMap) { private static Map<String, TableData> dealWithStoreProcedure(Map<String, TableData> tableDataMap) {
Map<String, TableData> resultMap = new HashMap<>(); Map<String, TableData> resultMap = new HashMap<>();
if (tableDataMap == null) { if (tableDataMap == null) {
return resultMap; return resultMap;
@ -153,7 +163,7 @@ public class TableDataFollowingPasteUtils {
for (Map.Entry<String, TableDataWrapper> dataWrapperEntry : dataWrapperMap.entrySet()) { for (Map.Entry<String, TableDataWrapper> dataWrapperEntry : dataWrapperMap.entrySet()) {
String tdName = dataWrapperEntry.getKey(); String tdName = dataWrapperEntry.getKey();
TableData td = dataWrapperEntry.getValue().getTableData(); TableData td = dataWrapperEntry.getValue().getTableData();
if (ComparatorUtils.equals(td, tableData)) { if (td.equals(tableData)) {
return tdName; return tdName;
} }
} }
@ -182,10 +192,7 @@ public class TableDataFollowingPasteUtils {
collectTableDataInChartCollection(templateTableData, tempMap, widget); collectTableDataInChartCollection(templateTableData, tempMap, widget);
collectTableDataInElementCaseEditor(templateTableData, tempMap, widget); collectTableDataInElementCaseEditor(templateTableData, tempMap, widget);
} }
// 对TableData做clone处理 return dealWithTableDataMap(tempMap);
tempMap = dealWithTableData4Clone(tempMap);
// 处理存储过程名称问题
return dealWithStoreProcedure(tempMap);
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error("transfer widget tabledata failed", e); FineLoggerFactory.getLogger().error("transfer widget tabledata failed", e);
} }

Loading…
Cancel
Save