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)) {