浏览代码

优化线下考试考号长度判断

tags/正式3.11.0
王宁 1年前
父节点
当前提交
08cf21d941

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/EClassStudentMapper.java 查看文件

@@ -33,5 +33,5 @@ public interface EClassStudentMapper extends TkMapper<EClassStudent> {
33 33
     List<Map> listStuByExamId(@Param("examid") Integer examid);
34 34
 
35 35
     //获取考试关联学校的准备考号长度
36
-    List<Integer> listSchoolExamNoLength(@Param("examid") Integer examid);
36
+    List<Integer> listSchoolExamNoLength(@Param("classids") List<Integer> classids);
37 37
 }

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java 查看文件

@@ -109,7 +109,7 @@ public class EBaseService {
109 109
             Integer num = eClassStudentMapper.getNoExamNoNumByClassIds(classids);//根据班级ids获取没有考号学生数量
110 110
             if (num != 0) return new ResultVo(1, "有学生未设置考号,请先设置");
111 111
             //验证选择学校的准考证号长度是否一致;获取参加考试的学校所有学生考号长度
112
-            List<Integer> schoolExamNo = eClassStudentMapper.listSchoolExamNoLength(examid);
112
+            List<Integer> schoolExamNo = eClassStudentMapper.listSchoolExamNoLength(classids);
113 113
             if(N_Utils.isListNotEmpty(schoolExamNo) && schoolExamNo.size() > 1){
114 114
                 return new ResultVo(1, "选择考试班级学生考号长度不一致");
115 115
             }

+ 6
- 3
sexam/src/main/resources/mapper/exam/EClassStudentMapper.xml 查看文件

@@ -79,8 +79,11 @@
79 79
     <!--获取考试关联学校的准备考号长度-->
80 80
     <select id="listSchoolExamNoLength" resultType="java.lang.Integer">
81 81
         select LENGTH(u.examno) from t_user u
82
-        left join e_class_student cs on u.userid=cs.studentid
83
-        left join e_class ec on cs.classid=ec.classid and cs.examid=ec.examid
84
-        where ec.examid=#{examid} and u.usertype=2 and u.userstate=1 group by LENGTH(u.examno)
82
+        left join t_class_student cs on u.userid=cs.studentid
83
+        where u.usertype=2 and u.userstate=1 and cs.classid in
84
+        <foreach collection="classids" item="classid" index="index" separator="," open="(" close=")">
85
+            #{classid}
86
+        </foreach>
87
+        group by LENGTH(u.examno)
85 88
     </select>
86 89
 </mapper>

正在加载...
取消
保存