소스 검색

Merge branch 'saas' of http://git.dayaedu.com/yonge/mec into dev

zouxuan 1 년 전
부모
커밋
6f01c69366
1개의 변경된 파일11개의 추가작업 그리고 8개의 파일을 삭제
  1. 11 8
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreServiceImpl.java

+ 11 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreServiceImpl.java

@@ -171,11 +171,14 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
                         .stream().collect(Collectors.toMap(CbsMusicSheetWrapper.MusicSheetApplication::getId, Function.identity()));
                         .stream().collect(Collectors.toMap(CbsMusicSheetWrapper.MusicSheetApplication::getId, Function.identity()));
 
 
                 //获取乐器名称
                 //获取乐器名称
-                String instrumentIds = applications.stream().map(CbsMusicSheetWrapper.MusicSheetApplication::getMusicalInstrumentIds).collect(Collectors.joining(","));
-                List<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> musicalInstrumentQueryDtos =
-                        this.queryMusicalInstrument(Arrays.stream(instrumentIds.split(",")).map(Integer::parseInt).distinct().collect(Collectors.toList()));
-                Map<Integer,CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> musicalInstrumentQueryMap = musicalInstrumentQueryDtos.stream()
-                        .collect(Collectors.toMap(CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto::getId, o -> o, (o1, o2) -> o1));
+                String instrumentIds = applications.stream().map(CbsMusicSheetWrapper.MusicSheetApplication::getMusicalInstrumentIds)
+                        .filter(StringUtils::isNotEmpty).collect(Collectors.joining(","));
+                Map<Integer,CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> musicalInstrumentQueryMap = new HashMap<>();
+                if(StringUtils.isNotEmpty(instrumentIds)){
+                    List<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> musicalInstrumentQueryDtos =
+                            this.queryMusicalInstrument(Arrays.stream(instrumentIds.split(",")).map(Integer::parseInt).distinct().collect(Collectors.toList()));
+                    musicalInstrumentQueryMap = musicalInstrumentQueryDtos.stream().collect(Collectors.toMap(CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto::getId, o -> o, (o1, o2) -> o1));
+                }
                 //获取分类名称
                 //获取分类名称
                 Map<Integer, String> categoriesMap = new HashMap<>(categoriesIds.size());
                 Map<Integer, String> categoriesMap = new HashMap<>(categoriesIds.size());
                 for (Integer categoriesId : categoriesIds) {
                 for (Integer categoriesId : categoriesIds) {
@@ -432,7 +435,7 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
     }
     }
 
 
     //测试环境合奏分类
     //测试环境合奏分类
-    private static String categoryIds = "42,43,44,45,46,91,92,93,94,95,7,11,15,180";
+//    private static String categoryIds = "42,43,44,45,46,91,92,93,94,95,7,11,15,180";
     private static String prodCategoryIds = "42,43,44,45,46,91,92,93,94,95,185,186,7,11,15,180";
     private static String prodCategoryIds = "42,43,44,45,46,91,92,93,94,95,185,186,7,11,15,180";
 
 
     private CbsMusicSheetWrapper.AddMusicSheet musicToAddMusicSheet(SysMusicScore from, List<SysMusicScoreAccompaniment> accList) {
     private CbsMusicSheetWrapper.AddMusicSheet musicToAddMusicSheet(SysMusicScore from, List<SysMusicScoreAccompaniment> accList) {
@@ -466,7 +469,7 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
             }
             }
         }
         }
         if(addMusicSheet.getMusicSheetType() == null){
         if(addMusicSheet.getMusicSheetType() == null){
-            if(Arrays.stream(categoryIds.split(",")).anyMatch(e->e.equals(from.getMusicScoreCategoriesId().toString()))){
+            if(Arrays.stream(prodCategoryIds.split(",")).anyMatch(e->e.equals(from.getMusicScoreCategoriesId().toString()))){
                 addMusicSheet.setMusicSheetType(EMusicSheetType.CONCERT);
                 addMusicSheet.setMusicSheetType(EMusicSheetType.CONCERT);
             }else {
             }else {
                 addMusicSheet.setMusicSheetType(EMusicSheetType.SINGLE);
                 addMusicSheet.setMusicSheetType(EMusicSheetType.SINGLE);
@@ -474,7 +477,6 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
         }
         }
         addMusicSheet.setIsEvaluated(from.isEnableEvaluation());
         addMusicSheet.setIsEvaluated(from.isEnableEvaluation());
         addMusicSheet.setIsConvertibleScore(true);
         addMusicSheet.setIsConvertibleScore(true);
-        addMusicSheet.setPlaySpeed(from.getSpeed());
         addMusicSheet.setPlayMode(from.getPlayMode() == SysMusicScore.PlayMode.MP3 ? EMusicPlayMode.MP3 : EMusicPlayMode.MIDI);
         addMusicSheet.setPlayMode(from.getPlayMode() == SysMusicScore.PlayMode.MP3 ? EMusicPlayMode.MP3 : EMusicPlayMode.MIDI);
         addMusicSheet.setMidiFileUrl(from.getMidiUrl());
         addMusicSheet.setMidiFileUrl(from.getMidiUrl());
         addMusicSheet.setExtConfigJson(from.getExtConfigJson());
         addMusicSheet.setExtConfigJson(from.getExtConfigJson());
@@ -518,6 +520,7 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
                         addMusicSheet.setIsUseSystemBeat(sheetAccompaniment.getIsOpenMetronome());
                         addMusicSheet.setIsUseSystemBeat(sheetAccompaniment.getIsOpenMetronome());
                         musicSheetSounds.add(musicSheetSound);
                         musicSheetSounds.add(musicSheetSound);
                     }
                     }
+                    addMusicSheet.setPlaySpeed(sheetAccompaniment.getSpeed());
                 }
                 }
                 tracks = musicSheetSounds.stream().map(CbsMusicSheetWrapper.MusicSheetSound::getTrack).collect(Collectors.joining(","));
                 tracks = musicSheetSounds.stream().map(CbsMusicSheetWrapper.MusicSheetSound::getTrack).collect(Collectors.joining(","));
                 addMusicSheet.setMusicSheetSoundList(musicSheetSounds);
                 addMusicSheet.setMusicSheetSoundList(musicSheetSounds);