xiangpei
2024-06-28 02d8e9c93d128ad87bd891cc45d652727862df5f
src/main/java/com/ycl/jxkg/service/impl/ExamServiceImpl.java
@@ -295,9 +295,9 @@
     * @return
     */
    @Override
    public Result examSubmit(ExamSubmitVO submitData) {
    public Result examSubmit(StartExamVO submitData) {
        // 校验
        Exam exam = examMapper.selectById(submitData.getExamId());
        Exam exam = examMapper.selectById(submitData.getId());
        if (Objects.isNull(exam)) {
            throw new RuntimeException("该考试不存在");
        }
@@ -340,7 +340,7 @@
     * @return
     */
    @Override
    public Result timingSubmit(ExamSubmitVO submitData) {
    public Result timingSubmit(StartExamVO submitData) {
        saveTempExam(submitData, ExamSubmitTempStatusEnum.TEMP);
        return Result.ok();
    }
@@ -351,9 +351,9 @@
     * @param submitData  前端传递的试卷数据
     * @param status  试卷的状态
     */
    public void saveTempExam(ExamSubmitVO submitData, ExamSubmitTempStatusEnum status) {
    public void saveTempExam(StartExamVO submitData, ExamSubmitTempStatusEnum status) {
        ExamSubmitTemp one = new LambdaQueryChainWrapper<>(examSubmitTempMapper)
                .eq(ExamSubmitTemp::getExamId, submitData.getExamId())
                .eq(ExamSubmitTemp::getExamId, submitData.getId())
                .eq(ExamSubmitTemp::getUserId, webContext.getCurrentUser().getId())
                .one();
        if (Objects.nonNull(one)) {
@@ -361,17 +361,17 @@
                return;
            }
            one.setDoTime(submitData.getDoTime());
            one.setExamSubmit(JSON.toJSONString(submitData.getPaperQuestionList()));
            one.setExamSubmit(JSON.toJSONString(submitData.getTitleList()));
            one.setCreateTime(new Date());
            one.setStatus(status);
            examSubmitTempMapper.updateById(one);
        } else {
            ExamSubmitTemp examSubmitTemp = new ExamSubmitTemp();
            examSubmitTemp.setExamId(submitData.getExamId());
            examSubmitTemp.setExamId(submitData.getId());
            examSubmitTemp.setDoTime(submitData.getDoTime());
            examSubmitTemp.setStatus(status);
            examSubmitTemp.setUserId(webContext.getCurrentUser().getId());
            examSubmitTemp.setExamSubmit(JSON.toJSONString(submitData.getPaperQuestionList()));
            examSubmitTemp.setExamSubmit(JSON.toJSONString(submitData.getTitleList()));
            examSubmitTemp.setMarkPaperStatus(ExamSubmitTempStatusEnum.TEMP);
            examSubmitTempMapper.insert(examSubmitTemp);
        }