浏览代码

Merge branch 'zx_online_cbs' of http://git.dayaedu.com/yonge/cooleshow into test

zouxuan 1 年之前
父节点
当前提交
f3b660aae6

+ 9 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CbsMusicSheetServiceImpl.java

@@ -113,6 +113,15 @@ public class CbsMusicSheetServiceImpl implements CbsMusicSheetService {
     }
 
     public boolean updateMusicSheet(CbsMusicSheetApiWrapper.MusicSheetUpdate musicSheetUpdate) {
+        if(musicSheetUpdate.getMusicSheetType() == EMusicSheetType.CONCERT){
+            musicSheetUpdate.setSubjectIds(null);
+        }
+        if(StringUtils.isNotBlank(musicSheetUpdate.getSubjectIds())) {
+            List<Subject> subjectIds = subjectService.getDao().getByCbsSubjectIds(musicSheetUpdate.getSubjectIds());
+            if (CollectionUtils.isNotEmpty(subjectIds)) {
+                musicSheetUpdate.setSubjectIds(subjectIds.stream().map(e -> e.getId().toString()).collect(Collectors.joining(",")));
+            }
+        }
         musicSheetService.getDao().updateMusicSheet(musicSheetUpdate);
         return true;
     }

+ 3 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetAuthRecordServiceImpl.java

@@ -111,11 +111,10 @@ public class MusicSheetAuthRecordServiceImpl extends ServiceImpl<MusicSheetAuthR
             CbsMusicSheetWrapper.MusicSheetExtend musicSheetExtend = new CbsMusicSheetWrapper.MusicSheetExtend();
             musicSheetExtend.setApplicationId(applicationId);
             R<CbsMusicSheetWrapper.MusicSheet> detail = musicFeignClientService.musicSheetDetail(musicSheet.getCbsMusicSheetId(), applicationId);
-            if (!detail.getCode().equals(200)) {
-                log.error("同步到内容平台失败,{}", detail.getMessage());
-                throw new BizException("同步到内容平台失败");
+            String useApplicationIds = null;
+            if (detail.getCode().equals(200) && detail.getData() != null){
+                useApplicationIds = detail.feignData().getMusicSheetExtend().getUseApplicationIds();
             }
-            String useApplicationIds = detail.feignData().getMusicSheetExtend().getUseApplicationIds();
             if(StringUtils.isEmpty(useApplicationIds)){
                 useApplicationIds = applicationId.toString();
             }else {

+ 19 - 7
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetServiceImpl.java

@@ -546,7 +546,11 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
             sheet.setAccompanimentType(AccompanimentTypeEnum.valueOf(musicSheetApplication.getAudioType().getCode()));
         }
         sheet.setMusicTagNames(musicSheetApplication.getMusicTagNames());
-        sheet.setSubjectNames(musicSheetApplication.getSubjectNames());
+        if(musicSheetApplication.getMusicSheetType() == EMusicSheetType.CONCERT){
+            sheet.setSubjectNames(null);
+        }else {
+            sheet.setSubjectNames(musicSheetApplication.getSubjectNames());
+        }
         sheet.setPaymentType(musicSheetApplication.getPaymentType());
         sheet.setSortNumber(musicSheetApplication.getSortNo());
         if (musicSheetApplication.getTopFlag() != null){
@@ -825,7 +829,11 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
     }
 
     public void initMusicSheetVo(MusicSheetVo record,CbsMusicSheetWrapper.MusicSheetApplication musicSheetApplication){
-        record.setSubjectNames(musicSheetApplication.getSubjectNames());
+        if (musicSheetApplication.getMusicSheetType() == EMusicSheetType.CONCERT) {
+            record.setSubjectNames(null);
+        } else {
+            record.setSubjectNames(musicSheetApplication.getSubjectNames());
+        }
         record.setCbsMusicSheetId(musicSheetApplication.getId());
         record.setAudioType(AudioTypeEnum.valueOf(musicSheetApplication.getPlayMode().getCode()));
         record.setCanEvaluate(musicSheetApplication.getIsEvaluated() ? YesOrNoEnum.YES : YesOrNoEnum.NO);
@@ -1572,9 +1580,9 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         if (CollectionUtils.isEmpty(rows)){
             throw new BizException("查询曲谱信息失败");
         }
-        List<Subject> subjects = subjectService.getDao().getByCbsSubjectIds(rows.stream().map(CbsMusicSheetWrapper.MusicSheetApplication::getSubjectIds).
-                filter(StringUtils::isNotEmpty).collect(Collectors.joining(",")));
-        Map<Long, String> subjectMap = subjects.stream().collect(Collectors.toMap(Subject::getCbsSubjectId, Subject::getName));
+//        List<Subject> subjects = subjectService.getDao().getByCbsSubjectIds(rows.stream().map(CbsMusicSheetWrapper.MusicSheetApplication::getSubjectIds).
+//                filter(StringUtils::isNotEmpty).collect(Collectors.joining(",")));
+//        Map<Long, String> subjectMap = subjects.stream().collect(Collectors.toMap(Subject::getCbsSubjectId, Subject::getName));
 
         Map<Long,CbsMusicSheetWrapper.MusicSheetApplication> musicSheetMap =
                 rows.stream().collect(Collectors.toMap(CbsMusicSheetWrapper.MusicSheetApplication::getId, Function.identity()));
@@ -1583,7 +1591,7 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
             if(musicSheetApplication == null){
                 continue;
             }
-            if(StringUtils.isNotEmpty(musicSheetApplication.getSubjectIds())){
+            /*if(StringUtils.isNotEmpty(musicSheetApplication.getSubjectIds())){
                 StringBuffer sb = new StringBuffer();
                 for (String s : musicSheetApplication.getSubjectIds().split(",")) {
                     String subjectName = subjectMap.get(Long.parseLong(s));
@@ -1594,7 +1602,11 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
                         sb.append(subjectName);
                     }
                 }
-                record.setSubjectNames(sb.toString());
+            }*/
+            if(musicSheetApplication.getMusicSheetType() == EMusicSheetType.CONCERT){
+                record.setSubjectNames(null);
+            }else {
+                record.setSubjectNames(musicSheetApplication.getSubjectNames());
             }
             record.setCbsMusicSheetId(musicSheetApplication.getId());
             record.setAudioType(AudioTypeEnum.valueOf(musicSheetApplication.getPlayMode().getCode()));

+ 0 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/SubjectServiceImpl.java

@@ -321,7 +321,6 @@ public class SubjectServiceImpl extends BaseServiceImpl<Long, Subject> implement
                 dataList = new ArrayList<>();
                 CbsSubjectWrapper.SubjectQuery subjectQuery = new CbsSubjectWrapper.SubjectQuery();
                 subjectQuery.setIds(cbsSubjectIds);
-                subjectQuery.setName(query.getKeyword());
                 subjectQuery.setPage(1);
                 subjectQuery.setRows(query.getRows());
                 try {

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantAlbumMusicServiceImpl.java

@@ -150,7 +150,7 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
                 CbsMusicSheetWrapper.MusicSheetApplication sheetApplication = recordMap.get(m.getCbsMusicSheetId());
                 if (sheetApplication != null) {
                     if(StringUtils.equals(m.getMusicSheetType(),"CONCERT")){
-                        m.setMusicSubjectName("合奏");
+                        m.setMusicSubjectName(null);
                     }else{
                         m.setMusicSubjectName(sheetApplication.getSubjectNames());
                     }

+ 1 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml

@@ -883,7 +883,7 @@
             composer_ = #{param.composer},title_img_ = #{param.musicCover},music_img_ = #{param.musicCover},accompaniment_type_ = #{param.audioType},
             play_speed_ = #{param.playSpeed},music_price_ = #{param.musicPrice},notation_ = #{param.notation},
             music_sheet_type_ = #{param.musicSheetType},source_type_ = CASE WHEN #{param.sourceType} = 'PLATFORM' THEN 'PLATFORM' ELSE 'TEACHER' END,
-            create_by_ = #{param.userId},audit_status_ = 'PASS'
+            create_by_ = #{param.userId}
         where cbs_music_sheet_id_ = #{param.id}
     </update>