Browse Source

考试报告

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

+ 37
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java View File

11
 import com.xhkjedu.sexam.model.notice.TNoticeTeacher;
11
 import com.xhkjedu.sexam.model.notice.TNoticeTeacher;
12
 import com.xhkjedu.sexam.service.exam.EBaseService;
12
 import com.xhkjedu.sexam.service.exam.EBaseService;
13
 import com.xhkjedu.sexam.service.notice.NoticeService;
13
 import com.xhkjedu.sexam.service.notice.NoticeService;
14
+import com.xhkjedu.sexam.service.report.EReportGenerateService;
14
 import com.xhkjedu.sexam.vo.exam.EBaseVo;
15
 import com.xhkjedu.sexam.vo.exam.EBaseVo;
15
 import com.xhkjedu.sexam.vo.exam.ExamVo;
16
 import com.xhkjedu.sexam.vo.exam.ExamVo;
16
 import com.xhkjedu.sexam.vo.system.UserVo;
17
 import com.xhkjedu.sexam.vo.system.UserVo;
43
     private EBaseService eBaseService;
44
     private EBaseService eBaseService;
44
     @Resource
45
     @Resource
45
     private NoticeService noticeService;
46
     private NoticeService noticeService;
47
+    @Resource
48
+    private EReportGenerateService eReportGenerateService;
46
 
49
 
47
     /**
50
     /**
48
      * 发起考试
51
      * 发起考试
404
         String macNumber = eBaseService.getMacNumber(mac);
407
         String macNumber = eBaseService.getMacNumber(mac);
405
         return new ResultVo(0, "获取mac编号成功", macNumber);
408
         return new ResultVo(0, "获取mac编号成功", macNumber);
406
     }
409
     }
410
+
411
+    /**
412
+     * 考试科目选择列表
413
+     *
414
+     * @return com.xhkjedu.vo.ResultVo
415
+     * @Param [eBase]
416
+     * @Author ywx
417
+     * @Date 2022/9/7 14:23
418
+     **/
419
+    @PostMapping("/list_selsub")
420
+    public ResultVo listSubjectForSel(@RequestBody EBase eBase) {
421
+        Integer examid = eBase.getExamid();
422
+        N_Utils.validation(new Object[]{examid, "考试id", 1});
423
+        List<Map> list = eBaseService.listSubjectForSel(examid);
424
+        return new ResultVo(0, "获取考试科目列表成功", list);
425
+    }
426
+
427
+    /**
428
+     * 生成考试报告
429
+     *
430
+     * @return com.xhkjedu.vo.ResultVo
431
+     * @Param [eBase]
432
+     * @Author ywx
433
+     * @Date 2022/9/8 9:56
434
+     **/
435
+    @PostMapping("/scbg")
436
+    public ResultVo generateExamReport(@RequestBody EBase eBase) {
437
+        Integer examid = eBase.getExamid();
438
+        Integer createid = eBase.getCreateid();
439
+        N_Utils.validation(new Object[]{examid, "考试id", 1, createid, "操作人", 1});
440
+        eReportGenerateService.generateExamReport(examid, createid);
441
+        return new ResultVo(0, "生成成功");
442
+    }
443
+
407
 }
444
 }

+ 35
- 2
sexam/src/main/java/com/xhkjedu/sexam/controller/report/EReportClassController.java View File

110
      **/
110
      **/
111
     @PostMapping("/get_dkgk")
111
     @PostMapping("/get_dkgk")
112
     public ResultVo getDkGk(@RequestBody ERankParamVo rank) {
112
     public ResultVo getDkGk(@RequestBody ERankParamVo rank) {
113
-        N_Utils.validation(new Object[]{rank.getExamid(), "考试id", 1, rank.getClassid(), "班级id", 1, rank.getSubjectid(), "科目id", 2});
113
+        N_Utils.validation(new Object[]{rank.getExamid(), "考试id", 1, rank.getClassid(), "班级id", 1
114
+                , rank.getSubjectid(), "科目id", 2});
114
         Map map = eReportClassService.getDkGk(rank);
115
         Map map = eReportClassService.getDkGk(rank);
115
         return new ResultVo(0, "获取成功", map);
116
         return new ResultVo(0, "获取成功", map);
116
     }
117
     }
117
 
118
 
119
+    /**
120
+     * 单科概况-平均分
121
+     *
122
+     * @return com.xhkjedu.vo.ResultVo
123
+     * @Param [rank]
124
+     * @Author ywx
125
+     * @Date 2022/9/7 14:41
126
+     **/
127
+    @PostMapping("/list_pjf")
128
+    public ResultVo listPjf(@RequestBody ERankParamVo rank) {
129
+        N_Utils.validation(new Object[]{rank.getExamid(), "考试id", 1, rank.getClassid(), "班级id", 1
130
+                , rank.getSubjectid(), "科目id", 2});
131
+        List<Map> list = eReportClassService.listPjf(rank);
132
+        return new ResultVo(0, "获取成功", list);
133
+    }
134
+
135
+    /**
136
+     * 单科概况-高频错题
137
+     *
138
+     * @return com.xhkjedu.vo.ResultVo
139
+     * @Param [rank]
140
+     * @Author ywx
141
+     * @Date 2022/9/7 14:41
142
+     **/
143
+    @PostMapping("/list_gpct")
144
+    public ResultVo listGpCt(@RequestBody ERankParamVo rank) {
145
+        N_Utils.validation(new Object[]{rank.getExamid(), "考试id", 1, rank.getClassid(), "班级id", 1
146
+                , rank.getSubjectid(), "科目id", 2});
147
+        List<Map> list = eReportClassService.listGpCt(rank);
148
+        return new ResultVo(0, "获取成功", list);
149
+    }
150
+
118
     /*
151
     /*
119
      * 单科概况-需关注学生
152
      * 单科概况-需关注学生
120
      * @Param [rank]
153
      * @Param [rank]
141
     public ResultVo listSjGk(@RequestBody ERankParamVo rank) {
174
     public ResultVo listSjGk(@RequestBody ERankParamVo rank) {
142
         N_Utils.validation(new Object[]{rank.getExamid(), "考试id", 1, rank.getClassid(), "班级id", 1
175
         N_Utils.validation(new Object[]{rank.getExamid(), "考试id", 1, rank.getClassid(), "班级id", 1
143
                 , rank.getSubjectid(), "科目id", 2});
176
                 , rank.getSubjectid(), "科目id", 2});
144
-        List<Map> list = eReportClassService.listSjGk(rank);
177
+        Map list = eReportClassService.listSjGk(rank);
145
         return new ResultVo(0, "获取成功", list);
178
         return new ResultVo(0, "获取成功", list);
146
     }
179
     }
147
 
180
 

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

37
 
37
 
38
     //获取考试关联科目及科目下试题数量
38
     //获取考试关联科目及科目下试题数量
39
     List<Map> listSubjectAndPnum(@Param("examid") Integer examid);
39
     List<Map> listSubjectAndPnum(@Param("examid") Integer examid);
40
+
41
+    //考试科目选择列表
42
+    List<Map> listSubjectForSel(Integer examid);
40
 }
43
 }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/model/reportclass/ERclass.java View File

66
 
66
 
67
     //标准差
67
     //标准差
68
     private Double bzc;
68
     private Double bzc;
69
+
70
+    //全科标准差
71
+    private Double qkbzc;
69
 }
72
 }

+ 7
- 0
sexam/src/main/java/com/xhkjedu/sexam/model/reportstu/ERstudent.java View File

6
 import javax.persistence.Id;
6
 import javax.persistence.Id;
7
 import javax.persistence.Table;
7
 import javax.persistence.Table;
8
 import javax.persistence.Transient;
8
 import javax.persistence.Transient;
9
+import java.util.ArrayList;
10
+import java.util.List;
9
 
11
 
10
 @Table(name = "e_rstudent")
12
 @Table(name = "e_rstudent")
11
 @Data
13
 @Data
70
     @Transient
72
     @Transient
71
     //总分校次
73
     //总分校次
72
     private Integer zfSchoolRank;
74
     private Integer zfSchoolRank;
75
+
76
+    @Transient
77
+    //班级ids
78
+    private List<Integer> classids = new ArrayList<>();
79
+
73
 }
80
 }

+ 7
- 10
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java View File

1
 package com.xhkjedu.sexam.service.exam;
1
 package com.xhkjedu.sexam.service.exam;
2
 
2
 
3
-import com.xhkjedu.sexam.mapper.exam.EBaseMacMapper;
4
-import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
5
-import com.xhkjedu.sexam.mapper.exam.EClassMapper;
6
-import com.xhkjedu.sexam.mapper.exam.EClassStudentMapper;
7
-import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
3
+import com.xhkjedu.sexam.mapper.exam.*;
8
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
4
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
9
 import com.xhkjedu.sexam.mapper.paper.EPaperQtypeQuestionMapper;
5
 import com.xhkjedu.sexam.mapper.paper.EPaperQtypeQuestionMapper;
10
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
6
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
11
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
7
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
12
 import com.xhkjedu.sexam.mapper.system.UserMapper;
8
 import com.xhkjedu.sexam.mapper.system.UserMapper;
13
-import com.xhkjedu.sexam.model.exam.EBase;
14
-import com.xhkjedu.sexam.model.exam.EBaseMac;
15
-import com.xhkjedu.sexam.model.exam.EClass;
16
-import com.xhkjedu.sexam.model.exam.EClassStudent;
17
-import com.xhkjedu.sexam.model.exam.ESubject;
9
+import com.xhkjedu.sexam.model.exam.*;
18
 import com.xhkjedu.sexam.model.paper.EPaper;
10
 import com.xhkjedu.sexam.model.paper.EPaper;
19
 import com.xhkjedu.sexam.model.paper.EPaperQtypeQuestion;
11
 import com.xhkjedu.sexam.model.paper.EPaperQtypeQuestion;
20
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
12
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
364
         }
356
         }
365
         return macCode + ebmid;
357
         return macCode + ebmid;
366
     }
358
     }
359
+
360
+    //考试科目选择列表
361
+    public List<Map> listSubjectForSel(Integer examid) {
362
+        return eSubjectMapper.listSubjectForSel(examid);
363
+    }
367
 }
364
 }

+ 20
- 15
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportClassService.java View File

75
     //单科概况
75
     //单科概况
76
     public Map getDkGk(ERankParamVo rank) {
76
     public Map getDkGk(ERankParamVo rank) {
77
         Map map = eRclassMapper.findById(rank);//班级概况
77
         Map map = eRclassMapper.findById(rank);//班级概况
78
-        List<Map> pjfList = eRclassMapper.listPjf(rank);//平均分
79
-        map.put("pjfList", pjfList);
80
-        List<Map> cjdjList = eRclassMapper.listCjDj(rank);//成绩等级分布
81
-        map.put("cjdjList", cjdjList);
82
-        rank.setRanktype(1);//大幅进步
83
-        List<Map> gzxsList = eRclassMapper.listGzXs(rank);//需关注学生
84
-        map.put("gzxsList", gzxsList);
85
-        List<Map> gpctList = eRclassMapper.listGpCt(rank);//高频错题
78
+        return map;
79
+    }
80
+
81
+    //单科概况-平均分
82
+    public List<Map> listPjf(ERankParamVo rank) {
83
+        return eRclassMapper.listPjf(rank);
84
+    }
85
+
86
+    //单科概况-高频错题
87
+    public List<Map> listGpCt(ERankParamVo rank) {
88
+        List<Map> gpctList = eRclassMapper.listGpCt(rank);
86
         for (Map ct : gpctList) {
89
         for (Map ct : gpctList) {
87
             //知识点
90
             //知识点
88
             setQuestionPoint(ct);
91
             setQuestionPoint(ct);
92
             ct.remove("answer");
95
             ct.remove("answer");
93
             ct.remove("pointjson");
96
             ct.remove("pointjson");
94
         }
97
         }
95
-        map.put("gpctList", gpctList);
96
-        return map;
98
+        return gpctList;
97
     }
99
     }
98
 
100
 
99
     //试题知识点
101
     //试题知识点
135
     }
137
     }
136
 
138
 
137
     //试卷概况
139
     //试卷概况
138
-    public List<Map> listSjGk(ERankParamVo rank) {
140
+    public Map listSjGk(ERankParamVo rank) {
139
         Map paper = eReportClassMapper.getPaperByExamSubjectId(rank);
141
         Map paper = eReportClassMapper.getPaperByExamSubjectId(rank);
140
         Integer ptype = (Integer) paper.get("ptype");
142
         Integer ptype = (Integer) paper.get("ptype");
143
+        List<Map> list;
141
         if (ptype == 1) {
144
         if (ptype == 1) {
142
-            List<Map> list = eReportClassMapper.listTkSjGk(rank);
145
+            list = eReportClassMapper.listTkSjGk(rank);
143
             List<Map> questions = eReportClassMapper.listTkQuestion((Integer) paper.get("epid"));
146
             List<Map> questions = eReportClassMapper.listTkQuestion((Integer) paper.get("epid"));
144
             Object pointjson = paper.get("pointjson");
147
             Object pointjson = paper.get("pointjson");
145
             for (Map q : list) {
148
             for (Map q : list) {
184
                     q.put("qorder", qmap.get("qorder"));
187
                     q.put("qorder", qmap.get("qorder"));
185
                 }
188
                 }
186
             }
189
             }
187
-            return list;
188
         } else {
190
         } else {
189
             String examname = paper.get("examname").toString();
191
             String examname = paper.get("examname").toString();
190
-            List<Map> list = eReportClassMapper.listFjSjGk(rank);
192
+            list = eReportClassMapper.listFjSjGk(rank);
191
             for (Map q : list) {
193
             for (Map q : list) {
192
                 q.put("qstem", examname + "-第" + q.get("qorder") + "题");
194
                 q.put("qstem", examname + "-第" + q.get("qorder") + "题");
193
             }
195
             }
194
-            return list;
195
         }
196
         }
197
+        paper.remove("examname");
198
+        paper.remove("pointjson");
199
+        paper.put("questions", list);
200
+        return paper;
196
     }
201
     }
197
 
202
 
198
     //试卷分析
203
     //试卷分析

+ 27
- 8
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java View File

136
             List<ERstudent> studentList = entry.getValue();
136
             List<ERstudent> studentList = entry.getValue();
137
 
137
 
138
             Map<Integer, List<ERstudent>> sCollect = studentList.stream().collect(Collectors.groupingBy(s -> s.getStudentid()));
138
             Map<Integer, List<ERstudent>> sCollect = studentList.stream().collect(Collectors.groupingBy(s -> s.getStudentid()));
139
+            List<ERstudent> rstudents = new ArrayList<>();
139
             for (Map.Entry<Integer, List<ERstudent>> csEntry : sCollect.entrySet()) {
140
             for (Map.Entry<Integer, List<ERstudent>> csEntry : sCollect.entrySet()) {
140
                 ERstudent cs = new ERstudent();
141
                 ERstudent cs = new ERstudent();
141
                 cs.setExamid(examid);
142
                 cs.setExamid(examid);
144
                 cs.setSubjectid(subjectid);
145
                 cs.setSubjectid(subjectid);
145
                 cs.setSubjectname(subjectname);
146
                 cs.setSubjectname(subjectname);
146
                 cs.setScore(csEntry.getValue().stream().mapToDouble(s -> s.getScore()).sum());
147
                 cs.setScore(csEntry.getValue().stream().mapToDouble(s -> s.getScore()).sum());
147
-                classStudents.add(cs);
148
+                rstudents.add(cs);
148
             }
149
             }
150
+            setRank(rstudents, classStuRank, 3);//班级学生分数排名
151
+            classStudents.addAll(rstudents);
149
             Map<String, List<ERstudent>> subCollect = studentList.stream().collect(Collectors.groupingBy(s -> s.getSubjectid()));
152
             Map<String, List<ERstudent>> subCollect = studentList.stream().collect(Collectors.groupingBy(s -> s.getSubjectid()));
150
             for (Map.Entry<String, List<ERstudent>> ssEntry : subCollect.entrySet()) {
153
             for (Map.Entry<String, List<ERstudent>> ssEntry : subCollect.entrySet()) {
151
                 subjectid = ssEntry.getKey();
154
                 subjectid = ssEntry.getKey();
152
                 subjectname = subjectMap.get(subjectid);
155
                 subjectname = subjectMap.get(subjectid);
153
                 studentList = ssEntry.getValue();
156
                 studentList = ssEntry.getValue();
157
+                rstudents = new ArrayList<>();
154
                 for (ERstudent cs : studentList) {
158
                 for (ERstudent cs : studentList) {
155
                     cs.setSubjectname(subjectname);
159
                     cs.setSubjectname(subjectname);
156
-                    classSubjectStudents.add(cs);
160
+                    rstudents.add(cs);
157
                 }
161
                 }
162
+                setRank(rstudents, classSubStuRank, 4);//班级科目学生分数排名
163
+                classSubjectStudents.addAll(rstudents);
158
             }
164
             }
159
         }
165
         }
160
 
166
 
187
             subjectname = subjectMap.get(subjectid);
193
             subjectname = subjectMap.get(subjectid);
188
             List<ERstudent> list = ssEntry.getValue();
194
             List<ERstudent> list = ssEntry.getValue();
189
             Map<Integer, List<ERstudent>> sCollect = list.stream().collect(Collectors.groupingBy(s -> s.getStudentid()));
195
             Map<Integer, List<ERstudent>> sCollect = list.stream().collect(Collectors.groupingBy(s -> s.getStudentid()));
196
+            List<ERstudent> rstudents = new ArrayList<>();
190
             for (Map.Entry<Integer, List<ERstudent>> csEntry : sCollect.entrySet()) {
197
             for (Map.Entry<Integer, List<ERstudent>> csEntry : sCollect.entrySet()) {
191
                 ERstudent cs = new ERstudent();
198
                 ERstudent cs = new ERstudent();
192
                 cs.setClassid(0);
199
                 cs.setClassid(0);
194
                 cs.setSubjectid(subjectid);
201
                 cs.setSubjectid(subjectid);
195
                 cs.setSubjectname(subjectname);
202
                 cs.setSubjectname(subjectname);
196
                 cs.setScore(csEntry.getValue().stream().mapToDouble(s -> s.getScore()).sum());
203
                 cs.setScore(csEntry.getValue().stream().mapToDouble(s -> s.getScore()).sum());
197
-                schoolSubjectStudents.add(cs);
204
+                rstudents.add(cs);
198
             }
205
             }
206
+            setRank(rstudents, schoolSubStuRank, 2);//学校科目学生分数排名
207
+            schoolSubjectStudents.addAll(rstudents);
199
             ERPaperVo rp = paperMap.get(subjectid);
208
             ERPaperVo rp = paperMap.get(subjectid);
200
             Double allscore = rp.getPscore();//满分
209
             Double allscore = rp.getPscore();//满分
201
             setSubject(examid, stunum, subjectid, subjectname, subjectList, classList, list, allscore);
210
             setSubject(examid, stunum, subjectid, subjectname, subjectList, classList, list, allscore);
206
         eRsubjectMapper.insertList(subjectList);
215
         eRsubjectMapper.insertList(subjectList);
207
 
216
 
208
         setRank(schoolStudents, schoolStuRank, 1);//学校学生分数排名
217
         setRank(schoolStudents, schoolStuRank, 1);//学校学生分数排名
209
-        setRank(schoolSubjectStudents, schoolSubStuRank, 2);//学校科目学生分数排名
210
-        setRank(classStudents, classStuRank, 3);//班级学生分数排名
211
-        setRank(classSubjectStudents, classSubStuRank, 4);//班级科目学生分数排名
212
 
218
 
213
         for (ERstudent cs : classStudents) {
219
         for (ERstudent cs : classStudents) {
214
             Integer studentid = cs.getStudentid();
220
             Integer studentid = cs.getStudentid();
240
         }
246
         }
241
         eRstudentMapper.insertList(classSubjectStudents);
247
         eRstudentMapper.insertList(classSubjectStudents);
242
 
248
 
243
-//        setClassQuestion(examid, subjects, classes);//题型试题
249
+        setClassQuestion(examid, subjects, classes);//题型试题
244
         List<Integer> userids = students.stream().map(ERstudent::getStudentid).distinct().collect(Collectors.toList());
250
         List<Integer> userids = students.stream().map(ERstudent::getStudentid).distinct().collect(Collectors.toList());
245
         List<UserVo> users = userMapper.listNameByUserIds(userids);
251
         List<UserVo> users = userMapper.listNameByUserIds(userids);
246
         Map<Integer, String> userMap = users.stream().collect(Collectors.toMap(UserVo::getUserid, UserVo::getUsername));
252
         Map<Integer, String> userMap = users.stream().collect(Collectors.toMap(UserVo::getUserid, UserVo::getUsername));
278
         rs.setLhrate(N_Utils.getIntegerDivideAndMulitiply(lhnum, stunum));
284
         rs.setLhrate(N_Utils.getIntegerDivideAndMulitiply(lhnum, stunum));
279
         rs.setJgrate(N_Utils.getIntegerDivideAndMulitiply(jgnum, stunum));
285
         rs.setJgrate(N_Utils.getIntegerDivideAndMulitiply(jgnum, stunum));
280
         rs.setDfrate(N_Utils.getIntegerDivideAndMulitiply(dfnum, stunum));
286
         rs.setDfrate(N_Utils.getIntegerDivideAndMulitiply(dfnum, stunum));
281
-        rs.setBzc(ExamUtil.standardDiviation(scores));
287
+        double qkbzc = ExamUtil.standardDiviation(scores);
288
+        rs.setBzc(qkbzc);
282
         int sknum = list.size();
289
         int sknum = list.size();
283
         rs.setStunum(sknum);//实考人数
290
         rs.setStunum(sknum);//实考人数
284
         rs.setMissnum(stunum - sknum);//缺考人数=计划人数-实考人数
291
         rs.setMissnum(stunum - sknum);//缺考人数=计划人数-实考人数
290
             List<ERstudent> rstudentList = entry.getValue();
297
             List<ERstudent> rstudentList = entry.getValue();
291
             DoubleSummaryStatistics claStatistics = rstudentList.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
298
             DoubleSummaryStatistics claStatistics = rstudentList.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
292
             ERclass rc = new ERclass();
299
             ERclass rc = new ERclass();
300
+            rc.setQkbzc(qkbzc);
293
             rc.setExamid(examid);
301
             rc.setExamid(examid);
294
             rc.setClassid(classid);
302
             rc.setClassid(classid);
295
             rc.setSubjectid(subjectid);
303
             rc.setSubjectid(subjectid);
908
         Map<String, List<ERstudent>> sscollect = students.stream().collect(
916
         Map<String, List<ERstudent>> sscollect = students.stream().collect(
909
                 Collectors.groupingBy(s -> s.getSubjectid() + "_" + s.getStudentid()));
917
                 Collectors.groupingBy(s -> s.getSubjectid() + "_" + s.getStudentid()));
910
         setStuScore(sscollect, sstudents);
918
         setStuScore(sscollect, sstudents);
919
+
920
+        //排名
921
+        Map<String, Integer> schoolStuRank = new HashMap<>();//学校学生分数排名
922
+        setRank(cstudents, schoolStuRank, 1);//学校学生分数排名
923
+        for (ERstudent cs : students) {
924
+            Integer studentid = cs.getStudentid();
925
+            Integer classid = cs.getClassid();
926
+            Integer schoolrank = schoolStuRank.get(studentid.toString());
927
+            cs.setSchoolrank(schoolrank);
928
+        }
929
+
911
         //全部班级统计
930
         //全部班级统计
912
         Map<String, List<ERstudent>> qbbjcollect = sstudents.stream().collect(
931
         Map<String, List<ERstudent>> qbbjcollect = sstudents.stream().collect(
913
                 Collectors.groupingBy(s -> s.getSubjectid()));
932
                 Collectors.groupingBy(s -> s.getSubjectid()));

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

69
         from e_subject es left join e_paper p on es.esid=p.esid
69
         from e_subject es left join e_paper p on es.esid=p.esid
70
         where es.examid=#{examid} order by es.esid
70
         where es.examid=#{examid} order by es.esid
71
     </select>
71
     </select>
72
+    <!--考试科目选择列表-->
73
+    <select id="listSubjectForSel" resultType="java.util.Map">
74
+        select es.subjectid,es.subjectname from e_subject es where es.examid=#{examid}
75
+    </select>
72
 </mapper>
76
 </mapper>

+ 6
- 5
sexam/src/main/resources/mapper/report/ERclassMapper.xml View File

4
     <!--校级报告-成绩分析-->
4
     <!--校级报告-成绩分析-->
5
     <select id="listByExamId" resultType="java.util.Map">
5
     <select id="listByExamId" resultType="java.util.Map">
6
         select er.allscore,er.classmaxscore,er.classminscore,er.classavgscore,er.schoolmaxscore,er.schoolavgscore
6
         select er.allscore,er.classmaxscore,er.classminscore,er.classavgscore,er.schoolmaxscore,er.schoolavgscore
7
-        ,er.stunum,er.missnum,er.yxrate,er.lhrate,er.jgrate,er.dfrate,er.bzc
7
+        ,er.stunum,er.missnum,er.yxrate,er.lhrate,er.jgrate,er.dfrate,er.bzc,er.qkbzc
8
         ,er.classid,(case when er.classid=0 then '全部班级' else ec.classname end)classname
8
         ,er.classid,(case when er.classid=0 then '全部班级' else ec.classname end)classname
9
         from e_rclass er left join e_class ec on er.examid = ec.examid and er.classid = ec.classid
9
         from e_rclass er left join e_class ec on er.examid = ec.examid and er.classid = ec.classid
10
         where er.examid=#{rank.examid} and er.subjectid=#{rank.subjectid}
10
         where er.examid=#{rank.examid} and er.subjectid=#{rank.subjectid}
15
     <!--班级报告-学科成绩-->
15
     <!--班级报告-学科成绩-->
16
     <select id="listByExamAndClassId" resultType="java.util.Map">
16
     <select id="listByExamAndClassId" resultType="java.util.Map">
17
         select er.allscore,er.classmaxscore,er.classminscore,er.classavgscore,er.schoolmaxscore,er.schoolavgscore
17
         select er.allscore,er.classmaxscore,er.classminscore,er.classavgscore,er.schoolmaxscore,er.schoolavgscore
18
-        ,er.stunum,er.missnum,er.yxrate,er.lhrate,er.jgrate,er.dfrate,er.bzc
18
+        ,er.stunum,er.missnum,er.yxrate,er.lhrate,er.jgrate,er.dfrate,er.bzc,er.qkbzc
19
         ,er.classid,(case when er.classid=0 then '全部班级' else ec.classname end)classname
19
         ,er.classid,(case when er.classid=0 then '全部班级' else ec.classname end)classname
20
         ,(case when er.subjectid='zf' then '总分' else (select s.subjectname from t_subject s where
20
         ,(case when er.subjectid='zf' then '总分' else (select s.subjectname from t_subject s where
21
                 er.subjectid=s.subjectid) end)subjectname
21
                 er.subjectid=s.subjectid) end)subjectname
32
     </select>
32
     </select>
33
     <!--班级报告-单科概况-平均分-->
33
     <!--班级报告-单科概况-平均分-->
34
     <select id="listPjf" resultType="java.util.Map">
34
     <select id="listPjf" resultType="java.util.Map">
35
-        select er.classavgscore,ec.classname
35
+        select er.classavgscore,ec.classname,er.classid
36
         from e_rclass er left join e_class ec on er.examid = ec.examid and er.classid = ec.classid
36
         from e_rclass er left join e_class ec on er.examid = ec.examid and er.classid = ec.classid
37
-        where er.examid=#{rank.examid} and er.classid=#{rank.classid} and er.subjectid=#{rank.subjectid}
37
+        where er.examid=#{rank.examid} and er.subjectid=#{rank.subjectid}
38
     </select>
38
     </select>
39
     <!--班级报告-单科概况-成绩等级分布-->
39
     <!--班级报告-单科概况-成绩等级分布-->
40
     <select id="listCjDj" resultType="java.util.Map">
40
     <select id="listCjDj" resultType="java.util.Map">
46
     <!--班级报告-单科概况-需关注学生-->
46
     <!--班级报告-单科概况-需关注学生-->
47
     <select id="listGzXs" resultType="java.util.Map">
47
     <select id="listGzXs" resultType="java.util.Map">
48
         select u.username,er.score,er.classrank,er.classrankpre,er.goal
48
         select u.username,er.score,er.classrank,er.classrankpre,er.goal
49
+        <if test="rank.ranktype==3">,es.score*0.6 hgscore</if>
49
         from e_rstudent er left join t_user u on er.studentid=u.userid
50
         from e_rstudent er left join t_user u on er.studentid=u.userid
50
         <if test="rank.ranktype==3">
51
         <if test="rank.ranktype==3">
51
             left join e_rsubject es on er.examid = es.examid and es.subjectid=er.subjectid
52
             left join e_rsubject es on er.examid = es.examid and es.subjectid=er.subjectid
58
             and er.classrankpre&lt;=5
59
             and er.classrankpre&lt;=5
59
         </if>
60
         </if>
60
         <if test="rank.ranktype==3">
61
         <if test="rank.ranktype==3">
61
-            and es.score*0.6-er.score &lt;5
62
+            and abs(es.score*0.6-er.score) between 0.01 and 5
62
         </if>
63
         </if>
63
         <if test="rank.ranktype==4">
64
         <if test="rank.ranktype==4">
64
             and abs(er.classrankpre)>=10
65
             and abs(er.classrankpre)>=10

+ 3
- 0
sexam/src/main/resources/mapper/report/ERclassRankMapper.xml View File

25
         <if test="rank.ranktype!=null and rank.ranktype!=0">
25
         <if test="rank.ranktype!=null and rank.ranktype!=0">
26
             and err.ranktype=#{rank.ranktype}
26
             and err.ranktype=#{rank.ranktype}
27
         </if>
27
         </if>
28
+        <if test="rank.subjectid!=null and rank.subjectid!=''">
29
+            and err.subjectid=#{rank.subjectid}
30
+        </if>
28
     </select>
31
     </select>
29
 </mapper>
32
 </mapper>

+ 3
- 0
sexam/src/main/resources/mapper/report/ERstudentMapper.xml View File

21
         from e_class_student s left join t_user u on s.studentid=u.userid
21
         from e_class_student s left join t_user u on s.studentid=u.userid
22
         left join e_class c on s.classid=c.classid
22
         left join e_class c on s.classid=c.classid
23
         where s.examid=#{stu.examid}
23
         where s.examid=#{stu.examid}
24
+        <foreach collection="stu.classids" item="classid" open="and s.classid in(" separator="," close=")">
25
+            ${classid}
26
+        </foreach>
24
         <if test="stu.classid!=null and stu.classid!=0">
27
         <if test="stu.classid!=null and stu.classid!=0">
25
             and s.classid=#{stu.classid}
28
             and s.classid=#{stu.classid}
26
         </if>
29
         </if>

Loading…
Cancel
Save