소스 검색

乐直播查询

liujc 2 년 전
부모
커밋
a9111ba10d

+ 21 - 21
.idea/httpRequests/http-requests-log.http

@@ -1,3 +1,24 @@
+POST http://127.0.0.1:9002/teacherCourseSchedule/liveCoursePage
+authorization: bearer a9b023c1-f525-4b95-8723-0ca14b038624
+Content-Type: application/json
+Content-Length: 152
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{
+  "page": 1,
+  "rows": 10,
+//  "startTime": "2023-06-06 10:14:57",
+//  "endTime": "2023-06-08 10:14:57",
+//  "search": "",
+//  "status": "NOT_START"
+}
+
+<> 2023-06-14T111123.200.json
+
+###
+
 POST http://127.0.0.1:8005/vipGroupManage/liveStudentList
 Authorization: bearer b2d082f2-2e51-4880-8119-5471c5287bf9
 Content-Type: application/json
@@ -728,24 +749,3 @@ Accept-Encoding: br,deflate,gzip,x-gzip
 
 ###
 
-POST http://127.0.0.1:9002/teacherCourseSchedule/liveCoursePage
-Authorization: bearer 6dbea593-df93-4bf4-9f75-538c1bcc231e
-Content-Type: application/json
-Content-Length: 145
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{
-  "page": 1,
-  "rows": 10,
-  "startTime": "2023-06-08 10:14:57",
-  "endTime": "2023-06-08 10:14:57",
-  "search": "",
-  "status": "NOT_START",
-}
-
-<> 2023-06-08T101549.200.json
-
-###
-

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/LiveGroupWrapper.java

@@ -115,6 +115,9 @@ public class LiveGroupWrapper {
 
         private Integer tenantId;
 
+        //未开始直播课,提前开始时间
+        private Integer notStartCourseTime;
+
     }
 
 

+ 5 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -6037,6 +6037,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
     @Override
     public IPage<CourseScheduleDto> liveCoursePage(LiveGroupWrapper.LiveCoursePageQuery queryInfo) {
         IPage<CourseScheduleDto> page = com.microsvc.toolkit.common.response.paging.QueryInfo.getPage(queryInfo);
+
+        // 直播课判断时间,提前30分钟将课程改为进行中
+        Integer studentRemindTime = Integer.parseInt(sysConfigService.findByParamName(SysConfigService.LIVE_CLASS_START_REMIND_TIME).getParanValue());
+
+        queryInfo.setNotStartCourseTime(studentRemindTime);
         List<CourseScheduleDto> courseScheduleDtos = liveGroupPlusMapper.liveCoursePage(page, queryInfo);
         if (CollectionUtils.isEmpty(courseScheduleDtos)) {
             return page;
@@ -6047,8 +6052,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 queryInfo.getTenantId(), courseScheduleDtos, courseIds, courseIds);
 
 
-        // 直播课判断时间,提前30分钟将课程改为进行中
-        Integer studentRemindTime = Integer.parseInt(sysConfigService.findByParamName(SysConfigService.LIVE_CLASS_START_REMIND_TIME).getParanValue());
         for (CourseScheduleDto record : teacherCourseFormat) {
             if (CourseScheduleType.LIVE.equals(record.getType()) && CourseStatusEnum.NOT_START.equals(record.getStatus())) {
                 Date date = DateUtil.addMinutes(new Date(), studentRemindTime);

+ 9 - 2
mec-biz/src/main/resources/config/mybatis/LiveGroupPlusMapper.xml

@@ -37,7 +37,7 @@
     cs.class_date_,
     CONCAT(cs.class_date_,' ',cs.start_class_time_) start_class_time_,
     CONCAT(cs.class_date_,' ',cs.end_class_time_) end_class_time_,
-    cs.status_,
+    cs.status_ as status_,
     csts.user_id_ actual_teacher_id_,
     csts.teacher_role_,
     cg.expect_student_num_,
@@ -71,7 +71,14 @@
     </if>
     AND csts.user_id_ = #{param.teacherId} AND cs.pre_course_flag_ = 0
     <if test="param.status != null">
-        AND cs.status_ = #{param.status}
+        <if test="param.status == 'UNDERWAY'">
+            AND (cs.status_  = 'UNDERWAY'
+                or (cs.status_ = 'NOT_START' and  CONCAT(cs.class_date_,' ',cs.start_class_time_) &lt; date_add(now(), interval #{param.notStartCourseTime} minute))
+            )
+        </if>
+        <if test="param.status == 'NOT_START'">
+            AND cs.status_ = 'NOT_START' and CONCAT(cs.class_date_,' ',cs.start_class_time_) &gt; date_add(now(), interval #{param.notStartCourseTime} minute)
+        </if>
     </if>
     <if test="param.search != null and param.search != ''">
         AND (cs.name_ LIKE CONCAT('%',#{param.search},'%'))