|
@@ -4,18 +4,22 @@ import com.aliyun.oss.common.utils.BinaryUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.google.common.reflect.TypeToken;
|
|
|
-import com.google.gson.Gson;
|
|
|
import com.qmth.themis.business.bean.StudentParams;
|
|
|
import com.qmth.themis.business.bean.admin.StudentPhotoUploadResponseBean;
|
|
|
+import com.qmth.themis.business.cache.bean.ExamCacheBean;
|
|
|
+import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
|
|
|
+import com.qmth.themis.business.constant.SystemConstant;
|
|
|
import com.qmth.themis.business.dao.TEStudentMapper;
|
|
|
import com.qmth.themis.business.dto.response.TEStudentDto;
|
|
|
import com.qmth.themis.business.dto.response.TEStudentExamRecordDto;
|
|
|
-import com.qmth.themis.business.dto.response.TEStudentMonitorRecordDto;
|
|
|
+import com.qmth.themis.business.dto.response.TEStudentExamRecordVideoDto;
|
|
|
+import com.qmth.themis.business.dto.response.TEStudentExamRecordVideoMessageDto;
|
|
|
import com.qmth.themis.business.entity.TBUser;
|
|
|
+import com.qmth.themis.business.entity.TEExamStudentLog;
|
|
|
import com.qmth.themis.business.entity.TEStudent;
|
|
|
-import com.qmth.themis.business.service.CacheService;
|
|
|
-import com.qmth.themis.business.service.TEStudentService;
|
|
|
+import com.qmth.themis.business.entity.TOeExamRecord;
|
|
|
+import com.qmth.themis.business.enums.MonitorVideoSourceEnum;
|
|
|
+import com.qmth.themis.business.service.*;
|
|
|
import com.qmth.themis.business.util.OssUtil;
|
|
|
import com.qmth.themis.business.util.ServletUtil;
|
|
|
import com.qmth.themis.common.enums.ExceptionResultEnum;
|
|
@@ -53,6 +57,14 @@ public class TEStudentServiceImpl extends ServiceImpl<TEStudentMapper, TEStudent
|
|
|
@Resource
|
|
|
CacheService cacheService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ TEExamService teExamService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ TEExamStudentService teExamStudentService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ TEExamStudentLogService teExamStudentLogService;
|
|
|
|
|
|
/**
|
|
|
* 学生档案查询
|
|
@@ -81,14 +93,7 @@ public class TEStudentServiceImpl extends ServiceImpl<TEStudentMapper, TEStudent
|
|
|
*/
|
|
|
@Override
|
|
|
public IPage<TEStudentExamRecordDto> studentExamRecordQuery(IPage<Map> iPage, Long studentId, Long examId) {
|
|
|
- IPage<TEStudentExamRecordDto> teStudentExamRecordDtoIPage = teStudentMapper.studentExamRecordQuery(iPage, studentId, examId);
|
|
|
- Gson gson = new Gson();
|
|
|
- for (TEStudentExamRecordDto t : teStudentExamRecordDtoIPage.getRecords()) {
|
|
|
- List<TEStudentMonitorRecordDto> monitorRecordList = gson.fromJson(t.getTencentVideoUrl(), new TypeToken<List<TEStudentMonitorRecordDto>>() {
|
|
|
- }.getType());
|
|
|
- t.setMonitorRecord(monitorRecordList);
|
|
|
- }
|
|
|
- return teStudentExamRecordDtoIPage;
|
|
|
+ return teStudentMapper.studentExamRecordQuery(iPage, studentId, examId);
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
@@ -143,4 +148,41 @@ public class TEStudentServiceImpl extends ServiceImpl<TEStudentMapper, TEStudent
|
|
|
this.updateById(teStudent);
|
|
|
cacheService.updateStudentAccountCache(teStudent.getId());
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 视频监考回放查询接口
|
|
|
+ *
|
|
|
+ * @param iPage
|
|
|
+ * @param examRecordId
|
|
|
+ * @param monitorVideoSource
|
|
|
+ * @param log
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public TEStudentExamRecordVideoDto examRecordVideoQuery(IPage<Map> iPage, Long examRecordId, MonitorVideoSourceEnum monitorVideoSource, Boolean log) {
|
|
|
+ TOeExamRecord tOeExamRecord = null;
|
|
|
+ ExamCacheBean examCacheBean = null;
|
|
|
+ ExamStudentCacheBean examStudentCacheBean = null;
|
|
|
+
|
|
|
+ List<TEExamStudentLog> teExamStudentLogList = null;
|
|
|
+ if (Objects.nonNull(log) && log) {
|
|
|
+ tOeExamRecord = SystemConstant.getExamRecord(examRecordId);
|
|
|
+ examCacheBean = teExamService.getExamCacheBean(tOeExamRecord.getExamId());
|
|
|
+ examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(tOeExamRecord.getExamStudentId());
|
|
|
+
|
|
|
+ QueryWrapper<TEExamStudentLog> teExamStudentLogQueryWrapper = new QueryWrapper<>();
|
|
|
+ teExamStudentLogQueryWrapper.lambda().eq(TEExamStudentLog::getExamStudentId, examStudentCacheBean.getId())
|
|
|
+ .eq(TEExamStudentLog::getExamRecordId, examRecordId)
|
|
|
+ .orderByAsc(TEExamStudentLog::getCreateTime);
|
|
|
+ teExamStudentLogList = teExamStudentLogService.list(teExamStudentLogQueryWrapper);
|
|
|
+ }
|
|
|
+ IPage<TEStudentExamRecordVideoMessageDto> teStudentExamRecordVideoMessageDtoIPage = teStudentMapper.examRecordVideoQuery(iPage, examRecordId, Objects.nonNull(monitorVideoSource) ? monitorVideoSource.name().toLowerCase() : null);
|
|
|
+
|
|
|
+ TEStudentExamRecordVideoDto teStudentExamRecordVideoDto = new TEStudentExamRecordVideoDto(Objects.nonNull(examCacheBean) ? examCacheBean.getId() : null,
|
|
|
+ Objects.nonNull(examCacheBean) ? examCacheBean.getName() : null, Objects.nonNull(examStudentCacheBean) ? examStudentCacheBean.getId() : null, examRecordId, Objects.nonNull(examStudentCacheBean) ? examStudentCacheBean.getCourseCode() : null,
|
|
|
+ Objects.nonNull(examStudentCacheBean) ? examStudentCacheBean.getCourseName() : null, Objects.nonNull(examStudentCacheBean) ? examStudentCacheBean.getIdentity() : null, Objects.nonNull(examStudentCacheBean) ? examStudentCacheBean.getName() : null,
|
|
|
+ Objects.nonNull(tOeExamRecord) ? tOeExamRecord.getFirstStartTime() : null, teExamStudentLogList, teStudentExamRecordVideoMessageDtoIPage);
|
|
|
+ //TODO 兼容1.2.3之前的版本
|
|
|
+ return teStudentExamRecordVideoDto;
|
|
|
+ }
|
|
|
}
|