| | |
| | | |
| | | save(live); |
| | | |
| | | //保存直播权限班级 |
| | | //保存直播权限班级 |
| | | if(classIds!=null && classIds.size()>0){ |
| | | this.doClearAndAddLiveReClass(live.getVideoLiveId(), classIds.toArray(new String[classIds.size()])); |
| | | } |
| | |
| | | |
| | | save(live); |
| | | |
| | | //更新班级课程关联关系 |
| | | //更新班级课程关联关系 |
| | | this.doClearAndAddLiveReClass(live.getVideoLiveId(), classIds!=null?classIds.toArray(new String[classIds.size()]):null); |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 清理并添加直播权限班级 |
| | | * 清理并添加直播权限班级 |
| | | * @param liveId |
| | | * @param classIds |
| | | */ |
| | |
| | | List<String> reIdLst = this.find("select r.liveReClassId from MediaVideoLiveReClass r where r.liveId=?", |
| | | CollectionUtils.newList(liveId), String.class); |
| | | |
| | | //删除关联关系 |
| | | //删除关联关系 |
| | | if(reIdLst!=null && reIdLst.size()>0){ |
| | | this.bulkUpdateInLoop("delete from MediaVideoLiveReClass where liveReClassId=?", reIdLst.toArray()); |
| | | } |
| | |
| | | @Override |
| | | public Result doIssue(String liveId) { |
| | | status(liveId,MediaVideoLive.STATUS_LIVE_ORDER); |
| | | doSendMsg(liveId,MsgInfo.TYPE_LIVE,"发布了直播"); |
| | | doSendMsg(liveId,MsgInfo.TYPE_LIVE,"发布了直播"); |
| | | return new Result(true); |
| | | } |
| | | |
| | | private void doSendMsg(String liveId,short type,String msg){ |
| | | MediaVideoLive liveInfo = this.read(liveId); |
| | | //查询直播关联的班级 |
| | | //查询直播关联的班级 |
| | | String hql = "select s.userId from MediaVideoLiveReClass m,StuStudent s where m.classId=s.classId and m.liveId=? and m.deleteFlag is false and s.deleteFlag is false"; |
| | | |
| | | List<String> lstUserIds = this.find(hql, CollectionUtils.newList(liveId),String.class); |
| | |
| | | |
| | | @Scheduled(cron = " 0 0/5 * * * ?") |
| | | protected void doTimer() { |
| | | // System.out.println("执行直播提醒定时器"); |
| | | // System.out.println("执行直播提醒定时器"); |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.add(Calendar.HOUR, 1); |
| | | Date beginDate = cal.getTime(); |
| | |
| | | cal.add(Calendar.MINUTE, 5); |
| | | Date endDate = cal.getTime(); |
| | | |
| | | //查询1小时内将开始的直播 |
| | | //查询1小时内将开始的直播 |
| | | List<MediaVideoLive> lstLives = this.find("from MediaVideoLive where startTime>=? and startTime<? and status=? and deleteFlag is false ", |
| | | CollectionUtils.newList(beginDate,endDate,MediaVideoLive.STATUS_LIVE_REVIEW), MediaVideoLive.class); |
| | | |
| | | if(lstLives!=null && lstLives.size()>0){ |
| | | for(MediaVideoLive live:lstLives){ |
| | | this.doLiveRemindMsg(live.getVideoLiveId(),MsgInfo.TYPE_REMIND, "直播马上开始了,请做好直播准备"); |
| | | this.doLiveRemindMsg(live.getVideoLiveId(),MsgInfo.TYPE_REMIND, "直播马上开始了,请做好直播准备"); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public Result doStop(String liveId) { |
| | | //发送生成回放消息 |
| | | //发送生成回放消息 |
| | | cacheService.lstRightPush(MediaVideoLivePlayBackService.LIVE_PLAYBACK_LST, liveId); |
| | | |
| | | return status(liveId,MediaVideoLive.STATUS_LIVE_DOWNLOAD); |