fix(用例管理): 修复批量取消关联用例时用例数量不对问题

--bug=1035795 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001035795
This commit is contained in:
guoyuqi 2024-02-20 11:52:33 +08:00 committed by 刘瑞斌
parent 4062a01c3a
commit aeb6486e68
1 changed files with 4 additions and 2 deletions

View File

@ -189,7 +189,7 @@ public class CaseReviewFunctionalCaseService {
}
/**
* 批量删除
* 批量取消
*
* @param request request
*/
@ -198,10 +198,12 @@ public class CaseReviewFunctionalCaseService {
if (CollectionUtils.isNotEmpty(ids)) {
CaseReviewFunctionalCaseExample example = new CaseReviewFunctionalCaseExample();
example.createCriteria().andIdIn(ids);
List<CaseReviewFunctionalCase> caseReviewFunctionalCases = caseReviewFunctionalCaseMapper.selectByExample(example);
List<String> caseIds = caseReviewFunctionalCases.stream().map(CaseReviewFunctionalCase::getCaseId).distinct().toList();
caseReviewFunctionalCaseMapper.deleteByExample(example);
Map<String, Object> param = new HashMap<>();
param.put(CaseEvent.Param.REVIEW_ID, request.getReviewId());
param.put(CaseEvent.Param.CASE_IDS, ids);
param.put(CaseEvent.Param.CASE_IDS, caseIds);
param.put(CaseEvent.Param.USER_ID, userId);
param.put(CaseEvent.Param.EVENT_NAME, CaseEvent.Event.DISASSOCIATE);
provider.updateCaseReview(param);