|
@@ -53,11 +53,12 @@ public class CbsMusicSheetServiceImpl implements CbsMusicSheetService {
|
|
|
List<Long> cbsMusicSheetIds = addMusicSheet.stream().map(CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend::getMusicSheetId).collect(Collectors.toList());
|
|
|
for (CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend extend : addMusicSheet) {
|
|
|
CbsMusicSheetApiWrapper.MusicSheetUpdate musicSheetUpdate = extend.getMusicSheetUpdate();
|
|
|
- if(StringUtils.isNotBlank(musicSheetUpdate.getSubjectIds())) {
|
|
|
- List<Long> cbsSubjectIds = Arrays.stream(musicSheetUpdate.getSubjectIds().split(",")).map(Long::parseLong).collect(Collectors.toList());
|
|
|
- List<Subject> subjectIds = subjectService.getDao().queryCbsList(cbsSubjectIds);
|
|
|
- if (CollectionUtils.isNotEmpty(subjectIds)) {
|
|
|
- musicSheetUpdate.setSubjectIds(subjectIds.stream().map(e -> e.getId().toString()).collect(Collectors.joining(",")));
|
|
|
+ if(StringUtils.isNotBlank(musicSheetUpdate.getMusicalInstrumentIds())) {
|
|
|
+ List<Instrument> instruments = instrumentService.lambdaQuery()
|
|
|
+ .in(Instrument::getId, Arrays.stream(musicSheetUpdate.getMusicalInstrumentIds().split(","))
|
|
|
+ .map(Integer::parseInt).collect(Collectors.toList())).list();
|
|
|
+ if (CollectionUtils.isNotEmpty(instruments)) {
|
|
|
+ musicSheetUpdate.setSubjectIds(instruments.stream().map(e -> e.getSubjectId().toString()).distinct().collect(Collectors.joining(",")));
|
|
|
}
|
|
|
}
|
|
|
}
|