|
@@ -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());
|
|
@@ -385,6 +408,72 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
}
|
|
|
return pageInfo;
|
|
|
}
|
|
|
+ @Override
|
|
|
+ public PageInfo<SysMusicScore> 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 = this.findCount(params);
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ dataList = this.getDAO().queryPage(params);
|
|
|
+ }
|
|
|
+ if (count == 0) {
|
|
|
+ dataList = new ArrayList<>();
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+ Map<String,SysMusicScore> cbsMusicSheetIds = rows.stream().collect(Collectors.toMap(SysMusicScore::getCbsMusicSheetId, Function.identity()));
|
|
|
+ List<CbsMusicSheetWrapper.MusicSheetApplicationSimple> applications = this.queryCbsMusicSheetApplicationSimple(cbsMusicSheetIds);
|
|
|
+ if(CollectionUtils.isNotEmpty(applications)){
|
|
|
+
|
|
|
+ }
|
|
|
+ dealMusicScoreData(rows);
|
|
|
+
|
|
|
+ // 根据用户会员判断是否锁定,免费曲目为试用
|
|
|
+ List<Integer> categoryIds = new ArrayList<>();
|
|
|
+ if (queryInfo.getUserType()!=null && ClientEnum.STUDENT==queryInfo.getUserType()) {
|
|
|
+ // 查询有效的会员
|
|
|
+ List<Integer> activationVipIds = cloudTeacherOrderDao.getActivationVipIds(queryInfo.getUserId());
|
|
|
+
|
|
|
+ // 获取会员的曲目分类
|
|
|
+ List<MemberRankCategoryMapper> categoryMapperList = memberRankCategoryMapperService.getByMemberRankId(activationVipIds);
|
|
|
+ if (CollectionUtils.isEmpty(categoryMapperList)) {
|
|
|
+ categoryMapperList = new ArrayList<>();
|
|
|
+ }
|
|
|
+ categoryIds = categoryMapperList.stream().map(MemberRankCategoryMapper::getCategoryId).distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断曲目是否在分类中
|
|
|
+ for (SysMusicScore row : rows) {
|
|
|
+ if (StringUtils.isBlank(row.getRankIds())) {
|
|
|
+ row.setUseStatus("FREE");
|
|
|
+ } else if (categoryIds.contains(row.getCbsMusicCategoriesId())) {
|
|
|
+ row.setUseStatus("UNLOCK");
|
|
|
+ } else {
|
|
|
+ row.setUseStatus("LOCK");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public Map<Long, SysMusicScore> getMapByIds(List<Long> musicSheetIds) {
|