|
@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.keao.edu.auth.api.client.SysUserFeignService;
|
|
|
import com.keao.edu.auth.api.entity.SysUser;
|
|
|
import com.keao.edu.common.dal.BaseDAO;
|
|
|
-import com.keao.edu.common.enums.YesOrNoEnum;
|
|
|
import com.keao.edu.common.exception.BizException;
|
|
|
import com.keao.edu.common.page.PageInfo;
|
|
|
import com.keao.edu.common.service.IdGeneratorService;
|
|
@@ -21,13 +20,12 @@ import com.keao.edu.user.dao.*;
|
|
|
import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
|
|
|
import com.keao.edu.user.dto.NeedCheckingDetailDto;
|
|
|
import com.keao.edu.user.dto.RoomStudentListDto;
|
|
|
+import com.keao.edu.user.dto.StuRecordDetailDto;
|
|
|
import com.keao.edu.user.entity.*;
|
|
|
import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
|
|
|
-import com.keao.edu.user.service.ExamCertificationService;
|
|
|
-import com.keao.edu.user.service.ExamRoomStudentRelationService;
|
|
|
-import com.keao.edu.user.service.ExamTeacherSalaryService;
|
|
|
-import com.keao.edu.user.service.OrganizationService;
|
|
|
+import com.keao.edu.user.service.*;
|
|
|
import com.keao.edu.util.collection.MapUtil;
|
|
|
+import com.keao.edu.util.date.DateUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -63,6 +61,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
private ImFeignService imFeignService;
|
|
|
@Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
+ @Autowired
|
|
|
+ private SysConfigService sysConfigService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, ExamRoomStudentRelation> getDAO() {
|
|
@@ -289,6 +289,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
//修改考试状态为录播
|
|
|
StudentExamResult studentExamResult = studentExamResultDao.findByRegistrationId(examRegistrationId);
|
|
|
studentExamResult.setRecordFlag(1);
|
|
|
+ studentExamResult.setRecordStartTime(new Date());
|
|
|
studentExamResultDao.update(studentExamResult);
|
|
|
//返回详情数据
|
|
|
return examCertificationService.needCheckingDetail(examRegistrationId);
|
|
@@ -324,6 +325,31 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public StuRecordDetailDto stuRecordDetail(Long examRegistrationId) {
|
|
|
+ StudentExamResult studentExamResult = studentExamResultDao.findByRegistrationId(examRegistrationId);
|
|
|
+ //当前学员是否完成考试
|
|
|
+ if(studentExamResult.getIsFinishedExam() == 1){
|
|
|
+ throw new BizException("操作失败:您已完成考试");
|
|
|
+ }
|
|
|
+ //是否允许录播
|
|
|
+ if(studentExamResult.getRecordFlag() == 0){
|
|
|
+ throw new BizException("操作失败:请走直播通道");
|
|
|
+ }
|
|
|
+ StuRecordDetailDto stuRecordDetailDto = examRegistrationDao.getStuRecordDetail(examRegistrationId);
|
|
|
+ int recordMinutes = Integer.parseInt(sysConfigService.findByParamName("record_minutes").getParanValue());
|
|
|
+ Date date = new Date();
|
|
|
+ date = DateUtil.addMinutes(date,recordMinutes);
|
|
|
+ int secondsBetween = DateUtil.secondsBetween(stuRecordDetailDto.getRecordStartTime(), date);
|
|
|
+ if(secondsBetween <= 0){
|
|
|
+ throw new BizException("操作失败:录制超时");
|
|
|
+ }
|
|
|
+ stuRecordDetailDto.setSubTime(secondsBetween);
|
|
|
+ stuRecordDetailDto.setRecordTime(recordMinutes);
|
|
|
+ stuRecordDetailDto.setSingleSongRecordMinutes(Integer.parseInt(sysConfigService.findByParamName("single_song_record_minutes").getParanValue()));
|
|
|
+ return stuRecordDetailDto;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public void nextBit(Long nextExamRoomStudentRelationId, Long currentExamRoomStudentRelationId, Integer examStatus,Long examRoomId) {
|
|
|
Boolean isPush = true;
|
|
|
if(currentExamRoomStudentRelationId != null){
|