fix (接口自动化): 增加关系重复验证

This commit is contained in:
fit2-zhao 2021-10-22 10:43:47 +08:00 committed by fit2-zhao
parent 05e1c16ead
commit 6f7903df26
1 changed files with 3 additions and 1 deletions

View File

@ -153,7 +153,9 @@ public class RelationshipEdgeService {
relationshipEdges.forEach(item -> {
if (addEdgesIds.contains(item.getSourceId() + item.getTargetId())) {
batchMapper.insert(item);
if(batchMapper.selectByPrimaryKey(item) == null ) {
batchMapper.insert(item);
}
} else {
item.setGraphId(graphId); // 把原来图的id设置成合并后新的图的id
batchMapper.updateByPrimaryKey(item);