Browse Source

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

zouxuan 1 năm trước cách đây
mục cha
commit
c10ab1077d

+ 1 - 12
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/MusicSheetController.java

@@ -161,18 +161,7 @@ public class MusicSheetController extends BaseController {
         if (StringUtil.isEmpty(id)) {
             return failed("参数不能为空");
         }
-        MusicSheet musicSheet = musicSheetService.getById(id);
-        if (musicSheet == null) {
-            return failed("曲目不存在");
-        }
-        if (YesOrNoEnum.YES.equals(musicSheet.getState())) {
-            musicSheet.setState(YesOrNoEnum.NO);
-        } else {
-            musicSheet.setState(YesOrNoEnum.YES);
-        }
-        musicSheetService.updateById(musicSheet);
-        return succeed(true);
-//        return status(musicSheetService.state(id,reasonDto.getReason(),ClientEnum.TEACHER));
+        return status(musicSheetService.state(id,"",ClientEnum.TEACHER));
     }
 
     /**

+ 1 - 12
cooleshow-app/src/main/java/com/yonge/cooleshow/website/controller/MusicSheetController.java

@@ -165,18 +165,7 @@ public class MusicSheetController extends BaseController {
         if (StringUtil.isEmpty(id)) {
             return failed("参数不能为空");
         }
-        MusicSheet musicSheet = musicSheetService.getById(id);
-        if (musicSheet == null) {
-            return failed("曲目不存在");
-        }
-        if (YesOrNoEnum.YES.equals(musicSheet.getState())) {
-            musicSheet.setState(YesOrNoEnum.NO);
-        } else {
-            musicSheet.setState(YesOrNoEnum.YES);
-        }
-        musicSheetService.updateById(musicSheet);
-        return succeed(true);
-//        return status(musicSheetService.state(id,"", ClientEnum.TEACHER));
+        return status(musicSheetService.state(id,"", ClientEnum.TEACHER));
     }
 
     @ApiOperation(value = "关联的曲目列表")

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

@@ -108,6 +108,20 @@ 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 = detail.feignData().getMusicSheetExtend().getUseApplicationIds();
+            if(StringUtils.isEmpty(useApplicationIds)){
+                useApplicationIds = applicationId.toString();
+            }else {
+                if(!useApplicationIds.contains(applicationId.toString())){
+                    useApplicationIds = useApplicationIds + "," + applicationId;
+                }
+            }
+            musicSheetExtend.setUseApplicationIds(useApplicationIds);
             musicSheetExtend.setUserId(addMusicSheet.getCreateBy());
             addMusicSheet.setSendAppFlag(true);
             addMusicSheet.setMusicSheetExtend(musicSheetExtend);

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

@@ -285,10 +285,6 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         if (musicSheet == null) {
             throw new BizException("未找到曲目信息");
         }
-//        if (YesOrNoEnum.YES.equals(musicSheet.getState()) &&
-//                musicSheet.getSourceType().equals(SourceTypeEnum.TEACHER) && StringUtil.isEmpty(reason)) {
-//            throw new BizException("请填写下架原因");
-//        }
         CbsMusicSheetWrapper.MusicSheetApplicationQuery query = new CbsMusicSheetWrapper.MusicSheetApplicationQuery();
         query.setApplicationId(applicationId);
         query.setMusicSheetIds(Collections.singletonList(musicSheet.getCbsMusicSheetId()));

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

@@ -8,6 +8,7 @@ import com.dayaedu.cbs.common.enums.EClientType;
 import com.dayaedu.cbs.common.enums.school.ECourseType;
 import com.dayaedu.cbs.openfeign.client.CoursewareFeignService;
 import com.dayaedu.cbs.openfeign.client.MusicFeignClientService;
+import com.dayaedu.cbs.openfeign.service.CbsMusicSheetService;
 import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsCourseTypeWrapper;
 import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsLessonCoursewareWrapper;
 import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetWrapper;
@@ -20,6 +21,7 @@ import com.yonge.cooleshow.biz.dal.enums.SubjectTypeEnum;
 import com.yonge.cooleshow.biz.dal.mapper.SysUserMapper;
 import com.yonge.cooleshow.biz.dal.mapper.TenantAlbumMusicMapper;
 import com.yonge.cooleshow.biz.dal.service.*;
+import com.yonge.cooleshow.biz.dal.service.cbs.CbsMusicScoreService;
 import com.yonge.cooleshow.biz.dal.wrapper.LessonCoursewareWrapper;
 import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumMusicWrapper;
 import com.yonge.toolset.base.exception.BizException;
@@ -68,7 +70,7 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
     private MusicFavoriteService musicFavoriteService;
 
     @Autowired
-    private MusicFeignClientService musicFeignClientService;
+    private CbsMusicScoreService cbsMusicScoreService;
 
     @Autowired
     private TenantAlbumCategoryDetailService tenantAlbumCategoryDetailService;
@@ -107,13 +109,12 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
                 return page.setRecords(musicSheets);
             }
             CbsMusicSheetWrapper.MusicSheetApplicationQuery cbsQuery = new CbsMusicSheetWrapper.MusicSheetApplicationQuery();
-            cbsQuery.setApplicationId(applicationId);
             List<Long> cbsMusicSheetIds = musicSheets.stream().map(e -> e.getCbsMusicSheetId()).collect(Collectors.toList());
             cbsQuery.setMusicSheetIds(cbsMusicSheetIds);
             cbsQuery.setDelFlag(true);
             cbsQuery.setPage(1);
             cbsQuery.setRows(cbsMusicSheetIds.size());
-            R<PageInfo<CbsMusicSheetWrapper.MusicSheetApplication>> pageInfoR = musicFeignClientService.musicSheetPageByApplication(cbsQuery);
+            R<PageInfo<CbsMusicSheetWrapper.MusicSheetApplication>> pageInfoR = cbsMusicScoreService.selectPage(cbsQuery);
             if (pageInfoR.getCode() != 200) {
                 log.error("查询内容平台曲目失败,{}", pageInfoR.getMessage());
                 throw new BizException("查询内容平台曲目失败");
@@ -148,7 +149,11 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
             for (TenantAlbumMusicWrapper.StudentTenantAlbumMusic m : musicSheets) {
                 CbsMusicSheetWrapper.MusicSheetApplication sheetApplication = recordMap.get(m.getCbsMusicSheetId());
                 if (sheetApplication != null) {
-                    m.setMusicSheetName(sheetApplication.getSubjectNames());
+                    if(StringUtils.equals(m.getMusicSheetType(),"CONCERT")){
+                        m.setMusicSubjectName("合奏");
+                    }else{
+                        m.setMusicSubjectName(sheetApplication.getSubjectNames());
+                    }
                     m.setTitleImg(sheetApplication.getMusicCover());
                 }
                 SysUser sysUser = userMap.get(m.getUserId());