Browse Source

小组课

zouxuan 2 days ago
parent
commit
cd8216bda9

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

+ 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()) {

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

@@ -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}

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

@@ -273,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