Browse Source

监控列表

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

+ 46
- 2
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/ESubjectBadstudentController.java View File

@@ -57,7 +57,7 @@ public class ESubjectBadstudentController {
57 57
         Integer classid = invigilate.getClassid();
58 58
         Integer page = invigilate.getPage();
59 59
         Integer pageSize = invigilate.getPageSize();
60
-        N_Utils.validation(new Object[]{teacherid, "教师id", 1, page, "页码", 1, pageSize, "显示条数", 1});
60
+        N_Utils.validation(new Object[]{teacherid, "教师id", 1, esid, "考试科目id", page, "页码", 1, pageSize, "显示条数", 1});
61 61
         Map map = eSubjectBadstudentService.getJkDetail(esid, teacherid);
62 62
         String classids = map.get("classids").toString();
63 63
         PageHelper.startPage(page, pageSize);
@@ -81,7 +81,7 @@ public class ESubjectBadstudentController {
81 81
         Integer classid = invigilate.getClassid();
82 82
         Integer page = invigilate.getPage();
83 83
         Integer pageSize = invigilate.getPageSize();
84
-        N_Utils.validation(new Object[]{page, "页码", 1, pageSize, "显示条数", 1});
84
+        N_Utils.validation(new Object[]{esid, "考试科目id", page, "页码", 1, pageSize, "显示条数", 1});
85 85
         Map map = eSubjectBadstudentService.getJkDetail(esid, 0);
86 86
         String classids = map.get("classids").toString();
87 87
         PageHelper.startPage(page, pageSize);
@@ -90,4 +90,48 @@ public class ESubjectBadstudentController {
90 90
         map.put("pageResult", pageResult);
91 91
         return new ResultVo(0, "获取成功", map);
92 92
     }
93
+
94
+    /**
95
+     * 试卷学生异常记录--教师
96
+     *
97
+     * @return com.xhkjedu.vo.ResultVo
98
+     * @Param [invigilate]
99
+     * @Author ywx
100
+     * @Date 2022/8/18 9:16
101
+     **/
102
+    @PostMapping("/list_bs")
103
+    public ResultVo listBadStu(@RequestBody ESubjectInvigilate invigilate) {
104
+        Integer teacherid = invigilate.getTeacherid();
105
+        Integer esid = invigilate.getEsid();
106
+        Integer classid = invigilate.getClassid();
107
+        Integer page = invigilate.getPage();
108
+        Integer pageSize = invigilate.getPageSize();
109
+        N_Utils.validation(new Object[]{teacherid, "教师id", 1, esid, "考试科目id", 1, page, "页码", 1, pageSize, "显示条数", 1});
110
+        String classids = eSubjectBadstudentService.getClassIds(esid, teacherid);//教师监考班级ids
111
+        PageHelper.startPage(page, pageSize);
112
+        List<Map> list = eSubjectBadstudentService.listBadStu(esid, classids, classid);
113
+        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
114
+        return new ResultVo(0, "获取成功", pageResult);
115
+    }
116
+
117
+    /**
118
+     * 试卷学生异常记录--管理员
119
+     *
120
+     * @return com.xhkjedu.vo.ResultVo
121
+     * @Param [invigilate]
122
+     * @Author ywx
123
+     * @Date 2022/8/18 9:16
124
+     **/
125
+    @PostMapping("/list_gbs")
126
+    public ResultVo listGBadStu(@RequestBody ESubjectInvigilate invigilate) {
127
+        Integer esid = invigilate.getEsid();
128
+        Integer classid = invigilate.getClassid();
129
+        Integer page = invigilate.getPage();
130
+        Integer pageSize = invigilate.getPageSize();
131
+        N_Utils.validation(new Object[]{esid, "考试科目id", 1, page, "页码", 1, pageSize, "显示条数", 1});
132
+        PageHelper.startPage(page, pageSize);
133
+        List<Map> list = eSubjectBadstudentService.listBadStu(esid, null, classid);
134
+        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
135
+        return new ResultVo(0, "获取成功", pageResult);
136
+    }
93 137
 }

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

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

+ 17
- 6
sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectBadstudentService.java View File

@@ -11,7 +11,6 @@ import javax.annotation.Resource;
11 11
 import java.util.ArrayList;
12 12
 import java.util.List;
13 13
 import java.util.Map;
14
-import java.util.stream.Collectors;
15 14
 
16 15
 @Service
17 16
 public class ESubjectBadstudentService {
@@ -52,15 +51,27 @@ public class ESubjectBadstudentService {
52 51
                 classes = classes2;
53 52
             }
54 53
         }
55
-        if (classids == null) {//教师是主监考或是管理员
56
-            classids = classes.stream().map(m -> m.get("classid").toString()).collect(Collectors.joining(","));
57
-        }
58 54
         map.put("classids", classids);
59 55
         map.put("classes", classes);
60
-        Integer errnum = eSubjectBadstudentMapper.getErrNumByEsId(esid);//试卷异常次数
61
-        map.put("errnum", errnum);
62 56
         Map rate = eSubjectBadstudentMapper.getPaperRate(esid);//学生进场概况
63 57
         map.putAll(rate);
64 58
         return map;
65 59
     }
60
+
61
+    //试卷学生异常记录
62
+    public List<Map> listBadStu(Integer esid, String classids, Integer classid) {
63
+        return eSubjectBadstudentMapper.listBadStu(esid, classids, classid);
64
+    }
65
+
66
+    //教师监考班级ids
67
+    public String getClassIds(Integer esid, Integer teacherid) {
68
+        String classids = null;
69
+        if (teacherid != 0) {
70
+            Map claMap = eSubjectBadstudentMapper.getClass(esid, teacherid);//教师监考班级
71
+            if (claMap.get("majored").equals(0)) {//教师不是主监考
72
+                classids = claMap.get("classids").toString();
73
+            }
74
+        }
75
+        return classids;
76
+    }
66 77
 }

+ 14
- 5
sexam/src/main/resources/mapper/exam/ESubjectBadstudentMapper.xml View File

@@ -9,17 +9,13 @@
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">
12
+        <if test="classids!=null and classids!=''">
13 13
             and es.classid in(${classids})
14 14
         </if>
15 15
         <if test="studentname!=null and studentname!=''">
16 16
             and u.username like '%${studentname}%'
17 17
         </if>
18 18
     </select>
19
-    <!--试卷异常次数-->
20
-    <select id="getErrNumByEsId" resultType="java.lang.Integer">
21
-        select count(*) from e_subject_badstudent where esid=#{esid}
22
-    </select>
23 19
     <!--学生进场概况-->
24 20
     <select id="getPaperRate" resultType="java.util.Map">
25 21
         select count(*)examnum
@@ -34,4 +30,17 @@
34 30
         select max(majored)majored,group_concat(classid)classids
35 31
         from e_subject_invigilate where esid=#{esid} and teacherid=#{teacherid}
36 32
     </select>
33
+    <!--试卷学生异常记录-->
34
+    <select id="listBadStu" resultType="java.util.Map">
35
+        select es.classid,u.username,es.studentid,es.badtype,es.picpath,es.createtime
36
+        from e_subject_badstudent es left join t_user u on es.studentid = u.userid
37
+        where esid=#{esid}
38
+        <if test="classid!=null and classid!=0">
39
+            and es.classid=#{classid}
40
+        </if>
41
+        <if test="classids!=null and classids!=''">
42
+            and es.classid in(${classids})
43
+        </if>
44
+        order by es.esbsid desc
45
+    </select>
37 46
 </mapper>

Loading…
Cancel
Save