刘俊驰 vor 3 Tagen
Ursprung
Commit
d22be0d160

+ 5 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/OrderSearch.java

@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.time.LocalDateTime;
+import java.util.List;
 
 /**
  * @Author: liweifan
@@ -52,6 +53,10 @@ public class OrderSearch extends QueryInfo{
 	@ApiModelProperty(hidden = true)
 	private String goodType;
 
+
+	@ApiModelProperty(hidden = true)
+	private List<String> goodTypes;
+
 	@ApiModelProperty(hidden = true)
 	private Long bizId;
 

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

@@ -152,6 +152,8 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
 
         LiveCourseInfoVo result = new LiveCourseInfoVo();
         result.setCourseGroupId(group.getId());
+        result.setType(group.getType());
+        result.setCourseGroupId(group.getId());
         result.setCourseGroupName(group.getName());
         result.setCourseStartTime(group.getCourseStartTime());
         result.setSingleCourseMinutes(group.getSingleCourseMinutes());
@@ -210,7 +212,7 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
         //因为页面再点击购买按钮时,会请求/userOrder/getPendingOrder接口,如果有支付中的订单,用户选择继续支付或取消订单
         OrderSearch query = new OrderSearch();
         query.setUserId(id);
-        query.setGoodType(GoodTypeEnum.LIVE.getCode());
+        query.setGoodTypes(Lists.newArrayList(GoodTypeEnum.LIVE.getCode(),GoodTypeEnum.GROUP.getCode()));
         query.setBizId(groupId);
         query.setStatus(OrderStatusEnum.PAID.getCode());
         List<UserOrderVo> userOrderVos = userOrderService.selectAllList(query);
@@ -1810,7 +1812,7 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
 
         ShareProfitVo result = new ShareProfitVo();
         result.setTeacherId(sysUser.getId());
-        result.setType("LIVE");
+        result.setType(liveCourseInfoVo.getType());
         result.setLiveCourseGroup(liveCourseGroupShareVo);
         result.setUrl(MessageFormatter.arrayFormat(teacherLiveGroupShareProfitUrl, liveGroupId, sysUser.getId()));
         result.setName(sysUser.getUsername());

+ 5 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/CourseGroupVo.java

@@ -1,5 +1,6 @@
 package com.yonge.cooleshow.biz.dal.vo;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -24,6 +25,10 @@ public class CourseGroupVo implements Serializable {
     @ApiModelProperty(value = "名称")
     private String courseGroupName;
 
+
+    @ApiModelProperty(value = "类型 practice趣纠课 live直播课")
+    private String type;
+
     @ApiModelProperty(value = "声部名称")
     private String subjectName;
 

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

@@ -253,7 +253,7 @@
         left join user_order as o on a.order_no_ = o.order_no_
         left join sys_user as su on o.user_id_ = su.id_
         <where>
-            a.good_type_ = 'LIVE' and o.status_ = 'PAID'
+            o.status_ = 'PAID'
             <if test="param.courseGroupId != null">
                 and #{param.courseGroupId} = a.biz_id_
             </if>

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

@@ -60,7 +60,7 @@
                 sum(if(a.end_time_ &lt;= now(),1,0)) as expTime,
                 sum(if(a.end_time_ &gt; now(),1,0)) as unExpTime
             from course_schedule a
-            where a.lock_ = 0 and a.type_ in ('PRACTICE','PIANO_ROOM_CLASS','VIP','LIVE')
+            where a.lock_ = 0 and a.type_ in ('PRACTICE','PIANO_ROOM_CLASS','VIP','LIVE','GROUP')
             <if test="userId != null and userId != ''">
                 and a.teacher_id_ = #{userId}
             </if>
@@ -73,7 +73,7 @@
                 avg (b.score_) as starGrade
             from course_schedule a
             join course_schedule_replied b on a.id_ = b.course_schedule_id_
-            where a.lock_ = 0 and a.type_ in ('PRACTICE','PIANO_ROOM_CLASS','VIP','LIVE') and b.score_ is not null
+            where a.lock_ = 0 and a.type_ in ('PRACTICE','PIANO_ROOM_CLASS','VIP','LIVE','GROUP') and b.score_ is not null
             <if test="userId != null and userId != ''">
                 and a.teacher_id_ = #{userId}
             </if>
@@ -93,7 +93,7 @@
         from student t
         left join course_schedule_student_payment a on t.user_id_ = a.user_id_
         left join course_schedule b on a.course_id_ = b.id_
-        where b.lock_ = 0 and b.type_ in ('PRACTICE','PIANO_ROOM_CLASS','VIP','LIVE')
+        where b.lock_ = 0 and b.type_ in ('PRACTICE','PIANO_ROOM_CLASS','VIP','LIVE','GROUP')
             <if test="userId != null and userId != ''">
                 and t.user_id_ = #{userId}
             </if>
@@ -306,7 +306,7 @@
         FROM course_group g
         LEFT JOIN course_schedule s ON g.id_=s.course_group_id_
         WHERE g.teacher_id_=#{teacherId}
-        AND g.type_='LIVE'
+        AND g.type_ in ('LIVE','GROUP')
         AND g.status_ IN ('COMPLETE','ING')
         <![CDATA[ AND s.class_date_  >= #{startDate} ]]>
         <![CDATA[ AND s.class_date_  <= #{endDate} ]]>
@@ -382,7 +382,7 @@
         WHERE cs.lock_=0
         AND cs.status_ IN ('ING','COMPLETE','NOT_START')
         AND g.status_ IN ('ING', 'COMPLETE')
-        AND cs.type_ IN ('LIVE','PIANO_ROOM_CLASS')
+        AND cs.type_ IN ('LIVE','PIANO_ROOM_CLASS','GROUP')
         AND cs.teacher_id_=#{param.teacherId}
         AND cs.class_date_=#{param.classDate}
         AND cs.id_ IN(
@@ -392,7 +392,7 @@
             AND p.course_group_id_ = c.course_group_id_
             AND c.teacher_id_=#{param.teacherId}
             AND c.class_date_=#{param.classDate}
-            AND c.type_ IN ('LIVE','PIANO_ROOM_CLASS')
+            AND c.type_ IN ('LIVE','PIANO_ROOM_CLASS','GROUP')
             )
         UNION
         SELECT
@@ -552,7 +552,7 @@
         AND s.status_ IN ('ING','NOT_START','COMPLETE')
         AND g.status_ IN ('ING', 'COMPLETE','APPLY','OUT_SALE')
         AND s.id_ IN
-        (SELECT course_id_ FROM course_schedule_student_payment WHERE user_id_ = #{param.studentId} AND course_type_ IN ('LIVE','PIANO_ROOM_CLASS'))
+        (SELECT course_id_ FROM course_schedule_student_payment WHERE user_id_ = #{param.studentId} AND course_type_ IN ('LIVE','PIANO_ROOM_CLASS','GROUP'))
         AND s.class_date_ = #{param.classDate}
         ORDER BY startTime
     </select>

+ 6 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/UserOrderMapper.xml

@@ -183,6 +183,12 @@
                     <if test="param.goodType !=null and param.goodType !=''">
                         and d.good_type_ = #{param.goodType}
                     </if>
+                <if test="param.goodTypes != null and param.goodTypes.size() != 0">
+                    and d.good_type_ in
+                    <foreach collection="param.goodTypes" item="item" separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
+                </if>
                     <if test="param.bizId !=null">
                         and d.biz_id_ = #{param.bizId}
                     </if>