|
@@ -13,6 +13,7 @@ import com.ym.job.ScheduleManager;
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.CourseScheduleDao;
|
|
|
+import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
|
import com.ym.mec.biz.dal.dao.TeacherDao;
|
|
|
import com.ym.mec.biz.dal.entity.CourseSchedule;
|
|
|
import com.ym.mec.biz.dal.entity.Teacher;
|
|
@@ -20,10 +21,12 @@ import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
import com.ym.mec.biz.dal.enums.SignStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
|
|
|
import com.ym.mec.biz.service.StudentAttendanceService;
|
|
|
+import com.ym.mec.biz.service.SysConfigService;
|
|
|
import com.ym.mec.biz.service.TeacherAttendanceService;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.im.IMHelper;
|
|
|
import com.ym.mec.im.message.*;
|
|
|
+import com.ym.mec.util.date.DateUtil;
|
|
|
import com.ym.pojo.*;
|
|
|
import com.ym.service.RoomService;
|
|
|
import com.ym.utils.CheckUtils;
|
|
@@ -32,6 +35,7 @@ import com.ym.utils.DateTimeUtils;
|
|
|
import com.ym.utils.IdentifierUtils;
|
|
|
import com.ym.whiteboard.WhiteBoardHelper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -42,7 +46,7 @@ import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
- * Created by weiqinxiao on 2019/2/28.
|
|
|
+ * Created by super_zou on 2019/11/28.
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@Service
|
|
@@ -89,6 +93,9 @@ public class RoomServiceImpl implements RoomService {
|
|
|
@Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysConfigDao sysConfigDao;
|
|
|
+
|
|
|
@Value("${auth.sysconfig.tenantId}")
|
|
|
private Integer lesseeOrganId;
|
|
|
|
|
@@ -104,7 +111,24 @@ public class RoomServiceImpl implements RoomService {
|
|
|
String userId = sysUser.getId().toString();
|
|
|
Teacher teacher = teacherDao.get(Integer.parseInt(userId));
|
|
|
CourseSchedule courseSchedule = courseScheduleDao.get(Long.parseLong(roomId));
|
|
|
- try {
|
|
|
+
|
|
|
+ String continueCourseTime = sysConfigDao.findConfigValue(SysConfigService.ONLINE_CONTINUE_COURSE_TIME);
|
|
|
+ if(StringUtils.isEmpty(continueCourseTime)){
|
|
|
+ continueCourseTime = "3";
|
|
|
+ }
|
|
|
+ CourseSchedule schedule = courseSchedule;
|
|
|
+ //如果当前课程是连堂课,那么获取第一节课的课程编号
|
|
|
+ while (true){
|
|
|
+ String classDate = DateUtil.format(schedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
|
|
|
+ String startClassTime = DateUtil.format(schedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
|
|
|
+ schedule = courseScheduleDao.getLastCourse(schedule.getClassGroupId(),classDate + " " + startClassTime,schedule.getActualTeacherId(),continueCourseTime);
|
|
|
+ if(schedule != null){
|
|
|
+ roomId = schedule.getId().toString();
|
|
|
+ }else {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /*try {
|
|
|
if(teacher != null && teacher.getId().equals(courseSchedule.getActualTeacherId())){
|
|
|
teacherAttendanceService.addTeacherAttendanceRecord(Integer.parseInt(roomId),courseSchedule.getActualTeacherId(), SignStatusEnum.SIGN_IN,true);
|
|
|
}else {
|
|
@@ -112,7 +136,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
- }
|
|
|
+ }*/
|
|
|
if(courseSchedule.getGroupType() == GroupType.COMM){
|
|
|
roomId = "I" + roomId;
|
|
|
}else {
|