瀏覽代碼

Merge remote-tracking branch 'cloud-schoolapi/ywx'

tags/正式版本
王宁 2 年之前
父節點
當前提交
660818d3a8

+ 0
- 2
sexam/src/main/java/com/xhkjedu/sexam/model/exam/ESubject.java 查看文件

@@ -5,7 +5,6 @@ import lombok.Data;
5 5
 
6 6
 import javax.persistence.Id;
7 7
 import javax.persistence.Table;
8
-import javax.persistence.Transient;
9 8
 
10 9
 @Table(name = "e_subject")
11 10
 @Data
@@ -41,7 +40,6 @@ public class ESubject extends BaseBean {
41 40
     //设置时间
42 41
     private Integer handletime;
43 42
 
44
-    @Transient
45 43
     //科目名称
46 44
     private String subjectname;
47 45
 }

+ 5
- 2
sexam/src/main/java/com/xhkjedu/sexam/model/paperstudent/EPaperStudentQuestion.java 查看文件

@@ -67,8 +67,11 @@ public class EPaperStudentQuestion extends BaseBean {
67 67
     //批改时间
68 68
     private Integer checktime;
69 69
 
70
-    //作答情况0默认1优秀2违规
71
-    private Integer goodbad;
70
+    //优秀试卷0默认1优秀
71
+    private Integer good;
72
+
73
+    //违纪试卷0默认1违纪
74
+    private Integer bad;
72 75
 
73 76
     //学生答题卡作答图片
74 77
     private String stupic;

+ 1
- 21
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java 查看文件

@@ -90,10 +90,9 @@ public class EBaseService {
90 90
         students.forEach(s -> s.setExamid(examid));
91 91
         eClassStudentMapper.insertList(students);
92 92
 
93
-        //考试科目、试卷
93
+        //考试科目
94 94
         List<String> subjectids = model.getSubjectids();
95 95
         List<ESubject> subjects = new ArrayList<>();//考试科目
96
-        List<EPaper> papers = new ArrayList<>();//考试试卷
97 96
         String examdate = model.getExamdate();//考试时间
98 97
         for (String subjectid : subjectids) {
99 98
             ESubject s = new ESubject();
@@ -102,28 +101,9 @@ public class EBaseService {
102 101
             s.setSdate(examdate);
103 102
             s.setEsstate(0);
104 103
             subjects.add(s);
105
-            EPaper p = new EPaper();
106
-            p.setExamid(examid);
107
-            p.setSubjectid(subjectid);
108
-            p.setPtype(0);
109
-            p.setPnum(0);
110
-            p.setPscore(0.0);
111
-            p.setAnswered(0);
112
-            p.setCorrecttype(0);
113
-            papers.add(p);
114 104
         }
115 105
         eSubjectMapper.insertList(subjects);//考试科目
116 106
 
117
-        Integer createid = model.getCreateid();
118
-        Integer createtime = model.getCreatetime();
119
-        for (int i = 0; i < papers.size(); i++) {
120
-            EPaper ePaper = papers.get(i);
121
-            ePaper.setEsid(subjects.get(i).getId());
122
-            ePaper.setCreateid(createid);
123
-            ePaper.setCreatetime(createtime);
124
-        }
125
-        ePaperMapper.insertList(papers);//考试试卷
126
-
127 107
         return null;
128 108
     }
129 109
 

+ 2
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/notice/NoticeService.java 查看文件

@@ -104,11 +104,12 @@ public class NoticeService {
104 104
             } else {//通知对象2老师
105 105
                 List<Integer> userids = msgList.stream().map(m -> m.getUserid()).distinct().collect(Collectors.toList());
106 106
                 List<Map> users = userMapper.listPhoneByUserIds(userids);//根据用户ids查找手机号
107
+                Map<Integer, TMsg> msgMap = msgList.stream().collect(Collectors.toMap(m -> m.getUserid(), m -> m));
107 108
                 for (int i = 0; i < users.size(); i++) {
108 109
                     Map u = users.get(i);
109 110
                     String userphone = u.get("userphone").toString();
110 111
                     if (N_Utils.isEmpty(userphone)) continue;
111
-                    TMsg m = msgList.get(i);
112
+                    TMsg m = msgMap.get(u.get("userid"));
112 113
                     m.setUserphone(userphone);
113 114
                     m.setCreatetime(createtime);
114 115
                     msgs.add(m);

+ 1
- 2
sexam/src/main/resources/mapper/exam/EBaseMapper.xml 查看文件

@@ -14,7 +14,7 @@
14 14
     <!--考试列表-->
15 15
     <select id="listAll" resultType="java.util.Map">
16 16
         select b.examid,b.examname,b.examdate,b.gradeid,b.examtype,b.exammode,b.monitored
17
-        ,b.examstate,group_concat(distinct s.subjectname order by s.subjectorder separator '|')subjectname
17
+        ,b.examstate,group_concat(distinct es.subjectname separator '|')subjectname
18 18
         ,count(distinct case when es.begintime is null or es.begintime='' then es.esid else null end)esnum
19 19
         ,min(es.esstate)esstate,min(ep.correcttype)correcttype
20 20
         ,(case when b.exammode=1 then (count(distinct es.esid)-count(distinct ei.esid))
@@ -22,7 +22,6 @@
22 22
         left join e_paper_student ps on ec.examid=ps.examid and ps.sstate in(0,1)
23 23
         where ec.examid=b.examid) end)papernum
24 24
         from e_base b left join e_subject es on es.examid=b.examid
25
-        left join t_subject s on es.subjectid=s.subjectid
26 25
         left join e_paper ep on ep.esid = es.esid
27 26
         left join e_subject_invigilate ei on ei.esid = es.esid
28 27
         where b.schoolid=#{base.schoolid} and b.deleted=1

+ 2
- 4
sexam/src/main/resources/mapper/exam/ESubjectInvigilateMapper.xml 查看文件

@@ -7,9 +7,8 @@
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
10
+        select s.esid,s.subjectid,s.sdate,s.begintime,s.endtime,s.esstate,s.subjectname
11 11
         ,ifnull(ep.pnum,0)pnum,ifnull(ep.pscore,0)pscore,ep.correcttype
12
-        ,(select ts.subjectname from t_subject ts where ts.subjectid=s.subjectid)subjectname
13 12
         ,(select group_concat(distinct u.username separator '、')
14 13
         from e_subject_invigilate ei left join t_user u on ei.teacherid = u.userid
15 14
         where ei.esid=s.esid and ei.majored=1)majorname
@@ -24,7 +23,7 @@
24 23
     </select>
25 24
     <!--教师监考-监控列表-->
26 25
     <select id="listJkSubject" resultType="java.util.Map">
27
-        select es.esid,es.sdate,es.begintime,es.endtime,es.esstate,ts.subjectname
26
+        select es.esid,es.sdate,es.begintime,es.endtime,es.esstate,es.subjectname
28 27
         ,eb.examname,eb.gradeid,eb.examtype,sum(ec.classnum)examnum
29 28
         ,count(case when eps.sstate=0 then eps.epsid else null end) wjcnum
30 29
         ,count(case when eps.sstate=1 then eps.epsid else null end)jcnum
@@ -34,7 +33,6 @@
34 33
         from e_subject es left join e_base eb on eb.examid = es.examid
35 34
         left join e_class ec on eb.examid = ec.examid
36 35
         left join e_paper_student eps on es.esid = eps.esid
37
-        left join t_subject ts on es.subjectid = ts.subjectid
38 36
         where es.teacherid=#{teacherid}
39 37
         <if test="esstate==1">
40 38
             and concat(es.sdate,' ',es.endtime)>now()

+ 7
- 11
sexam/src/main/resources/mapper/exam/ESubjectMapper.xml 查看文件

@@ -12,9 +12,8 @@
12 12
     <!--考试下所有科目-->
13 13
     <select id="listExamSubjects" resultType="com.xhkjedu.sexam.vo.exam.ESubjectVo">
14 14
         select es.esid,es.subjectid,es.sdate,es.begintime,es.endtime,es.teacherid,
15
-        u.username teachername,es.esstate,s.subjectname
15
+        u.username teachername,es.esstate,es.subjectname
16 16
         from e_subject es left join t_user u on es.teacherid=u.userid
17
-        left join t_subject s on es.subjectid=s.subjectid
18 17
         where es.examid=#{examid} order by s.subjectorder
19 18
     </select>
20 19
 
@@ -29,9 +28,8 @@
29 28
     </update>
30 29
     <!--考试科目列表-->
31 30
     <select id="listSubject" resultType="java.util.Map">
32
-        select es.subjectid,s.subjectname,es.sdate,es.begintime,es.endtime,es.teacherid,u.username
33
-        from e_subject es left join t_subject s on es.subjectid=s.subjectid
34
-        left join t_user u on es.teacherid=u.userid
31
+        select es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.teacherid,u.username
32
+        from e_subject es left join t_user u on es.teacherid=u.userid
35 33
         where examid=#{examid}
36 34
     </select>
37 35
     <!--根据考试科目id获取考试id-->
@@ -40,25 +38,23 @@
40 38
     </select>
41 39
     <!--考试科目设置列表-->
42 40
     <select id="listSubjectSet" resultType="java.util.Map">
43
-        select es.subjectid,s.subjectname,es.sdate,es.begintime,es.endtime,es.esstate
41
+        select es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.esstate
44 42
         ,ep.correcttype
45 43
         ,(select count(*) from e_subject_invigilate ei where ei.esid=es.esid)jkjsnum
46 44
         ,count(case when eps.sstate=3 then eps.epsid else null end)qknum
47 45
         ,count(case when eps.sstate=2 then eps.epsid else null end)tjnum
48 46
         ,ifnull(truncate(count(case when eps.checked=2 then eps.epsid else null end)*100/
49 47
         count(case when eps.sstate=2 then eps.epsid else null end),0),0)pyrate
50
-        from e_subject es left join t_subject s on es.subjectid=s.subjectid
51
-        left join e_paper ep on es.esid = ep.esid
48
+        from e_subject es left join e_paper ep on es.esid = ep.esid
52 49
         left join e_paper_student eps on ep.epid = eps.epid
53 50
         where es.examid=#{examid}
54 51
         group by es.esid
55 52
     </select>
56 53
     <!--考试科目阅卷设置列表-->
57 54
     <select id="listSubjectCSet" resultType="java.util.Map">
58
-        select es.subjectid,s.subjectname,es.sdate,es.begintime,es.endtime,es.esstate
55
+        select es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.esstate
59 56
         ,ep.ptype,ep.epid,ep.pnum,ep.pscore,ep.correcttype
60
-        from e_subject es left join t_subject s on es.subjectid=s.subjectid
61
-        left join e_paper ep on es.esid = ep.esid
57
+        from e_subject es left join e_paper ep on es.esid = ep.esid
62 58
         where es.examid=#{examid}
63 59
     </select>
64 60
     <!--根据考试科目id获取考试科目基本信息-->

Loading…
取消
儲存