Преглед на файлове

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

tags/正式版本
雍文秀 преди 2 години
родител
ревизия
a833c20e66

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/EClassMapper.java Целия файл

@@ -35,4 +35,7 @@ public interface EClassMapper extends TkMapper<EClass> {
35 35
 
36 36
     //按班设置教师列表
37 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 Целия файл

@@ -12,7 +12,7 @@ public interface ESubjectInvigilateMapper extends TkMapper<ESubjectInvigilate> {
12 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 18
     List<Map> listByEsId(@Param("esid") Integer esid);

+ 2
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectInvigilateService.java Целия файл

@@ -42,7 +42,8 @@ public class ESubjectInvigilateService {
42 42
     //监考设置列表
43 43
     public Map listSubject(Integer examid) {
44 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 47
         map.put("subjects", subjects);
47 48
         return map;
48 49
     }

+ 4
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/notice/NoticeService.java Целия файл

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

+ 4
- 0
sexam/src/main/resources/mapper/exam/EClassMapper.xml Целия файл

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

+ 7
- 7
sexam/src/main/resources/mapper/exam/ESubjectInvigilateMapper.xml Целия файл

@@ -7,13 +7,13 @@
7 7
     </delete>
8 8
     <!--监考设置列表-->
9 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 17
     </select>
18 18
     <!--考试监考人-->
19 19
     <select id="listByEsId" resultType="java.util.Map">

Loading…
Отказ
Запис