Selaa lähdekoodia

fix:直播课创建失败

liujunchi 3 vuotta sitten
vanhempi
commit
3e159a0a34

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

@@ -326,6 +326,9 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
         boolean courseTypeFlag = CourseScheduleEnum.existCourseType(dto.getCourseType(), "课程类型不正确!").equals(CourseScheduleEnum.PRACTICE);
         //先自校验传入时间是否交集
         List<CourseTimeEntity> timeList = dto.getTimeList();
+        if (CollectionUtils.isEmpty(timeList)) {
+            throw new BizException("课程时间不能为空");
+        }
         if (timeList.size() > 1) {
             for (int i = 0; i < timeList.size(); i++) {
                 if (i == timeList.size() - 1) {

+ 6 - 7
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicAlbumMapper.xml

@@ -194,15 +194,14 @@
         where find_in_set(mt.id_,t.album_tag_) and mt.del_flag_ = 0 and mt.state_ = 1) as musicTagNames
         ,(select group_concat(s.name_) from subject s
         where find_in_set(s.id_,t.subject_id_) and s.del_flag_ = 0 ) as subjectNames
-        ,if( t1.num>0,t1.num,0) as musicSheetCount
+        ,(select count(1) as num
+        from album_music_relate amr
+        join music_sheet ms on amr.music_sheet_id_ = ms.id_
+        left join sys_user su on su.id_ = ms.user_id_
+        where ms.del_flag_ = 0 and ms.state_ = 1 and ms.audit_status_ = 'PASS' and su.del_flag_ = 0
+       and amr.album_id_ = t.id_) as musicSheetCount
         ,if(t2.num >0,t2.num,0) as albumFavoriteCount
         from music_album t
-        left join (select count(1) as num,amr.album_id_
-            from album_music_relate amr
-            join music_sheet ms on amr.music_sheet_id_ = ms.id_
-            left join sys_user su on su.id_ = ms.user_id_
-            where ms.del_flag_ = 0 and ms.state_ = 1 and ms.audit_status_ = 'PASS' and su.del_flag_ = 0
-        group by amr.album_id_) t1 on t1.album_id_ = t.id_
         left join (select count(1) as num,af.album_id_ from album_favorite af
             left join sys_user su on af.user_id_ = su.id_
             where su.del_flag_ = 0 group by af.album_id_