Browse Source

考试详情改版 阅卷设置 监考设置 考试基础信息参数校验

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

+ 34
- 2
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java View File

1
 package com.xhkjedu.sexam.controller.exam;
1
 package com.xhkjedu.sexam.controller.exam;
2
 
2
 
3
+import com.alibaba.fastjson.JSON;
3
 import com.github.pagehelper.PageHelper;
4
 import com.github.pagehelper.PageHelper;
4
 import com.github.pagehelper.PageInfo;
5
 import com.github.pagehelper.PageInfo;
5
 import com.xhkjedu.sexam.model.exam.EBase;
6
 import com.xhkjedu.sexam.model.exam.EBase;
14
 import com.xhkjedu.sexam.service.report.EReportGenerateService;
15
 import com.xhkjedu.sexam.service.report.EReportGenerateService;
15
 import com.xhkjedu.sexam.vo.exam.EBaseVo;
16
 import com.xhkjedu.sexam.vo.exam.EBaseVo;
16
 import com.xhkjedu.sexam.vo.exam.ExamVo;
17
 import com.xhkjedu.sexam.vo.exam.ExamVo;
18
+import com.xhkjedu.sexam.vo.paper.EPaperVo;
17
 import com.xhkjedu.sexam.vo.system.UserVo;
19
 import com.xhkjedu.sexam.vo.system.UserVo;
18
 import com.xhkjedu.utils.N_Utils;
20
 import com.xhkjedu.utils.N_Utils;
19
 import com.xhkjedu.utils.PageUtil;
21
 import com.xhkjedu.utils.PageUtil;
59
     public ResultVo add(@RequestBody EBase eBase) {
61
     public ResultVo add(@RequestBody EBase eBase) {
60
         if (N_Utils.isListEmpty(eBase.getClassids())) return new ResultVo(1, "考试班级不能为空");
62
         if (N_Utils.isListEmpty(eBase.getClassids())) return new ResultVo(1, "考试班级不能为空");
61
         if (N_Utils.isListEmpty(eBase.getSubjects())) return new ResultVo(1, "考试科目不能为空");
63
         if (N_Utils.isListEmpty(eBase.getSubjects())) return new ResultVo(1, "考试科目不能为空");
64
+        if ("NaN-aN-aN".equals(eBase.getExamdate())) {
65
+            return new ResultVo(1,"日期格式不正确");
66
+        }
62
         return eBaseService.save(eBase);
67
         return eBaseService.save(eBase);
63
     }
68
     }
64
 
69
 
79
         Integer createid = map.getHandleid();
84
         Integer createid = map.getHandleid();
80
         Integer examid = map.getExamid();
85
         Integer examid = map.getExamid();
81
         N_Utils.validation(new Object[]{schoolid, "学校id", 1, createid, "操作人id", 1, examid, "考试id", 1});
86
         N_Utils.validation(new Object[]{schoolid, "学校id", 1, createid, "操作人id", 1, examid, "考试id", 1});
82
-        Integer examstate = eBaseService.getExamState(examid);
83
-        if (2 <= examstate) return new ResultVo(1, "考试已结束禁止操作");
87
+        EBaseVo vo = eBaseService.getExamStateAndMode(examid);
88
+        if (2 <= vo.getExamstate()) return new ResultVo(1, "考试已结束禁止操作");
89
+
90
+        if (JSON.toJSONString(subjects).contains("NaN-aN-aN")) {
91
+            return new ResultVo(1,"日期格式不正确");
92
+        }
93
+        if (vo.getExammode() == 1) {//线上的考试必须有时间
94
+            for (ESubject es : subjects) {
95
+                if (N_Utils.isEmpty(es.getSdate()) || N_Utils.isEmpty(es.getBegintime()) || N_Utils.isEmpty(es.getEndtime())) {
96
+                    return new ResultVo(1, "考试时间不能为空");
97
+                }
98
+            }
99
+        }
84
         List<TNotice> noticeList = new ArrayList<>();
100
         List<TNotice> noticeList = new ArrayList<>();
85
         List<TMsg> msgList = new ArrayList<>();
101
         List<TMsg> msgList = new ArrayList<>();
86
         String examname = eBaseService.getNameByExamId(examid);
102
         String examname = eBaseService.getNameByExamId(examid);
190
         EBaseVo exam = eBaseService.getExamStateById(examid);//根据考试id获取考试状态
206
         EBaseVo exam = eBaseService.getExamStateById(examid);//根据考试id获取考试状态
191
         String examname = exam.getExamname();
207
         String examname = exam.getExamname();
192
         Integer schoolid = exam.getSchoolid();
208
         Integer schoolid = exam.getSchoolid();
209
+        if (exam.getExammode() == 1 && exam.getBegintime() == 0) return new ResultVo(1, "还有考试试卷未设置时间");
193
         if (exam.getWwcnum() != 0) return new ResultVo(1, "还有考试试卷未设置完成");
210
         if (exam.getWwcnum() != 0) return new ResultVo(1, "还有考试试卷未设置完成");
194
         if (exam.getAnswered() == 0) return new ResultVo(1, "还有考试试卷未设置正确答案");
211
         if (exam.getAnswered() == 0) return new ResultVo(1, "还有考试试卷未设置正确答案");
195
         if (exam.getExamstate() != 0) return new ResultVo(0, "发布成功");
212
         if (exam.getExamstate() != 0) return new ResultVo(0, "发布成功");
529
         return new ResultVo(0, "获取考试未批阅试题数量成功", num);
546
         return new ResultVo(0, "获取考试未批阅试题数量成功", num);
530
     }
547
     }
531
 
548
 
549
+    /*
550
+     * 缺考详情
551
+     * @Param [vo]
552
+     * @Author ywx
553
+     * @Date 2022/11/9 17:24
554
+     * @return com.xhkjedu.vo.ResultVo
555
+     **/
556
+    @PostMapping("/list_qkd")
557
+    public ResultVo listQkDetail(@RequestBody EPaperVo vo) {
558
+        Integer epid = vo.getEpid();
559
+        N_Utils.validation(new Object[]{epid, "试卷id", 1});
560
+        List<Map> list = eBaseService.listQkDetail(epid);
561
+        return new ResultVo(0, "获取缺考详情成功", list);
562
+    }
563
+
532
 }
564
 }

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

57
 
57
 
58
     //考试未批阅试题数量
58
     //考试未批阅试题数量
59
     Integer getNoCheckNum(@Param("examid") Integer examid);
59
     Integer getNoCheckNum(@Param("examid") Integer examid);
60
+
61
+    //根据考试id获取状态和模式
62
+    EBaseVo getExamStateAndMode(@Param("examid") Integer examid);
60
 }
63
 }

+ 4
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/ESubjectInvigilateMapper.java View File

2
 
2
 
3
 import com.xhkjedu.sexam.base.TkMapper;
3
 import com.xhkjedu.sexam.base.TkMapper;
4
 import com.xhkjedu.sexam.model.exam.ESubjectInvigilate;
4
 import com.xhkjedu.sexam.model.exam.ESubjectInvigilate;
5
+import com.xhkjedu.sexam.vo.exam.EITeacherVo;
5
 import com.xhkjedu.sexam.vo.paper.EPTeacherVo;
6
 import com.xhkjedu.sexam.vo.paper.EPTeacherVo;
6
 import org.apache.ibatis.annotations.Param;
7
 import org.apache.ibatis.annotations.Param;
7
 
8
 
24
 
25
 
25
     //缺考学生列表
26
     //缺考学生列表
26
     List<Map> listMissStu(@Param("vo") EPTeacherVo vo);
27
     List<Map> listMissStu(@Param("vo") EPTeacherVo vo);
28
+
29
+    //监考教师
30
+    List<EITeacherVo> listUserByEsIds(@Param("esids") String esids);
27
 }
31
 }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EPaperStudentMapper.java View File

102
 
102
 
103
     //根据试卷学生id获取考试状态和考试科目状态和时间
103
     //根据试卷学生id获取考试状态和考试科目状态和时间
104
     Map getExamStateSubjectStateByEpsid(@Param("epsid") Integer epsid);
104
     Map getExamStateSubjectStateByEpsid(@Param("epsid") Integer epsid);
105
+
106
+    //缺考详情
107
+    List<Map> listQkDetail(@Param("epid") Integer epid);
105
 }
108
 }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/system/UserMapper.java View File

30
 
30
 
31
     //根据用户id获取用户类型
31
     //根据用户id获取用户类型
32
     Integer getUsertypeByUserid(@Param("userid")Integer userid);
32
     Integer getUsertypeByUserid(@Param("userid")Integer userid);
33
+
34
+    //根据用户ids查找用户
35
+    List<Map> listByUserIds(@Param("userids") String userids);
33
 }
36
 }

+ 18
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java View File

432
     public Integer getNoCheckNum(Integer examid) {
432
     public Integer getNoCheckNum(Integer examid) {
433
         return eBaseMapper.getNoCheckNum(examid);
433
         return eBaseMapper.getNoCheckNum(examid);
434
     }
434
     }
435
+
436
+    //根据考试id获取状态和模式
437
+    public EBaseVo getExamStateAndMode(Integer examid) {
438
+        return eBaseMapper.getExamStateAndMode(examid);
439
+    }
440
+
441
+    //缺考详情
442
+    public List<Map> listQkDetail(Integer epid) {
443
+        List<Map> list = ePaperStudentMapper.listQkDetail(epid);
444
+        for (Map c : list) {
445
+            List<Map> students=new ArrayList<>();
446
+            String userids = c.get("userids").toString();
447
+            if(N_Utils.isNotEmpty(userids)) students = userMapper.listByUserIds(userids);
448
+            c.put("students", students);
449
+            c.remove("userids");
450
+        }
451
+        return list;
452
+    }
435
 }
453
 }

+ 33
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectInvigilateService.java View File

1
 package com.xhkjedu.sexam.service.exam;
1
 package com.xhkjedu.sexam.service.exam;
2
 
2
 
3
 import com.alibaba.fastjson.JSON;
3
 import com.alibaba.fastjson.JSON;
4
+import com.alibaba.fastjson.serializer.SerializerFeature;
4
 import com.xhkjedu.config.MissingParametersException;
5
 import com.xhkjedu.config.MissingParametersException;
5
 import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
6
 import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
6
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
7
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
7
 import com.xhkjedu.sexam.mapper.exam.ESubjectInvigilateMapper;
8
 import com.xhkjedu.sexam.mapper.exam.ESubjectInvigilateMapper;
8
 import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
9
 import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
9
 import com.xhkjedu.sexam.model.exam.ESubjectInvigilate;
10
 import com.xhkjedu.sexam.model.exam.ESubjectInvigilate;
11
+import com.xhkjedu.sexam.vo.exam.EITeacherVo;
10
 import com.xhkjedu.sexam.vo.paper.EPTeacherVo;
12
 import com.xhkjedu.sexam.vo.paper.EPTeacherVo;
11
 import com.xhkjedu.utils.N_Utils;
13
 import com.xhkjedu.utils.N_Utils;
12
 import org.springframework.stereotype.Service;
14
 import org.springframework.stereotype.Service;
17
 import java.util.HashMap;
19
 import java.util.HashMap;
18
 import java.util.List;
20
 import java.util.List;
19
 import java.util.Map;
21
 import java.util.Map;
22
+import java.util.stream.Collectors;
20
 
23
 
21
 @Service
24
 @Service
22
 public class ESubjectInvigilateService {
25
 public class ESubjectInvigilateService {
49
     public Map listSubject(Integer examid) {
52
     public Map listSubject(Integer examid) {
50
         Map map = eBaseMapper.findById(examid);
53
         Map map = eBaseMapper.findById(examid);
51
         List<Map> subjects = eSubjectInvigilateMapper.listSubject(examid);//监考设置列表
54
         List<Map> subjects = eSubjectInvigilateMapper.listSubject(examid);//监考设置列表
55
+        String esids = subjects.stream().map(s -> s.get("esid").toString()).collect(Collectors.joining(","));
56
+        List<EITeacherVo> users = eSubjectInvigilateMapper.listUserByEsIds(esids);
57
+        List<Map> classes = eClassMapper.listByExamId(examid);//考试班级
58
+        for (Map s : subjects) {
59
+            Integer esid = (Integer) s.get("esid");
60
+            if (N_Utils.isListEmpty(users)) users = new ArrayList<>();
61
+            String majorname = users.stream().filter(u -> esid.equals(u.getEsid()) && u.getMajored() == 1)
62
+                    .map(u -> u.getUsername()).distinct().collect(Collectors.joining("、"));
63
+            s.put("majorname", majorname);
64
+            long einum = users.stream().filter(u -> !N_Utils.isEmptyInteger(u.getClassid()))
65
+                    .map(u -> u.getClassid()).distinct().count();
66
+            s.put("einum", einum);
67
+            for (Map c : classes) {
68
+                Integer classid = (Integer) c.get("classid");
69
+                List<Map> teachers=new ArrayList<>();
70
+                for (EITeacherVo u : users) {
71
+                    if(esid.equals(u.getEsid())&& (1 == u.getMajored() || classid.equals(u.getClassid()))){
72
+                        Map t=new HashMap();
73
+                        t.put("teacherid",u.getTeacherid());
74
+                        t.put("username",u.getUsername());
75
+                        t.put("loginname",u.getLoginname());
76
+                        teachers.add(t);
77
+                    }
78
+                }
79
+                c.put("teachers", teachers.stream().distinct().collect(Collectors.toList()));
80
+            }
81
+            //关闭引用检测,避免循环给classes赋值出现"$ref":"$[0]"现象
82
+            String str = JSON.toJSONString(classes, SerializerFeature.DisableCircularReferenceDetect);
83
+            s.put("classes", JSON.parseArray(str, Map.class));
84
+        }
52
         map.put("subjects", subjects);
85
         map.put("subjects", subjects);
53
         return map;
86
         return map;
54
     }
87
     }

+ 31
- 5
sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectSearchService.java View File

4
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
4
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
5
 import com.xhkjedu.sexam.mapper.exam.EClassStudentMapper;
5
 import com.xhkjedu.sexam.mapper.exam.EClassStudentMapper;
6
 import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
6
 import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
7
+import com.xhkjedu.sexam.mapper.paper.EPaperCorrectclassMapper;
8
+import com.xhkjedu.sexam.mapper.paper.EPaperCorrectquestionMapper;
7
 import com.xhkjedu.sexam.mapper.system.UserMapper;
9
 import com.xhkjedu.sexam.mapper.system.UserMapper;
8
 import com.xhkjedu.sexam.vo.exam.CTeacherVo;
10
 import com.xhkjedu.sexam.vo.exam.CTeacherVo;
9
 import com.xhkjedu.utils.N_Utils;
11
 import com.xhkjedu.utils.N_Utils;
10
 import org.springframework.stereotype.Service;
12
 import org.springframework.stereotype.Service;
11
 
13
 
12
 import javax.annotation.Resource;
14
 import javax.annotation.Resource;
13
-import java.util.ArrayList;
14
-import java.util.HashMap;
15
-import java.util.LinkedHashMap;
16
-import java.util.List;
17
-import java.util.Map;
15
+import java.util.*;
18
 import java.util.stream.Collectors;
16
 import java.util.stream.Collectors;
19
 
17
 
20
 @Service
18
 @Service
29
     private UserMapper userMapper;
27
     private UserMapper userMapper;
30
     @Resource
28
     @Resource
31
     private EClassStudentMapper eClassStudentMapper;
29
     private EClassStudentMapper eClassStudentMapper;
30
+    @Resource
31
+    private EPaperCorrectclassMapper ePaperCorrectclassMapper;
32
+    @Resource
33
+    private EPaperCorrectquestionMapper ePaperCorrectquestionMapper;
32
 
34
 
33
     //查找设置
35
     //查找设置
34
     public List<Map> listSearchTeacher(Integer examid, Integer schoolid) {
36
     public List<Map> listSearchTeacher(Integer examid, Integer schoolid) {
110
     public Map listSubject(Integer examid) {
112
     public Map listSubject(Integer examid) {
111
         Map map = eBaseMapper.findById(examid);
113
         Map map = eBaseMapper.findById(examid);
112
         List<Map> subjects = eSubjectMapper.listSubjectCSet(examid);//考试科目阅卷设置列表
114
         List<Map> subjects = eSubjectMapper.listSubjectCSet(examid);//考试科目阅卷设置列表
115
+        for (Map s : subjects) {
116
+            Integer correcttype = (Integer) s.get("correcttype");
117
+            Integer epid = (Integer) s.get("epid");
118
+            List<Map> list=new ArrayList<>();
119
+            if (correcttype == 1) {
120
+                list = eClassMapper.listByExamId(examid);//考试班级
121
+                List<Map> users = ePaperCorrectclassMapper.listByEpId(epid);//试卷批阅人
122
+                for (Map m : list) {
123
+                    List<Map> teachers = users.stream().filter(u -> u.get("classid").equals(m.get("classid")))
124
+                            .sorted(Comparator.comparing(t->t.get("username").toString())).collect(Collectors.toList());
125
+                    m.put("teachers", teachers);
126
+                }
127
+            } else if (correcttype == 2) {
128
+                list = ePaperCorrectquestionMapper.listQnByEpId(epid);
129
+                List<Map> users = ePaperCorrectquestionMapper.listByEpId(epid);//试卷批阅人
130
+                for (Map q : list) {
131
+                    Object qorder = q.get("qorder");
132
+                    List<Map> teachers = users.stream().filter(u -> u.get("qorder").equals(qorder))
133
+                            .sorted(Comparator.comparing(t->t.get("username").toString())).collect(Collectors.toList());
134
+                    q.put("teachers", teachers);
135
+                }
136
+            }
137
+            s.put("correctList", list);
138
+        }
113
         map.put("subjects", subjects);
139
         map.put("subjects", subjects);
114
         return map;
140
         return map;
115
     }
141
     }

+ 20
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/exam/EITeacherVo.java View File

1
+package com.xhkjedu.sexam.vo.exam;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * 
7
+ * @Param 监考教师
8
+ * @Author ywx
9
+ * @Date 2022/11/9 16:21
10
+ * @return 
11
+ **/
12
+@Data
13
+public class EITeacherVo {
14
+    private Integer esid;//考试科目id
15
+    private Integer classid;//班级id
16
+    private Integer majored;//是否是主监考0不是1是
17
+    private Integer teacherid;//教师id
18
+    private String username;//姓名
19
+    private String loginname;//账号
20
+}

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

122
         select count(*) from e_paper_student_question
122
         select count(*) from e_paper_student_question
123
         where examid=#{examid} and answered=1 and checked!=2
123
         where examid=#{examid} and answered=1 and checked!=2
124
     </select>
124
     </select>
125
+    <!--根据考试id获取状态和模式-->
126
+    <select id="getExamStateAndMode" resultType="com.xhkjedu.sexam.vo.exam.EBaseVo">
127
+        select eb.examstate,eb.exammode
128
+        from e_base eb where eb.examid=#{examid}
129
+    </select>
125
 </mapper>
130
 </mapper>

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

7
     </delete>
7
     </delete>
8
     <!--监考设置列表-->
8
     <!--监考设置列表-->
9
     <select id="listSubject" resultType="java.util.Map">
9
     <select id="listSubject" resultType="java.util.Map">
10
-        select s.*,ifnull(ep.pnum,0)pnum,ifnull(ep.pscore,0)pscore,ep.correcttype
11
-        from (select s.esid,s.subjectid,s.sdate,s.begintime,s.endtime,s.esstate,s.subjectname
12
-        ,group_concat(u.username separator '、')majorname
13
-        ,count(DISTINCT ei.classid) einum
14
-        from e_subject s left join e_subject_invigilate ei on ei.esid=s.esid
15
-        left join t_user u on u.userid=ei.teacherid and ei.majored=1
16
-        where s.examid=#{examid} group by s.esid)s left join e_paper ep on s.esid = ep.esid
10
+        select s.esid,s.subjectid,s.sdate,s.begintime,s.endtime,s.esstate,s.subjectname
11
+        ,ifnull(ep.pnum,0)pnum,ifnull(ep.pscore,0)pscore,ep.correcttype
12
+        from e_subject s left join e_paper ep on s.esid = ep.esid
13
+        where s.examid=#{examid} group by s.esid
17
     </select>
14
     </select>
18
     <!--考试监考人-->
15
     <!--考试监考人-->
19
     <select id="listByEsId" resultType="java.util.Map">
16
     <select id="listByEsId" resultType="java.util.Map">
64
         select eps.studentid,u.username,eps.sstate
61
         select eps.studentid,u.username,eps.sstate
65
         from e_paper_student eps  left join t_user u on eps.studentid = u.userid
62
         from e_paper_student eps  left join t_user u on eps.studentid = u.userid
66
         where eps.esid=#{vo.esid} and eps.sstate in(0,3) and eps.classid in(${vo.classids})
63
         where eps.esid=#{vo.esid} and eps.sstate in(0,3) and eps.classid in(${vo.classids})
67
-        order by convert(u.username using gbk)
64
+        order by convert(u.username using gbk),u.userid
65
+    </select>
66
+    <!--考试监考人-->
67
+    <select id="listUserByEsIds" resultType="com.xhkjedu.sexam.vo.exam.EITeacherVo">
68
+        select ei.esid,ei.classid,ei.majored,ei.teacherid,u.username,u.loginname
69
+        from e_subject_invigilate ei left join t_user u on ei.teacherid = u.userid
70
+        where ei.esid in(${esids}) order by convert(u.username using gbk),u.userid
68
     </select>
71
     </select>
69
 </mapper>
72
 </mapper>

+ 36
- 4
sexam/src/main/resources/mapper/exam/ESubjectMapper.xml View File

21
     </update>
21
     </update>
22
     <!--考试科目列表-->
22
     <!--考试科目列表-->
23
     <select id="listSubject" resultType="java.util.Map">
23
     <select id="listSubject" resultType="java.util.Map">
24
-        select es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.teacherid,u.username
25
-        from e_subject es left join t_user u on es.teacherid=u.userid
24
+        select es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime
25
+        ,(case when es.esstate!=0 then ep.handleid else es.teacherid end)teacherid
26
+        ,(select u.username from t_user u where u.userid=
27
+        (case when es.esstate!=0 then ep.handleid else ifnull(es.teacherid,0) end))username
28
+        from e_subject es left join e_paper ep on es.esid = ep.esid
26
         where examid=#{examid} order by es.esid
29
         where examid=#{examid} order by es.esid
27
     </select>
30
     </select>
28
     <!--根据考试科目id获取考试id-->
31
     <!--根据考试科目id获取考试id-->
30
         select examid from e_subject where esid=#{esid} limit 1
33
         select examid from e_subject where esid=#{esid} limit 1
31
     </select>
34
     </select>
32
     <!--考试科目设置列表-->
35
     <!--考试科目设置列表-->
33
-    <select id="listSubjectSet" resultType="java.util.Map">
36
+    <resultMap id="subjectResult" type="java.util.Map">
37
+        <collection property="yjteachers" ofType="java.util.Map" javaType="java.util.List"
38
+                    select="listYjTeacher" column="epid=epid,correcttype=correcttype">
39
+        </collection>
40
+        <collection property="jkteachers" ofType="java.util.Map" javaType="java.util.List"
41
+                    select="listJkTeacher" column="esid=esid">
42
+        </collection>
43
+    </resultMap>
44
+    <select id="listYjTeacher" resultType="java.util.Map">
45
+        <if test="correcttype==2">
46
+            select u.username,u.loginname
47
+            from t_user u where u.userid in(select distinct epc.teacherid
48
+            from e_paper_correctquestion epc where epc.epid=#{epid})
49
+            order by convert(u.username using gbk),u.userid
50
+        </if>
51
+        <if test="correcttype!=2">
52
+            select u.username,u.loginname
53
+            from t_user u where u.userid in(select distinct epc.teacherid
54
+            from e_paper_correctclass epc where epc.epid=#{epid})
55
+            order by convert(u.username using gbk),u.userid
56
+        </if>
57
+    </select>
58
+    <select id="listJkTeacher" resultType="java.util.Map">
59
+        select u.username,u.loginname
60
+        from t_user u where u.userid in(select distinct ei.teacherid
61
+        from e_subject_invigilate ei where ei.esid=#{esid})
62
+        order by convert(u.username using gbk),u.userid
63
+    </select>
64
+    <select id="listSubjectSet" resultMap="subjectResult">
34
         select es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.esstate
65
         select es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.esstate
35
         ,ep.correcttype,es.esid,ep.epid,ep.ptype
66
         ,ep.correcttype,es.esid,ep.epid,ep.ptype
36
-        ,(select count(distinct ei.teacherid) from e_subject_invigilate ei where ei.esid=es.esid)jkjsnum
67
+        ,(select u.username from t_user u where u.userid=
68
+        (case when es.esstate!=0 then ep.handleid else ifnull(es.teacherid,0) end))cjteacher
37
         ,count(distinct case when eps.sstate=3 then eps.epsid else null end)qknum
69
         ,count(distinct case when eps.sstate=3 then eps.epsid else null end)qknum
38
         ,count(distinct case when eps.sstate=2 then eps.epsid else null end)tjnum
70
         ,count(distinct case when eps.sstate=2 then eps.epsid else null end)tjnum
39
         ,ifnull(truncate(count(case when psq.answered=1 AND psq.checked=2 then psq.epsqid else null end)*100/
71
         ,ifnull(truncate(count(case when psq.answered=1 AND psq.checked=2 then psq.epsqid else null end)*100/

+ 9
- 0
sexam/src/main/resources/mapper/paperstudent/EPaperStudentMapper.xml View File

338
         left join e_base b on b.examid = eps.examid left join e_subject s on eps.esid=s.esid
338
         left join e_base b on b.examid = eps.examid left join e_subject s on eps.esid=s.esid
339
         where eps.epsid=#{epsid}
339
         where eps.epsid=#{epsid}
340
     </select>
340
     </select>
341
+    <!--缺考详情-->
342
+    <select id="listQkDetail" resultType="java.util.Map">
343
+        select ec.classid,ec.classname,ec.classnum
344
+        ,count(distinct case when eps.sstate=3 then eps.epsid else null end)qknum
345
+        ,group_concat(case when eps.sstate=3 then eps.studentid else null end)userids
346
+        ,truncate(count(distinct case when eps.sstate=3 then eps.epsid else null end)*100/count(*),2)qkrate
347
+        from e_paper_student eps left join e_class ec on eps.examid=ec.examid and eps.classid=ec.classid
348
+        where eps.epid=#{epid} group by eps.classid order by ec.ecid
349
+    </select>
341
 </mapper>
350
 </mapper>

+ 6
- 0
sexam/src/main/resources/mapper/system/UserMapper.xml View File

58
     <select id="getUsertypeByUserid" resultType="java.lang.Integer">
58
     <select id="getUsertypeByUserid" resultType="java.lang.Integer">
59
         select usertype from t_user where userid=#{userid}
59
         select usertype from t_user where userid=#{userid}
60
     </select>
60
     </select>
61
+    <!--根据用户ids查找用户-->
62
+    <select id="listByUserIds" resultType="java.util.Map">
63
+        select u.username,u.loginname
64
+        from t_user u where u.userid in(${userids})
65
+        order by convert(u.username using gbk),u.userid
66
+    </select>
61
 </mapper>
67
 </mapper>

Loading…
Cancel
Save