|
@@ -1615,24 +1615,24 @@ public class RoomServiceImpl implements RoomService {
|
|
|
Integer studentId = authUser.getId();
|
|
|
String roomId = musicScoreData.getRoomId();
|
|
|
Long scheduleId = Long.parseLong(roomId.substring(1));
|
|
|
- Integer status = musicScoreData.getStatus();
|
|
|
Integer accompanimentId = musicScoreData.getMusicScoreAccompanimentId();
|
|
|
-
|
|
|
- SysMusicScoreAccompaniment accompaniment = sysMusicScoreAccompanimentDao.get(accompanimentId);
|
|
|
- if(accompaniment == null){
|
|
|
- throw new BizException("曲目信息不存在");
|
|
|
- }
|
|
|
- //修改下载状态
|
|
|
List<CourseScheduleStudentMusicScore> studentMusicScores = courseScheduleStudentMusicScoreDao.queryByScoreIdAndCourseId(accompanimentId,scheduleId,studentId,null,null);
|
|
|
- if(studentMusicScores == null || studentMusicScores.size() == 0){
|
|
|
- throw new BizException("学员不存在此下载曲目");
|
|
|
+ if(accompanimentId != null){
|
|
|
+ SysMusicScoreAccompaniment accompaniment = sysMusicScoreAccompanimentDao.get(accompanimentId);
|
|
|
+ if(accompaniment == null){
|
|
|
+ throw new BizException("曲目信息不存在");
|
|
|
+ }
|
|
|
+ //修改下载状态
|
|
|
+ if(studentMusicScores == null || studentMusicScores.size() == 0){
|
|
|
+ throw new BizException("学员不存在此下载曲目");
|
|
|
+ }
|
|
|
+ CourseScheduleStudentMusicScore studentMusicScore = studentMusicScores.get(0);
|
|
|
+ studentMusicScore.setDownStatus(musicScoreData.getStatus());
|
|
|
+ courseScheduleStudentMusicScoreDao.update(studentMusicScore);
|
|
|
}
|
|
|
- CourseScheduleStudentMusicScore studentMusicScore = studentMusicScores.get(0);
|
|
|
- studentMusicScore.setDownStatus(musicScoreData.getStatus());
|
|
|
- courseScheduleStudentMusicScoreDao.update(studentMusicScore);
|
|
|
//给老师发送学员曲目下载状态
|
|
|
CourseSchedule courseSchedule = courseScheduleDao.get(scheduleId);
|
|
|
- MusicScoreDownloadStatusMessage statusMessage = new MusicScoreDownloadStatusMessage(status,studentId,accompanimentId);
|
|
|
+ MusicScoreDownloadStatusMessage statusMessage = new MusicScoreDownloadStatusMessage(studentId,studentMusicScores);
|
|
|
imHelper.publishMessage(studentId.toString(),courseSchedule.getActualTeacherId().toString(), roomId,statusMessage);
|
|
|
}
|
|
|
|