|
@@ -146,7 +146,7 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
* <p> en :房间类型
|
|
|
*/
|
|
|
private final BiFunction<Long, RoomTypeEnum, String> GenRoomUid = (userId, en) -> String
|
|
|
- .join("-", en.getCode(), userId.toString(), new Date().getTime() + "");
|
|
|
+ .join("-", en.equals(RoomTypeEnum.TEMP)?RoomTypeEnum.LIVE.getCode() +"_"+en.getCode():en.getCode(), userId.toString(), new Date().getTime() + "");
|
|
|
|
|
|
@Override
|
|
|
public LiveRoomDao getDao() {
|
|
@@ -405,7 +405,7 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
Long teacherId = sysUser.getId();
|
|
|
List<LiveRoom> liveRoomList = this.list(Wrappers.<LiveRoom>lambdaQuery()
|
|
|
.eq(LiveRoom::getSpeakerId, teacherId)
|
|
|
- .eq(LiveRoom::getType, RoomTypeEnum.LIVE_TEMP.getCode())
|
|
|
+ .eq(LiveRoom::getType, RoomTypeEnum.TEMP.getCode())
|
|
|
.eq(LiveRoom::getLiveState, 1)
|
|
|
.eq(LiveRoom::getRoomState, 0)
|
|
|
);
|
|
@@ -427,7 +427,7 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
//如果当前时间和课程时间有交集则不能开启临时直播
|
|
|
throw new BizException("当前选择的时间段有课无法开启直播");
|
|
|
}
|
|
|
- RoomTypeEnum en = RoomTypeEnum.LIVE_TEMP;
|
|
|
+ RoomTypeEnum en = RoomTypeEnum.TEMP;
|
|
|
String roomUid = GenRoomUid.apply(teacherId, en);
|
|
|
LiveRoom room = new LiveRoom();
|
|
|
room.setRoomUid(roomUid);
|
|
@@ -1072,7 +1072,7 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
|
|
|
CourseSchedule schedule = getCourseScheduleByRoomUid(roomUid);
|
|
|
//校验观看者是否买过课,如果是非临时直播间,则校验是否已经买过课
|
|
|
- if (!roomInfo.getRoomType().equals(RoomTypeEnum.LIVE_TEMP.getCode())) {
|
|
|
+ if (!roomInfo.getRoomType().equals(RoomTypeEnum.TEMP.getCode())) {
|
|
|
// 查询该学员成功购买课程
|
|
|
CourseScheduleStudentPayment studentPayment = courseScheduleStudentPaymentService.getOne(Wrappers.<CourseScheduleStudentPayment>lambdaQuery()
|
|
|
.eq(CourseScheduleStudentPayment::getUserId, sysUser.getId())
|
|
@@ -2278,7 +2278,7 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
}
|
|
|
RoomSpeakerInfo roomSpeakerInfo = speakerCache.get();
|
|
|
//已是直播状态则直接返回
|
|
|
- if (roomSpeakerInfo !=null && roomSpeakerInfo.getState() == 0) {
|
|
|
+ if (roomSpeakerInfo !=null &&roomSpeakerInfo.getState() !=null && roomSpeakerInfo.getState() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
|