fix(用例评审): 修复删除用例时用例评审的状态未及时更新问题

--bug=1048890 --user=郭雨琦 修复脑图排序失败问题
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001048890
This commit is contained in:
guoyuqi 2024-11-15 17:32:06 +08:00 committed by Craftsman
parent 0f7fb329bb
commit 268d04f1f5
1 changed files with 13 additions and 5 deletions

View File

@ -328,11 +328,19 @@ public class CaseReviewCaseProvider implements BaseCaseProvider {
List<String> reviewIds = deletedCaseReviewFunctionalCases.stream().map(CaseReviewFunctionalCase::getReviewId).distinct().toList(); List<String> reviewIds = deletedCaseReviewFunctionalCases.stream().map(CaseReviewFunctionalCase::getReviewId).distinct().toList();
//获取与选中case无关的关联关系 //获取与选中case无关的关联关系
List<CaseReviewFunctionalCase> caseReviewFunctionalCases = extCaseReviewFunctionalCaseMapper.getListExcludes(reviewIds, caseIdList, false); List<CaseReviewFunctionalCase> caseReviewFunctionalCases = extCaseReviewFunctionalCaseMapper.getListExcludes(reviewIds, caseIdList, false);
if (CollectionUtils.isEmpty(caseReviewFunctionalCases)) {
for (String reviewId : reviewIds) {
Map<String, Integer> caseCountMap = getCaseCountMap(caseReviewFunctionalCases);
updateCaseReview(reviewId, caseReviewFunctionalCases.size(), caseCountMap, paramMap.get(CaseEvent.Param.USER_ID).toString());
}
} else {
Map<String, List<CaseReviewFunctionalCase>> reviewIdMap = caseReviewFunctionalCases.stream().collect(Collectors.groupingBy(CaseReviewFunctionalCase::getReviewId)); Map<String, List<CaseReviewFunctionalCase>> reviewIdMap = caseReviewFunctionalCases.stream().collect(Collectors.groupingBy(CaseReviewFunctionalCase::getReviewId));
reviewIdMap.forEach((reviewId, caseReviewFunctionalCaseList) -> { reviewIdMap.forEach((reviewId, caseReviewFunctionalCaseList) -> {
Map<String, Integer> caseCountMap = getCaseCountMap(caseReviewFunctionalCaseList); Map<String, Integer> caseCountMap = getCaseCountMap(caseReviewFunctionalCaseList);
updateCaseReview(reviewId, caseReviewFunctionalCaseList.size(), caseCountMap, paramMap.get(CaseEvent.Param.USER_ID).toString()); updateCaseReview(reviewId, caseReviewFunctionalCaseList.size(), caseCountMap, paramMap.get(CaseEvent.Param.USER_ID).toString());
}); });
}
return false; return false;
} }