Browse Source

监考设置列表完善

tags/正式版本
雍文秀 2 years ago
parent
commit
ee8609d4f6

+ 9
- 2
sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectInvigilateService.java View File

@@ -55,14 +55,21 @@ public class ESubjectInvigilateService {
55 55
         String esids = subjects.stream().map(s -> s.get("esid").toString()).collect(Collectors.joining(","));
56 56
         List<EITeacherVo> users = eSubjectInvigilateMapper.listUserByEsIds(esids);
57 57
         List<Map> classes = eClassMapper.listByExamId(examid);//考试班级
58
+        int classnum = classes.size();
58 59
         for (Map s : subjects) {
59 60
             Integer esid = (Integer) s.get("esid");
60 61
             if (N_Utils.isListEmpty(users)) users = new ArrayList<>();
61 62
             String majorname = users.stream().filter(u -> esid.equals(u.getEsid()) && u.getMajored() == 1)
62 63
                     .map(u -> u.getUsername()).distinct().collect(Collectors.joining("、"));
63 64
             s.put("majorname", majorname);
64
-            long einum = users.stream().filter(u -> !N_Utils.isEmptyInteger(u.getClassid()))
65
-                    .map(u -> u.getClassid()).distinct().count();
65
+            long einum;
66
+            if (N_Utils.isNotEmpty(majorname)) {
67
+                einum = 0;
68
+            } else {
69
+                einum = users.stream().filter(u -> esid.equals(u.getEsid()) && !N_Utils.isEmptyInteger(u.getClassid()))
70
+                        .map(u -> u.getClassid()).distinct().count();
71
+                einum = classnum - einum;
72
+            }
66 73
             s.put("einum", einum);
67 74
             for (Map c : classes) {
68 75
                 Integer classid = (Integer) c.get("classid");

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

@@ -92,7 +92,7 @@
92 92
     <!--考试设置状态-->
93 93
     <select id="getSetState" resultType="java.util.Map">
94 94
         select count(distinct case when es.begintime is null or es.begintime='' then es.esid else null end)esnum
95
-        ,min(es.esstate)esstate,min(ifnull(ep.correcttype,0))correcttype
95
+        ,min(es.esstate)esstate,min(es.pstate)pstate,min(ifnull(ep.correcttype,0))correcttype
96 96
         ,(case when b.exammode=1 then (count(distinct es.esid)-count(distinct ei.esid))
97 97
         else (select sum(ec.classnum)*count(distinct es.esid)-(select count(ps.epsid) from e_paper_student ps
98 98
         where ps.examid=b.examid and ps.sstate in(0,1)) from e_class ec

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

@@ -7,7 +7,7 @@
7 7
     </delete>
8 8
     <!--监考设置列表-->
9 9
     <select id="listSubject" resultType="java.util.Map">
10
-        select s.esid,s.subjectid,s.sdate,s.begintime,s.endtime,s.esstate,s.subjectname
10
+        select s.esid,s.subjectid,s.sdate,s.begintime,s.endtime,s.esstate,s.pstate,s.subjectname
11 11
         ,ifnull(ep.pnum,0)pnum,ifnull(ep.pscore,0)pscore,ep.correcttype
12 12
         from e_subject s left join e_paper ep on s.esid = ep.esid
13 13
         where s.examid=#{examid} group by s.esid

Loading…
Cancel
Save