Forráskód Böngészése

Merge branch 'feature/0826_music' into develop-new

liujc 10 hónapja
szülő
commit
64fb7be3bf

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

@@ -1401,6 +1401,7 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         teacherMusicSheetListVo.setEntryFlag(teacherVo.getEntryFlag());
         teacherMusicSheetListVo.setMusicianFlag(teacherVo.getMusicianFlag());
         teacherMusicSheetListVo.setTag(teacherVo.getTag());
+        teacherMusicSheetListVo.setVipType(teacherVo.getVipType());
 
         TeacherTotal total = totalService.getTotalById(detail.getUserId());
         if (total != null) {

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

@@ -186,7 +186,18 @@ public class TeacherTotalServiceImpl extends ServiceImpl<TeacherTotalDao, Teache
     public TeacherTotal getTotalById(Long id) {
         RBucket<Object> bucket = redissonClient.getBucket(CacheNameEnum.TEACHER_TOTAL.getRedisKey(id));
         if (bucket.isExists()) {
-            return (TeacherTotal) bucket.get();
+            try {
+
+                return (TeacherTotal) bucket.get();
+            }catch (Exception e) {
+                log.error("getTotalById error", e);
+            }
+            //去数据库查询
+            TeacherTotal total = totalTeacherTotalById(id);
+            if(null != total){
+                bucket.set(total);
+            }
+            return total;
         } else {
             //去数据库查询
             TeacherTotal total = totalTeacherTotalById(id);

+ 6 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/TeacherMusicSheetListVo.java

@@ -1,8 +1,10 @@
 package com.yonge.cooleshow.biz.dal.vo;
 
+import com.yonge.cooleshow.biz.dal.enums.EUserVipType;
 import com.yonge.cooleshow.common.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 import java.util.List;
 
@@ -12,6 +14,7 @@ import java.util.List;
  * @author liujunchi
  * @date 2022-06-14
  */
+@Data
 @ApiModel("官网曲目详情老师和老师拥有的曲目信息")
 public class TeacherMusicSheetListVo {
 
@@ -46,6 +49,9 @@ public class TeacherMusicSheetListVo {
     private List<MusicSheetVo> musicSheetList;
 
 
+    @ApiModelProperty(value = "用户会员类型,普通用户:NORMAL,会员:VIP,SVIP:SVIP")
+    private EUserVipType vipType;
+
     public String getTag() {
         return tag;
     }

+ 1 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseCoursewareMapper.xml

@@ -34,7 +34,7 @@
 		FROM course_courseware t
         left join music_sheet ms on t.music_sheet_id_ = ms.id_
         <where>
-            t.del_flag_ = 0 AND ms.cbs_music_sheet_id_ IS NOT NULL
+            t.del_flag_ = 0 AND ms.cbs_music_sheet_id_ IS NOT NULL and find_in_set('PLATFORM',ms.provider_type_)
             <if test="param.userId != null">
                 and t.user_id_ = #{param.userId}
             </if>

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

@@ -189,7 +189,7 @@
         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_
-            where ms.del_flag_ = 0 and ms.state_ = 1 and ms.audit_status_ = 'PASS'
+            where ms.del_flag_ = 0 and ms.state_ = 1 and ms.audit_status_ = 'PASS' and find_in_set('PLATFORM',ms.provider_type_)
             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
               group by af.album_id_
@@ -241,7 +241,7 @@
         ,(select count(1) as num
             from album_music_relate amr
             join music_sheet ms on amr.music_sheet_id_ = ms.id_
-            where ms.del_flag_ = 0 and ms.state_ = 1 and ms.audit_status_ = 'PASS'
+            where ms.del_flag_ = 0 and ms.state_ = 1 and ms.audit_status_ = 'PASS' and find_in_set('PLATFORM',ms.provider_type_)
            and amr.album_id_ = t.id_) as musicSheetCount
         ,if(t2.num >0,t2.num,0) as albumFavoriteCount
         from music_album t
@@ -308,6 +308,7 @@
             </if>
             <if test="paymentType != null">
                 AND t2.payment_type_ = #{paymentType}
+                and find_in_set('PLATFORM',t2.provider_type_)
             </if>
         </where>
         GROUP BY t1.album_id_

+ 1 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml

@@ -812,7 +812,7 @@
             sum(if(ms.source_type_ = 'TEACHER',1,0)) as musicSheetTeacherCount,
             count(1) as musicSheetCount
         from music_sheet ms
-        where ms.state_ = 1 and ms.del_flag_ = 0 and ms.audit_status_ = 'PASS' and find_in_set('CHARGE',ms.payment_type_)
+        where ms.state_ = 1 and ms.del_flag_ = 0 and ms.audit_status_ = 'PASS' and find_in_set('CHARGE',ms.payment_type_) and find_in_set('PLATFORM',ms.provider_type_)
     </select>
 
     <select id="selectPayMusicSheet" resultType="com.yonge.cooleshow.biz.dal.vo.HomeMusicSheetVo$MusicSheetSmall">