“djh”
2026-02-05 868cf9aef166be2cba108bcc1fa5469195776673
multi-system/src/main/java/com/gkhy/exam/system/service/impl/ExPaperStudentServiceImpl.java
@@ -298,7 +298,7 @@
            }
            updateStudentAnswers.add(sa);
        }
        ExPaperStudent exPaperStudent = baseMapper.selectByPaperStudentId(paperStudent);
        studentAnswerService.saveOrUpdateBatch(updateStudentAnswers);
        paperStudent.setScore(totalScore);
        if(!easyViewFlag){
@@ -311,9 +311,13 @@
                //生成考试证书编号
                DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
                String format = LocalDate.now().format(dateTimeFormatter);
                Long l = baseMapper.selectCount(Wrappers.<ExPaperStudent>lambdaQuery().eq(ExPaperStudent::getPassed, 1).eq(ExPaperStudent::getState,2));
                l+=1;
                paperStudent.setNumber("AQSC-"+format+"-"+l);
                String timestamp = String.valueOf(System.currentTimeMillis()).substring(9, 13);
                paperStudent.setNumber("AQSC-"+format+"-"+timestamp);
            }
            if (exPaperStudent.getScore()>=paperStudent.getScore()){
                paperStudent.setScore(exPaperStudent.getScore());
                paperStudent.setNumber(exPaperStudent.getNumber());
            }
        }
        int row=baseMapper.updateById(paperStudent);
@@ -322,6 +326,21 @@
        }
    }
    @Override
    @Transactional
    public void againExam(ExPaperStudent exPaperStudent) {
//        baseMapper.deleteByPaperStudentId(exPaperStudent.getPaperId(),exPaperStudent.getStudentId());
//        studentAnswerMapper.deletedByPaperStudentId(exPaperStudent.getPaperId(),exPaperStudent.getStudentId());
//        BatchPaperStudentVO batchPaperStudentVO = new BatchPaperStudentVO();
//        batchPaperStudentVO.setPaperId(exPaperStudent.getPaperId());
//        List<Long> longs = new ArrayList<>();
//        longs.add(exPaperStudent.getStudentId());
//        batchPaperStudentVO.setStudentIds(longs);
//        batchAddPaperStudent(batchPaperStudentVO);
        baseMapper.updateByPaperStudentId(exPaperStudent);
        studentAnswerMapper.updateState(exPaperStudent);
    }
    private Integer getScore(ExExamPaper examPaper,Integer questionType){
        if(questionType.equals(QuestionTypeEnum.SINGLE.getCode())){
            return examPaper.getSingleScore();