From a57f24a37a333328bd790cbd40f4dbf5bd2139db Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 15 Dec 2022 11:53:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E7=BC=BA=E9=99=B7=E5=AF=BC=E5=85=A5ID=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1020773 --user=陈建星 [测试跟踪]#20568缺陷根据模板导入,缺陷ID重复 https://www.tapd.cn/55049933/s/1315841 --- .../main/java/io/metersphere/service/IssuesService.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java b/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java index c313481d95..060d0d4ba4 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java @@ -173,6 +173,7 @@ public class IssuesService { issues.setPlatform(project.getPlatform()); insertIssues(issues); issuesRequest.setId(issues.getId()); + issuesRequest.setPlatformId(issues.getPlatformId()); // 用例与第三方缺陷平台中的缺陷关联 handleTestCaseIssues(issuesRequest); @@ -621,13 +622,13 @@ public class IssuesService { issuesRequest.setProjectId(SessionUtils.getCurrentProjectId()); List issuesDaos = listByWorkspaceId(issuesRequest); if (CollectionUtils.isNotEmpty(issuesDaos)) { - issuesDaos.parallelStream().forEach(issuesDao -> { + issuesDaos.forEach(issuesDao -> { delete(issuesDao.getId()); }); } } else { if (CollectionUtils.isNotEmpty(request.getBatchDeleteIds())) { - request.getBatchDeleteIds().parallelStream().forEach(id -> delete(id)); + request.getBatchDeleteIds().forEach(id -> delete(id)); } } } @@ -1775,13 +1776,13 @@ public class IssuesService { } public void saveImportData(List issues) { - issues.parallelStream().forEach(issue -> { + issues.forEach(issue -> { addIssues(issue, null); }); } public void updateImportData(List issues) { - issues.parallelStream().forEach(issue -> { + issues.forEach(issue -> { updateIssues(issue); }); }