|
@@ -161,14 +161,12 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
List<String> cbsMusicSheetIds = records.stream().map(SysMusicScore::getCbsMusicSheetId).collect(Collectors.toList());
|
|
|
List<CbsMusicSheetWrapper.MusicSheetApplication> applications = this.queryCbsMusicSheetApplication(cbsMusicSheetIds);
|
|
|
if(CollectionUtils.isNotEmpty(applications)){
|
|
|
- Set<Integer> categoriesIds = records.stream().map(SysMusicScore::getMusicScoreCategoriesId).collect(Collectors.toSet());
|
|
|
+ List<Integer> categoriesIds = records.stream().map(SysMusicScore::getCbsMusicCategoriesId).distinct().filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
//获取分部列表
|
|
|
// Map<Integer, String> organMap = MapUtil.convertMybatisMap(sysMusicScoreCategoriesDao.queryOrganByIds(categoriesIds));
|
|
|
- Map<Integer, String> map = new HashMap<>(categoriesIds.size());
|
|
|
- for (Integer categoriesId : categoriesIds) {
|
|
|
- if(null != categoriesId){
|
|
|
- map.put(categoriesId, getParentTreeName(categoriesId));
|
|
|
- }
|
|
|
+ Map<Integer, String> map = new HashMap<>();
|
|
|
+ if(CollectionUtils.isNotEmpty(categoriesIds)){
|
|
|
+ map = cbsMusicScoreCategoriesService.getCategoriesNameMap(categoriesIds);
|
|
|
}
|
|
|
Map<Long, CbsMusicSheetWrapper.MusicSheetApplication> musicSheetApplicationMap = applications
|
|
|
.stream().collect(Collectors.toMap(CbsMusicSheetWrapper.MusicSheetApplication::getId, Function.identity()));
|
|
@@ -183,21 +181,21 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
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) {
|
|
|
if(null != categoriesId){
|
|
|
categoriesMap.put(categoriesId, getParentTreeName(categoriesId));
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
//获取声部乐器关联
|
|
|
List<Instrument> list = instrumentService.lambdaQuery().list();
|
|
|
Map<Integer, Instrument> instrumentMap = list.stream().collect(Collectors.toMap(Instrument::getSubjectId, o -> o));
|
|
|
for (SysMusicScore record : records) {
|
|
|
- record.setCategoriesName(map.get(record.getMusicScoreCategoriesId()));
|
|
|
+ record.setCategoriesName(map.get(record.getCbsMusicCategoriesId()));
|
|
|
// record.setOrganName(organMap.get(record.getMusicScoreCategoriesId()));
|
|
|
CbsMusicSheetWrapper.MusicSheetApplication musicSheetApplication = musicSheetApplicationMap.get(Long.parseLong(record.getCbsMusicSheetId()));
|
|
|
if(musicSheetApplication != null){
|
|
|
- this.initMusicSheetVo(record,musicSheetApplication,musicalInstrumentQueryMap,categoriesMap,instrumentMap);
|
|
|
+ this.initMusicSheetVo(record,musicSheetApplication,musicalInstrumentQueryMap,instrumentMap);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -206,20 +204,20 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
|
|
|
public void initMusicSheetVo(SysMusicScore record,CbsMusicSheetWrapper.MusicSheetApplication musicSheetApplication
|
|
|
,Map<Integer,CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> musicalInstrumentQueryMap,
|
|
|
- Map<Integer, String> categoriesMap,Map<Integer, Instrument> instrumentMap){
|
|
|
+ Map<Integer, Instrument> instrumentMap){
|
|
|
record.setRankIds(StringUtils.equals("FREE",musicSheetApplication.getPaymentType()) ? "" : "1");
|
|
|
record.setCbsMusicSheetId(musicSheetApplication.getId().toString());
|
|
|
record.setPlayMode(SysMusicScore.PlayMode.valueOf(musicSheetApplication.getPlayMode().getCode()));
|
|
|
record.setExtConfigJson(musicSheetApplication.getExtConfigJson());
|
|
|
record.setExtStyleConfigJson(musicSheetApplication.getExtStyleConfigJson());
|
|
|
- if(musicSheetApplication.getMusicSheetCategoryId() != null){
|
|
|
- record.setMusicScoreCategoriesId(musicSheetApplication.getMusicSheetCategoryId().intValue());
|
|
|
- record.setCategoriesId(musicSheetApplication.getMusicSheetCategoryId().intValue());
|
|
|
- }
|
|
|
+// if(musicSheetApplication.getMusicSheetCategoryId() != null){
|
|
|
+// record.setMusicScoreCategoriesId(musicSheetApplication.getMusicSheetCategoryId().intValue());
|
|
|
+// record.setCategoriesId(musicSheetApplication.getMusicSheetCategoryId().intValue());
|
|
|
+// }
|
|
|
record.setName(musicSheetApplication.getName());
|
|
|
- if(musicSheetApplication.getMusicSheetCategoryId() != null){
|
|
|
- record.setCategoriesName(categoriesMap.get(musicSheetApplication.getMusicSheetCategoryId().intValue()));
|
|
|
- }
|
|
|
+// if(musicSheetApplication.getMusicSheetCategoryId() != null){
|
|
|
+// record.setCategoriesName(categoriesMap.get(musicSheetApplication.getMusicSheetCategoryId().intValue()));
|
|
|
+// }
|
|
|
record.setSpeed(musicSheetApplication.getPlaySpeed());
|
|
|
record.setIsOpenMetronome(musicSheetApplication.getIsUseSystemBeat());
|
|
|
List<CbsMusicSheetWrapper.MusicSheetAccompaniment> accompanimentList = musicSheetApplication.getMusicSheetAccompanimentList();
|
|
@@ -291,17 +289,6 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
private void initCategoryIds(SysExamSongQueryInfo queryInfo){
|
|
|
if(StringUtils.isNotEmpty(queryInfo.getCategoriesId())){
|
|
|
List<Integer> categoriesIdList = cbsMusicScoreCategoriesService.getAllCategoryIdList(queryInfo.getCategoriesId());
|
|
|
- /*Integer categoriesId = Integer.parseInt(queryInfo.getCategoriesId());
|
|
|
-
|
|
|
- SysMusicScoreCategories sysMusicScoreCategories = sysMusicScoreCategoriesService.get(categoriesId);
|
|
|
-
|
|
|
- if(sysMusicScoreCategories == null){
|
|
|
- throw new BizException("分类找不到");
|
|
|
- }
|
|
|
- categoriesIdList.add(categoriesId);
|
|
|
- sysMusicScoreCategories = sysMusicScoreCategoriesService.getChildTree(sysMusicScoreCategories);
|
|
|
- getAllCategoryIdList(categoriesIdList, sysMusicScoreCategories.getSysMusicScoreCategoriesList());*/
|
|
|
-
|
|
|
queryInfo.setCategoriesIdList(categoriesIdList);
|
|
|
}
|
|
|
}
|
|
@@ -491,7 +478,7 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
}
|
|
|
}
|
|
|
if(addMusicSheet.getMusicSheetType() == null){
|
|
|
- if(Arrays.stream(prodCategoryIds.split(",")).anyMatch(e->e.equals(from.getMusicScoreCategoriesId().toString()))){
|
|
|
+ if(Arrays.stream(prodCategoryIds.split(",")).anyMatch(e->e.equals(from.getCbsMusicCategoriesId().toString()))){
|
|
|
addMusicSheet.setMusicSheetType(EMusicSheetType.CONCERT);
|
|
|
}else {
|
|
|
addMusicSheet.setMusicSheetType(EMusicSheetType.SINGLE);
|
|
@@ -571,8 +558,8 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
addMusicSheetApplicationExtend.setSortNo(from.getOrder());
|
|
|
addMusicSheetApplicationExtend.setPaymentType(StringUtils.isNotEmpty(from.getRankIds()) ? "VIP" : "FREE");
|
|
|
addMusicSheetApplicationExtend.setAvailableType(EMusicAvailableType.ORG);
|
|
|
- addMusicSheetApplicationExtend.setMusicSheetCategoryId(from.getMusicScoreCategoriesId().longValue());
|
|
|
- addMusicSheet.setMusicCategoryId(from.getMusicScoreCategoriesId().longValue());
|
|
|
+ addMusicSheetApplicationExtend.setMusicSheetCategoryId(from.getCbsMusicCategoriesId().longValue());
|
|
|
+ addMusicSheet.setMusicCategoryId(from.getCbsMusicCategoriesId().longValue());
|
|
|
addMusicSheet.setAddMusicSheetApplicationExtend(Lists.newArrayList(addMusicSheetApplicationExtend));
|
|
|
addMusicSheet.setIsConvertibleScore(true);
|
|
|
return addMusicSheet;
|