fix:补考时未选择且未参加过考试的考生新增零分记录、开始考试时非空判断
| | |
| | | @Getter |
| | | public enum UserConditionEnum { |
| | | |
| | | NORMAL("0", "正常"), |
| | | SICK("1", "病假"), |
| | | BUSINESS_TRIP("2", "出差"), |
| | | OTHER("3", "其他"), |
| | |
| | | package com.mindskip.xzs.repository; |
| | | |
| | | import com.mindskip.xzs.domain.ExamPaper; |
| | | import com.mindskip.xzs.domain.ExamPaperAnswer; |
| | | import com.mindskip.xzs.domain.ExamTemplatesUserCount; |
| | | import com.mindskip.xzs.domain.ScoreTemplatesUserCount; |
| | |
| | | import com.mindskip.xzs.domain.vo.ScoreTemplatesCountVO; |
| | | import com.mindskip.xzs.domain.vo.TeamplatesUserExcelVO; |
| | | import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM; |
| | | import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVO; |
| | | import com.mindskip.xzs.viewmodel.admin.paper.ExamPaperGradePageRequestVM; |
| | | import com.mindskip.xzs.viewmodel.admin.paper.ExamPaperGradeQuery; |
| | | import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageVM; |
| | |
| | | List<TeamplatesUserExcelVO> getByTimeOne(); |
| | | |
| | | void setMissExam(ExamPaperEditRequestVM model); |
| | | |
| | | void insertDefault(ExamPaperEditRequestVM model); |
| | | |
| | | } |
| | |
| | | List<ExamPaperUser> examPaperUsers = examPaperUserService.getByExamPaperId(examPaper.getId()); |
| | | Integer[][] userIds = new Integer[examPaperUsers.size()][2]; |
| | | for (int i = 0; i < examPaperUsers.size(); i++) { |
| | | Integer[] userId = {userService.getUserById(examPaperUsers.get(i).getUserId()).getUserLevel(), examPaperUsers.get(i).getUserId()}; |
| | | userIds[i] = userId; |
| | | User user = userService.getUserById(examPaperUsers.get(i).getUserId()); |
| | | if (ObjectUtils.isNotEmpty(user)) { |
| | | Integer[] userId = {user.getUserLevel(), examPaperUsers.get(i).getUserId()}; |
| | | userIds[i] = userId; |
| | | } |
| | | } |
| | | vm.setUserId(userIds); |
| | | return vm; |
| | |
| | | } |
| | | // 根据考试id将选择的补考考生的考试成绩设置为无效 |
| | | examPaperAnswerMapper.setMissExam(model); |
| | | |
| | | // 补考时将没有选择的并且没有参加过考试的考生增加一条零分考试记录,否则没有参加过考试的即使不被选择也可以参加补考 |
| | | examPaperAnswerMapper.insertDefault(model); |
| | | } |
| | | } |
| | |
| | | where a.create_time |
| | | </select> |
| | | |
| | | <insert id="insertDefault"> |
| | | INSERT INTO t_exam_paper_answer(exam_paper_id, paper_name, paper_type, system_score, user_score, paper_score, question_correct, question_count, do_time, status, |
| | | create_user, create_time, invalid) |
| | | SELECT |
| | | a.id, a.name, a.paper_type, 0, 0, a.score, 0, a.question_count, 0, 2, b.user_id, NOW(), 0 |
| | | FROM t_exam_paper a |
| | | left join t_exam_paper_user b on a.id = b.exam_paper_id and b.deleted = 0 |
| | | left join t_exam_paper_answer c on a.id = c.exam_paper_id and c.create_user = b.user_id |
| | | WHERE a.id = #{examPaperId} |
| | | and c.id is null |
| | | and b.user_id not in |
| | | <foreach collection="userIds" item="item" open="(" close=")" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | </insert> |
| | | |
| | | </mapper> |
| | |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from t_user |
| | | where id=#{value} and status = 1 and deleted = 0 |
| | | where id=#{value} and status = 1 and deleted = 0 and (`condition` = 0 or `condition` is null) |
| | | </select> |
| | | |
| | | <select id="getUserByUserName" resultMap="BaseResultMap"> |