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