|
@@ -1,5 +1,6 @@
|
|
|
package com.ym.service.Impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.ym.common.ApiException;
|
|
|
import com.ym.common.DisplayEnum;
|
|
@@ -201,7 +202,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
display = "display://type=0?userId=" + userId + "?uri=";
|
|
|
}else {
|
|
|
//获取学员曲目下载状态
|
|
|
- userResult.setExamSongDownloadOn(courseScheduleStudentPaymentDao.getExamSongDownloadStatus(courseId,userId));
|
|
|
+ userResult.setExamSongDownloadJson(courseScheduleStudentPaymentDao.getExamSongDownloadStatus(courseId,userId));
|
|
|
Room room = roomDao.findByRid(roomId);
|
|
|
if (room != null) {
|
|
|
display = room.getDisplay();
|
|
@@ -1290,22 +1291,36 @@ public class RoomServiceImpl implements RoomService {
|
|
|
msg.setUrl(sysExamSong.getUrl());
|
|
|
imHelper.publishMessage(authUser.getId().toString(), roomId.toString(), msg, 1);
|
|
|
//学员曲目下载状态改为未下载
|
|
|
- courseScheduleStudentPaymentDao.adjustExamSong(roomId,null,0);
|
|
|
+ ExamSongDownloadData json = new ExamSongDownloadData();
|
|
|
+ json.setSongName(sysExamSong.getName());
|
|
|
+ json.setUrl(sysExamSong.getUrl());
|
|
|
+ json.setStatus(0);
|
|
|
+ courseScheduleStudentPaymentDao.adjustExamSong(roomId,null, JSON.toJSONString(json));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void adjustExamSong(Long roomId, Integer status) throws Exception {
|
|
|
- if(roomId == null || status == null){
|
|
|
+ public void adjustExamSong(Long roomId, Integer status,Integer examSongId) throws Exception {
|
|
|
+ if(roomId == null || status == null || examSongId == null){
|
|
|
throw new BizException("参数校验失败");
|
|
|
}
|
|
|
SysUser authUser = sysUserFeignService.queryUserInfo();
|
|
|
CourseSchedule courseSchedule = courseScheduleDao.get(roomId);
|
|
|
- courseScheduleStudentPaymentDao.adjustExamSong(roomId,authUser.getId(),status);
|
|
|
+
|
|
|
//给老师发送学员曲目下载状态
|
|
|
DeviceStateChangedMessage deviceResourceMessage = new DeviceStateChangedMessage(DeviceTypeEnum.ExamSong.ordinal(), status==0?false:true);
|
|
|
deviceResourceMessage.setUserId(courseSchedule.getActualTeacherId().toString());
|
|
|
imHelper.publishMessage(authUser.getId().toString(), roomId.toString(), 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);
|
|
|
+ courseScheduleStudentPaymentDao.adjustExamSong(roomId,authUser.getId(),JSON.toJSONString(msg));
|
|
|
}
|
|
|
|
|
|
public void updateDisplay(String roomId, String senderId, String display, Integer isIncludeSender) throws Exception {
|