Explorar el Código

Merge branch 'zx_online_update_1218' of http://git.dayaedu.com/yonge/cooleshow into develop-new

zouxuan hace 2 días
padre
commit
dc6492b3bc

+ 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;
 

+ 7 - 97
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/StudentTime.java

@@ -9,11 +9,13 @@ import io.swagger.annotations.ApiModelProperty;
 import java.io.Serializable;
 import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * 学生使用功能时间表
  */
+@Data
 @TableName("student_time")
 @ApiModel(value = "StudentTime对象", description = "学生使用功能时间表")
 public class StudentTime implements Serializable {
@@ -26,6 +28,11 @@ public class StudentTime implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
     private Date firstVipTime;
 
+    @ApiModelProperty("第一次购买小组课时间 ")
+    @TableField(value = "first_group_time_")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date firstGroupTime;
 
     @ApiModelProperty("第一次购买svip时间 ")
     @TableField(value = "first_svip_time_")
@@ -88,101 +95,4 @@ public class StudentTime implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
     private Date firstDiscountTime;
 
-
-    public Date getFirstVipCourseTime() {
-        return firstVipCourseTime;
-    }
-
-    public void setFirstVipCourseTime(Date firstVipCourseTime) {
-        this.firstVipCourseTime = firstVipCourseTime;
-    }
-
-    public Date getFirstDiscountTime() {
-        return firstDiscountTime;
-    }
-
-    public void setFirstDiscountTime(Date firstDiscountTime) {
-        this.firstDiscountTime = firstDiscountTime;
-    }
-
-    public Date getFirstSvipTime() {
-        return firstSvipTime;
-    }
-
-    public void setFirstSvipTime(Date firstSvipTime) {
-        this.firstSvipTime = firstSvipTime;
-    }
-
-    public Date getFirstActivityTime() {
-        return firstActivityTime;
-    }
-
-    public void setFirstActivityTime(Date firstActivityTime) {
-        this.firstActivityTime = firstActivityTime;
-    }
-
-    public Date getFirstPayTime() {
-        return firstPayTime;
-    }
-
-    public void setFirstPayTime(Date firstPayTime) {
-        this.firstPayTime = firstPayTime;
-    }
-
-    public Long getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Long userId) {
-        this.userId = userId;
-    }
-
-    public Date getFirstVipTime() {
-        return firstVipTime;
-    }
-
-    public void setFirstVipTime(Date firstVipTime) {
-        this.firstVipTime = firstVipTime;
-    }
-
-    public Date getFirstPracticeTime() {
-        return firstPracticeTime;
-    }
-
-    public void setFirstPracticeTime(Date firstPracticeTime) {
-        this.firstPracticeTime = firstPracticeTime;
-    }
-
-    public Date getFirstVideoTime() {
-        return firstVideoTime;
-    }
-
-    public void setFirstVideoTime(Date firstVideoTime) {
-        this.firstVideoTime = firstVideoTime;
-    }
-
-    public Date getFirstLiveTime() {
-        return firstLiveTime;
-    }
-
-    public void setFirstLiveTime(Date firstLiveTime) {
-        this.firstLiveTime = firstLiveTime;
-    }
-
-    public Date getFirstMusicTime() {
-        return firstMusicTime;
-    }
-
-    public void setFirstMusicTime(Date firstMusicTime) {
-        this.firstMusicTime = firstMusicTime;
-    }
-
-    public Date getFirstMallTime() {
-        return firstMallTime;
-    }
-
-    public void setFirstMallTime(Date firstMallTime) {
-        this.firstMallTime = firstMallTime;
-    }
-
 }

+ 5 - 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);
@@ -235,6 +237,7 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
         result.setTeacherId(group.getTeacherId());
         result.setCoursePrice(group.getCoursePrice());
         result.setCourseNum(group.getCourseNum());
+        result.setCompleteCourseNum(group.getCompleteCourseNum());
         result.setCourseIntroduce(group.getCourseIntroduce());
         result.setSalesStartDate(group.getSalesStartDate());
         result.setSalesEndDate(group.getSalesEndDate());
@@ -1810,7 +1813,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());

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

@@ -78,8 +78,10 @@ public class StudentTimeServiceImpl extends ServiceImpl<StudentTimeDao, StudentT
                 if (null == studentTime.getFirstVipTime() && GoodTypeEnum.VIP.equals(detailVo.getGoodType())) {
                     studentTime.setFirstVipTime(now);
                 }
-
-                if (null == studentTime.getFirstVipTime() && GoodTypeEnum.SVIP.equals(detailVo.getGoodType())) {
+                if (null == studentTime.getFirstGroupTime() && GoodTypeEnum.GROUP.equals(detailVo.getGoodType())) {
+                    studentTime.setFirstGroupTime(now);
+                }
+                if (null == studentTime.getFirstSvipTime() && GoodTypeEnum.SVIP.equals(detailVo.getGoodType())) {
                     studentTime.setFirstSvipTime(now);
                 }
                 if (null == studentTime.getFirstPracticeTime() && GoodTypeEnum.PRACTICE.equals(detailVo.getGoodType())) {
@@ -168,8 +170,16 @@ public class StudentTimeServiceImpl extends ServiceImpl<StudentTimeDao, StudentT
         if (GoodTypeEnum.VIP.equals(goodType) && null == studentTime.getFirstVipTime()) {
             studentTime.setFirstVipTime(new Date());
         }
-
-        if (GoodTypeEnum.SVIP.equals(goodType) && null == studentTime.getFirstVipTime()) {
+        if (GoodTypeEnum.GROUP.equals(goodType) && null == studentTime.getFirstGroupTime()) {
+            studentTime.setFirstGroupTime(new Date());
+        }
+        if (GoodTypeEnum.DISCOUNT.equals(goodType) && null == studentTime.getFirstDiscountTime()) {
+            studentTime.setFirstDiscountTime(new Date());
+        }
+        if (GoodTypeEnum.VIP_COURSE.equals(goodType) && null == studentTime.getFirstVipCourseTime()) {
+            studentTime.setFirstVipCourseTime(new Date());
+        }
+        if (GoodTypeEnum.SVIP.equals(goodType) && null == studentTime.getFirstSvipTime()) {
             studentTime.setFirstSvipTime(new Date());
         }
         if (GoodTypeEnum.PRACTICE.equals(goodType) && null == studentTime.getFirstPracticeTime()) {

+ 8 - 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;
 
@@ -58,6 +63,9 @@ public class CourseGroupVo implements Serializable {
     @ApiModelProperty(value = "课程数")
     private Integer courseNum;
 
+    @ApiModelProperty(value = "已上完课的课程数")
+    private Integer completeCourseNum;
+
     @ApiModelProperty(value = "课程介绍")
     private String courseIntroduce;
 

+ 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>

+ 8 - 8
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>
@@ -999,7 +999,7 @@
         FROM course_schedule_teacher_salary ts
         LEFT JOIN course_group g ON ts.course_group_id_ = g.id_
         LEFT JOIN course_schedule_student_payment sp ON ts.course_schedule_id_ = sp.course_id_
-        WHERE ts.course_group_type_ in ('PRACTICE','VIP')
+        WHERE ts.course_group_type_ in ('PRACTICE','VIP','GROUP')
         AND ts.status_ = 'WAIT'
         <![CDATA[ AND DATE_FORMAT(ts.update_time_,'%Y-%m-%d') <= #{day}]]>
     </select>

+ 11 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -260,6 +260,17 @@
                             GROUP BY a.subject_id_
                         )
                     </if>
+                    <if test="type == null or type =='GROUP'">
+                        union all
+                        (
+                            select
+                                a.subject_id_ as subject_id_
+                            from course_group a
+                            join course_schedule_student_payment a1 on a.id_ = a1.course_group_id_
+                            where a.type_ = 'GROUP' and a1.user_id_ = #{userId}
+                            GROUP BY a.subject_id_
+                        )
+                    </if>
                     <if test="type == null or type =='VIP'">
                         union all
                         (

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

@@ -12,12 +12,16 @@
         <result column="first_mall_time_" property="firstMallTime" />
         <result column="first_activity_time_" property="firstActivityTime" />
         <result column="first_pay_time_" property="firstPayTime" />
+        <result column="first_group_time_" property="firstGroupTime" />
+        <result column="first_vip_course_time_" property="firstVipCourseTime" />
+        <result column="first_discount_time_" property="firstDiscountTime" />
     </resultMap>
 
     <!-- 表字段 -->
     <sql id="baseColumns">
          t.user_id_ as userId
         , t.first_vip_time_ as firstVipTime
+        , t.first_vip_course_time_ as firstVipCourseTime
         , t.first_svip_time_ as firstSvipTime
         , t.first_practice_time_ as firstPracticeTime
         , t.first_video_time_ as firstVideoTime
@@ -26,5 +30,7 @@
         , t.first_mall_time_ as firstMallTime
         , t.first_activity_time_ as firstActivityTime
         , t.first_pay_time_ as firstPayTime
+        , t.first_group_time_ as firstGroupTime
+        , t.first_discount_time_ as firstDiscountTime
         </sql>
 </mapper>

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

@@ -343,6 +343,11 @@
                 (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 =='GROUP'">
+                union all
+                (select subject_id_ as subject_id_ from course_group where type_ = 'GROUP' 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}

+ 10 - 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>
@@ -267,6 +273,10 @@
             select 1 from user_order_detail od where t.order_no_ = od.order_no_
             and (
                 (st.first_vip_time_ is null and od.good_type_ = 'VIP') or
+                (st.first_svip_time_ is null and od.good_type_ = 'SVIP') or
+                (st.first_vip_course_time_ is null and od.good_type_ = 'VIP_COURSE') or
+                (st.first_group_time_ is null and od.good_type_ = 'GROUP') or
+                (st.first_discount_time_ is null and od.good_type_ = 'DISCOUNT') or
                 (st.first_practice_time_ is null and od.good_type_ = 'PRACTICE') or
                 (st.first_video_time_ is null and od.good_type_ = 'VIDEO') or
                 (st.first_live_time_ is null and od.good_type_ = 'LIVE') or