浏览代码

老师端逻辑调整

zouxuan 3 月之前
父节点
当前提交
c9e7cfdcc2

+ 1 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/student/controller/CourseHomeworkController.java

@@ -100,6 +100,7 @@ public class CourseHomeworkController extends BaseController {
         list.add(CourseScheduleEnum.PIANO_ROOM_CLASS);
         list.add(CourseScheduleEnum.PRACTICE);
         list.add(CourseScheduleEnum.VIP);
+        list.add(CourseScheduleEnum.GROUP);
         query.setCourseType(list);
 
         IPage<CourseHomeworkVo> page = courseHomeworkService.selectPage(PageUtil.getPage(query), query);

+ 1 - 1
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherCourseScheduleController.java

@@ -100,7 +100,7 @@ public class TeacherCourseScheduleController extends BaseController {
     @PostMapping("/queryTeacherPracticeCourse")
     public HttpResponseResult<PageInfo<MyCourseVo>> queryTeacherPracticeCourse(@RequestBody MyCourseSearch search) {
         search.setTeacherId(sysUserService.getUserId());
-        search.setCourseType("VIP,PRACTICE");
+        search.setCourseType("VIP,PRACTICE,GROUP");
         IPage<MyCourseVo> pages = courseScheduleService.queryTeacherPracticeCourse(PageUtil.getPage(search), search);
         return succeed(PageUtil.pageInfo(pages));
     }

+ 8 - 0
cooleshow-common/src/main/java/com/yonge/cooleshow/common/constant/SysConfigConstant.java

@@ -57,6 +57,10 @@ public interface SysConfigConstant {
      */
     String PRE_CREATE_VIP_ROOM_MINUTE = "pre_create_vip_course_room_minute";
     /**
+     * 提前XX分钟创建/进入小组课房间时间
+     */
+    String PRE_CREATE_GROUP_ROOM_MINUTE = "pre_create_group_course_room_minute";
+    /**
      * 直播结束后,XX分钟关闭房间
      */
     String DESTROY_EXPIRED_LIVE_ROOM_MINUTE = "destroy_expired_live_room_minute";
@@ -69,6 +73,10 @@ public interface SysConfigConstant {
      */
     String DESTROY_EXPIRED_VIP_ROOM_MINUTE = "destroy_expired_vip_course_room_minute";
     /**
+     * 小组课结束后,XX分钟关闭房间
+     */
+    String DESTROY_EXPIRED_GROUP_ROOM_MINUTE = "destroy_expired_group_course_room_minute";
+    /**
      * 课程结束后,XX天后结算课酬
      */
     String COURSE_SETTLEMENT_TIME_DAY = "course_settlement_time_day";

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

@@ -1035,6 +1035,10 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
     @NotNull
     private Map<String, String> getCourseJoinMap() {
         Map<String, String> sysConfig = new HashMap<>();
+        //提前XX分钟创建/进入GROUP课房间时间
+        sysConfig.put("groupStartTime", sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_GROUP_ROOM_MINUTE));
+        //GROUP课结束后,XX分钟关闭房间
+        sysConfig.put("groupEndTime", sysConfigService.findConfigValue(SysConfigConstant.DESTROY_EXPIRED_GROUP_ROOM_MINUTE));
         //提前XX分钟创建/进入VIP课房间时间
         sysConfig.put("vipStartTime", sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_VIP_ROOM_MINUTE));
         //VIP课结束后,XX分钟关闭房间
@@ -1567,7 +1571,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
             StudentHomePage.RecentCourses recentCourses = baseMapper.selectRecentCourses(studentId);
 
             if (recentCourses !=null &&
-                    (CourseScheduleEnum.PRACTICE.getCode().equals(recentCourses.getCourseType()) || CourseScheduleEnum.VIP.getCode().equals(recentCourses.getCourseType()))) {
+                    (CourseScheduleEnum.PRACTICE.getCode().equals(recentCourses.getCourseType())
+                            || CourseScheduleEnum.VIP.getCode().equals(recentCourses.getCourseType()))) {
                 SysUser sysUser = sysUserService.getByUserId(studentId);
                 if (sysUser != null) {
                     recentCourses.setCourseGroupName(recentCourses.getCourseGroupName() + "-" + sysUser.getUsername());
@@ -1578,7 +1583,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         if (studentId == null) {
             //vip课和趣纠课
             StudentHomePage.RecentCourses coursesPractice = baseMapper.selectRecentCoursesPractice(teacherId);
-            StudentHomePage.RecentCourses coursesLive = baseMapper.selectRecentCoursesLive(teacherId);//直播课&琴房课共用coursesLive
+            StudentHomePage.RecentCourses coursesLive = baseMapper.selectRecentCoursesLive(teacherId);//直播课&琴房课&小组课共用coursesLive
 
             if (coursesPractice == null && coursesLive != null) {
                 homePage.setRecentCourses(coursesLive);
@@ -1599,7 +1604,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
             // 本周未上课程数
 
             if (coursesPractice != null &&
-                    (CourseScheduleEnum.PRACTICE.getCode().equals(coursesPractice.getCourseType()) || CourseScheduleEnum.VIP.getCode().equals(coursesPractice.getCourseType()))) {
+                    (CourseScheduleEnum.PRACTICE.getCode().equals(coursesPractice.getCourseType())
+                            || CourseScheduleEnum.VIP.getCode().equals(coursesPractice.getCourseType()))) {
                 SysUser sysUser = sysUserService.getByUserId(coursesPractice.getStudentId());
                 if (sysUser != null) {
                     coursesPractice.setCourseGroupName(coursesPractice.getCourseGroupName() + "-" + sysUser.getUsername());
@@ -1628,6 +1634,9 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
                 case "VIP":
                     start= Integer.parseInt(courseJoinMap.get("vipStartTime"));
                     break;
+                case "GROUP":
+                    start= Integer.parseInt(courseJoinMap.get("groupStartTime"));
+                    break;
                 default:
                     break;
             }

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

@@ -136,9 +136,6 @@
                     and sch.id_ is not null
                 </if>
             </if>
-            <if test="param.search != null and param.search != ''">
-                and cs.name_ like concat('%',#{param.search},'%')
-            </if>
             <if test="param.courseStatus != null">
                 and cs.status_ = #{param.courseStatus}
             </if>

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

@@ -675,7 +675,8 @@
         FROM video_lesson_group g
         LEFT JOIN sys_user u ON g.teacher_id_=u.id_
         LEFT JOIN `subject` s ON g.lesson_subject_=s.id_
-        LEFT JOIN (SELECT video_lesson_group_id_ ,COUNT(1) AS count_ FROM video_lesson_purchase_record WHERE order_status_='PAID' GROUP BY video_lesson_group_id_) r ON g.id_= r.video_lesson_group_id_
+        LEFT JOIN (SELECT video_lesson_group_id_ ,COUNT(1) AS count_ FROM video_lesson_purchase_record
+                                                                     WHERE order_status_='PAID' GROUP BY video_lesson_group_id_) r ON g.id_= r.video_lesson_group_id_
         WHERE u.del_flag_ = 0 and g.audit_status_='PASS' and g.shelves_flag_ = 1 and #{appAuditVersion} = g.audit_version_
         <if test="subjectId != null">
         	and g.lesson_subject_ = #{subjectId}
@@ -749,7 +750,7 @@
         LEFT JOIN sys_user u ON s.teacher_id_=u.id_
         LEFT JOIN course_group g ON s.course_group_id_=g.id_
         WHERE s.teacher_id_=#{teacherId}
-        AND s.type_ IN ('LIVE','PIANO_ROOM_CLASS')
+        AND s.type_ IN ('LIVE','PIANO_ROOM_CLASS','GROUP')
         AND s.status_ IN ('ING','NOT_START')  and g.status_='ING'
         and date_format(s.class_date_,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
         ORDER BY ABS(NOW() - s.start_time_) ASC