Browse Source

监考设置列表返回未设置监考人班级数量 通知、短信不发送

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

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

35
 
35
 
36
     //按班设置教师列表
36
     //按班设置教师列表
37
     List<Map> listClassTeacher(@Param("classids") String classids, @Param("subjectid") String subjectid);
37
     List<Map> listClassTeacher(@Param("classids") String classids, @Param("subjectid") String subjectid);
38
+
39
+    //获取考试班级数量
40
+    Integer getClassNumByExamId(@Param("examid") Integer examid);
38
 }
41
 }

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

12
     void delByEsId(@Param("esid") Integer esid);
12
     void delByEsId(@Param("esid") Integer esid);
13
 
13
 
14
     //监考设置列表
14
     //监考设置列表
15
-    List<Map> listSubject(@Param("examid") Integer examid);
15
+    List<Map> listSubject(@Param("examid") Integer examid, @Param("classnum") Integer classnum);
16
 
16
 
17
     //考试监考人
17
     //考试监考人
18
     List<Map> listByEsId(@Param("esid") Integer esid);
18
     List<Map> listByEsId(@Param("esid") Integer esid);

+ 2
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectInvigilateService.java View File

42
     //监考设置列表
42
     //监考设置列表
43
     public Map listSubject(Integer examid) {
43
     public Map listSubject(Integer examid) {
44
         Map map = eBaseMapper.findById(examid);
44
         Map map = eBaseMapper.findById(examid);
45
-        List<Map> subjects = eSubjectInvigilateMapper.listSubject(examid);//监考设置列表
45
+        Integer classnum = eClassMapper.getClassNumByExamId(examid);//获取考试班级数量
46
+        List<Map> subjects = eSubjectInvigilateMapper.listSubject(examid, classnum);//监考设置列表
46
         map.put("subjects", subjects);
47
         map.put("subjects", subjects);
47
         return map;
48
         return map;
48
     }
49
     }

+ 4
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/notice/NoticeService.java View File

49
     //批量添加通知和短信
49
     //批量添加通知和短信
50
     @Transactional(rollbackFor = Exception.class)
50
     @Transactional(rollbackFor = Exception.class)
51
     public void batchSave(List<TNotice> noticeList, List<TMsg> msgList, Integer schoolid, Integer createid, Integer noticetype) {
51
     public void batchSave(List<TNotice> noticeList, List<TMsg> msgList, Integer schoolid, Integer createid, Integer noticetype) {
52
+        noticeList = null;
53
+        msgList = null;
52
         Integer createtime = N_Utils.getSecondTimestamp();
54
         Integer createtime = N_Utils.getSecondTimestamp();
53
         if (N_Utils.isListNotEmpty(noticeList)) {//通知
55
         if (N_Utils.isListNotEmpty(noticeList)) {//通知
54
             noticeList.forEach(n -> {
56
             noticeList.forEach(n -> {
141
 
143
 
142
     //批量添加通知和短信(发布考试用)
144
     //批量添加通知和短信(发布考试用)
143
     public void batchSave2(List<TNotice> noticeList, List<TMsg> msgList, Integer schoolid, Integer createid) {
145
     public void batchSave2(List<TNotice> noticeList, List<TMsg> msgList, Integer schoolid, Integer createid) {
146
+        noticeList = null;
147
+        msgList = null;
144
         Integer createtime = N_Utils.getSecondTimestamp();
148
         Integer createtime = N_Utils.getSecondTimestamp();
145
         if (N_Utils.isListNotEmpty(noticeList)) {//通知
149
         if (N_Utils.isListNotEmpty(noticeList)) {//通知
146
             noticeList.forEach(n -> {
150
             noticeList.forEach(n -> {

+ 4
- 0
sexam/src/main/resources/mapper/exam/EClassMapper.xml View File

60
         where ct.classid in(${classids}) and sb.subjectid=#{subjectid} and u.userstate=1
60
         where ct.classid in(${classids}) and sb.subjectid=#{subjectid} and u.userstate=1
61
         group by ct.classid,ct.teacherid
61
         group by ct.classid,ct.teacherid
62
     </select>
62
     </select>
63
+    <!--获取考试班级数量-->
64
+    <select id="getClassNumByExamId" resultType="java.lang.Integer">
65
+        select count(*) from e_class where examid=#{examid}
66
+    </select>
63
 </mapper>
67
 </mapper>

+ 7
- 7
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.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
-        ,(select group_concat(distinct u.username separator '、')
13
-        from e_subject_invigilate ei left join t_user u on ei.teacherid = u.userid
14
-        where ei.esid=s.esid and ei.majored=1)majorname
15
-        from e_subject s left join e_paper ep on s.esid = ep.esid
16
-        where s.examid=#{examid}
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
+        ,#{classnum}-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
17
     </select>
17
     </select>
18
     <!--考试监考人-->
18
     <!--考试监考人-->
19
     <select id="listByEsId" resultType="java.util.Map">
19
     <select id="listByEsId" resultType="java.util.Map">

Loading…
Cancel
Save