Преглед изворни кода

阅卷监考设置,教师阅卷列表

tags/正式版本
雍文秀 пре 2 година
родитељ
комит
f7350db9b5

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java Прегледај датотеку

@@ -172,7 +172,7 @@ public class EBaseController {
172 172
         String examcomm = vo.getExamcomm();
173 173
         Integer createid = vo.getHandleid();
174 174
         Integer examid = vo.getExamid();
175
-        N_Utils.validation(new Object[]{examid, "考试id", 1, examcomm, "考试公告", 2, createid, "操作人id"});
175
+        N_Utils.validation(new Object[]{examid, "考试id", 1, examcomm, "考试公告", 2, createid, "操作人id", 1});
176 176
         EBaseVo exam = eBaseService.getExamStateById(examid);//根据考试id获取考试状态
177 177
         String examname = exam.getExamname();
178 178
         Integer schoolid = exam.getSchoolid();

+ 34
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/ESubjectSearchController.java Прегледај датотеку

@@ -56,7 +56,7 @@ public class ESubjectSearchController {
56 56
     public ResultVo listQuickTeacher(@RequestBody ESubjectInvigilate subject) {
57 57
         String username = subject.getCreatename();
58 58
         Integer classid = subject.getClassid();
59
-        N_Utils.validation(new Object[]{username, "姓名", 2, classid, "班级id", 1});
59
+        N_Utils.validation(new Object[]{username, "姓名", 2});
60 60
         Map list = eSubjectSearchService.listQuickTeacher(username, classid);
61 61
         return new ResultVo(0, "获取成功", list);
62 62
     }
@@ -93,4 +93,37 @@ public class ESubjectSearchController {
93 93
         Map map = eSubjectSearchService.listSubject(examid);
94 94
         return new ResultVo(0, "获取成功", map);
95 95
     }
96
+
97
+    /**
98
+     * 主监考人查找
99
+     *
100
+     * @return com.xhkjedu.vo.ResultVo
101
+     * @Param [base]
102
+     * @Author ywx
103
+     * @Date 2022/7/29 14:32
104
+     **/
105
+    @PostMapping("/list_zt")
106
+    public ResultVo listMasterTeacher(@RequestBody EBase base) {
107
+        Integer schoolid = base.getSchoolid();
108
+        N_Utils.validation(new Object[]{schoolid, "学校id", 1});
109
+        List<Map> list = eSubjectSearchService.listMasterTeacher(schoolid);
110
+        return new ResultVo(0, "获取成功", list);
111
+    }
112
+
113
+    /**
114
+     * 主监考人快捷查找
115
+     *
116
+     * @return com.xhkjedu.vo.ResultVo
117
+     * @Param [base]
118
+     * @Author ywx
119
+     * @Date 2022/7/29 15:25
120
+     **/
121
+    @PostMapping("/list_qzt")
122
+    public ResultVo listQuickMasterTeacher(@RequestBody EBase base) {
123
+        Integer schoolid = base.getSchoolid();
124
+        String username = base.getCreatename();
125
+        N_Utils.validation(new Object[]{schoolid, "学校id", 1, username, "姓名", 2});
126
+        Map list = eSubjectSearchService.listQuickMasterTeacher(schoolid, username);
127
+        return new ResultVo(0, "获取成功", list);
128
+    }
96 129
 }

+ 7
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/system/UserMapper.java Прегледај датотеку

@@ -4,6 +4,7 @@ import com.xhkjedu.sexam.vo.system.UserVo;
4 4
 import org.apache.ibatis.annotations.Param;
5 5
 
6 6
 import java.util.List;
7
+import java.util.Map;
7 8
 
8 9
 public interface UserMapper {
9 10
     //根据用户ids查找手机号
@@ -14,4 +15,10 @@ public interface UserMapper {
14 15
 
15 16
     //获取考试班级任教老师
16 17
     List<UserVo> listTeacherByClassIds(@Param("classids") String classids);
18
+
19
+    //主监考人查找
20
+    List<Map> listMasterTeacher(@Param("schoolid") Integer schoolid);
21
+
22
+    //主监考人快捷查找
23
+    List<Map> listQuickMasterTeacher(@Param("usernames") String[] usernames, @Param("schoolid") Integer schoolid);
17 24
 }

+ 36
- 4
sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectSearchService.java Прегледај датотеку

@@ -3,6 +3,7 @@ package com.xhkjedu.sexam.service.exam;
3 3
 import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
4 4
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
5 5
 import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
6
+import com.xhkjedu.sexam.mapper.system.UserMapper;
6 7
 import com.xhkjedu.sexam.vo.exam.CTeacherVo;
7 8
 import org.springframework.stereotype.Service;
8 9
 
@@ -22,18 +23,24 @@ public class ESubjectSearchService {
22 23
     private EBaseMapper eBaseMapper;
23 24
     @Resource
24 25
     private ESubjectMapper eSubjectMapper;
26
+    @Resource
27
+    private UserMapper userMapper;
25 28
 
26 29
     //查找设置
27 30
     public List<Map> listSearchTeacher(Integer examid, Integer schoolid) {
28 31
         List<Map> classes = eClassMapper.listByExamId(examid);
29 32
         String classids = classes.stream().map(c -> c.get("classid").toString()).collect(Collectors.joining(","));
30 33
         List<CTeacherVo> teachers = eClassMapper.listTeacherByClassIds(classids);//获取班级教师
31
-        String teacherids = teachers.stream().map((CTeacherVo::getTeacherid)).map(String::valueOf).distinct().collect(Collectors.joining(","));
34
+        String teacherids =
35
+                teachers.stream().map((CTeacherVo::getTeacherid)).map(String::valueOf).distinct().collect(Collectors.joining(","
36
+                ));
32 37
         List<CTeacherVo> subjects = eClassMapper.listSubjectByTeacherIds(teacherids);//获取教师科目
33 38
         String subjectids = subjects.stream().map(CTeacherVo::getSubjectid).distinct().collect(Collectors.joining("','"));
34 39
         List<CTeacherVo> subjects2 = eClassMapper.listSubjectBySubjectIds(subjectids);
35
-        Map<String, String> subjectNameMap = subjects2.stream().collect(Collectors.toMap(CTeacherVo::getSubjectid, CTeacherVo::getSubjectname));
36
-        Map<Integer, String> subjectMap = subjects.stream().collect(Collectors.toMap(CTeacherVo::getTeacherid, CTeacherVo::getSubjectid));
40
+        Map<String, String> subjectNameMap = subjects2.stream().collect(Collectors.toMap(CTeacherVo::getSubjectid,
41
+                CTeacherVo::getSubjectname));
42
+        Map<Integer, String> subjectMap = subjects.stream().collect(Collectors.toMap(CTeacherVo::getTeacherid,
43
+                CTeacherVo::getSubjectid));
37 44
         List<CTeacherVo> users = eClassMapper.listTeacherBySchoolId(schoolid);//获取学校所有教师
38 45
         for (CTeacherVo teacher : teachers) {
39 46
             CTeacherVo vo = users.stream().filter(u -> u.getTeacherid().equals(teacher.getTeacherid())).findFirst().orElse(null);
@@ -68,7 +75,8 @@ public class ESubjectSearchService {
68 75
         Map map = new HashMap();
69 76
         String[] usernames = username.split(",");
70 77
         List<Map> teachers = eClassMapper.listSearchTeacher(usernames, classid);
71
-        Map<String, Object> nameMap = teachers.stream().collect(Collectors.toMap(t -> t.get("username").toString(), t -> t.get("teacherid")));
78
+        Map<String, Object> nameMap = teachers.stream().collect(Collectors.toMap(t -> t.get("username").toString(), t -> t.get(
79
+                "teacherid")));
72 80
         StringBuilder sb = new StringBuilder();
73 81
         for (String name : usernames) {
74 82
             if (nameMap.get(name) == null) {
@@ -99,4 +107,28 @@ public class ESubjectSearchService {
99 107
         map.put("subjects", subjects);
100 108
         return map;
101 109
     }
110
+
111
+    //主监考人查找
112
+    public List<Map> listMasterTeacher(Integer schoolid) {
113
+        return userMapper.listMasterTeacher(schoolid);
114
+    }
115
+
116
+    //主监考人快捷查找
117
+    public Map listQuickMasterTeacher(Integer schoolid, String username) {
118
+        Map map = new HashMap();
119
+        String[] usernames = username.split(",");
120
+        List<Map> teachers = userMapper.listQuickMasterTeacher(usernames, schoolid);
121
+        Map<String, Object> nameMap = teachers.stream().collect(Collectors.toMap(t -> t.get("username").toString(), t -> t.get(
122
+                "teacherid")));
123
+        StringBuilder sb = new StringBuilder();
124
+        for (String name : usernames) {
125
+            if (nameMap.get(name) == null) {
126
+                sb.append(name).append(",");
127
+            }
128
+        }
129
+        map.put("teachers", teachers);//匹配的教师
130
+        String notExist = sb.toString();//未匹配的教师
131
+        map.put("notExist", notExist.substring(0, notExist.length() - 1));
132
+        return map;
133
+    }
102 134
 }

+ 4
- 1
sexam/src/main/resources/mapper/exam/EClassMapper.xml Прегледај датотеку

@@ -40,12 +40,15 @@
40 40
     </select>
41 41
     <!--班级教师查找-->
42 42
     <select id="listSearchTeacher" resultType="java.util.Map">
43
-        select ct.teacherid,u.username
43
+        select ct.teacherid,u.username,u.loginname,u.usersex,sb.subjectid
44 44
         from t_class_teacher ct left join t_user u on ct.teacherid = u.userid
45
+        left join t_teacher_powersb tp on tp.teacherid=ct.teacherid
46
+        left join t_subject_book sb on tp.lsbid = sb.lsbid
45 47
         where ct.classid=#{classid} and u.usertype=1 and u.userstate=1 and u.username in
46 48
         <foreach collection="usernames" item="username" open="(" separator="," close=")">
47 49
             #{username}
48 50
         </foreach>
51
+        group by ct.teacherid
49 52
     </select>
50 53
 
51 54
     <!--按班设置教师列表-->

+ 8
- 5
sexam/src/main/resources/mapper/paper/EPaperCorrectTeacherMapper.xml Прегледај датотеку

@@ -4,22 +4,25 @@
4 4
     <!--待阅卷列表-->
5 5
     <select id="listPending" resultType="java.util.Map">
6 6
         select a.*,eb.examname,eb.gradeid,eb.examtype,es.sdate,es.begintime,es.endtime,es.subjectname
7
-        ,truncate(count(case when ps.sstate=2 and ps.checked=2 then ps.epsid else null end)*100/
8
-                  count(case when ps.sstate=2 then ps.epsid else null end),2)pgrate
7
+        ,truncate(a.pynum*100/a.tjnum,2)pgrate
9 8
         from(select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
10 9
         ,group_concat(distinct pq.qorder order by pq.qorder)qorders,group_concat(pc.classid)classids
10
+        ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
11
+        ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
11 12
         from e_paper p left join e_paper_qtype_question pq on p.epid = pq.epid
12 13
         left join e_paper_correctclass pc on p.epid = pc.epid
14
+        left join e_paper_student_question psq on psq.epid = pc.epid and psq.classid=pc.classid and psq.qorder=pq.qorder
13 15
         where pc.teacherid=#{teacherid} and pq.ctype in(3,14,15)
14 16
         union
15 17
         select p.esid,p.epid,group_concat(distinct pq.qn order by pq.qorder)qns
16 18
         ,group_concat(distinct pq.qorder order by pq.qorder)qorders,0 classids
19
+        ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
20
+        ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
17 21
         from e_paper p left join e_paper_correctquestion pq on p.epid = pq.epid
22
+        left join e_paper_student_question psq on psq.epid = pq.epid and psq.qorder=pq.qorder
18 23
         where pq.teacherid=#{teacherid})a left join e_subject es on a.esid = es.esid
19 24
         left join e_base eb on es.examid = eb.examid
20
-        left join e_paper_student ps on a.epid=ps.epid
21
-        group by a.epid
22
-        having count(case when ps.checked!=2 then ps.epsid else null end)>0
25
+        where a.tjnum!=a.pynum group by a.epid
23 26
     </select>
24 27
     <!--已阅卷列表-->
25 28
     <select id="listMarked" resultType="java.util.Map">

+ 19
- 0
sexam/src/main/resources/mapper/system/UserMapper.xml Прегледај датотеку

@@ -22,4 +22,23 @@
22 22
         where ct.classid in(${classids}) and u.userstate=1
23 23
         group by u.userid
24 24
     </select>
25
+    <!--主监考人查找-->
26
+    <select id="listMasterTeacher" resultType="java.util.Map">
27
+        select u.userid teacherid,u.username,u.loginname,u.usersex,sb.subjectid
28
+        from t_user u left join t_teacher_powersb tp on tp.teacherid=u.userid
29
+        left join t_subject_book sb on tp.lsbid = sb.lsbid
30
+        where u.schoolid=#{schoolid} and u.usertype=1 and u.userstate=1
31
+        group by u.userid
32
+    </select>
33
+    <!--主监考人快捷查找-->
34
+    <select id="listQuickMasterTeacher" resultType="java.util.Map">
35
+        select u.userid teacherid,u.username,u.loginname,u.usersex,sb.subjectid
36
+        from t_user u left join t_teacher_powersb tp on tp.teacherid=u.userid
37
+        left join t_subject_book sb on tp.lsbid = sb.lsbid
38
+        where u.schoolid=#{schoolid} and u.usertype=1 and u.userstate=1 and u.username in
39
+        <foreach collection="usernames" item="username" open="(" separator="," close=")">
40
+            #{username}
41
+        </foreach>
42
+        group by u.userid
43
+    </select>
25 44
 </mapper>

Loading…
Откажи
Сачувај