Bladeren bron

实时监控

tags/正式版本
雍文秀 2 jaren geleden
bovenliggende
commit
f5b5df00d8

+ 12
- 10
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/ESubjectBadstudentController.java Bestand weergeven

@@ -3,6 +3,7 @@ package com.xhkjedu.sexam.controller.exam;
3 3
 import com.github.pagehelper.PageHelper;
4 4
 import com.github.pagehelper.PageInfo;
5 5
 import com.xhkjedu.sexam.model.exam.ESubjectBadstudent;
6
+import com.xhkjedu.sexam.model.exam.ESubjectInvigilate;
6 7
 import com.xhkjedu.sexam.service.exam.ESubjectBadstudentService;
7 8
 import com.xhkjedu.utils.N_Utils;
8 9
 import com.xhkjedu.utils.PageUtil;
@@ -45,22 +46,23 @@ public class ESubjectBadstudentController {
45 46
      * 实时监控
46 47
      *
47 48
      * @return com.xhkjedu.vo.ResultVo
48
-     * @Param [badstudent]
49
+     * @Param [invigilate]
49 50
      * @Author ywx
50 51
      * @Date 2022/8/17 11:44
51 52
      **/
52 53
     @PostMapping("/list_sjk")
53
-    public ResultVo listJk(@RequestBody ESubjectBadstudent badstudent) {
54
-        Integer examid = badstudent.getExamid();
55
-        Integer esid = badstudent.getEsid();
56
-        Integer classid = badstudent.getClassid();
57
-        Integer page = badstudent.getPage();
58
-        Integer pageSize = badstudent.getPageSize();
59
-        N_Utils.validation(new Object[]{examid, "考试id", 1, page, "页码", 1, pageSize, "显示条数", 1});
54
+    public ResultVo listJk(@RequestBody ESubjectInvigilate invigilate) {
55
+        Integer teacherid = invigilate.getTeacherid();
56
+        Integer esid = invigilate.getEsid();
57
+        Integer classid = invigilate.getClassid();
58
+        Integer page = invigilate.getPage();
59
+        Integer pageSize = invigilate.getPageSize();
60
+        N_Utils.validation(new Object[]{teacherid, "教师id", 1, page, "页码", 1, pageSize, "显示条数", 1});
61
+        Map map = eSubjectBadstudentService.getJkDetail(esid, teacherid);
62
+        String classids = map.get("classids").toString();
60 63
         PageHelper.startPage(page, pageSize);
61
-        List<Map> list = eSubjectBadstudentService.listStu(esid, classid, badstudent.getCreatename());
64
+        List<Map> list = eSubjectBadstudentService.listStu(esid, classids, classid, invigilate.getCreatename());
62 65
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
63
-        Map map = eSubjectBadstudentService.getJkDetail(examid, esid);
64 66
         map.put("pageResult", pageResult);
65 67
         return new ResultVo(0, "获取成功", map);
66 68
     }

+ 6
- 1
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/ESubjectBadstudentMapper.java Bestand weergeven

@@ -9,10 +9,15 @@ import java.util.Map;
9 9
 
10 10
 public interface ESubjectBadstudentMapper extends TkMapper<ESubjectBadstudent> {
11 11
     //试卷学生
12
-    List<Map> listStu(@Param("esid") Integer esid, @Param("classid") Integer classid, @Param("studentname") String studentname);
12
+    List<Map> listStu(@Param("esid") Integer esid, @Param("classids") String classids, @Param("classid") Integer classid,
13
+                      @Param("studentname") String studentname);
13 14
 
14 15
     //试卷异常次数
15 16
     Integer getErrNumByEsId(@Param("esid") Integer esid);
16 17
 
18
+    //学生进场概况
17 19
     Map getPaperRate(@Param("esid") Integer esid);
20
+
21
+    //教师监考班级
22
+    Map getClass(@Param("esid") Integer esid, @Param("teacherid") Integer teacherid);
18 23
 }

+ 26
- 8
sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectBadstudentService.java Bestand weergeven

@@ -1,22 +1,24 @@
1 1
 package com.xhkjedu.sexam.service.exam;
2 2
 
3
-import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
4 3
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
5 4
 import com.xhkjedu.sexam.mapper.exam.ESubjectBadstudentMapper;
5
+import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
6 6
 import com.xhkjedu.sexam.model.exam.ESubjectBadstudent;
7 7
 import com.xhkjedu.utils.N_Utils;
8 8
 import org.springframework.stereotype.Service;
9 9
 
10 10
 import javax.annotation.Resource;
11
+import java.util.ArrayList;
11 12
 import java.util.List;
12 13
 import java.util.Map;
14
+import java.util.stream.Collectors;
13 15
 
14 16
 @Service
15 17
 public class ESubjectBadstudentService {
16 18
     @Resource
17 19
     private ESubjectBadstudentMapper eSubjectBadstudentMapper;
18 20
     @Resource
19
-    private EBaseMapper eBaseMapper;
21
+    private ESubjectMapper eSubjectMapper;
20 22
     @Resource
21 23
     private EClassMapper eClassMapper;
22 24
 
@@ -27,18 +29,34 @@ public class ESubjectBadstudentService {
27 29
     }
28 30
 
29 31
     //试卷学生
30
-    public List<Map> listStu(Integer esid, Integer classid, String studentname) {
31
-        List<Map> students = eSubjectBadstudentMapper.listStu(esid, classid, studentname);
32
+    public List<Map> listStu(Integer esid, String classids, Integer classid, String studentname) {
33
+        List<Map> students = eSubjectBadstudentMapper.listStu(esid, classids, classid, studentname);
32 34
         return students;
33 35
     }
34 36
 
35
-    public Map getJkDetail(Integer examid, Integer esid) {
36
-        Map map = eBaseMapper.findById(examid);
37
-        List<Map> classes = eClassMapper.listByExamId(examid);
37
+    //监控详情
38
+    public Map getJkDetail(Integer esid, Integer teacherid) {
39
+        Map map = eSubjectMapper.getESubjectByEsId(esid);//考试科目基本信息
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);
50
+            }
51
+            classes = classes2;
52
+        } else {//教师是主监考
53
+            classids = classes.stream().map(m -> m.get("classid").toString()).collect(Collectors.joining(","));
54
+        }
55
+        map.put("classids", classids);
38 56
         map.put("classes", classes);
39 57
         Integer errnum = eSubjectBadstudentMapper.getErrNumByEsId(esid);//试卷异常次数
40 58
         map.put("errnum", errnum);
41
-        Map rate = eSubjectBadstudentMapper.getPaperRate(esid);
59
+        Map rate = eSubjectBadstudentMapper.getPaperRate(esid);//学生进场概况
42 60
         map.putAll(rate);
43 61
         return map;
44 62
     }

+ 9
- 0
sexam/src/main/resources/mapper/exam/ESubjectBadstudentMapper.xml Bestand weergeven

@@ -9,6 +9,9 @@
9 9
         <if test="classid!=null and classid!=0">
10 10
             and es.classid=#{classid}
11 11
         </if>
12
+        <if test="classid==null or classid==0">
13
+            and es.classid in(${classids})
14
+        </if>
12 15
         <if test="studentname!=null and studentname!=''">
13 16
             and u.username like '%${studentname}%'
14 17
         </if>
@@ -17,6 +20,7 @@
17 20
     <select id="getErrNumByEsId" resultType="java.lang.Integer">
18 21
         select count(*) from e_subject_badstudent where esid=#{esid}
19 22
     </select>
23
+    <!--学生进场概况-->
20 24
     <select id="getPaperRate" resultType="java.util.Map">
21 25
         select count(*)examnum
22 26
              ,count(case when sstate!=0 then epsid else null end)jcnum
@@ -25,4 +29,9 @@
25 29
              ,truncate(count(case when sstate!=0 then epsid else null end)*100/count(*),2)jcrate
26 30
         from e_paper_student where esid=#{esid}
27 31
     </select>
32
+    <!--教师监考班级-->
33
+    <select id="getClass" resultType="java.util.Map">
34
+        select max(majored)majored,group_concat(classid)classids
35
+        from e_subject_invigilate where esid=#{esid} and teacherid=#{teacherid}
36
+    </select>
28 37
 </mapper>

+ 3
- 2
sexam/src/main/resources/mapper/exam/ESubjectInvigilateMapper.xml Bestand weergeven

@@ -30,12 +30,13 @@
30 30
         ,truncate(count(case when eps.sstate=1 then eps.epsid else null end)*100/sum(ec.classnum),2) jcrate
31 31
         ,count(case when eps.sstate=2 then eps.epsid else null end)tjnum
32 32
         ,count(case when eps.sstate=3 then eps.epsid else null end)qknum
33
-        from e_subject es left join e_base eb on eb.examid = es.examid
33
+        from e_subject_invigilate ei left join e_subject es on ei.esid=es.esid
34
+        left join e_base eb on eb.examid = es.examid
34 35
         left join e_class ec on eb.examid = ec.examid
35 36
         left join e_paper_student eps on es.esid = eps.esid
36 37
         <where>
37 38
         <if test="teacherid!=null and teacherid!=0">
38
-            and es.teacherid=#{teacherid}
39
+            and ei.teacherid=#{teacherid}
39 40
         </if>
40 41
         <if test="examid!=null and examid!=0">
41 42
             and es.examid=#{examid}

+ 2
- 1
sexam/src/main/resources/mapper/exam/ESubjectMapper.xml Bestand weergeven

@@ -53,7 +53,8 @@
53 53
     </select>
54 54
     <!--根据考试科目id获取考试科目基本信息-->
55 55
     <select id="getESubjectByEsId" resultType="java.util.Map">
56
-        select es.sdate,es.begintime,es.endtime,eb.examname,eb.schoolid
56
+        select es.sdate,es.begintime,es.endtime,es.subjectname
57
+        ,eb.examname,eb.schoolid,eb.examid,eb.gradeid,eb.examtype
57 58
         from e_subject es left join e_base eb on es.examid = eb.examid
58 59
         where es.esid=#{esid}
59 60
     </select>

+ 1
- 1
sexam/src/main/resources/mapper/paperstudent/EScanerrorMapper.xml Bestand weergeven

@@ -3,7 +3,7 @@
3 3
 <mapper namespace="com.xhkjedu.sexam.mapper.paperstudent.EScanerrorMapper">
4 4
     <!--试卷扫描出错列表-->
5 5
     <select id="listByBatchIds" resultType="com.xhkjedu.sexam.model.paperstudent.EScanerror">
6
-        select serrorid, batchid, errortype, pagenum, stupic, errorjson, createtime
6
+        select serrorid, batchid, errortype, pagenum, stupic, errorstate, errorjson, createtime
7 7
         from e_scanerror where batchid in (${batchids})
8 8
     </select>
9 9
     <!--批量标记待处理的扫描异常为已处理-->

Laden…
Annuleren
Opslaan