class OnlineMemberStatistics implements EveryHourExecute {

    /**
     * 缓存
     */
    @Autowired
    private Cache<List<OnlineMemberVO>> cache;
    /**
     * 统计小时
     */
    @Autowired
    private StatisticsProperties statisticsProperties;


    @Override
    public void execute() {<FILL_FUNCTION_BODY>}


    /**
     * 手动设置某一时间，活跃人数
     *
     * @param time 时间
     * @param num  人数
     */
    public void execute(Date time, Integer num) {

        List<OnlineMemberVO> onlineMemberVOS = cache.get(CachePrefix.ONLINE_MEMBER.getPrefix());

        if (onlineMemberVOS == null) {
            onlineMemberVOS = new ArrayList<>();
        }

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(time);
        //过滤 有效统计时间
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.set(Calendar.HOUR_OF_DAY, calendar.get(Calendar.HOUR_OF_DAY) - 48);

        onlineMemberVOS = onlineMemberVOS.stream()
                .filter(onlineMemberVO -> onlineMemberVO.getDate().after(calendar.getTime()))
                .collect(Collectors.toList());
        onlineMemberVOS.add(new OnlineMemberVO(time, num, num));

        //写入缓存
        cache.put(CachePrefix.ONLINE_MEMBER.getPrefix(), onlineMemberVOS);
    }

}


        Calendar calendar = Calendar.getInstance();

        List<OnlineMemberVO> onlineMemberVOS = cache.get(CachePrefix.ONLINE_MEMBER.getPrefix());

        if (onlineMemberVOS == null) {
            onlineMemberVOS = new ArrayList<>();
        }

        //过滤 有效统计时间
        calendar.set(Calendar.HOUR_OF_DAY, calendar.get(Calendar.HOUR_OF_DAY) - statisticsProperties.getOnlineMember());
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);

        Calendar finalCalendar = calendar;

        AtomicReference<Integer> lastNum = new AtomicReference<>(0);
        onlineMemberVOS = onlineMemberVOS.stream()
                .filter(onlineMemberVO -> {
                    //如果为过滤参数，则记录为过期参数，则为统一时段上一周期的在线人数
                    if (!onlineMemberVO.getDate().after(finalCalendar.getTime())) {
                        lastNum.set(onlineMemberVO.getNum());
                    }
                    return onlineMemberVO.getDate().after(finalCalendar.getTime());
                })
                .collect(Collectors.toList());

        //计入新数据
        calendar = Calendar.getInstance();
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        onlineMemberVOS.add(new OnlineMemberVO(calendar.getTime(), cache.keys(CachePrefix.ACCESS_TOKEN.getPrefix(UserEnums.MEMBER) + "*").size(),
                lastNum.get()));

        //写入缓存
        cache.put(CachePrefix.ONLINE_MEMBER.getPrefix(), onlineMemberVOS);
    
<no_super_class>