|
@@ -22,10 +22,7 @@ import com.ym.mec.biz.dal.dto.ReasonDto;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
|
|
|
-import com.ym.mec.biz.service.CbsMusicScoreCategoriesService;
|
|
|
-import com.ym.mec.biz.service.InstrumentService;
|
|
|
-import com.ym.mec.biz.service.SubjectService;
|
|
|
-import com.ym.mec.biz.service.SysMusicScoreService;
|
|
|
+import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
@@ -62,6 +59,8 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
@Resource
|
|
|
private SysMusicScoreAccompanimentDao sysMusicScoreAccompanimentDao;
|
|
|
@Resource
|
|
|
+ private SysMusicScoreAccompanimentService sysMusicScoreAccompanimentService;
|
|
|
+ @Resource
|
|
|
private MusicFeignClientService musicFeignClientService;
|
|
|
@Resource
|
|
|
private InstrumentService instrumentService;
|
|
@@ -161,13 +160,6 @@ 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)){
|
|
|
-// 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<>();
|
|
|
- if(CollectionUtils.isNotEmpty(categoriesIds)){
|
|
|
- map = cbsMusicScoreCategoriesService.getCategoriesNameMap(categoriesIds);
|
|
|
- }*/
|
|
|
Map<Long, CbsMusicSheetWrapper.MusicSheetApplication> musicSheetApplicationMap = applications
|
|
|
.stream().collect(Collectors.toMap(CbsMusicSheetWrapper.MusicSheetApplication::getId, Function.identity()));
|
|
|
|
|
@@ -180,25 +172,29 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
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());
|
|
|
- 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.getCbsMusicCategoriesId()));
|
|
|
-// record.setOrganName(organMap.get(record.getMusicScoreCategoriesId()));
|
|
|
CbsMusicSheetWrapper.MusicSheetApplication musicSheetApplication = musicSheetApplicationMap.get(Long.parseLong(record.getCbsMusicSheetId()));
|
|
|
if(musicSheetApplication != null){
|
|
|
this.initMusicSheetVo(record,musicSheetApplication,musicalInstrumentQueryMap,instrumentMap);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ List<Integer> musicSheetIds = records.stream().map(SysMusicScore::getId).collect(Collectors.toList());
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("musicScoreIds", musicSheetIds);
|
|
|
+ List<SysMusicScoreAccompaniment> accompaniments = sysMusicScoreAccompanimentService.queryAccPage(params);
|
|
|
+ if(CollectionUtils.isNotEmpty(accompaniments)){
|
|
|
+ Map<Integer, List<SysMusicScoreAccompaniment>> accompanimentMap = accompaniments.stream().collect(Collectors.groupingBy(SysMusicScoreAccompaniment::getExamSongId));
|
|
|
+ for (SysMusicScore record : records) {
|
|
|
+ List<SysMusicScoreAccompaniment> accompanimentList = accompanimentMap.get(record.getId());
|
|
|
+ if(CollectionUtils.isNotEmpty(accompanimentList)){
|
|
|
+ record.setBackground(accompanimentList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|