zouxuan před 5 měsíci
rodič
revize
a4e81a08b4

+ 4 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/ActivityPlan.java

@@ -157,4 +157,8 @@ public class ActivityPlan implements Serializable {
     @ApiModelProperty("拓展配置")
     @TableField(value = "ext_config_")
     private String extConfig;
+
+    @ApiModelProperty("可购买次数")
+    @TableField(value = "buy_count_")
+    private Integer buyCount = -1;
 }

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

@@ -667,9 +667,16 @@ public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao
         query.setAuditStatus(AuthStatusEnum.PASS.getCode());
         query.setShelvesFlag(1);
         List<LessonGroupVo> lessonGroupVos = baseMapper.selectLessonGroup(page, query);
-        for (LessonGroupVo videoLessonGroupVo : lessonGroupVos) {
-            if (videoLessonGroupVo.getLessonPrice().compareTo(BigDecimal.ZERO) == 0) {
-                videoLessonGroupVo.setCountStudent(videoLessonGroupVo.getCountStudent() + videoLessonGroupVo.getVirtualNumber());
+        if (CollectionUtils.isNotEmpty(lessonGroupVos)) {
+            //获取直播课关联的曲目数量
+            List<Long> videoLessonGroupIds = lessonGroupVos.stream().map(LessonGroupVo::getId).collect(Collectors.toList());
+            List<Map<Long,Long>> musicNum = this.baseMapper.countMusicAlbum(videoLessonGroupIds);
+            Map<Long,Long> map = MapUtil.convertIntegerMap(musicNum);
+            for (LessonGroupVo videoLessonGroupVo : lessonGroupVos) {
+                if (videoLessonGroupVo.getLessonPrice().compareTo(BigDecimal.ZERO) == 0) {
+                    videoLessonGroupVo.setCountStudent(videoLessonGroupVo.getCountStudent() + videoLessonGroupVo.getVirtualNumber());
+                }
+                videoLessonGroupVo.setMusicNum(map.get(videoLessonGroupVo.getId()));
             }
         }
         return page.setRecords(lessonGroupVos);

+ 4 - 137
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/LessonGroupVo.java

@@ -1,21 +1,19 @@
 package com.yonge.cooleshow.biz.dal.vo;
 
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.yonge.cooleshow.biz.dal.enums.course.CourseRelationTypeEnum;
-import com.yonge.cooleshow.biz.dal.valid.AddGroup;
-import com.yonge.cooleshow.biz.dal.valid.UpdateGroup;
 import com.yonge.cooleshow.common.entity.BaseEntity;
 import com.yonge.cooleshow.common.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
-import javax.validation.constraints.NotBlank;
 import java.math.BigDecimal;
 
 /**
  * @Author: cy
  * @Date: 2022/4/11
  */
+@Data
 @ApiModel(value = "LessonGroupVo对象")
 public class LessonGroupVo extends BaseEntity {
     @ApiModelProperty(value = "视频课组id")
@@ -68,138 +66,7 @@ public class LessonGroupVo extends BaseEntity {
     @ApiModelProperty("虚拟人数 ")
     private Integer virtualNumber;
 
-    public Integer getVirtualNumber() {
-        return virtualNumber;
-    }
 
-    public void setVirtualNumber(Integer virtualNumber) {
-        this.virtualNumber = virtualNumber;
-    }
-    public YesOrNoEnum getAuditVersion() {
-        return auditVersion;
-    }
-
-    public void setAuditVersion(YesOrNoEnum auditVersion) {
-        this.auditVersion = auditVersion;
-    }
-
-    public String getRealName() {
-        return realName;
-    }
-
-    public void setRealName(String realName) {
-        this.realName = realName;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getLessonName() {
-        return lessonName;
-    }
-
-    public void setLessonName(String lessonName) {
-        this.lessonName = lessonName;
-    }
-
-    public String getLessonSubject() {
-        return lessonSubject;
-    }
-
-    public void setLessonSubject(String lessonSubject) {
-        this.lessonSubject = lessonSubject;
-    }
-
-    public String getLessonSubjectName() {
-        return lessonSubjectName;
-    }
-
-    public void setLessonSubjectName(String lessonSubjectName) {
-        this.lessonSubjectName = lessonSubjectName;
-    }
-
-    public String getLessonDesc() {
-        return lessonDesc;
-    }
-
-    public void setLessonDesc(String lessonDesc) {
-        this.lessonDesc = lessonDesc;
-    }
-
-    public BigDecimal getLessonPrice() {
-        return lessonPrice;
-    }
-
-    public void setLessonPrice(BigDecimal lessonPrice) {
-        this.lessonPrice = lessonPrice;
-    }
-
-    public String getLessonCoverUrl() {
-        return lessonCoverUrl;
-    }
-
-    public void setLessonCoverUrl(String lessonCoverUrl) {
-        this.lessonCoverUrl = lessonCoverUrl;
-    }
-
-    public Integer getLessonCount() {
-        return lessonCount;
-    }
-
-    public void setLessonCount(Integer lessonCount) {
-        this.lessonCount = lessonCount;
-    }
-
-    public Long getTeacherId() {
-        return teacherId;
-    }
-
-    public void setTeacherId(Long teacherId) {
-        this.teacherId = teacherId;
-    }
-
-    public String getUserName() {
-        return userName;
-    }
-
-    public void setUserName(String userName) {
-        this.userName = userName;
-    }
-
-    public String getAvatar() {
-        return avatar;
-    }
-
-    public void setAvatar(String avatar) {
-        this.avatar = avatar;
-    }
-
-    public Integer getCountStudent() {
-        return countStudent;
-    }
-
-    public void setCountStudent(Integer countStudent) {
-        this.countStudent = countStudent;
-    }
-
-    public CourseRelationTypeEnum getRelationType() {
-        return relationType;
-    }
-
-    public void setRelationType(CourseRelationTypeEnum relationType) {
-        this.relationType = relationType;
-    }
-
-    public String getPayType() {
-        return payType;
-    }
-
-    public void setPayType(String payType) {
-        this.payType = payType;
-    }
+    @ApiModelProperty("曲目数量")
+    private Long musicNum;
 }

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

@@ -26,6 +26,7 @@
 	        <result column="activity_state_" property="activityState" />
 	        <result column="vip_card_id_" property="vipCardId" />
 	        <result column="ext_config_" property="extConfig" />
+	        <result column="buy_count_" property="buyCount" />
 	        <result column="create_time_" property="createTime" />
 	        <result column="create_by_" property="createBy" />
 	        <result column="update_time_" property="updateTime" />
@@ -58,6 +59,7 @@
         , if(t.activity_state_ = 1, 1, 0) as activityState
         , t.vip_card_id_ as vipCardId
         , t.ext_config_ as extConfig
+        , t.buy_count_ as buyCount
         , t.create_time_ as createTime
         , t.create_by_ as createBy
         , t.update_time_ as updateTime

+ 3 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherFreeTimeMapper.xml

@@ -70,6 +70,9 @@
             <if test="param.courseType != null and param.courseType != ''">
                 AND tsp.course_type_ = #{param.courseType}
             </if>
+            <if test="param.search != null and param.search != ''">
+                AND u.real_name_ LIKE CONCAT('%',#{param.search},'%')
+            </if>
         </where>
         <if test="param.sortField != null and param.sortField != ''">
             order by ${param.sortField} ${param.sortRule}

+ 5 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -337,6 +337,11 @@
                 (select subject_id_ as subject_id_ from course_group where type_ = 'PRACTICE' and teacher_id_ =
                 #{userId} GROUP BY subject_id_)
             </if>
+            <if test="type == null or type =='VIP'">
+                union all
+                (select subject_id_ as subject_id_ from course_group where type_ = 'VIP' and teacher_id_ =
+                #{userId} GROUP BY subject_id_)
+            </if>
             <if test="type == null or type =='LIVE'">
                 union all
                 (select subject_id_ as subject_id_ from course_group where type_ = 'LIVE' and teacher_id_ = #{userId}