fix(场景自动化) 修复生成依赖关系问题
This commit is contained in:
parent
987d8f919c
commit
f96e30d341
|
@ -281,6 +281,12 @@ public class ElementUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 只找出场景直接依赖
|
||||||
|
*
|
||||||
|
* @param hashTree
|
||||||
|
* @param referenceRelationships
|
||||||
|
*/
|
||||||
public static void relationships(JSONArray hashTree, List<String> referenceRelationships) {
|
public static void relationships(JSONArray hashTree, List<String> referenceRelationships) {
|
||||||
for (int i = 0; i < hashTree.size(); i++) {
|
for (int i = 0; i < hashTree.size(); i++) {
|
||||||
JSONObject element = hashTree.getJSONObject(i);
|
JSONObject element = hashTree.getJSONObject(i);
|
||||||
|
@ -288,10 +294,11 @@ public class ElementUtil {
|
||||||
if (!referenceRelationships.contains(element.get("id").toString())) {
|
if (!referenceRelationships.contains(element.get("id").toString())) {
|
||||||
referenceRelationships.add(element.get("id").toString());
|
referenceRelationships.add(element.get("id").toString());
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
if (element.containsKey("hashTree")) {
|
if (element.containsKey("hashTree")) {
|
||||||
JSONArray elementJSONArray = element.getJSONArray("hashTree");
|
JSONArray elementJSONArray = element.getJSONArray("hashTree");
|
||||||
relationships(elementJSONArray, referenceRelationships);
|
relationships(elementJSONArray, referenceRelationships);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,6 +232,9 @@ public class RelationshipEdgeService {
|
||||||
if (addEdgesIds.contains(item.getSourceId() + item.getTargetId())) {
|
if (addEdgesIds.contains(item.getSourceId() + item.getTargetId())) {
|
||||||
if(batchMapper.selectByPrimaryKey(item) == null ) {
|
if(batchMapper.selectByPrimaryKey(item) == null ) {
|
||||||
batchMapper.insert(item);
|
batchMapper.insert(item);
|
||||||
|
}else{
|
||||||
|
item.setGraphId(graphId); // 把原来图的id设置成合并后新的图的id
|
||||||
|
batchMapper.updateByPrimaryKey(item);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
item.setGraphId(graphId); // 把原来图的id设置成合并后新的图的id
|
item.setGraphId(graphId); // 把原来图的id设置成合并后新的图的id
|
||||||
|
|
Loading…
Reference in New Issue