From 4744b2504159f61d4209cd46c43233fc41fe86b5 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 21 Jun 2024 16:38:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E8=84=91?= =?UTF-8?q?=E5=9B=BE=E5=88=A0=E9=99=A4=E6=97=B6=E6=B6=88=E6=81=AF=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functional/service/FunctionalCaseMinderService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java index e52efe8260..5484c815ed 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java @@ -1109,8 +1109,9 @@ public class FunctionalCaseMinderService { User user = userMapper.selectByPrimaryKey(userId); Map> resourceMap = request.getDeleteResourceList().stream().collect(Collectors.groupingBy(MinderOptionDTO::getType)); List caseOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.case")); + List caseIds = new ArrayList<>(); if (CollectionUtils.isNotEmpty(caseOptionDTOS)) { - List caseIds = caseOptionDTOS.stream().map(MinderOptionDTO::getId).toList(); + caseIds= caseOptionDTOS.stream().map(MinderOptionDTO::getId).toList(); functionalCaseService.handDeleteFunctionalCase(caseIds, false, userId, request.getProjectId()); functionalCaseLogService.batchDeleteFunctionalCaseLogByIds(caseIds, "/functional/mind/case/edit"); functionalCaseNoticeService.batchSendNotice(request.getProjectId(), caseIds, user, NoticeConstants.Event.DELETE); @@ -1121,7 +1122,8 @@ public class FunctionalCaseMinderService { List moduleIds = caseModuleOptionDTOS.stream().map(MinderOptionDTO::getId).toList(); List functionalCases = functionalCaseModuleService.deleteModuleByIds(moduleIds, new ArrayList<>(), userId); functionalCaseModuleService.batchDelLog(functionalCases, request.getProjectId()); - functionalCaseNoticeService.batchSendNotice(request.getProjectId(), functionalCases.stream().map(FunctionalCase::getId).toList(), user, NoticeConstants.Event.DELETE); + List finalCaseIds = caseIds; + functionalCaseNoticeService.batchSendNotice(request.getProjectId(), functionalCases.stream().map(FunctionalCase::getId).filter(id ->!finalCaseIds.contains(id)).toList(), user, NoticeConstants.Event.DELETE); } List additionalOptionDTOS = resourceMap.get(ModuleConstants.ROOT_NODE_PARENT_ID); if (CollectionUtils.isNotEmpty(additionalOptionDTOS)) {