|
@@ -569,7 +569,8 @@ public class RoomServiceImpl implements RoomService {
|
|
|
.setGroupId(roomId);
|
|
|
}
|
|
|
|
|
|
- List<CourseScheduleStudentMusicScore> scheduleStudentMusicScores = courseScheduleStudentMusicScoreDao.queryByScoreIdAndCourseId(null, courseId, null, null, null);
|
|
|
+ List<CourseScheduleStudentMusicScore> scheduleStudentMusicScores =
|
|
|
+ courseScheduleStudentMusicScoreDao.queryByScoreIdAndCourseId(null, courseId, null, null, null);
|
|
|
Room room = roomDao.findByRid(roomId);
|
|
|
String display = "";
|
|
|
if (roleEnum == RoleTeacher || roleEnum == RoleEnum.RoleAssistant) {
|
|
@@ -2703,6 +2704,24 @@ public class RoomServiceImpl implements RoomService {
|
|
|
courseScheduleStudentPaymentDao.adjustPlayMidi(Long.parseLong(roomId.substring(1)), playMidiMessageData.getUserId(), content);
|
|
|
}
|
|
|
|
|
|
+ private CbsMusicSheetWrapper.MusicSheetApplication getSheetApplication(String musicSheetSoundId){
|
|
|
+ CbsMusicSheetWrapper.MusicSheetApplicationQuery query = sysMusicScoreService.getMusicSheetApplicationQuery();
|
|
|
+ query.setRows(1);
|
|
|
+ query.setMusicSheetSoundId(Long.parseLong(musicSheetSoundId));
|
|
|
+ List<CbsMusicSheetWrapper.MusicSheetApplication> applications = sysMusicScoreService.queryCbsMusicSheetApplication(query);
|
|
|
+ if (CollectionUtils.isEmpty(applications)) {
|
|
|
+ throw new BizException("曲目信息不存在");
|
|
|
+ }
|
|
|
+ CbsMusicSheetWrapper.MusicSheetApplication sheetApplication = applications.get(0);
|
|
|
+ if (CollectionUtils.isEmpty(sheetApplication.getMusicSheetSoundList())) {
|
|
|
+ throw new BizException("曲目原音信息不存在");
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isEmpty(sheetApplication.getMusicSheetAccompanimentList())) {
|
|
|
+ throw new BizException("曲目伴奏信息不存在");
|
|
|
+ }
|
|
|
+ return sheetApplication;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void pushDownloadMusicScoreMsg(MusicScoreData musicScoreData) throws Exception {
|
|
@@ -2712,18 +2731,10 @@ public class RoomServiceImpl implements RoomService {
|
|
|
List<CourseScheduleStudentMusicScore> scheduleStudentMusicScores =
|
|
|
courseScheduleStudentMusicScoreDao.queryByScoreIdAndCourseId(musicScoreData.getMusicScoreAccompanimentId(),
|
|
|
courseScheduleId, null, null, 0);
|
|
|
- CbsMusicSheetWrapper.MusicSheetApplicationQuery query = sysMusicScoreService.getMusicSheetApplicationQuery();
|
|
|
- query.setRows(1);
|
|
|
- query.setMusicSheetSoundId(Long.parseLong(musicScoreData.getMusicScoreAccompanimentId()));
|
|
|
- List<CbsMusicSheetWrapper.MusicSheetApplication> applications = sysMusicScoreService.queryCbsMusicSheetApplication(query);
|
|
|
- if (CollectionUtils.isEmpty(applications)) {
|
|
|
- throw new BizException("曲目信息不存在");
|
|
|
- }
|
|
|
- CbsMusicSheetWrapper.MusicSheetApplication sheetApplication = applications.get(0);
|
|
|
+ //获取曲目信息
|
|
|
+ CbsMusicSheetWrapper.MusicSheetApplication sheetApplication = this.getSheetApplication(musicScoreData.getMusicScoreAccompanimentId());
|
|
|
+ //获取曲目原音信息
|
|
|
List<CbsMusicSheetWrapper.MusicSheetSound> soundList = sheetApplication.getMusicSheetSoundList();
|
|
|
- if (CollectionUtils.isEmpty(soundList)) {
|
|
|
- throw new BizException("曲目原音信息不存在");
|
|
|
- }
|
|
|
if (scheduleStudentMusicScores.size() == 0) {
|
|
|
//第一次下载,生成数据
|
|
|
List<CourseScheduleStudentPayment> courseScheduleStudentPayments = courseScheduleStudentPaymentDao.findByCourseSchedule(courseScheduleId);
|
|
@@ -2829,28 +2840,19 @@ public class RoomServiceImpl implements RoomService {
|
|
|
String accompanimentId = musicScoreData.getMusicScoreAccompanimentId();
|
|
|
List<CourseScheduleStudentMusicScore> studentMusicScores = courseScheduleStudentMusicScoreDao.queryByScoreIdAndCourseId(accompanimentId, scheduleId, studentId, null, null);
|
|
|
if (accompanimentId != null) {
|
|
|
- /*CbsMusicSheetWrapper.MusicSheetApplicationQuery query = sysMusicScoreService.getMusicSheetApplicationQuery();
|
|
|
- query.setRows(1);
|
|
|
- query.setMusicSheetIds(Lists.newArrayList(Long.parseLong(accompanimentId)));
|
|
|
- List<CbsMusicSheetWrapper.MusicSheetApplication> applications = sysMusicScoreService.queryCbsMusicSheetApplication(query);
|
|
|
- if (CollectionUtils.isEmpty(applications)) {
|
|
|
- throw new BizException("曲目信息不存在");
|
|
|
- }
|
|
|
- CbsMusicSheetWrapper.MusicSheetApplication sheetApplication = applications.get(0);
|
|
|
- List<CbsMusicSheetWrapper.MusicSheetSound> soundList = sheetApplication.getMusicSheetSoundList();
|
|
|
- if (CollectionUtils.isEmpty(soundList)) {
|
|
|
- throw new BizException("曲目原音信息不存在");
|
|
|
- }
|
|
|
- CbsMusicSheetWrapper.MusicSheetSound sheetSound = soundList.stream().
|
|
|
- filter(e -> e.getId().toString().equals(musicScoreData.getMusicScoreAccompanimentId())).collect(Collectors.toList()).get(0);
|
|
|
- SysMusicScoreAccompaniment accompaniment = sysMusicScoreAccompanimentService.initSysMusicScoreAccompaniment(sheetApplication,sheetSound);
|
|
|
- if (accompaniment == null) {
|
|
|
- throw new BizException("曲目信息不存在");
|
|
|
- }*/
|
|
|
//修改下载状态
|
|
|
if (CollectionUtils.isEmpty(studentMusicScores)) {
|
|
|
throw new BizException("学员不存在此下载曲目");
|
|
|
}
|
|
|
+ CbsMusicSheetWrapper.MusicSheetApplication sheetApplication = this.getSheetApplication(accompanimentId);
|
|
|
+ for (CourseScheduleStudentMusicScore studentMusicScore : studentMusicScores) {
|
|
|
+ studentMusicScore.setMusicScoreName(sheetApplication.getName());
|
|
|
+ CbsMusicSheetWrapper.MusicSheetSound sound = sheetApplication.getMusicSheetSoundList().get(0);
|
|
|
+ studentMusicScore.setMp3Url(sound.getAudioFileUrl());
|
|
|
+ CbsMusicSheetWrapper.MusicSheetAccompaniment accompaniment = sheetApplication.getMusicSheetAccompanimentList().get(0);
|
|
|
+ studentMusicScore.setUrl(accompaniment.getAudioFileUrl());
|
|
|
+ courseScheduleStudentMusicScoreDao.update(studentMusicScore);
|
|
|
+ }
|
|
|
CourseScheduleStudentMusicScore studentMusicScore = studentMusicScores.get(0);
|
|
|
studentMusicScore.setDownStatus(musicScoreData.getStatus());
|
|
|
courseScheduleStudentMusicScoreDao.update(studentMusicScore);
|