From 4ffb6baf48c94cb688819c842c6634a636b7cbe2 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 22 Oct 2021 10:43:47 +0800 Subject: [PATCH] =?UTF-8?q?fix=20(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E5=A2=9E=E5=8A=A0=E5=85=B3=E7=B3=BB=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/service/RelationshipEdgeService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/service/RelationshipEdgeService.java b/backend/src/main/java/io/metersphere/service/RelationshipEdgeService.java index f76c94cc30..a5678c5b77 100644 --- a/backend/src/main/java/io/metersphere/service/RelationshipEdgeService.java +++ b/backend/src/main/java/io/metersphere/service/RelationshipEdgeService.java @@ -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);