Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

zouxuan 3 gadi atpakaļ
vecāks
revīzija
cb55f94b88

+ 6 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/AlbumMusicRelateService.java

@@ -32,4 +32,10 @@ public interface AlbumMusicRelateService extends IService<AlbumMusicRelate> {
      */
     boolean addMusicSheet(Long albumId, List<Long> musicSheetIdList, Long userId);
 
+    /**
+     * 删除曲目与专辑关联
+     *
+     * @param musicSheetId 曲目id
+     */
+    void delByMusicSheet(Long musicSheetId);
 }

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

@@ -26,6 +26,7 @@ public interface LiveRoomService extends IService<LiveRoom> {
      *
      * @param param 参数
      *              <p>roomType 房间类型  LIVE-直播课  TEMP-临时直播间
+     *              <p>liveState 直播状态 0未开始 1已开始 2已结束
      *              <p>page 页数
      *              <p>rows 每页数量
      */

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

@@ -70,4 +70,11 @@ public class AlbumMusicRelateServiceImpl extends ServiceImpl<AlbumMusicRelateDao
 
         return this.saveBatch(albumMusicRelateList);
     }
+
+    @Override
+    public void delByMusicSheet(Long musicSheetId) {
+        this.lambdaUpdate()
+                .eq(AlbumMusicRelate::getMusicSheetId,musicSheetId)
+                .remove();
+    }
 }

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

@@ -261,6 +261,9 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         Integer month = WrapperUtil.toInt(param, "month", "日历的时间月份不能为空!");
         Integer singleCourseMinutes = WrapperUtil.toInt(param, "singleCourseMinutes", "单课时时长不能为空!");
         Integer freeCourseMinutes = WrapperUtil.toInt(param, "freeCourseMinutes");
+        if (Objects.isNull(freeCourseMinutes)) {
+            freeCourseMinutes = 0;
+        }
         if (singleCourseMinutes < 25) {
             throw new BizException("单课时时长不能小于25分钟!");
         }

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

@@ -95,16 +95,20 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
      *
      * @param param 参数
      *              <p>roomType 房间类型  LIVE-直播课  TEMP-临时直播间
+     *              <p>liveState 直播状态 0未开始 1已开始 2已结束
      *              <p>page 页数
      *              <p>rows 每页数量
      */
     @Override
     public PageInfo<LiveRoom> queryPageRoom(Map<String, Object> param) {
         String roomType = WrapperUtil.toStr(param, "roomType");
+        Integer liveState = WrapperUtil.toInt(param, "liveState");
         Long userId = getSysUser().getId();
         Page<LiveRoom> pageInfo = PageUtil.getPageInfo(param);
         IPage<LiveRoom> page = this.page(pageInfo, Wrappers.<LiveRoom>lambdaQuery()
                 .eq(WrapperUtil.StrPredicate.test(roomType), LiveRoom::getType, roomType)
+                .eq(WrapperUtil.ObjPredicate.test(liveState), LiveRoom::getLiveState, liveState)
+                .eq(LiveRoom::getRoomState, 0)
                 .eq(LiveRoom::getSpeakerId, userId)
         );
         return PageUtil.pageInfo(page);

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

@@ -94,9 +94,7 @@ public class MusicAlbumServiceImpl extends ServiceImpl<MusicAlbumDao,MusicAlbum>
         albumDetailVo.setAlbumFavoriteCount(musicAlbum.getAlbumFavoriteCount());
         albumDetailVo.setMusicTagNames(musicTagService.getMusicTagNames(StringUtil.toLongList(musicAlbum.getAlbumTag())));
 
-        if(query.getType() == 1) {
-            query.setSubjectIds(musicAlbum.getSubjectId());
-        }
+        query.setSubjectIds(musicAlbum.getSubjectId());
 
         IPage<MusicSheetVo> musicSheetVoIPage = musicSheetService.selectAlbumDetailPage(page,query);
         albumDetailVo.setMusicSheetList(PageUtil.pageInfo(musicSheetVoIPage));

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

@@ -78,6 +78,9 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao,MusicSheet>
     private MusicSheetAuthRecordService musicSheetAuthRecordService;
 
     @Autowired
+    private AlbumMusicRelateService albumMusicRelateService;
+
+    @Autowired
     private SysUserFeignService sysUserFeignService;
 
     @Autowired
@@ -392,6 +395,10 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao,MusicSheet>
         if (musicSheetDto.getAuditVersion() == null) {
             musicSheetDto.setAuditVersion(YesOrNoEnum.NO);
         }
+
+        // 删除曲目专辑关联
+        delAlbumSheetRef(musicSheetDto.getId(),musicSheetDto.getMusicSubject());
+
         List<MusicSheetAccompaniment> list;
         if (!AudioTypeEnum.MIDI.getCode().equals(musicSheetDto.getAudioType().getCode())){
             list = musicSheetDto.getBackground();
@@ -414,6 +421,26 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao,MusicSheet>
         }
     }
 
+    /**
+     * 删除专辑曲目关联
+     *
+     * @param id 曲目id
+     * @param subjectId 声部id
+     */
+    private void delAlbumSheetRef(Long id,String subjectId) {
+
+        if (id == null ) {
+            return;
+        }
+        MusicSheet musicSheet = this.getById(id);
+        if (musicSheet.getMusicSubject().equals(subjectId)) {
+            return;
+        }
+        albumMusicRelateService.delByMusicSheet(musicSheet.getId());
+
+
+    }
+
     @Override
     public HttpResponseResult<OrderCreateRes> buyMusicSheetCheck(OrderReq.OrderReqInfo orderReqInfo) {
 

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/support/WrapperUtil.java

@@ -38,7 +38,7 @@ public class WrapperUtil {
         Optional<O> o = Optional.ofNullable(map)
                 .map(m -> m.get(str));
         return intOptional(o)
-                .orElse(0);
+                .orElse(null);
     }
 
     public static <S, O> Long toLong(Map<S, O> map, S str) {

+ 1 - 0
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherLiveRoomController.java

@@ -36,6 +36,7 @@ public class TeacherLiveRoomController extends BaseController {
 
     @ApiImplicitParams({
             @ApiImplicitParam(name = "roomType", dataType = "String", value = "房间类型  LIVE-直播课  TEMP-临时直播间"),
+            @ApiImplicitParam(name = "liveState", dataType = "String", value = "直播状态 0未开始 1已开始 2已结束"),
             @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
             @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
     })