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,4 +31,7 @@ public interface EClassStudentMapper extends TkMapper<EClassStudent> {
31 31
 
32 32
     //考试学生列表
33 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,7 +108,12 @@ public class EBaseService {
108 108
         if(model.getExammode() == 2) {//线下考试必须有考号
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);
113
+            if(N_Utils.isListNotEmpty(schoolExamNo) && schoolExamNo.size() > 1){
114
+                return new ResultVo(1, "选择考试班级学生考号长度不一致");
115
+            }
116
+
112 117
         }
113 118
         List<EClassStudent> students = eClassStudentMapper.listByClassIds(classids);
114 119
         int stuNum = students.stream().distinct().collect(Collectors.toList()).size();

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

@@ -166,6 +166,6 @@
166 166
 
167 167
     <!--获取考试选择班级关联学校id-->
168 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 170
     </select>
171 171
 </mapper>

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

@@ -75,4 +75,12 @@
75 75
         from e_class_student es left join t_user u on es.studentid = u.userid
76 76
         where es.examid=#{examid}
77 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 86
 </mapper>

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

@@ -27,7 +27,7 @@
27 27
         ,count(case when eps.sstate=2 then eps.epsid else null end)tjnum
28 28
         ,count(case when eps.sstate=3 then eps.epsid else null end)qknum
29 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 31
         ,(case when max(ei.majored)=0 then group_concat(distinct ei.classid) else group_concat(distinct ec.classid) end)classids
32 32
         ,concat('[',group_concat(distinct json_object('classid',ec.classid,'classname',ec.classname
33 33
             ,'schoolid',ec.schoolid,'schoolname',s.schoolname)),']')classnames

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

@@ -3,7 +3,7 @@
3 3
 <mapper namespace="com.xhkjedu.sexam.mapper.paper.EPaperCorrectTeacherMapper">
4 4
     <!--待阅卷列表-->
5 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 7
         ,truncate(a.pynum*100/a.tjnum,2)pgrate
8 8
         from(select p.esid,p.epid,group_concat(distinct concat(psq.qn,'_',psq.eptqid) order by psq.eptqid)qns
9 9
         ,group_concat(distinct pc.classid)classids
@@ -25,7 +25,7 @@
25 25
     </select>
26 26
     <!--已阅卷列表-->
27 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 29
         ,100 pgrate
30 30
         from(select p.esid,p.epid,group_concat(distinct concat(psq.qn,'_',psq.eptqid) order by psq.eptqid)qns
31 31
         ,group_concat(distinct pc.classid)classids

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

@@ -16,7 +16,7 @@
16 16
     <select id="listExamPapersByTeacherid" resultType="java.util.Map">
17 17
         select es.esid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,
18 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 20
         from e_subject es left join e_paper ep on es.esid=ep.esid
21 21
         left join e_base e on es.examid=e.examid
22 22
         left join t_user u on ep.handleid=u.userid

Loading…
Cancel
Save