权限时间调整

This commit is contained in:
tiger_zhou 2023-02-17 18:16:59 +08:00
parent 5d3a8905c2
commit f074c4db94

View File

@ -160,14 +160,14 @@ public class SimulationServiceImpl implements SimulationService {
private List<PermissionSubjectVO> findCanUsedPermission(List<PermissionSubjectVO> newVOLIst, RtsMapFunctionVO functionVO, LoginUserInfoVO loginInfo){
List<PermissionSubjectVO> canUseSubjectList = newVOLIst.stream().filter(d->Objects.equals(true,d.getForever())).collect(Collectors.toList());
if(CollectionUtils.isEmpty(canUseSubjectList)){
List<Long> timeOverIdList = newVOLIst.stream().filter(d->Objects.nonNull(d.getEndTime()) && d.getEndTime().isBefore(LocalDateTime.now()))
List<Long> timeOverIdList = newVOLIst.stream().filter(d->Objects.nonNull(d.getEndTime()) && d.getEndTime().isAfter(LocalDateTime.now()))
.map(d->d.getId())
.collect(Collectors.toList());
canUseSubjectList = newVOLIst.stream().filter(d->!timeOverIdList.contains(d)).collect(Collectors.toList());
if(CollectionUtils.isEmpty(timeOverIdList)){
log.error("mapId[{}],functionId[{}] userId[{}] 权限过期",functionVO.getMapId(),functionVO.getId(),loginInfo.getAccountVO().getId());
return Collections.emptyList();
}
canUseSubjectList = newVOLIst.stream().filter(d->!timeOverIdList.contains(d)).collect(Collectors.toList());
}
return canUseSubjectList;
}