修复定时统计不支持录播问题
This commit is contained in:
parent
5606486228
commit
51b8dbe742
@ -32,6 +32,7 @@ import javax.annotation.Resource;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
// admin交互Service
|
||||
@ -571,15 +572,13 @@ public class AdminVideoInteractionService {
|
||||
Set<Integer> videoIds = onlineMap.values().stream().map(OnlineUser::getProductId).collect(Collectors.toSet());
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
List<VideoLive> videoLives = videoLiveMapper.selectList(Wrappers.<VideoLive>lambdaQuery().in(VideoLive::getId, videoIds));
|
||||
Map<Integer, Integer> videoStatusMap = videoLives.stream().collect(Collectors.toMap(VideoLive::getId, VideoLive::getLiveStatus));
|
||||
Map<Integer, VideoLive> videoMap = videoLives.stream().collect(Collectors.toMap(VideoLive::getId, Function.identity()));
|
||||
LocalDateTime time = now.withSecond(0).withNano(0);
|
||||
LocalDateTime startTime = now.plusMinutes(-1);
|
||||
List<VideoUserFlow> onLineList = onlineUsers.stream().map(user -> {
|
||||
Integer videoId = user.getProductId();
|
||||
Integer liveStatus = videoStatusMap.get(videoId);
|
||||
if (liveStatus == null) {
|
||||
return null;
|
||||
}
|
||||
VideoLive videoLive = videoMap.get(videoId);
|
||||
Integer liveStatus = videoLive.getLiveStatus();
|
||||
if (IsOrNot.IS.value.equals(user.getIsOnline()) || (user.getExitTime() != null && user.getExitTime().isAfter(startTime))) {
|
||||
boolean calIsPlay = Objects.equals(VideoLiveStatus.LIVING.value, liveStatus) || Objects.equals(VideoLiveStatus.HAS_ENDED.value, liveStatus);
|
||||
VideoUserFlow videoUserFlow = new VideoUserFlow();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user