Browse Source

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

刘俊驰 1 day ago
parent
commit
9d0b418039

+ 2 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/website/controller/WebCourseScheduleController.java

@@ -5,6 +5,7 @@ import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dto.search.MyCourseSearch;
 import com.yonge.cooleshow.biz.dal.entity.CourseCalendarEntity;
+import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
 import com.yonge.cooleshow.biz.dal.service.CourseScheduleService;
 import com.yonge.cooleshow.biz.dal.service.HolidaysFestivalsService;
 import com.yonge.cooleshow.biz.dal.vo.ArrangeCourseVo;
@@ -67,6 +68,7 @@ public class WebCourseScheduleController extends BaseController {
     @ApiOperation("老师端-首页-我的课程-直播课")
     @PostMapping("/queryTeacherLiveCourse")
     public HttpResponseResult<PageInfo<TeacherLiveCourseInfoVo>> queryTeacherLiveCourse(@RequestBody Map<String, Object> param) {
+        param.put("type",param.get("courseType") == null? CourseScheduleEnum.LIVE.getCode():param.get("courseType").toString());
         return succeed(courseScheduleService.queryTeacherLiveCourse(param));
     }
 

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

@@ -1115,6 +1115,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
     public PageInfo<CourseStudent> queryStudentLiveCourse(Map<String, Object> param) {
         //本月的最后一天
         param.put("orderState", OrderStatusEnum.PAID.getCode());
+        param.put("groupState", String.join(",", CourseGroupEnum.ING.getCode(), CourseGroupEnum.COMPLETE.getCode()));
         Page<CourseStudent> pageInfo = PageUtil.getPageInfo(param);
         return PageUtil.pageInfo(baseMapper.queryStudentLiveCourse(pageInfo, param));
     }
@@ -1442,8 +1443,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         CourseSchedule schedule = baseMapper.selectOne(Wrappers.<CourseSchedule>lambdaQuery()
                 .eq(CourseSchedule::getId, courseId)
                 .eq(CourseSchedule::getLock, 0)
-                .eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START)
-                .in(CourseSchedule::getType, CourseScheduleEnum.PRACTICE, CourseScheduleEnum.VIP));
+                .eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START));
         if (ObjectUtil.isEmpty(schedule)) {
             throw new BizException("无法调整该课程,课程不存在");
         }
@@ -1460,8 +1460,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
 
         //查询是否有人购买
         CourseScheduleStudentPayment studentPayment = paymentDao.selectOne(Wrappers.<CourseScheduleStudentPayment>lambdaQuery()
-                .eq(CourseScheduleStudentPayment::getCourseId, courseId)
-                .in(CourseScheduleStudentPayment::getCourseType, CourseScheduleEnum.PRACTICE,CourseScheduleEnum.VIP));
+                .eq(CourseScheduleStudentPayment::getCourseId, courseId));
         if (ObjectUtil.isEmpty(studentPayment)) {
             throw new BizException("课程无人购买");
         }

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/LiveCourseGroupVo.java

@@ -59,6 +59,9 @@ public class LiveCourseGroupVo {
     @ApiModelProperty(value = "手机号")
     private String phone;
 
+    @ApiModelProperty(value = "老师姓名")
+    private String teacherName;
+
     @ApiModelProperty("订单号")
     private String orderNo;
 

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

@@ -167,7 +167,6 @@
     <select id="selectAdminLivePage" resultType="com.yonge.cooleshow.biz.dal.vo.LiveCourseGroupVo">
         select distinct
         cg.id_ as courseGroupId,
-
         cg.reason_ as                   reason,
         cg.name_ as name,
         cg.complete_course_num_ as endCourseNum,
@@ -182,28 +181,35 @@
             cssp.order_no_ as orderNo,
         </if>
         cg.im_group_id_  as imGroupId,
-        cg.course_plan_ as coursePlan
+        cg.course_plan_ as coursePlan,
+        su.username_ as teacherName,
+        su.phone_ as phone
         from course_group cg
-        left join course_schedule_student_payment cssp on cg.id_ = cssp.course_group_id_
-        left join sys_user su on su.id_ = cssp.user_id_
+        left join sys_user su on su.id_ = cg. teacher_id_
+        <if test="param.studentId != null">
+            left join course_schedule_student_payment cssp on cg.id_ = cssp.course_group_id_
+        </if>
         <where>
             <if test="param.teacherId != null">
                 and #{param.teacherId} = cg.teacher_id_
+                <if test="param.search != null and param.search !=''">
+                    and  (cg.id_ = #{param.search} or cg.name_ like concat('%',#{param.search},'%'))
+                </if>
             </if>
             <if test="param.studentId != null">
                 and #{param.studentId} = cssp.user_id_
-            </if>
-            <if test="param.search != null and param.search !=''">
-                and  (
-                    cg.id_ like concat('%',#{param.search},'%')
+                <if test="param.search != null and param.search !=''">
+                    and  (
+                    cg.id_ = #{param.search}
                     or cg.name_ like concat('%',#{param.search},'%')
-                    or su.id_ like concat('%',#{param.search},'%')
+                    or su.id_ = #{param.search}
                     or su.username_ like concat('%',#{param.search},'%')
                     or su.phone_  like concat('%',#{param.search},'%')
-                )
-            </if>
-            <if test="param.orderNo != null and param.orderNo != ''">
-                and cssp.order_no_ like concat('%',#{param.orderNo},'%')
+                    )
+                </if>
+                <if test="param.orderNo != null and param.orderNo != ''">
+                    and cssp.order_no_ like concat('%',#{param.orderNo},'%')
+                </if>
             </if>
             <if test="param.subjectId != null">
                 and #{param.subjectId} = cg.subject_id_

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

@@ -601,6 +601,9 @@
             <if test="param.subjectId != null">
                 AND g.subject_id_ = #{param.subjectId}
             </if>
+            <if test="param.groupState !=null and param.groupState !=''">
+                AND find_in_set(cg.status_, #{param.groupState})
+            </if>
             <if test="param.courseState != null">
                 <if test="param.courseState == 'COMPLETE'">
                     AND g.status_ = 'COMPLETE'