xiangpei
2024-07-01 1ad824cbc0b6e39166431f3b16611351820cfde0
src/main/java/com/ycl/jxkg/service/impl/ExamServiceImpl.java
@@ -91,6 +91,10 @@
        Exam entity = baseMapper.selectById(form.getId());
        // 为空抛IllegalArgumentException,做全局异常处理
        Assert.notNull(entity, "记录不存在");
        // 判断考试状态
        if (! ExamStatusEnum.NOT_START.equals(entity.getStatus())) {
            throw new RuntimeException("只能修改还未开始的考试");
        }
        BeanUtils.copyProperties(form, entity);
        entity.setStatus(ExamStatusEnum.getStatusByTime(form.getStartTime(), form.getEndTime(), null));
        baseMapper.updateById(entity);
@@ -513,11 +517,11 @@
        //插入exam_paper_answer(成绩表)
        ExamPaperScore examPaperScore = new ExamPaperScore();
        BeanUtils.copyProperties(examPaperMark,examPaperScore);
        examPaperScore.setUserScore(new BigDecimal(examPaperMark.getScore()));
        examPaperScore.setPaperScore(new BigDecimal(examPaperMark.getTotalScore()));
        examPaperScore.setScore(new BigDecimal(examPaperMark.getScore()));
        examPaperScore.setTotalScore(new BigDecimal(examPaperMark.getTotalScore()));
        examPaperScore.setJudgeUser(userId);
        examPaperScore.setCreateUser(examPaperMark.getUserId());
        examPaperScore.setAnswerTime(examPaperMark.getSubmitTime());
        examPaperScore.setUserId(examPaperMark.getUserId());
        examPaperScore.setSubmitTime(examPaperMark.getSubmitTime());
        examPaperScore.setPaperContent(JSON.toJSONString(examPaperMark.getTitleItems()));
        long questionCorrect =0;
        long questionCount=0;