|
@@ -122,13 +122,17 @@ public class TIeInvigilateController {
|
|
IPage<InvigilateListVideoBean> invigilateListVideoBeanIPage = tOeExamRecordService.invigilatePageListVideo(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, userId, tbUser.getOrgId());
|
|
IPage<InvigilateListVideoBean> invigilateListVideoBeanIPage = tOeExamRecordService.invigilatePageListVideo(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, userId, tbUser.getOrgId());
|
|
if (Objects.nonNull(invigilateListVideoBeanIPage)) {
|
|
if (Objects.nonNull(invigilateListVideoBeanIPage)) {
|
|
List<InvigilateListVideoBean> invigilateListVideoBeanList = invigilateListVideoBeanIPage.getRecords();
|
|
List<InvigilateListVideoBean> invigilateListVideoBeanList = invigilateListVideoBeanIPage.getRecords();
|
|
- ExamCacheBean examCacheBean = teExamService.getExamCacheBean(examId);
|
|
|
|
|
|
+ ExamCacheBean examCacheBean = null;
|
|
|
|
+ if (Objects.nonNull(examId)) {
|
|
|
|
+ examCacheBean = teExamService.getExamCacheBean(examId);
|
|
|
|
+ }
|
|
List<String> monitorVideoSourceList = null;
|
|
List<String> monitorVideoSourceList = null;
|
|
- if (Objects.nonNull(examCacheBean.getMonitorVideoSource()) && !Objects.equals(examCacheBean.getMonitorVideoSource().toString().trim().replaceAll(" ", ""), "")) {
|
|
|
|
|
|
+ if (Objects.nonNull(examCacheBean) && Objects.nonNull(examCacheBean.getMonitorVideoSource()) && !Objects.equals(examCacheBean.getMonitorVideoSource().toString().trim().replaceAll(" ", ""), "")) {
|
|
monitorVideoSourceList = Arrays.asList(examCacheBean.getMonitorVideoSource().trim().toUpperCase().replaceAll(" ", "").split(","));
|
|
monitorVideoSourceList = Arrays.asList(examCacheBean.getMonitorVideoSource().trim().toUpperCase().replaceAll(" ", "").split(","));
|
|
}
|
|
}
|
|
if (Objects.nonNull(invigilateListVideoBeanList) && invigilateListVideoBeanList.size() > 0) {
|
|
if (Objects.nonNull(invigilateListVideoBeanList) && invigilateListVideoBeanList.size() > 0) {
|
|
List<String> finalMonitorVideoSourceList = monitorVideoSourceList;
|
|
List<String> finalMonitorVideoSourceList = monitorVideoSourceList;
|
|
|
|
+ ExamCacheBean finalExamCacheBean = examCacheBean;
|
|
invigilateListVideoBeanList.forEach(s -> {
|
|
invigilateListVideoBeanList.forEach(s -> {
|
|
if (Objects.nonNull(finalMonitorVideoSourceList) && finalMonitorVideoSourceList.size() > 0) {
|
|
if (Objects.nonNull(finalMonitorVideoSourceList) && finalMonitorVideoSourceList.size() > 0) {
|
|
finalMonitorVideoSourceList.forEach(l -> {
|
|
finalMonitorVideoSourceList.forEach(l -> {
|
|
@@ -165,6 +169,10 @@ public class TIeInvigilateController {
|
|
if (Objects.nonNull(paperDownLoad)) {
|
|
if (Objects.nonNull(paperDownLoad)) {
|
|
s.setPaperDownload(paperDownLoad);
|
|
s.setPaperDownload(paperDownLoad);
|
|
}
|
|
}
|
|
|
|
+ //剩余时间计算
|
|
|
|
+ if (Objects.nonNull(finalExamCacheBean)) {
|
|
|
|
+ s.setRemainTime(this.getRemainTime(finalExamCacheBean.getMode(), s.getExamRecordId()));
|
|
|
|
+ }
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -187,6 +195,11 @@ public class TIeInvigilateController {
|
|
}
|
|
}
|
|
List<InvigilateListVideoBean> invigilateListVideoBeanList = tOeExamRecordService.invigilatePageListVideoRandom(examId, userId, randomNum, tbUser.getOrgId());
|
|
List<InvigilateListVideoBean> invigilateListVideoBeanList = tOeExamRecordService.invigilatePageListVideoRandom(examId, userId, randomNum, tbUser.getOrgId());
|
|
if (Objects.nonNull(invigilateListVideoBeanList) && invigilateListVideoBeanList.size() > 0) {
|
|
if (Objects.nonNull(invigilateListVideoBeanList) && invigilateListVideoBeanList.size() > 0) {
|
|
|
|
+ ExamCacheBean examCacheBean = null;
|
|
|
|
+ if (Objects.nonNull(examId)) {
|
|
|
|
+ examCacheBean = teExamService.getExamCacheBean(examId);
|
|
|
|
+ }
|
|
|
|
+ ExamCacheBean finalExamCacheBean = examCacheBean;
|
|
invigilateListVideoBeanList.forEach(s -> {
|
|
invigilateListVideoBeanList.forEach(s -> {
|
|
String monitorLiveUrl = ExamRecordCacheUtil.getMonitorLiveUrl(s.getExamRecordId(), MonitorVideoSourceEnum.CLIENT_CAMERA);
|
|
String monitorLiveUrl = ExamRecordCacheUtil.getMonitorLiveUrl(s.getExamRecordId(), MonitorVideoSourceEnum.CLIENT_CAMERA);
|
|
if (Objects.nonNull(monitorLiveUrl)) {
|
|
if (Objects.nonNull(monitorLiveUrl)) {
|
|
@@ -200,6 +213,10 @@ public class TIeInvigilateController {
|
|
if (Objects.nonNull(paperDownLoad)) {
|
|
if (Objects.nonNull(paperDownLoad)) {
|
|
s.setPaperDownload(paperDownLoad);
|
|
s.setPaperDownload(paperDownLoad);
|
|
}
|
|
}
|
|
|
|
+ //剩余时间计算
|
|
|
|
+ if (Objects.nonNull(finalExamCacheBean)) {
|
|
|
|
+ s.setRemainTime(this.getRemainTime(finalExamCacheBean.getMode(), s.getExamRecordId()));
|
|
|
|
+ }
|
|
});
|
|
});
|
|
}
|
|
}
|
|
return ResultUtil.ok(invigilateListVideoBeanList);
|
|
return ResultUtil.ok(invigilateListVideoBeanList);
|
|
@@ -382,11 +399,20 @@ public class TIeInvigilateController {
|
|
if (Objects.nonNull(invigilateListPatrolBeanIPage)) {
|
|
if (Objects.nonNull(invigilateListPatrolBeanIPage)) {
|
|
List<InvigilateListPatrolBean> invigilateListPatrolBeanList = invigilateListPatrolBeanIPage.getRecords();
|
|
List<InvigilateListPatrolBean> invigilateListPatrolBeanList = invigilateListPatrolBeanIPage.getRecords();
|
|
if (Objects.nonNull(invigilateListPatrolBeanList) && invigilateListPatrolBeanList.size() > 0) {
|
|
if (Objects.nonNull(invigilateListPatrolBeanList) && invigilateListPatrolBeanList.size() > 0) {
|
|
|
|
+ ExamCacheBean examCacheBean = null;
|
|
|
|
+ if (Objects.nonNull(examId)) {
|
|
|
|
+ examCacheBean = teExamService.getExamCacheBean(examId);
|
|
|
|
+ }
|
|
|
|
+ ExamCacheBean finalExamCacheBean = examCacheBean;
|
|
invigilateListPatrolBeanList.forEach(s -> {
|
|
invigilateListPatrolBeanList.forEach(s -> {
|
|
WebsocketStatusEnum websocketStatusEnum = ExamRecordCacheUtil.getClientWebsocketStatus(s.getExamRecordId());
|
|
WebsocketStatusEnum websocketStatusEnum = ExamRecordCacheUtil.getClientWebsocketStatus(s.getExamRecordId());
|
|
if (Objects.nonNull(websocketStatusEnum)) {
|
|
if (Objects.nonNull(websocketStatusEnum)) {
|
|
s.setClientWebsocketStatus(websocketStatusEnum);
|
|
s.setClientWebsocketStatus(websocketStatusEnum);
|
|
}
|
|
}
|
|
|
|
+ //剩余时间计算
|
|
|
|
+ if (Objects.nonNull(finalExamCacheBean)) {
|
|
|
|
+ s.setRemainTime(this.getRemainTime(finalExamCacheBean.getMode(), s.getExamRecordId()));
|
|
|
|
+ }
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -652,4 +678,30 @@ public class TIeInvigilateController {
|
|
examPropCountDto.setExamCount(examCount.get());
|
|
examPropCountDto.setExamCount(examCount.get());
|
|
return ResultUtil.ok(examPropCountDto);
|
|
return ResultUtil.ok(examPropCountDto);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取剩余时间
|
|
|
|
+ *
|
|
|
|
+ * @param mode
|
|
|
|
+ * @param recordId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private String getRemainTime(ExamModeEnum mode, Long recordId) {
|
|
|
|
+ String remainTime = null;
|
|
|
|
+ Integer forceFinish = ExamRecordCacheUtil.getForceFinish(recordId);
|
|
|
|
+ Integer maxDurationSeconds = Objects.isNull(ExamRecordCacheUtil.getMaxDurationSeconds(recordId)) ? 0 : ExamRecordCacheUtil.getMaxDurationSeconds(recordId);
|
|
|
|
+ Integer durationSeconds = Objects.isNull(ExamRecordCacheUtil.getDurationSeconds(recordId)) ? 0 : ExamRecordCacheUtil.getDurationSeconds(recordId);
|
|
|
|
+ Long endTime = Objects.isNull(ExamRecordCacheUtil.getEndTime(recordId)) ? 0 : ExamRecordCacheUtil.getEndTime(recordId);
|
|
|
|
+ if (Objects.nonNull(mode) && Objects.equals(mode, ExamModeEnum.ANYTIME)) {
|
|
|
|
+ Long diffTime = maxDurationSeconds.longValue() - durationSeconds.longValue();
|
|
|
|
+ remainTime = diffTime.intValue() == 0 ? "00:00:00" : SystemConstant.getRemainTime(diffTime);
|
|
|
|
+ } else if (Objects.nonNull(mode) && Objects.equals(mode, ExamModeEnum.TOGETHER) && Objects.nonNull(forceFinish) && forceFinish.intValue() == 1) {
|
|
|
|
+ Long diffTime = endTime - System.currentTimeMillis();
|
|
|
|
+ remainTime = diffTime.intValue() == 0 ? "00:00:00" : SystemConstant.getRemainTime(diffTime);
|
|
|
|
+ } else {
|
|
|
|
+ Long diffTime = maxDurationSeconds.longValue() - durationSeconds.longValue();
|
|
|
|
+ remainTime = diffTime.intValue() == 0 ? "00:00:00" : SystemConstant.getRemainTime(diffTime);
|
|
|
|
+ }
|
|
|
|
+ return remainTime;
|
|
|
|
+ }
|
|
}
|
|
}
|