|
@@ -130,6 +130,20 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public List<CbsMusicSheetWrapper.MusicSheetApplicationSimple> queryCbsMusicSheetApplicationSimple(CbsMusicSheetWrapper.MusicSheetApplicationQuery query) {
|
|
|
+ R<com.microsvc.toolkit.common.response.paging.PageInfo<CbsMusicSheetWrapper.MusicSheetApplicationSimple>> pageInfoR =
|
|
|
+ musicFeignClientService.musicSheetPageByApplicationSimple(query);
|
|
|
+ if(pageInfoR.getCode() != 200){
|
|
|
+ throw new BizException("获取曲目信息失败");
|
|
|
+ }
|
|
|
+ com.microsvc.toolkit.common.response.paging.PageInfo<CbsMusicSheetWrapper.MusicSheetApplicationSimple> pageInfo = pageInfoR.getData();
|
|
|
+ if(pageInfo != null && CollectionUtils.isNotEmpty(pageInfo.getRows())){
|
|
|
+ return pageInfo.getRows();
|
|
|
+ }
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public PageInfo<CbsMusicSheetWrapper.MusicSheetAccApplication> queryCbsMusicSheetSoundApplication(CbsMusicSheetWrapper.MusicSheetApplicationQuery query) {
|
|
|
R<com.microsvc.toolkit.common.response.paging.PageInfo<CbsMusicSheetWrapper.MusicSheetAccApplication>> pageInfoR =
|
|
|
musicFeignClientService.musicSheetAccPageByApplication(query);
|
|
@@ -148,6 +162,14 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
return this.queryCbsMusicSheetApplication(query);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<CbsMusicSheetWrapper.MusicSheetApplicationSimple> queryCbsMusicSheetApplicationSimple(List<String> cbsMusicSheetIds){
|
|
|
+ CbsMusicSheetWrapper.MusicSheetApplicationQuery query = this.getMusicSheetApplicationQuery();
|
|
|
+ query.setMusicSheetIds(cbsMusicSheetIds.stream().map(Long::parseLong).collect(Collectors.toList()));
|
|
|
+ query.setRows(cbsMusicSheetIds.size());
|
|
|
+ return this.queryCbsMusicSheetApplicationSimple(query);
|
|
|
+ }
|
|
|
+
|
|
|
//获取乐器名称
|
|
|
@Override
|
|
|
public List<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> queryMusicalInstrument(List<Integer> musicalInstrumentIds){
|
|
@@ -164,6 +186,7 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
return infoR.getData().getRows();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private void dealMusicScoreData(List<SysMusicScore> records){
|
|
|
if (CollectionUtils.isNotEmpty(records)) {
|
|
|
List<String> cbsMusicSheetIds = records.stream().map(SysMusicScore::getCbsMusicSheetId).collect(Collectors.toList());
|
|
@@ -386,6 +409,52 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
}
|
|
|
return pageInfo;
|
|
|
}
|
|
|
+ @Override
|
|
|
+ public PageInfo<MusicSheetWrapper.MusicSheetSimpleDto> queryMusicScorePageInfoSimple(SysExamSongQueryInfo queryInfo) {
|
|
|
+ this.initCategoryIds(queryInfo);
|
|
|
+ if(queryInfo.getSubjectId() != null){
|
|
|
+ if(queryInfo.getSubjectId() == 5){
|
|
|
+ queryInfo.setSubjectId(null);
|
|
|
+ queryInfo.setSubjectIds("6");
|
|
|
+ }else if(queryInfo.getSubjectId() == 122){
|
|
|
+ queryInfo.setSubjectId(null);
|
|
|
+ queryInfo.setSubjectIds("122,121,113,23");
|
|
|
+ }else {
|
|
|
+ queryInfo.setSubjectIds(queryInfo.getSubjectId().toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(CollectionUtils.isEmpty(queryInfo.getCategoriesIdList())){
|
|
|
+ return new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ }
|
|
|
+ PageInfo<MusicSheetWrapper.MusicSheetSimpleDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+
|
|
|
+ List<MusicSheetWrapper.MusicSheetSimpleDto> dataList = null;
|
|
|
+ int count = sysMusicScoreDao.findCountSimple(params);
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ dataList = sysMusicScoreDao.queryPageSimple(params);
|
|
|
+ List<String> cbsMusicSheetIds = dataList.stream().map(MusicSheetWrapper.MusicSheetSimpleDto::getCbsMusicSheetId).collect(Collectors.toList());
|
|
|
+ List<CbsMusicSheetWrapper.MusicSheetApplicationSimple> applications = this.queryCbsMusicSheetApplicationSimple(cbsMusicSheetIds);
|
|
|
+ if(CollectionUtils.isNotEmpty(applications)){
|
|
|
+ Map<Long, CbsMusicSheetWrapper.MusicSheetApplicationSimple> musicSheetApplicationMap = applications
|
|
|
+ .stream().collect(Collectors.toMap(CbsMusicSheetWrapper.MusicSheetApplicationSimple::getId, Function.identity()));
|
|
|
+ for (MusicSheetWrapper.MusicSheetSimpleDto record : dataList) {
|
|
|
+ CbsMusicSheetWrapper.MusicSheetApplicationSimple simple = musicSheetApplicationMap.get(Long.parseLong(record.getCbsMusicSheetId()));
|
|
|
+ record.setAudioFileUrl(simple.getAudioFileUrl());
|
|
|
+ record.setName(simple.getName());
|
|
|
+ record.setTitleImg(simple.getTitleImg());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (count == 0) {
|
|
|
+ dataList = new ArrayList<>();
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public Map<Long, SysMusicScore> getMapByIds(List<Long> musicSheetIds) {
|