Browse Source

优化集团考试

tags/正式3.11.0
王宁 1 year ago
parent
commit
697231ea36

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/EClassStudentMapper.java View File

31
 
31
 
32
     //考试学生列表
32
     //考试学生列表
33
     List<Map> listStuByExamId(@Param("examid") Integer examid);
33
     List<Map> listStuByExamId(@Param("examid") Integer examid);
34
+
35
+    //获取考试关联学校的准备考号长度
36
+    List<Integer> listSchoolExamNoLength(@Param("examid") Integer examid);
34
 }
37
 }

+ 6
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java View File

108
         if(model.getExammode() == 2) {//线下考试必须有考号
108
         if(model.getExammode() == 2) {//线下考试必须有考号
109
             Integer num = eClassStudentMapper.getNoExamNoNumByClassIds(classids);//根据班级ids获取没有考号学生数量
109
             Integer num = eClassStudentMapper.getNoExamNoNumByClassIds(classids);//根据班级ids获取没有考号学生数量
110
             if (num != 0) return new ResultVo(1, "有学生未设置考号,请先设置");
110
             if (num != 0) return new ResultVo(1, "有学生未设置考号,请先设置");
111
-            //验证选择学校的准考证号是否一致
111
+            //验证选择学校的准考证号长度是否一致;获取参加考试的学校所有学生考号长度
112
+            List<Integer> schoolExamNo = eClassStudentMapper.listSchoolExamNoLength(examid);
113
+            if(N_Utils.isListNotEmpty(schoolExamNo) && schoolExamNo.size() > 1){
114
+                return new ResultVo(1, "选择考试班级学生考号长度不一致");
115
+            }
116
+
112
         }
117
         }
113
         List<EClassStudent> students = eClassStudentMapper.listByClassIds(classids);
118
         List<EClassStudent> students = eClassStudentMapper.listByClassIds(classids);
114
         int stuNum = students.stream().distinct().collect(Collectors.toList()).size();
119
         int stuNum = students.stream().distinct().collect(Collectors.toList()).size();

+ 1
- 1
sexam/src/main/resources/mapper/exam/EClassMapper.xml View File

166
 
166
 
167
     <!--获取考试选择班级关联学校id-->
167
     <!--获取考试选择班级关联学校id-->
168
     <select id="listSchoolidByClassids" resultType="java.lang.Integer">
168
     <select id="listSchoolidByClassids" resultType="java.lang.Integer">
169
-        select schoolid from t_class where classid in (${classids) group by schoolid
169
+        select schoolid from t_class where classid in (${classids}) group by schoolid
170
     </select>
170
     </select>
171
 </mapper>
171
 </mapper>

+ 8
- 0
sexam/src/main/resources/mapper/exam/EClassStudentMapper.xml View File

75
         from e_class_student es left join t_user u on es.studentid = u.userid
75
         from e_class_student es left join t_user u on es.studentid = u.userid
76
         where es.examid=#{examid}
76
         where es.examid=#{examid}
77
     </select>
77
     </select>
78
+
79
+    <!--获取考试关联学校的准备考号长度-->
80
+    <select id="listSchoolExamNoLength" resultType="java.lang.Integer">
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)
85
+    </select>
78
 </mapper>
86
 </mapper>

+ 1
- 1
sexam/src/main/resources/mapper/exam/ESubjectInvigilateMapper.xml View File

27
         ,count(case when eps.sstate=2 then eps.epsid else null end)tjnum
27
         ,count(case when eps.sstate=2 then eps.epsid else null end)tjnum
28
         ,count(case when eps.sstate=3 then eps.epsid else null end)qknum
28
         ,count(case when eps.sstate=3 then eps.epsid else null end)qknum
29
         from(select es.esid,es.sdate,es.begintime,es.endtime,es.esstate,es.subjectname,es.pstate
29
         from(select es.esid,es.sdate,es.begintime,es.endtime,es.esstate,es.subjectname,es.pstate
30
-        ,eb.examname,eb.gradeid,eb.examtype,eb.examstate,max(ei.majored)majored
30
+        ,eb.examname,eb.gradeid,eb.examtype,eb.examstate,eb.hashb,eb.schoolid,max(ei.majored)majored
31
         ,(case when max(ei.majored)=0 then group_concat(distinct ei.classid) else group_concat(distinct ec.classid) end)classids
31
         ,(case when max(ei.majored)=0 then group_concat(distinct ei.classid) else group_concat(distinct ec.classid) end)classids
32
         ,concat('[',group_concat(distinct json_object('classid',ec.classid,'classname',ec.classname
32
         ,concat('[',group_concat(distinct json_object('classid',ec.classid,'classname',ec.classname
33
             ,'schoolid',ec.schoolid,'schoolname',s.schoolname)),']')classnames
33
             ,'schoolid',ec.schoolid,'schoolname',s.schoolname)),']')classnames

+ 2
- 2
sexam/src/main/resources/mapper/paper/EPaperCorrectTeacherMapper.xml View File

3
 <mapper namespace="com.xhkjedu.sexam.mapper.paper.EPaperCorrectTeacherMapper">
3
 <mapper namespace="com.xhkjedu.sexam.mapper.paper.EPaperCorrectTeacherMapper">
4
     <!--待阅卷列表-->
4
     <!--待阅卷列表-->
5
     <select id="listPending" resultType="java.util.Map">
5
     <select id="listPending" resultType="java.util.Map">
6
-        select a.*,eb.examname,eb.gradeid,eb.examtype,eb.examstate,es.sdate,es.begintime,es.endtime,es.subjectname
6
+        select a.*,eb.examname,eb.gradeid,eb.examtype,eb.examstate,eb.hashb,eb.schoolid,es.sdate,es.begintime,es.endtime,es.subjectname
7
         ,truncate(a.pynum*100/a.tjnum,2)pgrate
7
         ,truncate(a.pynum*100/a.tjnum,2)pgrate
8
         from(select p.esid,p.epid,group_concat(distinct concat(psq.qn,'_',psq.eptqid) order by psq.eptqid)qns
8
         from(select p.esid,p.epid,group_concat(distinct concat(psq.qn,'_',psq.eptqid) order by psq.eptqid)qns
9
         ,group_concat(distinct pc.classid)classids
9
         ,group_concat(distinct pc.classid)classids
25
     </select>
25
     </select>
26
     <!--已阅卷列表-->
26
     <!--已阅卷列表-->
27
     <select id="listMarked" resultType="java.util.Map">
27
     <select id="listMarked" resultType="java.util.Map">
28
-        select a.*,eb.examname,eb.gradeid,eb.examtype,eb.examstate,es.sdate,es.begintime,es.endtime,es.subjectname
28
+        select a.*,eb.examname,eb.gradeid,eb.examtype,eb.examstate,eb.hashb,eb.schoolid,es.sdate,es.begintime,es.endtime,es.subjectname
29
         ,100 pgrate
29
         ,100 pgrate
30
         from(select p.esid,p.epid,group_concat(distinct concat(psq.qn,'_',psq.eptqid) order by psq.eptqid)qns
30
         from(select p.esid,p.epid,group_concat(distinct concat(psq.qn,'_',psq.eptqid) order by psq.eptqid)qns
31
         ,group_concat(distinct pc.classid)classids
31
         ,group_concat(distinct pc.classid)classids

+ 1
- 1
sexam/src/main/resources/mapper/paper/EPaperMapper.xml View File

16
     <select id="listExamPapersByTeacherid" resultType="java.util.Map">
16
     <select id="listExamPapersByTeacherid" resultType="java.util.Map">
17
         select es.esid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,
17
         select es.esid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,
18
         es.esstate ,ep.epid,ep.ptype,ep.pnum,ep.pscore,ep.answered,ep.handleid,u.username as handlename,
18
         es.esstate ,ep.epid,ep.ptype,ep.pnum,ep.pscore,ep.answered,ep.handleid,u.username as handlename,
19
-        ep.scantronpdf,es.examid,e.examname,e.examtype,e.exammode,e.examstate
19
+        ep.scantronpdf,es.examid,e.examname,e.examtype,e.exammode,e.examstate,e.hashb,e.schoolid
20
         from e_subject es left join e_paper ep on es.esid=ep.esid
20
         from e_subject es left join e_paper ep on es.esid=ep.esid
21
         left join e_base e on es.examid=e.examid
21
         left join e_base e on es.examid=e.examid
22
         left join t_user u on ep.handleid=u.userid
22
         left join t_user u on ep.handleid=u.userid

Loading…
Cancel
Save