feat(training): 添加按记录ID列表查询培训申请审批详情功能
parent
1409e7a9ea
commit
34bb4e581e
|
|
@ -76,8 +76,11 @@ public class TrainingApplyRecordQueryExe {
|
|||
List<String> recordIdList = examCenterCOS.stream().map(TrainingApplyRecordCO::getTrainingApplyRecordId).collect(Collectors.toList());
|
||||
List<TrainingApplyProcessDO> trainingApplyProcessDOs = trainingApplyProcessRepository.getApproveDetailListByRecordIdList(recordIdList);
|
||||
//按照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();
|
||||
//只有审批人和审批人的企业能进行审批
|
||||
|
|
@ -89,8 +92,8 @@ public class TrainingApplyRecordQueryExe {
|
|||
hasApprovalPermission = AuthContext.getTenantId().equals(info.getApprovalCorpinfoId());
|
||||
} else {
|
||||
//委托人:检查是否在审批流程中
|
||||
List<TrainingApplyProcessDO> processList = trainingApplyProcessDOMap.get(info.getTrainingApplyRecordId());
|
||||
hasApprovalPermission = processList != null && processList.contains(AuthContext.getUserId());
|
||||
List<Long> userIdList = trainingApplyProcessDOMap.get(info.getTrainingApplyRecordId());
|
||||
hasApprovalPermission = userIdList != null && userIdList.contains(AuthContext.getUserId());
|
||||
}
|
||||
|
||||
if (hasApprovalPermission) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue