|
@@ -191,6 +191,7 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
record.setCategoriesName(categoriesMap.get(musicSheetApplication.getMusicSheetCategoryId().intValue()));
|
|
|
}
|
|
|
record.setSpeed(musicSheetApplication.getPlaySpeed());
|
|
|
+ record.setIsOpenMetronome(musicSheetApplication.getIsUseSystemBeat());
|
|
|
List<CbsMusicSheetWrapper.MusicSheetAccompaniment> accompanimentList = musicSheetApplication.getMusicSheetAccompanimentList();
|
|
|
if (CollectionUtils.isNotEmpty(accompanimentList)) {
|
|
|
record.setMetronomeUrl(accompanimentList.get(0).getAudioFileUrl());
|
|
@@ -205,19 +206,22 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
record.setMidiUrl(musicSheetApplication.getMidiFileUrl());
|
|
|
record.setOrder(musicSheetApplication.getSortNo());
|
|
|
record.setEnableEvaluation(musicSheetApplication.getIsEvaluated());
|
|
|
- record.setIsOpenMetronome(musicSheetApplication.getIsUseSystemBeat() && musicSheetApplication.getIsPlayBeat());
|
|
|
if(musicSheetApplication.getMusicSheetType() == EMusicSheetType.CONCERT){
|
|
|
record.setSubjectName("");
|
|
|
}else {
|
|
|
if(StringUtils.isNotEmpty(musicSheetApplication.getMusicalInstrumentIds())){
|
|
|
- if(record.getSubjectId() != null){
|
|
|
- Instrument instrument = instrumentMap.get(record.getSubjectId());
|
|
|
- if(instrument != null){
|
|
|
- CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto musicalInstrumentQueryDto = musicalInstrumentQueryMap.get(instrument.getId());
|
|
|
- if(Objects.nonNull(musicalInstrumentQueryDto)) {
|
|
|
- record.setSubjectName(musicalInstrumentQueryDto.getName());
|
|
|
+ if(StringUtils.isNotEmpty(record.getSubjectIds())){
|
|
|
+ Set<String> subjectNames = new HashSet<>();
|
|
|
+ for (String subjectId : record.getSubjectIds().split(",")) {
|
|
|
+ Instrument instrument = instrumentMap.get(Integer.parseInt(subjectId));
|
|
|
+ if(instrument != null){
|
|
|
+ CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto musicalInstrumentQueryDto = musicalInstrumentQueryMap.get(instrument.getId());
|
|
|
+ if(Objects.nonNull(musicalInstrumentQueryDto)) {
|
|
|
+ subjectNames.add(musicalInstrumentQueryDto.getName());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ record.setSubjectName(String.join(",",subjectNames));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -446,19 +450,15 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
String tracks = "";
|
|
|
// 伴奏,原音 扩展信息
|
|
|
if (addMusicSheet.getPlayMode() == EMusicPlayMode.MP3) {
|
|
|
- CbsMusicSheetWrapper.MusicSheetAccompaniment musicSheetAccompaniment = new CbsMusicSheetWrapper.MusicSheetAccompaniment();
|
|
|
- if (StringUtils.isNotBlank(musicSheetAccompaniment.getAudioFileUrl())) {
|
|
|
- addMusicSheet.setMusicSheetAccompanimentList(Lists.newArrayList(musicSheetAccompaniment));
|
|
|
- }
|
|
|
if (CollectionUtils.isNotEmpty(accList)) {
|
|
|
List<CbsMusicSheetWrapper.MusicSheetSound> musicSheetSounds = new ArrayList<>();
|
|
|
int i = 0;
|
|
|
for (SysMusicScoreAccompaniment sheetAccompaniment : accList) {
|
|
|
CbsMusicSheetWrapper.MusicSheetSound musicSheetSound = new CbsMusicSheetWrapper.MusicSheetSound();
|
|
|
- if (StringUtils.isNotBlank(sheetAccompaniment.getMetronomeMp3Url())){
|
|
|
- musicSheetSound.setAudioFileUrl(sheetAccompaniment.getMetronomeMp3Url());
|
|
|
- } else {
|
|
|
+ if (sheetAccompaniment.getIsOpenMetronome()){
|
|
|
musicSheetSound.setAudioFileUrl(sheetAccompaniment.getMp3Url());
|
|
|
+ } else {
|
|
|
+ musicSheetSound.setAudioFileUrl(sheetAccompaniment.getMetronomeMp3Url());
|
|
|
}
|
|
|
musicSheetSound.setTrack(sheetAccompaniment.getTrack());
|
|
|
if (sheetAccompaniment.getSubjectId() != null) {
|
|
@@ -485,6 +485,15 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
tracks = musicSheetSounds.stream().map(CbsMusicSheetWrapper.MusicSheetSound::getTrack).collect(Collectors.joining(","));
|
|
|
addMusicSheet.setMusicSheetSoundList(musicSheetSounds);
|
|
|
}
|
|
|
+ CbsMusicSheetWrapper.MusicSheetAccompaniment musicSheetAccompaniment = new CbsMusicSheetWrapper.MusicSheetAccompaniment();
|
|
|
+ if (addMusicSheet.getIsUseSystemBeat() != null && addMusicSheet.getIsUseSystemBeat()) {
|
|
|
+ musicSheetAccompaniment.setAudioFileUrl(from.getUrl());
|
|
|
+ }else {
|
|
|
+ musicSheetAccompaniment.setAudioFileUrl(from.getMetronomeUrl());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(musicSheetAccompaniment.getAudioFileUrl())) {
|
|
|
+ addMusicSheet.setMusicSheetAccompanimentList(Lists.newArrayList(musicSheetAccompaniment));
|
|
|
+ }
|
|
|
}
|
|
|
addMusicSheet.setMultiTracksSelection(tracks);
|
|
|
|