feat(training): 添加按记录ID列表查询培训申请审批详情功能

dev
zhaokai 2026-03-07 15:59:01 +08:00
parent 1409e7a9ea
commit 34bb4e581e
1 changed files with 7 additions and 4 deletions

View File

@ -76,8 +76,11 @@ public class TrainingApplyRecordQueryExe {
List<String> recordIdList = examCenterCOS.stream().map(TrainingApplyRecordCO::getTrainingApplyRecordId).collect(Collectors.toList()); List<String> recordIdList = examCenterCOS.stream().map(TrainingApplyRecordCO::getTrainingApplyRecordId).collect(Collectors.toList());
List<TrainingApplyProcessDO> trainingApplyProcessDOs = trainingApplyProcessRepository.getApproveDetailListByRecordIdList(recordIdList); List<TrainingApplyProcessDO> trainingApplyProcessDOs = trainingApplyProcessRepository.getApproveDetailListByRecordIdList(recordIdList);
//按照recordId分组 //按照recordId分组
Map<String, List<TrainingApplyProcessDO>> trainingApplyProcessDOMap = trainingApplyProcessDOs.stream()
.collect(Collectors.groupingBy(TrainingApplyProcessDO::getTrainingApplyRecordId)); Map<String, List<Long>> trainingApplyProcessDOMap = trainingApplyProcessDOs.stream()
.collect(Collectors.groupingBy(TrainingApplyProcessDO::getTrainingApplyRecordId,
Collectors.mapping(TrainingApplyProcessDO::getUserId, Collectors.toList())));
boolean isCorrectCorp = corpInfoRepository.checkCorp(); boolean isCorrectCorp = corpInfoRepository.checkCorp();
//只有审批人和审批人的企业能进行审批 //只有审批人和审批人的企业能进行审批
@ -89,8 +92,8 @@ public class TrainingApplyRecordQueryExe {
hasApprovalPermission = AuthContext.getTenantId().equals(info.getApprovalCorpinfoId()); hasApprovalPermission = AuthContext.getTenantId().equals(info.getApprovalCorpinfoId());
} else { } else {
//委托人:检查是否在审批流程中 //委托人:检查是否在审批流程中
List<TrainingApplyProcessDO> processList = trainingApplyProcessDOMap.get(info.getTrainingApplyRecordId()); List<Long> userIdList = trainingApplyProcessDOMap.get(info.getTrainingApplyRecordId());
hasApprovalPermission = processList != null && processList.contains(AuthContext.getUserId()); hasApprovalPermission = userIdList != null && userIdList.contains(AuthContext.getUserId());
} }
if (hasApprovalPermission) { if (hasApprovalPermission) {