|
@@ -2723,9 +2723,12 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
|
|
|
} else if (CollectionUtils.isNotEmpty(cbsMusicSheet.getMusicSheetSoundList())) {
|
|
|
musicSheetDetail.setMusicSheetSoundList(new ArrayList<>());
|
|
|
// 按乐器取原音 有乐器按乐器来,没乐器用声部,都不匹配取第一个
|
|
|
- List<CbsMusicSheetWrapper.MusicSheetSound> sheetSoundList = cbsMusicSheet.getMusicSheetSoundList().stream().filter(o -> o.getAudioPlayType() == EAudioPlayType.PLAY).collect(Collectors.toList());
|
|
|
+ List<CbsMusicSheetWrapper.MusicSheetSound> sheetSoundList = cbsMusicSheet.getMusicSheetSoundList().stream()
|
|
|
+ .filter(o -> o.getAudioPlayType() == EAudioPlayType.PLAY)
|
|
|
+ .collect(Collectors.toList());
|
|
|
if (query.getInstrumentId() !=null) {
|
|
|
Optional<CbsMusicSheetWrapper.MusicSheetSound> first =sheetSoundList.stream()
|
|
|
+ .filter(o->StringUtils.isNotBlank(o.getMusicalInstrumentId()))
|
|
|
.filter(o -> o.getMusicalInstrumentId().equals(query.getInstrumentId().toString())).findFirst();
|
|
|
if (first.isPresent()) {
|
|
|
musicSheetDetail.setMp3Url(first.get().getAudioFileUrl());
|
|
@@ -2735,6 +2738,7 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
|
|
|
Subject subject = subjectService.get(query.getSubjectId());
|
|
|
if (subject != null && subject.getInstrumentId() !=null) {
|
|
|
Optional<CbsMusicSheetWrapper.MusicSheetSound> first = sheetSoundList.stream()
|
|
|
+ .filter(o->StringUtils.isNotBlank(o.getMusicalInstrumentId()))
|
|
|
.filter(o -> o.getMusicalInstrumentId().equals(subject.getInstrumentId().toString())).findFirst();
|
|
|
if (first.isPresent()) {
|
|
|
musicSheetDetail.setMp3Url(first.get().getAudioFileUrl());
|
|
@@ -2743,7 +2747,7 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- if (CollectionUtils.isEmpty(musicSheetDetail.getMusicSheetSoundList())) {
|
|
|
+ if (CollectionUtils.isEmpty(sheetSoundList)) {
|
|
|
Optional<CbsMusicSheetWrapper.MusicSheetSound> first = sheetSoundList.stream().findFirst();
|
|
|
if (first.isPresent()) {
|
|
|
musicSheetDetail.setMp3Url(first.get().getAudioFileUrl());
|