From 268d04f1f5c6032214e504d92156de4b2b9ca363 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 15 Nov 2024 17:32:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E4=BE=8B=E8=AF=84=E5=AE=A1):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4=E7=94=A8=E4=BE=8B=E6=97=B6?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E8=AF=84=E5=AE=A1=E7=9A=84=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=9C=AA=E5=8F=8A=E6=97=B6=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1048890 --user=郭雨琦 修复脑图排序失败问题 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001048890 --- .../provider/CaseReviewCaseProvider.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/provider/CaseReviewCaseProvider.java b/backend/services/case-management/src/main/java/io/metersphere/functional/provider/CaseReviewCaseProvider.java index bf739695f7..7859fcc9bf 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/provider/CaseReviewCaseProvider.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/provider/CaseReviewCaseProvider.java @@ -328,11 +328,19 @@ public class CaseReviewCaseProvider implements BaseCaseProvider { List reviewIds = deletedCaseReviewFunctionalCases.stream().map(CaseReviewFunctionalCase::getReviewId).distinct().toList(); //获取与选中case无关的关联关系 List caseReviewFunctionalCases = extCaseReviewFunctionalCaseMapper.getListExcludes(reviewIds, caseIdList, false); - Map> reviewIdMap = caseReviewFunctionalCases.stream().collect(Collectors.groupingBy(CaseReviewFunctionalCase::getReviewId)); - reviewIdMap.forEach((reviewId, caseReviewFunctionalCaseList) -> { - Map caseCountMap = getCaseCountMap(caseReviewFunctionalCaseList); - updateCaseReview(reviewId, caseReviewFunctionalCaseList.size(), caseCountMap, paramMap.get(CaseEvent.Param.USER_ID).toString()); - }); + if (CollectionUtils.isEmpty(caseReviewFunctionalCases)) { + for (String reviewId : reviewIds) { + Map caseCountMap = getCaseCountMap(caseReviewFunctionalCases); + updateCaseReview(reviewId, caseReviewFunctionalCases.size(), caseCountMap, paramMap.get(CaseEvent.Param.USER_ID).toString()); + } + } else { + Map> reviewIdMap = caseReviewFunctionalCases.stream().collect(Collectors.groupingBy(CaseReviewFunctionalCase::getReviewId)); + reviewIdMap.forEach((reviewId, caseReviewFunctionalCaseList) -> { + Map caseCountMap = getCaseCountMap(caseReviewFunctionalCaseList); + updateCaseReview(reviewId, caseReviewFunctionalCaseList.size(), caseCountMap, paramMap.get(CaseEvent.Param.USER_ID).toString()); + }); + } + return false; }