|
@@ -6,10 +6,8 @@ import cn.com.qmth.examcloud.commons.util.JsonUtil;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.bean.*;
|
|
|
import cn.com.qmth.examcloud.core.oe.student.service.*;
|
|
|
import cn.com.qmth.examcloud.support.Constants;
|
|
|
-import cn.com.qmth.examcloud.support.enums.HandInExamType;
|
|
|
import cn.com.qmth.examcloud.support.examing.*;
|
|
|
import cn.com.qmth.examcloud.support.redis.RedisKeyHelper;
|
|
|
-import cn.com.qmth.examcloud.web.helpers.SequenceLockHelper;
|
|
|
import cn.com.qmth.examcloud.web.redis.RedisClient;
|
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -81,27 +79,7 @@ public class ExamProcessController extends ControllerSupport {
|
|
|
@PostMapping("/endExam")
|
|
|
public void endExam(HttpServletRequest request) {
|
|
|
User user = getAccessUser();
|
|
|
- Long studentId = user.getUserId();
|
|
|
- String sequenceLockKey = Constants.EXAM_CONTROL_LOCK_PREFIX + user.getUserId();
|
|
|
- //系统在请求结束后会,自动释放锁,无需手动解锁
|
|
|
- SequenceLockHelper.getLock(sequenceLockKey);
|
|
|
-
|
|
|
- long st = System.currentTimeMillis();
|
|
|
- long startTime = System.currentTimeMillis();
|
|
|
-
|
|
|
- ExamingSession examingSession = examingSessionService.getExamingSession(studentId);
|
|
|
-
|
|
|
- if (examingSession == null) {
|
|
|
- throw new StatusException("8010", "无效的会话,请离开考试");
|
|
|
- }
|
|
|
-
|
|
|
- if (LOGGER.isDebugEnabled()) {
|
|
|
- LOGGER.debug("0 [END_EXAM] 交卷前处理耗时:" + (System.currentTimeMillis() - startTime) + " ms");
|
|
|
- }
|
|
|
- examControlService.handInExam(examingSession.getExamRecordDataId(), HandInExamType.MANUAL, getIp(request));
|
|
|
- if (LOGGER.isDebugEnabled()) {
|
|
|
- LOGGER.debug("1 [END_EXAM]合计 耗时:" + (System.currentTimeMillis() - st) + " ms");
|
|
|
- }
|
|
|
+ examControlService.manualEndExam(user.getUserId(), getIp(request));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取考试记录信息")
|