|
@@ -202,7 +202,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
display = "display://type=0?userId=" + userId + "?uri=";
|
|
|
}else {
|
|
|
//获取学员曲目下载状态
|
|
|
- userResult.setExamSongDownloadJson(courseScheduleStudentPaymentDao.getExamSongDownloadStatus(courseId,userId));
|
|
|
+ userResult.setExamSongDownloadJson(courseScheduleStudentPaymentDao.getExamJsonByCourseIdAndUserId(courseId,sysUser.getId()));
|
|
|
Room room = roomDao.findByRid(roomId);
|
|
|
if (room != null) {
|
|
|
display = room.getDisplay();
|
|
@@ -727,6 +727,17 @@ public class RoomServiceImpl implements RoomService {
|
|
|
roomMemberDao.updateMicByRidAndUid(roomId, userId, false);
|
|
|
} else if (typeEnum.equals(DeviceTypeEnum.HandUp)){
|
|
|
roomMemberDao.updateHandByRidAndUid(roomId, userId, false);
|
|
|
+ } else if (typeEnum.equals(DeviceTypeEnum.PlaySong)){
|
|
|
+ long scheduleId = Long.parseLong(roomId.substring(1));
|
|
|
+ ExamSongDownloadData msg;
|
|
|
+ String examJson = courseScheduleStudentPaymentDao.getExamJsonByCourseIdAndUserId(scheduleId, authUser.getId());
|
|
|
+ if(StringUtils.isEmpty(examJson)){
|
|
|
+ throw new BizException("学员伴奏信息异常");
|
|
|
+ }else {
|
|
|
+ msg = JSON.parseObject(examJson, ExamSongDownloadData.class);
|
|
|
+ msg.setEnable(enable);
|
|
|
+ }
|
|
|
+ courseScheduleStudentPaymentDao.adjustExamSong(scheduleId,authUser.getId(),JSON.toJSONString(msg));
|
|
|
}else {
|
|
|
roomMemberDao.updateMusicByRidAndUid(roomId, userId, false);
|
|
|
}
|
|
@@ -827,19 +838,26 @@ public class RoomServiceImpl implements RoomService {
|
|
|
String userId = authUser.getId().toString();
|
|
|
|
|
|
int result;
|
|
|
- DeviceStateChangedMessage deviceResourceMessage;
|
|
|
+ DeviceStateChangedMessage deviceResourceMessage = new DeviceStateChangedMessage(type.ordinal(), enable);
|
|
|
if (type.equals(DeviceTypeEnum.Camera)) {
|
|
|
result = roomMemberDao.updateCameraByRidAndUid(roomId, userId, enable);
|
|
|
- deviceResourceMessage = new DeviceStateChangedMessage(type.ordinal(), enable);
|
|
|
} else if (type.equals(DeviceTypeEnum.Microphone)){
|
|
|
result = roomMemberDao.updateMicByRidAndUid(roomId, userId, enable);
|
|
|
- deviceResourceMessage = new DeviceStateChangedMessage(type.ordinal(), enable);
|
|
|
} else if (type.equals(DeviceTypeEnum.HandUp)){
|
|
|
result = roomMemberDao.updateHandByRidAndUid(roomId, userId, enable);
|
|
|
- deviceResourceMessage = new DeviceStateChangedMessage(type.ordinal(), enable);
|
|
|
+ } else if (type.equals(DeviceTypeEnum.PlaySong)){
|
|
|
+ long scheduleId = Long.parseLong(roomId.substring(1));
|
|
|
+ ExamSongDownloadData msg;
|
|
|
+ String examJson = courseScheduleStudentPaymentDao.getExamJsonByCourseIdAndUserId(scheduleId, authUser.getId());
|
|
|
+ if(StringUtils.isEmpty(examJson)){
|
|
|
+ throw new BizException("学员伴奏信息异常");
|
|
|
+ }else {
|
|
|
+ msg = JSON.parseObject(examJson, ExamSongDownloadData.class);
|
|
|
+ msg.setEnable(enable);
|
|
|
+ }
|
|
|
+ result = courseScheduleStudentPaymentDao.adjustExamSong(scheduleId,authUser.getId(),JSON.toJSONString(msg));
|
|
|
}else {
|
|
|
result = roomMemberDao.updateMusicByRidAndUid(roomId, userId, enable);
|
|
|
- deviceResourceMessage = new DeviceStateChangedMessage(type.ordinal(), enable);
|
|
|
}
|
|
|
deviceResourceMessage.setUserId(userId);
|
|
|
imHelper.publishMessage(userId, roomId, deviceResourceMessage, 1);
|
|
@@ -1276,25 +1294,14 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<RongyunBasicUserDto> queryNoJoinStu(String roomId) {
|
|
|
- return courseScheduleStudentPaymentDao.queryNoJoinStu(roomId,roomId.substring(1));
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void pushDownloadExamSongMsg(String roomId, Integer examSongId) throws Exception {
|
|
|
SysUser authUser = sysUserFeignService.queryUserInfo();
|
|
|
- ExamSongDownloadMessageMessage msg = new ExamSongDownloadMessageMessage();
|
|
|
+
|
|
|
SysExamSong sysExamSong = sysExamSongDao.get(examSongId);
|
|
|
if(sysExamSong == null){
|
|
|
throw new BizException("曲目信息不存在");
|
|
|
}
|
|
|
- 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());
|
|
@@ -1302,6 +1309,18 @@ public class RoomServiceImpl implements RoomService {
|
|
|
json.setStatus(0);
|
|
|
json.setSongId(examSongId);
|
|
|
courseScheduleStudentPaymentDao.adjustExamSong(Long.parseLong(roomId.substring(1)),null, JSON.toJSONString(json));
|
|
|
+
|
|
|
+ ExamSongMessage examSongMessage = new ExamSongMessage();
|
|
|
+ examSongMessage.setSongName(sysExamSong.getName());
|
|
|
+ examSongMessage.setUrl(sysExamSong.getUrl());
|
|
|
+ examSongMessage.setSongId(examSongId);
|
|
|
+ ExamSongDownloadMessageMessage msg = new ExamSongDownloadMessageMessage(examSongMessage);
|
|
|
+ imHelper.publishMessage(authUser.getId().toString(), roomId, msg, 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<RongyunBasicUserDto> queryNoJoinStu(String roomId) {
|
|
|
+ return courseScheduleStudentPaymentDao.queryNoJoinStu(roomId,roomId.substring(1));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -1312,23 +1331,29 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
SysUser authUser = sysUserFeignService.queryUserInfo();
|
|
|
long scheduleId = Long.parseLong(roomId.substring(1));
|
|
|
- CourseSchedule courseSchedule = courseScheduleDao.get(scheduleId);
|
|
|
-
|
|
|
- //给老师发送学员曲目下载状态
|
|
|
- DeviceStateChangedMessage deviceResourceMessage = new DeviceStateChangedMessage(DeviceTypeEnum.ExamSong.ordinal(), status==0?false:true);
|
|
|
- deviceResourceMessage.setUserId(courseSchedule.getActualTeacherId().toString());
|
|
|
- imHelper.publishMessage(authUser.getId().toString(), roomId, deviceResourceMessage, 1);
|
|
|
|
|
|
SysExamSong sysExamSong = sysExamSongDao.get(examSongId);
|
|
|
if(sysExamSong == null){
|
|
|
throw new BizException("曲目信息不存在");
|
|
|
}
|
|
|
- ExamSongDownloadData msg = new ExamSongDownloadData();
|
|
|
- msg.setSongName(sysExamSong.getName());
|
|
|
- msg.setUrl(sysExamSong.getUrl());
|
|
|
- msg.setStatus(status);
|
|
|
- msg.setSongId(examSongId);
|
|
|
+ ExamSongDownloadData msg;
|
|
|
+ String examJson = courseScheduleStudentPaymentDao.getExamJsonByCourseIdAndUserId(scheduleId, authUser.getId());
|
|
|
+ if(StringUtils.isEmpty(examJson)){
|
|
|
+ msg = new ExamSongDownloadData();
|
|
|
+ msg.setSongName(sysExamSong.getName());
|
|
|
+ msg.setUrl(sysExamSong.getUrl());
|
|
|
+ msg.setStatus(status);
|
|
|
+ msg.setSongId(examSongId);
|
|
|
+ }else {
|
|
|
+ msg = JSON.parseObject(examJson, ExamSongDownloadData.class);
|
|
|
+ msg.setStatus(status);
|
|
|
+ }
|
|
|
courseScheduleStudentPaymentDao.adjustExamSong(scheduleId,authUser.getId(),JSON.toJSONString(msg));
|
|
|
+
|
|
|
+ //给老师发送学员曲目下载状态
|
|
|
+ CourseSchedule courseSchedule = courseScheduleDao.get(scheduleId);
|
|
|
+ ExamSongDownloadStatusMessage deviceResourceMessage = new ExamSongDownloadStatusMessage(status,authUser.getId());
|
|
|
+ imHelper.publishMessage(authUser.getId().toString(),courseSchedule.getActualTeacherId().toString(), roomId, deviceResourceMessage);
|
|
|
}
|
|
|
|
|
|
public void updateDisplay(String roomId, String senderId, String display, Integer isIncludeSender) throws Exception {
|