|
@@ -244,6 +244,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
if(roomMember == null){
|
|
|
return ;
|
|
|
}
|
|
|
+ Room room = roomDao.findByLockRid(roomId);
|
|
|
log.info("joinRoomSuccess : roomId={}, userId={}", roomId, userId);
|
|
|
RoleEnum roleEnum = RoleEnum.getEnumByValue(roomMember.getRole());
|
|
|
CourseSchedule schedule = courseScheduleDao.get(Long.parseLong(roomId.substring(1)));
|
|
@@ -260,15 +261,11 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
|
|
|
Date curTime = DateTimeUtils.currentUTC();
|
|
|
- Room room = roomDao.findByRid(roomId);
|
|
|
+
|
|
|
if (room == null) {
|
|
|
//如果房间不存在,删除除了自己之外的其他用户
|
|
|
// roomMemberDao.deleteRoomMember(roomId,userId);
|
|
|
- try {
|
|
|
- saveRoom(roomId, roomId, curTime, display);
|
|
|
- }catch (Exception e){
|
|
|
- log.error("joinRoomSuccess saveRoom error: {}", e.getMessage());
|
|
|
- }
|
|
|
+ saveRoom(roomId, roomId, curTime, display);
|
|
|
IMApiResultInfo resultInfo = imHelper.createGroup(new String[]{userId}, roomId, roomId);
|
|
|
if (!resultInfo.isSuccess()) {
|
|
|
log.error("joinRoomSuccess createGroup error: roomId={}, {}", roomId, resultInfo.getErrorMessage());
|
|
@@ -1291,9 +1288,12 @@ public class RoomServiceImpl implements RoomService {
|
|
|
if(sysExamSong == null){
|
|
|
throw new BizException("曲目信息不存在");
|
|
|
}
|
|
|
- msg.setSongName(sysExamSong.getName());
|
|
|
- msg.setUrl(sysExamSong.getUrl());
|
|
|
- imHelper.publishMessage(authUser.getId().toString(), roomId, msg, 1);
|
|
|
+ ExamSongMessage examSongMessage = new ExamSongMessage();
|
|
|
+ examSongMessage.setSongName(sysExamSong.getName());
|
|
|
+ examSongMessage.setUrl(sysExamSong.getUrl());
|
|
|
+ examSongMessage.setSongId(examSongId);
|
|
|
+ msg.setContent(examSongMessage);
|
|
|
+ imHelper.publishMessage(authUser.getId().toString(), roomId, msg, 0);
|
|
|
//学员曲目下载状态改为未下载
|
|
|
ExamSongDownloadData json = new ExamSongDownloadData();
|
|
|
json.setSongName(sysExamSong.getName());
|