Prechádzať zdrojové kódy

酷乐秀曲目来源改为内容平台

zouxuan 1 rok pred
rodič
commit
080f23ed47

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

@@ -260,7 +260,7 @@ public class MusicSheetAuthRecordServiceImpl extends ServiceImpl<MusicSheetAuthR
         if(musicSheetAuthRecord.getId() == null){
             throw new BizException("先选择要修改的曲目");
         }
-        MusicSheetAuthRecord record = this.lambdaQuery().eq(MusicSheetAuthRecord::getId, musicSheetAuthRecord.getId()).last("LIMIT 1").one();
+        MusicSheetAuthRecord record = this.lambdaQuery().eq(MusicSheetAuthRecord::getId, musicSheetAuthRecord.getId()).one();
         if (record == null){
             throw new BizException("审核记录不存在");
         }
@@ -273,10 +273,6 @@ public class MusicSheetAuthRecordServiceImpl extends ServiceImpl<MusicSheetAuthR
         }
         CbsMusicSheetWrapper.AddMusicSheet addMusicSheet = this.checkRecord(musicSheetAuthRecord);
         musicSheetService.initMusicSheet(addMusicSheet);
-//        musicSheet.setCbsMusicSheetId(musicSheet1.getCbsMusicSheetId());
-//        musicSheet.setId(musicSheet1.getId());
-//        musicSheetService.removeById(record.getMusicSheetId());
-//        musicSheetAccompanimentService.delByMusicSheetId(record.getMusicSheetId());
         musicSheet1.setDelFlag(true);
         musicSheetService.updateById(musicSheet1);
         musicSheetAuthRecord.setMusicSheetId(musicSheet1.getId());
@@ -284,21 +280,6 @@ public class MusicSheetAuthRecordServiceImpl extends ServiceImpl<MusicSheetAuthR
         musicSheetAuthRecord.setAuditState(AuthStatusEnum.DOING);
         musicSheetAuthRecord.setMusicSheetJson(JSON.toJSONString(addMusicSheet));
         baseMapper.insert(musicSheetAuthRecord);
-        /*record.setAuditState(AuthStatusEnum.DOING);
-        record.setMusicSheetJson(JSON.toJSONString(addMusicSheet));
-        baseMapper.updateById(record);
-        if(record.getAuditState() == AuthStatusEnum.DOING){
-            //保存曲目信息
-//            musicSheetService.updateById(musicSheet);
-//            List<MusicSheetAccompaniment> musicSheetAccompaniments = musicSheetAccompanimentService.initMusicSheetAccompaniment(musicSheetAuthRecord.getMusicSheetJson(),musicSheet.getId());
-//            musicSheetAccompanimentService.saveBatch(musicSheetAccompaniments);
-            record.setMusicSheetId(musicSheet1.getId());
-        }else {
-            //保存曲目信息
-//            musicSheetService.updateById(musicSheet);
-//            List<MusicSheetAccompaniment> musicSheetAccompaniments = musicSheetAccompanimentService.initMusicSheetAccompaniment(musicSheetAuthRecord.getMusicSheetJson(),musicSheet.getId());
-//            musicSheetAccompanimentService.saveBatch(musicSheetAccompaniments);
-        }*/
     }
 
     @Override
@@ -391,7 +372,6 @@ public class MusicSheetAuthRecordServiceImpl extends ServiceImpl<MusicSheetAuthR
                         }
                     }
                 }
-                sheetDetailVo.setMusicSheetJson(null);
                 sheetDetailVo.setSubmitAuditTime(sheetDetailVo.getCreateTime());
                 //获取声部
                 String musicSubject = sheetDetailVo.getMusicSubject();

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

@@ -595,7 +595,15 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         if (detailVo == null) {
             MusicSheetDetailVo result = musicSheetAuthRecordService.auditDetail(id);
             if (result != null) {
-                return result;
+                if(StringUtils.isNotEmpty(result.getMusicSheetJson())){
+                    return result;
+                }else {
+                    MusicSheetAuthRecord authRecord = musicSheetAuthRecordService.getById(id);
+                    detailVo = baseMapper.detail(authRecord.getMusicSheetId());
+                    if(detailVo == null){
+                        throw new BizException("未找到曲目信息");
+                    }
+                }
             }
             if(result == null){
                 throw new BizException("未找到曲目信息");