zouxuan 2 年之前
父節點
當前提交
b6b5f97aa2

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupDao.java

@@ -111,6 +111,15 @@ public interface VipGroupDao extends BaseDAO<Long, VipGroup> {
     List<StudentVipGroupShowListDto> findVipGroups(Map<String, Object> params);
 
     /**
+     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentVipGroupShowListDto>
+     * @Author: Joburgess
+     * @Date: 2019/10/3
+     * @params [params]
+     * @describe 学生端获取vip课列表
+     */
+    List<StudentVipGroupShowListDto> findLiveGroups(Map<String, Object> params);
+
+    /**
      * @return int
      * @Author: Joburgess
      * @Date: 2019/10/3

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -2375,7 +2375,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             throw new BizException("该课程已结束报名!");
         }
 
-        if (Objects.nonNull(vipGroup.getStudentIdList())) {
+        if (groupType == VIP && Objects.nonNull(vipGroup.getStudentIdList())) {
             Set<Integer> userIds = Arrays.asList(vipGroup.getStudentIdList().split(",")).stream().mapToInt(Integer::parseInt).boxed().collect(Collectors.toSet());
             if (!userIds.contains(userId)) {
                 throw new BizException("您无法购买此课程");
@@ -4393,6 +4393,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         MapUtil.populateMap(params, queryInfo);
         // VIP小课、直播课
         List<StudentVipGroupShowListDto> vipGroups = vipGroupDao.findVipGroups(params);
+        // 直播课
+        vipGroups.addAll(vipGroupDao.findLiveGroups(params));
         // 网课
         vipGroups.addAll(practiceGroupService.findPracticeGroups(params));
         // 删除返回null值数据

+ 65 - 0
mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -392,6 +392,42 @@
         </where>
     </sql>
 
+    <sql id="studentLiveGroupQueryCondition">
+        <where>
+            vg.audit_status_='PASS'
+            AND vg.group_status_ = 1
+            AND vg.courses_expire_date_ &gt;= DATE_FORMAT(NOW(),'%Y%m%d')
+            AND vg.registration_start_time_ &lt;= NOW()
+            AND vg.courses_start_date &gt; NOW()
+            AND (select count(1) as num from student_payment_order where vg.id_ = music_group_id_ AND user_id_=#{userId} AND type_ = 'LIVE_GROUP_BUY'
+            AND status_='SUCCESS') = 0
+            <if test="expireFlag != null and expireFlag == true">
+                AND vg.payment_expire_date_ >= NOW()
+            </if>
+            <if test="subjectId!=null">
+                AND FIND_IN_SET(#{subjectId},cg.subject_id_list_)
+            </if>
+            <if test="subjectId!=null">
+                AND FIND_IN_SET(#{subjectId},cg.subject_id_list_)
+            </if>
+            <if test="categoryId!=null">
+                AND FIND_IN_SET(vg.vip_group_category_id_,#{categoryId})
+            </if>
+            <if test="classType!=null and classType.toString()=='0'.toString()">
+                AND vg.offline_classes_num_>0
+            </if>
+            <if test="classType!=null and classType.toString()=='1'.toString()">
+                AND vg.online_classes_num_>0
+            </if>
+            <if test="search != null and search != ''">
+                AND vg.name_ like concat('%',#{search},'%')
+            </if>
+            <if test="groupType != null and groupType != ''">
+                AND vg.group_type_ = #{groupType}
+            </if>
+        </where>
+    </sql>
+
     <select id="findVipGroups" resultMap="studentVipGroup">
         SELECT
         vg.id_,
@@ -422,6 +458,35 @@
         ORDER BY vg.id_ DESC
         <include refid="global.limit"/>
     </select>
+
+    <select id="findLiveGroups" resultMap="studentVipGroup">
+        SELECT
+        vg.id_,
+        vg.name_,
+        vg.single_class_minutes_,
+        vg.payment_expire_date_,
+        vg.courses_expire_date_,
+        vg.courses_start_date,
+        vg.online_classes_num_,
+        vg.offline_classes_num_,
+        vg.total_price_,
+        cg.expect_student_num_,
+        cg.student_num_,
+        su.real_name_ teacher_name_,
+        su.avatar_,
+        t.introduction_,
+        vgc.name_ category_name_,vg.create_time_,
+        vg.group_type_
+        FROM
+        vip_group vg
+        LEFT JOIN class_group cg ON vg.id_=cg.music_group_id_ AND cg.group_type_ = vg.group_type_
+        LEFT JOIN teacher t ON vg.user_id_=t.id_
+        LEFT JOIN sys_user su ON vg.user_id_=su.id_
+        LEFT JOIN vip_group_category vgc ON vg.vip_group_category_id_=vgc.id_
+        <include refid="studentLiveGroupQueryCondition"/>
+        ORDER BY vg.id_ DESC
+        <include refid="global.limit"/>
+    </select>
     <select id="countVipGorups" resultType="int">
         SELECT
         count(*)

+ 2 - 2
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/eseal/provider/TsignPlugin.java

@@ -57,7 +57,7 @@ public class TsignPlugin implements ESealPlugin, InitializingBean, DisposableBea
 
     @Override
     public void afterPropertiesSet() {
-        ProjectConfig projectconfig = new ProjectConfig();
+        /*ProjectConfig projectconfig = new ProjectConfig();
         projectconfig.setProjectId(projectId);
         projectconfig.setProjectSecret(projectSecret);
         projectconfig.setItsmApiUrl(apisUrl);
@@ -69,7 +69,7 @@ public class TsignPlugin implements ESealPlugin, InitializingBean, DisposableBea
         serviceClient = ServiceClientManager.get(projectId);
         if (serviceClient == null) {
             throw new ThirdpartyException("获取e签宝客户端失败");
-        }
+        }*/
     }
 
     @Override