Parcourir la source

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

zouxuan il y a 1 an
Parent
commit
1fc533f285

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

@@ -131,7 +131,7 @@ public class MusicSheetController extends BaseController {
 
             //  只能看通过审核 并且 启用的 曲目
             query.setState(YesOrNoEnum.YES);
-//            query.setAuditStatus(AuthStatusEnum.PASS);
+            query.setAuditStatus(null);
             query.setStudentId(sysUser.getId());
             query.setMyself(false);
             query.setProviderType(SourceTypeEnum.PLATFORM);

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

@@ -145,7 +145,7 @@ public class MusicSheetController extends BaseController {
             query.setAuditVersion(appVersionInfoService.getAppAuditVersion(query.getPlatform(),query.getVersion()));
             //  只能看通过审核 并且 启用的 曲目
             query.setState(YesOrNoEnum.YES);
-//            query.setAuditStatus(AuthStatusEnum.PASS);
+            query.setAuditStatus(null);
             query.setStudentId(sysUser.getId());
             query.setMyself(false);
             query.setProviderType(SourceTypeEnum.PLATFORM);
@@ -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 = "关联的曲目列表")

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/req/TeacherMusicSheetAuditReq.java

@@ -72,6 +72,9 @@ public class TeacherMusicSheetAuditReq {
 
     private AccompanimentTypeEnum accompanimentType;
 
+    @ApiModelProperty(value = "单曲、合奏")
+    private String musicSheetType;
+
     @ApiModelProperty(value = "音频文件存储路径")
     private String audioFileUrl;  //音频文件存储路径
 }

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

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.dayaedu.cbs.common.enums.music.EAudioType;
 import com.dayaedu.cbs.common.enums.music.EMusicAvailableType;
+import com.dayaedu.cbs.common.enums.school.EMusicSheetType;
 import com.dayaedu.cbs.openfeign.client.MusicFeignClientService;
 import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetApplicationExtendClientWrapper;
 import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetWrapper;
@@ -96,6 +97,7 @@ public class MusicSheetAuthRecordServiceImpl extends ServiceImpl<MusicSheetAuthR
         addMusicSheet.setIsConvertibleScore(param.getNotation()==YesOrNoEnum.YES);
         addMusicSheet.setExtConfigJson(param.getExtConfigJson());
         addMusicSheet.setAudioType(EAudioType.valueOf(param.getAccompanimentType().getCode()));
+        addMusicSheet.setMusicSheetType(EMusicSheetType.valueOf(param.getMusicSheetType()));
         musicSheetAuthRecord.setMusicSheetJson(JSON.toJSONString(addMusicSheet));
         MusicSheet musicSheet = musicSheetService.getById(musicSheetAuthRecord.getMusicSheetId());
         if (musicSheet == null) {
@@ -108,6 +110,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);

+ 1 - 5
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()));
@@ -2002,7 +1998,7 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
             addMusicSheet.setStatus(true);
         }
         if (addMusicSheet.getMusicSheetType() == null) {
-            addMusicSheet.setMusicSheetType(EMusicSheetType.CONCERT);
+            addMusicSheet.setMusicSheetType(EMusicSheetType.SINGLE);
         }
         if (addMusicSheet.getMusicCategoryId() == null) {
             addMusicSheet.setMusicCategoryId(-2L);

+ 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());

+ 2 - 2
cooleshow-user/user-biz/src/main/resources/config/mybatis/SubjectMapper.xml

@@ -251,7 +251,7 @@
                 AND t.parent_subject_id_ != 0 AND t.cbs_subject_id_ is not null
             </if>
             <if test="keyword != null and keyword != ''">
-                AND t.name_ LIKE CONCAT('%',#{keyword},'%')
+                AND (t.name_ LIKE CONCAT('%',#{keyword},'%') OR t.code_ LIKE CONCAT('%',#{keyword},'%'))
             </if>
             <if test="delFlag != null">
                 AND t.del_flag_ = #{delFlag}
@@ -308,7 +308,7 @@
                 AND t.parent_subject_id_ != 0 AND t.cbs_subject_id_ is not null
             </if>
             <if test="keyword != null and keyword != ''">
-                AND t.name_ LIKE CONCAT('%',#{keyword},'%')
+                AND (t.name_ LIKE CONCAT('%',#{keyword},'%') OR t.code_ LIKE CONCAT('%',#{keyword},'%'))
             </if>
             <if test="delFlag != null">
                 AND t.del_flag_ = #{delFlag}