Explorar el Código

Merge remote-tracking branch 'origin/master' into ywx

tags/正式版本
雍文秀 hace 2 años
padre
commit
ae98e4e487

+ 3
- 0
slive/src/main/java/com/xhkjedu/slive/mapper/liveplay/CourseSectionMapper.java Ver fichero

@@ -116,4 +116,7 @@ public interface CourseSectionMapper extends TkMapper<LCourseSection> {
116 116
 
117 117
     //根据班级id获取课程班级类型
118 118
     Integer getCourseTypeByClassId(@Param("classid") Integer classid);
119
+
120
+    //获取课程中正在进行的课节数量
121
+    Integer getJxzSectionNum(@Param("courseid") Integer courseid);
119 122
 }

+ 9
- 0
slive/src/main/java/com/xhkjedu/slive/service/liveplay/CourseService.java Ver fichero

@@ -4,6 +4,7 @@ import com.xhkjedu.slive.mapper.gradeclass.ClassTeacherMapper;
4 4
 import com.xhkjedu.slive.mapper.gradeclass.SchoolMapper;
5 5
 import com.xhkjedu.slive.mapper.liveplay.CourseClassMapper;
6 6
 import com.xhkjedu.slive.mapper.liveplay.CourseMapper;
7
+import com.xhkjedu.slive.mapper.liveplay.CourseSectionMapper;
7 8
 import com.xhkjedu.slive.mapper.system.UserMapper;
8 9
 import com.xhkjedu.slive.model.gradeclass.TClass;
9 10
 import com.xhkjedu.slive.model.gradeclass.TClassTeacher;
@@ -50,6 +51,8 @@ public class CourseService {
50 51
     private UserMapper userMapper;
51 52
     @Resource
52 53
     private CourseClassMapper courseClassMapper;
54
+    @Resource
55
+    private CourseSectionMapper courseSectionMapper;
53 56
 
54 57
     //添加
55 58
     @Transactional(rollbackFor = Exception.class)
@@ -315,6 +318,12 @@ public class CourseService {
315 318
                 return new ResultVo(1, "没有结课权限");
316 319
             }
317 320
 
321
+            //结课时判断是否有进行中的直播课,如果有就提示
322
+            Integer jxznum = courseSectionMapper.getJxzSectionNum(course.getCourseid());
323
+            if(N_Utils.isTrueInteger(jxznum)){
324
+                return new ResultVo(1,"有进行中的课程,暂不能结课");
325
+            }
326
+
318 327
             //如果课程状态变成已结束,则班级变成结束直播班类型
319 328
             classService.updateClasstype(c.getClassid(),99);
320 329
         }

+ 5
- 0
slive/src/main/resources/mapper/liveplay/CourseSectionMapper.xml Ver fichero

@@ -489,4 +489,9 @@
489 489
         </if>
490 490
         order by cs.sectionstate,abs(UNIX_TIMESTAMP(concat(cs.sectiondate,' ',cs.planbegintime))-UNIX_TIMESTAMP(now())),cs.sectionid
491 491
     </select>
492
+    
493
+    <!--获取课程中正在进行的课节数量-->
494
+    <select id="getJxzSectionNum" resultType="java.lang.Integer">
495
+        select count(*) from l_course_section where courseid=#{courseid} and sectionstate=2
496
+    </select>
492 497
 </mapper>

Loading…
Cancelar
Guardar