ソースを参照

曲目列表返回原音信息

zouxuan 2 ヶ月 前
コミット
3eb0236b11

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

@@ -60,8 +60,7 @@ public class MusicSheetController extends BaseController {
     private MusicSheetAuthRecordService musicSheetAuthRecordService;
     @Resource
     private TeacherService teacherService;
-
-    @Autowired
+    @Resource
     private StudentService studentService;
 
     /**

+ 17 - 25
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/TenantAlbumSheetController.java

@@ -3,14 +3,11 @@ package com.yonge.cooleshow.teacher.controller;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.dayaedu.cbs.openfeign.client.CoursewareFeignService;
-import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsLessonCoursewareDetailWrapper;
 import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsLessonCoursewareWrapper;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
-import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
-import com.yonge.cooleshow.auth.api.entity.SysUser;
-import com.yonge.cooleshow.biz.dal.entity.Teacher;
 import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
-import com.yonge.cooleshow.biz.dal.service.TeacherService;
+import com.yonge.cooleshow.biz.dal.service.MusicSheetService;
+import com.yonge.cooleshow.biz.dal.service.SysUserService;
 import com.yonge.cooleshow.biz.dal.service.TenantAlbumMusicService;
 import com.yonge.cooleshow.biz.dal.wrapper.LessonCoursewareDetailWrapper;
 import com.yonge.cooleshow.biz.dal.wrapper.LessonCoursewareWrapper;
@@ -22,11 +19,10 @@ import com.yonge.toolset.mybatis.support.PageUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.collections.CollectionUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.validation.Valid;
 import java.util.ArrayList;
 import java.util.List;
@@ -42,29 +38,25 @@ import java.util.List;
 @Api(tags = "机构专辑曲目 API接口")
 public class TenantAlbumSheetController extends BaseController {
 
-    @Autowired
+    @Resource
     private TenantAlbumMusicService tenantAlbumMusicService;
 
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
+    @Resource
+    private SysUserService sysUserService;
 
-
-    @Autowired
-    private TeacherService teacherService;
-
-    @Autowired
+    @Resource
     private CoursewareFeignService coursewareFeignService;
 
 
     @ApiOperation(value = "分页查询")
     @PostMapping("/page")
     public HttpResponseResult<PageInfo<TenantAlbumMusicWrapper.StudentTenantAlbumMusic>> page(@RequestBody @Validated TenantAlbumMusicWrapper.StudentTenantAlbumMusicQuery query) {
-        SysUser user = sysUserFeignService.queryUserInfo();
-        if (user == null || null == user.getId()) {
-            return failed(HttpStatus.FORBIDDEN, "请登录");
-        }
+//        SysUser user = sysUserFeignService.queryUserInfo();
+//        if (user == null || null == user.getId()) {
+//            return failed(HttpStatus.FORBIDDEN, "请登录");
+//        }
 
-        Teacher teacher = teacherService.getById(user.getId());
+//        Teacher teacher = teacherService.getById(user.getId());
 //        query.setTenantId(Optional.ofNullable(teacher.getTenantId()).orElse(-1L));
         query.setClientType(ClientEnum.TEACHER);
         IPage<TenantAlbumMusicWrapper.StudentTenantAlbumMusic> page = tenantAlbumMusicService.selectPage(QueryInfo.getPage(query), query);
@@ -76,11 +68,11 @@ public class TenantAlbumSheetController extends BaseController {
     @PostMapping("/getLessonCoursewareDetail")
     public HttpResponseResult<LessonCoursewareWrapper.LessonCourseware> getLessonCoursewareDetail(@RequestBody @Valid LessonCoursewareWrapper.LessonCourseQuery query){
         query.setClient(ClientEnum.TEACHER);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null || null == sysUser.getId()) {
-            return failed("用户信息获取失败");
-        }
-        query.setUserId(sysUser.getId());
+//        SysUser sysUser = sysUserFeignService.queryUserInfo();
+//        if (sysUser == null || null == sysUser.getId()) {
+//            return failed("用户信息获取失败");
+//        }
+        query.setUserId(sysUserService.getUserId());
         LessonCoursewareWrapper.LessonCourseware lessonCourseware = tenantAlbumMusicService.getLessonCoursewareDetail(query);
         return succeed(lessonCourseware);
     }

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

@@ -153,6 +153,21 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
                 if (sheetApplication != null) {
                     m.setMusicSubjectName(sheetApplication.getSubjectNames());
                     m.setTitleImg(sheetApplication.getMusicCover());
+                    // 设置曲目原音
+                    List<CbsMusicSheetWrapper.MusicSheetSound> soundList = sheetApplication.getMusicSheetSoundList();
+                    if (CollectionUtils.isNotEmpty(soundList)) {
+                        List<MusicSheetAccompaniment> background = new ArrayList<>();
+                        for (CbsMusicSheetWrapper.MusicSheetSound sound : soundList) {
+                            MusicSheetAccompaniment accompaniment = new MusicSheetAccompaniment();
+                            accompaniment.setMusicSheetId(m.getId());
+                            accompaniment.setAudioFileUrl(sound.getAudioFileUrl());
+                            accompaniment.setSortNumber(sound.getSortNumber());
+                            accompaniment.setTrack(sound.getTrack());
+                            accompaniment.setMusicalInstrumentId(sound.getMusicalInstrumentId());
+                            background.add(accompaniment);
+                        }
+                        m.setBackground(background);
+                    }
                 }
                 SysUser sysUser = userMap.get(m.getUserId());
                 if (sysUser != null) {

+ 5 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantAlbumMusicWrapper.java

@@ -5,11 +5,13 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.dayaedu.cbs.common.enums.school.ECourseType;
 import com.dayaedu.cbs.openfeign.wrapper.music.MusicSheetCategoriesWrapper;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.yonge.cooleshow.biz.dal.entity.MusicSheetAccompaniment;
 import com.yonge.cooleshow.biz.dal.entity.MusicTag;
 import com.yonge.cooleshow.biz.dal.entity.Subject;
 import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategoryDetail;
 import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
 import com.yonge.cooleshow.biz.dal.enums.SubjectTypeEnum;
+import com.yonge.cooleshow.biz.dal.vo.MusicSheetDetailVo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -253,6 +255,9 @@ public class TenantAlbumMusicWrapper {
         @ApiModelProperty("声谱类型,SINGLE:单曲,CONCERT:合奏")
         private String musicSheetType;
 
+        @ApiModelProperty("曲谱伴奏")
+        private List<MusicSheetAccompaniment> background;
+
         public String jsonString() {
             return JSON.toJSONString(this);
         }