Procházet zdrojové kódy

监控列表

tags/正式版本
雍文秀 před 2 roky
rodič
revize
5842cefed5

+ 25
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/ESubjectBadstudentController.java Zobrazit soubor

@@ -43,7 +43,7 @@ public class ESubjectBadstudentController {
43 43
     }
44 44
 
45 45
     /**
46
-     * 实时监控
46
+     * 实时监控--教师
47 47
      *
48 48
      * @return com.xhkjedu.vo.ResultVo
49 49
      * @Param [invigilate]
@@ -66,4 +66,28 @@ public class ESubjectBadstudentController {
66 66
         map.put("pageResult", pageResult);
67 67
         return new ResultVo(0, "获取成功", map);
68 68
     }
69
+
70
+    /**
71
+     * 实时监控--管理员
72
+     *
73
+     * @return com.xhkjedu.vo.ResultVo
74
+     * @Param [invigilate]
75
+     * @Author ywx
76
+     * @Date 2022/8/17 17:00
77
+     **/
78
+    @PostMapping("/list_gsjk")
79
+    public ResultVo listGJk(@RequestBody ESubjectInvigilate invigilate) {
80
+        Integer esid = invigilate.getEsid();
81
+        Integer classid = invigilate.getClassid();
82
+        Integer page = invigilate.getPage();
83
+        Integer pageSize = invigilate.getPageSize();
84
+        N_Utils.validation(new Object[]{page, "页码", 1, pageSize, "显示条数", 1});
85
+        Map map = eSubjectBadstudentService.getJkDetail(esid, 0);
86
+        String classids = map.get("classids").toString();
87
+        PageHelper.startPage(page, pageSize);
88
+        List<Map> list = eSubjectBadstudentService.listStu(esid, classids, classid, invigilate.getCreatename());
89
+        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
90
+        map.put("pageResult", pageResult);
91
+        return new ResultVo(0, "获取成功", map);
92
+    }
69 93
 }

+ 14
- 11
sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectBadstudentService.java Zobrazit soubor

@@ -38,18 +38,21 @@ public class ESubjectBadstudentService {
38 38
     public Map getJkDetail(Integer esid, Integer teacherid) {
39 39
         Map map = eSubjectMapper.getESubjectByEsId(esid);//考试科目基本信息
40 40
         List<Map> classes = eClassMapper.listByExamId((Integer) map.get("examid"));//考试班级
41
-        Map claMap = eSubjectBadstudentMapper.getClass(esid, teacherid);//教师监考班级
42
-        String classids;
43
-        if (claMap.get("majored").equals(0)) {//教师不是主监考
44
-            List<Map> classes2 = new ArrayList<>();
45
-            classids = claMap.get("classids").toString();
46
-            String[] classIds = classids.split(",");
47
-            for (String classid : classIds) {
48
-                Map cla = classes.stream().filter(c -> c.get("classid").toString().equals(classid)).findFirst().orElse(null);
49
-                if (cla != null) classes2.add(cla);
41
+        String classids = null;
42
+        if (teacherid != 0) {
43
+            Map claMap = eSubjectBadstudentMapper.getClass(esid, teacherid);//教师监考班级
44
+            if (claMap.get("majored").equals(0)) {//教师不是主监考
45
+                List<Map> classes2 = new ArrayList<>();
46
+                classids = claMap.get("classids").toString();
47
+                String[] classIds = classids.split(",");
48
+                for (String classid : classIds) {
49
+                    Map cla = classes.stream().filter(c -> c.get("classid").toString().equals(classid)).findFirst().orElse(null);
50
+                    if (cla != null) classes2.add(cla);
51
+                }
52
+                classes = classes2;
50 53
             }
51
-            classes = classes2;
52
-        } else {//教师是主监考
54
+        }
55
+        if (classids == null) {//教师是主监考或是管理员
53 56
             classids = classes.stream().map(m -> m.get("classid").toString()).collect(Collectors.joining(","));
54 57
         }
55 58
         map.put("classids", classids);

+ 1
- 1
sexam/src/main/resources/mapper/exam/ESubjectBadstudentMapper.xml Zobrazit soubor

@@ -3,7 +3,7 @@
3 3
 <mapper namespace="com.xhkjedu.sexam.mapper.exam.ESubjectBadstudentMapper">
4 4
     <!--试卷学生-->
5 5
     <select id="listStu" resultType="java.util.Map">
6
-        select es.classid,es.sstate,u.username
6
+        select es.classid,es.sstate,u.username,es.studentid
7 7
         from e_paper_student es left join t_user u on es.studentid = u.userid
8 8
         where es.esid=#{esid}
9 9
         <if test="classid!=null and classid!=0">

+ 19
- 18
sexam/src/main/resources/mapper/exam/ESubjectInvigilateMapper.xml Zobrazit soubor

@@ -23,30 +23,31 @@
23 23
     </select>
24 24
     <!--教师监考-监控列表-->
25 25
     <select id="listJkSubject" resultType="java.util.Map">
26
-        select es.esid,es.sdate,es.begintime,es.endtime,es.esstate,es.subjectname
27
-        ,eb.examname,eb.gradeid,eb.examtype,sum(ec.classnum)examnum
26
+        select es.*,count(eps.epsid)examnum
28 27
         ,count(case when eps.sstate=0 then eps.epsid else null end) wjcnum
29
-        ,count(case when eps.sstate=1 then eps.epsid else null end)jcnum
30
-        ,truncate(count(case when eps.sstate=1 then eps.epsid else null end)*100/sum(ec.classnum),2) jcrate
28
+        ,count(case when eps.sstate!=0 then eps.epsid else null end)jcnum
29
+        ,truncate(count(case when eps.sstate!=0 then eps.epsid else null end)*100/count(eps.epsid),2) jcrate
31 30
         ,count(case when eps.sstate=2 then eps.epsid else null end)tjnum
32 31
         ,count(case when eps.sstate=3 then eps.epsid else null end)qknum
32
+        from(select es.esid,es.sdate,es.begintime,es.endtime,es.esstate,es.subjectname
33
+        ,eb.examname,eb.gradeid,eb.examtype
34
+        ,(case when max(ei.majored)=0 then group_concat(distinct ei.classid) else group_concat(distinct ec.classid) end)classids
33 35
         from e_subject_invigilate ei left join e_subject es on ei.esid=es.esid
34 36
         left join e_base eb on eb.examid = es.examid
35 37
         left join e_class ec on eb.examid = ec.examid
36
-        left join e_paper_student eps on es.esid = eps.esid
37 38
         <where>
38
-        <if test="teacherid!=null and teacherid!=0">
39
-            and ei.teacherid=#{teacherid}
40
-        </if>
41
-        <if test="examid!=null and examid!=0">
42
-            and es.examid=#{examid}
43
-        </if>
44
-        <if test="esstate==1">
45
-            and concat(es.sdate,' ',es.endtime)>now()
46
-        </if>
47
-        <if test="esstate==2">
48
-            and concat(es.sdate,' ',es.endtime)&lt;=now()
49
-        </if>
39
+            <if test="teacherid!=null and teacherid!=0">
40
+                and ei.teacherid=#{teacherid}
41
+            </if>
42
+            <if test="examid!=null and examid!=0">
43
+                and es.examid=#{examid}
44
+            </if>
45
+            <if test="esstate==1">
46
+                and concat(es.sdate,' ',es.endtime)>now()
47
+            </if>
48
+            <if test="esstate==2">
49
+                and concat(es.sdate,' ',es.endtime)&lt;=now()
50
+            </if>
50 51
         </where>
51 52
         group by es.esid
52 53
         <if test="esstate==1">
@@ -54,7 +55,7 @@
54 55
         </if>
55 56
         <if test="esstate==2">
56 57
             order by es.sdate desc,es.endtime desc
57
-        </if>
58
+        </if>)es left join e_paper_student eps on es.esid = eps.esid and eps.classid in(es.classids)
58 59
     </select>
59 60
 
60 61
 </mapper>

Načítá se…
Zrušit
Uložit