Browse Source

REPORT-70857 数据集复制后独立

【问题原因】处理重复代码问题
【改动思路】处理重复代码问题
【review建议】无
final/11.0
Yvan 2 years ago
parent
commit
834044d06b
  1. 30
      designer-base/src/main/java/com/fr/design/data/tabledata/paste/TableDataFollowingPasteUtils.java

30
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<String, TableData> dealWithTableDataMap(Map<String, TableData> tableDataMap) {
// 处理存储过程名称问题,名称问题需要优先处理,否则就找不到匹配的TableData了
tableDataMap = dealWithStoreProcedure(tableDataMap);
// 对TableData做clone处理
tableDataMap = dealWithTableData4Clone(tableDataMap);
return 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<>();
if (tableDataMap == null) {
return resultMap;
@ -154,8 +163,7 @@ public class TableDataFollowingPasteUtils {
for (Map.Entry<String, TableDataWrapper> 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);
}

Loading…
Cancel
Save