Browse Source

班级报告、单科报告 分数排名显示控制

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

+ 3
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/report/EReportClassController.java View File

63
         Integer examid = stu.getExamid();
63
         Integer examid = stu.getExamid();
64
         Integer page = stu.getPage();
64
         Integer page = stu.getPage();
65
         N_Utils.validation(new Object[]{examid, "考试id", 1, stu.getClassid(), "班级id", 1});
65
         N_Utils.validation(new Object[]{examid, "考试id", 1, stu.getClassid(), "班级id", 1});
66
+        Integer showrank = eReportClassService.getShowRank(examid);
67
+        stu.setShowrank(showrank);
66
         if (N_Utils.isEmptyInteger(page)) {
68
         if (N_Utils.isEmptyInteger(page)) {
67
             List<Map> list = eReportClassService.listCjd(stu);
69
             List<Map> list = eReportClassService.listCjd(stu);
68
-            return new ResultVo(0, "获取成功", ExamUtil.listCjdOrder(list));
70
+            return new ResultVo(0, "获取成功", ExamUtil.listCjdOrder(list, showrank));
69
         } else {
71
         } else {
70
             List<Map> list = eReportClassService.listCjd(stu);
72
             List<Map> list = eReportClassService.listCjd(stu);
71
             PageResult pageResult = ExamUtil.getCjdPageResult(stu, list);
73
             PageResult pageResult = ExamUtil.getCjdPageResult(stu, list);

+ 3
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/report/EReportSchoolController.java View File

65
         Integer examid = stu.getExamid();
65
         Integer examid = stu.getExamid();
66
         Integer page = stu.getPage();
66
         Integer page = stu.getPage();
67
         N_Utils.validation(new Object[]{examid, "考试id", 1});
67
         N_Utils.validation(new Object[]{examid, "考试id", 1});
68
+        Integer showrank = eReportSchoolService.getShowRank(examid);
69
+        stu.setShowrank(showrank);
68
         if (N_Utils.isEmptyInteger(page)) {
70
         if (N_Utils.isEmptyInteger(page)) {
69
             List<Map> list = eReportSchoolService.listCjd(stu);
71
             List<Map> list = eReportSchoolService.listCjd(stu);
70
-            return new ResultVo(0, "获取成功", ExamUtil.listCjdOrder(list));
72
+            return new ResultVo(0, "获取成功", ExamUtil.listCjdOrder(list, showrank));
71
         } else {
73
         } else {
72
             List<Map> list = eReportSchoolService.listCjd(stu);
74
             List<Map> list = eReportSchoolService.listCjd(stu);
73
             PageResult pageResult = ExamUtil.getCjdPageResult(stu, list);
75
             PageResult pageResult = ExamUtil.getCjdPageResult(stu, list);

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

91
     @Transient
91
     @Transient
92
     private Integer teacherid;//教师id
92
     private Integer teacherid;//教师id
93
 
93
 
94
+    @Transient
95
+    private Integer showrank;//显示排名得分0保密1分数2分数+班排名3分数+班/校排名
96
+
94
 }
97
 }

+ 17
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportClassService.java View File

8
 import com.xhkjedu.sexam.mapper.reportclass.ERclassRankMapper;
8
 import com.xhkjedu.sexam.mapper.reportclass.ERclassRankMapper;
9
 import com.xhkjedu.sexam.mapper.reportclass.EReportClassMapper;
9
 import com.xhkjedu.sexam.mapper.reportclass.EReportClassMapper;
10
 import com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper;
10
 import com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper;
11
+import com.xhkjedu.sexam.model.exam.EBase;
11
 import com.xhkjedu.sexam.model.reportstu.ERstudent;
12
 import com.xhkjedu.sexam.model.reportstu.ERstudent;
12
 import com.xhkjedu.sexam.model.reportstu.ERstudentAction;
13
 import com.xhkjedu.sexam.model.reportstu.ERstudentAction;
13
 import com.xhkjedu.sexam.utils.ExamUtil;
14
 import com.xhkjedu.sexam.utils.ExamUtil;
93
 
94
 
94
     //单科概况
95
     //单科概况
95
     public Map getDkGk(ERankParamVo rank) {
96
     public Map getDkGk(ERankParamVo rank) {
97
+        EBase base = eBaseMapper.getShowRankById(rank.getExamid());
98
+        rank.setShowrank(base.getTeashowrank());
96
         Map map = eRclassMapper.findById(rank);//班级概况
99
         Map map = eRclassMapper.findById(rank);//班级概况
97
         return map;
100
         return map;
98
     }
101
     }
99
 
102
 
100
     //单科概况-平均分
103
     //单科概况-平均分
101
     public List<Map> listPjf(ERankParamVo rank) {
104
     public List<Map> listPjf(ERankParamVo rank) {
105
+        EBase base = eBaseMapper.getShowRankById(rank.getExamid());
106
+        Integer showrank = base.getTeashowrank();
107
+        if(showrank == 0) return new ArrayList<>();
108
+        rank.setShowrank(base.getTeashowrank());
102
         return eRclassMapper.listPjf(rank);
109
         return eRclassMapper.listPjf(rank);
103
     }
110
     }
104
 
111
 
161
     //试卷概况
168
     //试卷概况
162
     public Map listSjGk(ERankParamVo rank) {
169
     public Map listSjGk(ERankParamVo rank) {
163
         Map paper = eReportClassMapper.getPaperByExamSubjectId(rank);
170
         Map paper = eReportClassMapper.getPaperByExamSubjectId(rank);
171
+        EBase base = eBaseMapper.getShowRankById(rank.getExamid());
172
+        rank.setShowrank(base.getTeashowrank());
164
         Integer ptype = (Integer) paper.get("ptype");
173
         Integer ptype = (Integer) paper.get("ptype");
165
         List<Map> list;
174
         List<Map> list;
166
         if (ptype == 1) {
175
         if (ptype == 1) {
225
     //试卷分析
234
     //试卷分析
226
     public Map getSjFx(ERankParamVo rank) {
235
     public Map getSjFx(ERankParamVo rank) {
227
         Map map = new HashMap();
236
         Map map = new HashMap();
237
+        EBase base = eBaseMapper.getShowRankById(rank.getExamid());
238
+        rank.setShowrank(base.getTeashowrank());
228
         List<Map> types = eReportClassMapper.listType(rank);//大题分析
239
         List<Map> types = eReportClassMapper.listType(rank);//大题分析
229
         List<Map> questions = eReportClassMapper.listQuestion(rank);//小题分析
240
         List<Map> questions = eReportClassMapper.listQuestion(rank);//小题分析
230
         List<Map> points = eReportClassMapper.listPoint(rank);//知识点分析
241
         List<Map> points = eReportClassMapper.listPoint(rank);//知识点分析
370
     public List<Map> listEndExamsForClass(ReportParamsVo paramsVo) {
381
     public List<Map> listEndExamsForClass(ReportParamsVo paramsVo) {
371
         return eReportClassMapper.listEndExamsForClass(paramsVo);
382
         return eReportClassMapper.listEndExamsForClass(paramsVo);
372
     }
383
     }
384
+
385
+    //获取教师显示排名得分
386
+    public Integer getShowRank(Integer examid) {
387
+        EBase base = eBaseMapper.getShowRankById(examid);
388
+        return base.getTeashowrank();
389
+    }
373
 }
390
 }

+ 6
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportSchoolService.java View File

204
         map.put("classes",classes);
204
         map.put("classes",classes);
205
         return map;
205
         return map;
206
     }
206
     }
207
+
208
+    //获取教师显示排名得分
209
+    public Integer getShowRank(Integer examid) {
210
+        EBase base = eBaseMapper.getShowRankById(examid);
211
+        return base.getTeashowrank();
212
+    }
207
 }
213
 }

+ 34
- 1
sexam/src/main/java/com/xhkjedu/sexam/utils/ExamUtil.java View File

319
         }
319
         }
320
         List<ERstudent> studentList = students.stream().skip(start).limit(pageSize).collect(Collectors.toList());
320
         List<ERstudent> studentList = students.stream().skip(start).limit(pageSize).collect(Collectors.toList());
321
         List<Map> rstudentList = new ArrayList<>();
321
         List<Map> rstudentList = new ArrayList<>();
322
+        Integer showrank = stu.getShowrank();
322
         for (ERstudent map : studentList) {
323
         for (ERstudent map : studentList) {
323
             Integer studentid = map.getStudentid();
324
             Integer studentid = map.getStudentid();
324
             Map rs = list.stream().filter(s2 -> s2.get("studentid").equals(studentid)).findFirst().orElse(null);
325
             Map rs = list.stream().filter(s2 -> s2.get("studentid").equals(studentid)).findFirst().orElse(null);
326
+            if (showrank != 3) {
327
+                List<Map> subjects = (List<Map>) rs.get("subjects");
328
+                for (Map s : subjects) {
329
+                    if (showrank == 2) {
330
+                        s.put("schoolrank", "0");
331
+                        s.put("goal", "0");
332
+                        s.put("nextgoal", "0");
333
+                    } else {
334
+                        s.put("classrank", "0");
335
+                        s.put("classrankpre", "0");
336
+                        s.put("schoolrank", "0");
337
+                        s.put("goal", "0");
338
+                        s.put("nextgoal", "0");
339
+                    }
340
+                }
341
+            }
325
             rstudentList.add(rs);
342
             rstudentList.add(rs);
326
         }
343
         }
327
         pageResult.setList(rstudentList);
344
         pageResult.setList(rstudentList);
335
      * @Date 2022/10/23 11:49
352
      * @Date 2022/10/23 11:49
336
      * @return java.util.List<java.util.Map>
353
      * @return java.util.List<java.util.Map>
337
      **/
354
      **/
338
-    public static List<Map> listCjdOrder(List<Map> list) {
355
+    public static List<Map> listCjdOrder(List<Map> list, Integer showrank) {
339
         List<ERstudent> students = new ArrayList<>();
356
         List<ERstudent> students = new ArrayList<>();
340
         for (Map s : list) {
357
         for (Map s : list) {
341
             Integer studentid = (Integer) s.get("studentid");
358
             Integer studentid = (Integer) s.get("studentid");
355
         for (ERstudent map : students) {
372
         for (ERstudent map : students) {
356
             Integer studentid = map.getStudentid();
373
             Integer studentid = map.getStudentid();
357
             Map rs = list.stream().filter(s2 -> s2.get("studentid").equals(studentid)).findFirst().orElse(null);
374
             Map rs = list.stream().filter(s2 -> s2.get("studentid").equals(studentid)).findFirst().orElse(null);
375
+            if (showrank != 3) {
376
+                List<Map> subjects = (List<Map>) rs.get("subjects");
377
+                for (Map s : subjects) {
378
+                    if (showrank == 2) {
379
+                        s.put("schoolrank", "0");
380
+                        s.put("goal", "0");
381
+                        s.put("nextgoal", "0");
382
+                    } else {
383
+                        s.put("classrank", "0");
384
+                        s.put("classrankpre", "0");
385
+                        s.put("schoolrank", "0");
386
+                        s.put("goal", "0");
387
+                        s.put("nextgoal", "0");
388
+                    }
389
+                }
390
+            }
358
             rstudentList.add(rs);
391
             rstudentList.add(rs);
359
         }
392
         }
360
         return rstudentList;
393
         return rstudentList;

+ 2
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/report/ERankParamVo.java View File

32
     private Integer ranktype;
32
     private Integer ranktype;
33
 
33
 
34
     private List<ERrank> rranks;//等级
34
     private List<ERrank> rranks;//等级
35
+
36
+    private Integer showrank;//显示排名得分0保密1分数2分数+班排名3分数+班/校排名
35
 }
37
 }

+ 13
- 2
sexam/src/main/resources/mapper/report/ERclassMapper.xml View File

32
     </select>
32
     </select>
33
     <!--班级报告-单科概况-班级概况-->
33
     <!--班级报告-单科概况-班级概况-->
34
     <select id="findById" resultType="java.util.Map">
34
     <select id="findById" resultType="java.util.Map">
35
-        select er.classmaxscore,er.classavgscore,er.classavgscorerank,er.schoolmaxscore,er.schoolavgscore
36
-        ,er.yxrate,er.jgrate
35
+        select er.yxrate,er.jgrate
36
+        <if test="rank.showrank==0">
37
+            ,0 classmaxscore,0 classavgscore,0 classavgscorerank,0 schoolmaxscore,0 schoolavgscore
38
+        </if>
39
+        <if test="rank.showrank==1">
40
+            ,er.classmaxscore,er.classavgscore,0 classavgscorerank,0 schoolmaxscore,0 schoolavgscore
41
+        </if>
42
+        <if test="rank.showrank==2">
43
+            ,er.classmaxscore,er.classavgscore,er.classavgscorerank,0 schoolmaxscore,0 schoolavgscore
44
+        </if>
45
+        <if test="rank.showrank==3">
46
+            ,er.classmaxscore,er.classavgscore,er.classavgscorerank,er.schoolmaxscore,er.schoolavgscore
47
+        </if>
37
         from e_rclass er
48
         from e_rclass er
38
         where er.examid=#{rank.examid} and er.classid=#{rank.classid} and er.subjectid=#{rank.subjectid}
49
         where er.examid=#{rank.examid} and er.classid=#{rank.classid} and er.subjectid=#{rank.subjectid}
39
         limit 1
50
         limit 1

+ 34
- 5
sexam/src/main/resources/mapper/report/EReportClassMapper.xml View File

10
     </select>
10
     </select>
11
     <!--试卷概况-题库-->
11
     <!--试卷概况-题库-->
12
     <select id="listTkSjGk" resultType="java.util.Map">
12
     <select id="listTkSjGk" resultType="java.util.Map">
13
-        select erq.qn,erq.qorder,erq.classavgscore,erq.classsrate,erq.gradeavgscore,erq.gradesrate,erq.classratetype
13
+        select erq.qn,erq.qorder,erq.classratetype
14
         ,erq.answerjson,erq.fullscorenum,erq.goodstujson,erq.badstujson,erq.questionid,erq.eptqid,erq.complexity,erq.score
14
         ,erq.answerjson,erq.fullscorenum,erq.goodstujson,erq.badstujson,erq.questionid,erq.eptqid,erq.complexity,erq.score
15
+        <if test="rank.showrank==0">
16
+            ,0 classavgscore,0 classsrate,0 gradeavgscore,0 gradesrate
17
+        </if>
18
+        <if test="rank.showrank!=0">
19
+            ,erq.classavgscore,erq.classsrate,erq.gradeavgscore,erq.gradesrate
20
+        </if>
15
         from e_rclass_question erq
21
         from e_rclass_question erq
16
         where erq.examid=#{rank.examid} and erq.classid=#{rank.classid}
22
         where erq.examid=#{rank.examid} and erq.classid=#{rank.classid}
17
         and erq.subjectid=#{rank.subjectid}
23
         and erq.subjectid=#{rank.subjectid}
29
     </select>
35
     </select>
30
     <!--试卷概况-附件-->
36
     <!--试卷概况-附件-->
31
     <select id="listFjSjGk" resultType="java.util.Map">
37
     <select id="listFjSjGk" resultType="java.util.Map">
32
-        select erq.qn,erq.qorder,erq.classavgscore,erq.classsrate,erq.gradeavgscore,erq.gradesrate
38
+        select erq.qn,erq.qorder
33
         ,erq.answerjson,erq.fullscorenum,erq.goodstujson,erq.badstujson,erq.eptqid,erq.classratetype
39
         ,erq.answerjson,erq.fullscorenum,erq.goodstujson,erq.badstujson,erq.eptqid,erq.classratetype
34
         ,epqq.ctype,epqq.score,epqq.answer,epqq.qtypename,epqq.optionnum
40
         ,epqq.ctype,epqq.score,epqq.answer,epqq.qtypename,epqq.optionnum
41
+        <if test="rank.showrank==0">
42
+            ,0 classavgscore,0 classsrate,0 gradeavgscore,0 gradesrate
43
+        </if>
44
+        <if test="rank.showrank!=0">
45
+            ,erq.classavgscore,erq.classsrate,erq.gradeavgscore,erq.gradesrate
46
+        </if>
35
         from e_rclass_question erq left join e_paper_qtype_question epqq on erq.eptqid = epqq.eptqid
47
         from e_rclass_question erq left join e_paper_qtype_question epqq on erq.eptqid = epqq.eptqid
36
         where erq.examid=#{rank.examid} and erq.classid=#{rank.classid}
48
         where erq.examid=#{rank.examid} and erq.classid=#{rank.classid}
37
         and erq.subjectid=#{rank.subjectid}
49
         and erq.subjectid=#{rank.subjectid}
40
     </select>
52
     </select>
41
     <!--试卷分析-大题分析-->
53
     <!--试卷分析-大题分析-->
42
     <select id="listType" resultType="java.util.Map">
54
     <select id="listType" resultType="java.util.Map">
43
-        select erq.qtypename,erq.qns,erq.score,erq.srate,erq.classavgscore,erq.classsrate,erq.gradeavgscore,erq.gradesrate
55
+        select erq.qtypename,erq.qns,erq.score,erq.srate
56
+        <if test="rank.showrank==0">
57
+            ,0 classavgscore,0 classsrate,0 gradeavgscore,0 gradesrate
58
+        </if>
59
+        <if test="rank.showrank!=0">
60
+            ,erq.classavgscore,erq.classsrate,erq.gradeavgscore,erq.gradesrate
61
+        </if>
44
         from e_rclass_qtype erq
62
         from e_rclass_qtype erq
45
         where erq.examid=#{rank.examid} and erq.classid=#{rank.classid}
63
         where erq.examid=#{rank.examid} and erq.classid=#{rank.classid}
46
         and erq.subjectid=#{rank.subjectid}
64
         and erq.subjectid=#{rank.subjectid}
48
     <!--试卷分析-小题分析-->
66
     <!--试卷分析-小题分析-->
49
     <select id="listQuestion" resultType="java.util.Map">
67
     <select id="listQuestion" resultType="java.util.Map">
50
         select erq.eptqid,erq.qn,erq.qorder,erq.score,erq.qtypename,erq.complexity
68
         select erq.eptqid,erq.qn,erq.qorder,erq.score,erq.qtypename,erq.complexity
51
-        ,erq.classavgscore,erq.classsrate,erq.gradeavgscore,erq.gradesrate
69
+        <if test="rank.showrank==0">
70
+            ,0 classavgscore,0 classsrate,0 gradeavgscore,0 gradesrate
71
+        </if>
72
+        <if test="rank.showrank!=0">
73
+            ,erq.classavgscore,erq.classsrate,erq.gradeavgscore,erq.gradesrate
74
+        </if>
52
         ,erq.answerjson,erq.fullscorenum
75
         ,erq.answerjson,erq.fullscorenum
53
         from e_rclass_question erq
76
         from e_rclass_question erq
54
         where erq.examid=#{rank.examid} and erq.classid=#{rank.classid}
77
         where erq.examid=#{rank.examid} and erq.classid=#{rank.classid}
56
     </select>
79
     </select>
57
     <!--试卷分析-知识点分析-->
80
     <!--试卷分析-知识点分析-->
58
     <select id="listPoint" resultType="java.util.Map">
81
     <select id="listPoint" resultType="java.util.Map">
59
-        select erp.pointname,erp.qns,erp.score,erp.srate,erp.classavgscore,erp.classsrate,erp.gradeavgscore,erp.gradesrate
82
+        select erp.pointname,erp.qns,erp.score,erp.srate
83
+        <if test="rank.showrank==0">
84
+            ,0 classavgscore,0 classsrate,0 gradeavgscore,0 gradesrate
85
+        </if>
86
+        <if test="rank.showrank!=0">
87
+            ,erp.classavgscore,erp.classsrate,erp.gradeavgscore,erp.gradesrate
88
+        </if>
60
         from e_rclass_point erp
89
         from e_rclass_point erp
61
         where erp.examid=#{rank.examid} and erp.classid=#{rank.classid}
90
         where erp.examid=#{rank.examid} and erp.classid=#{rank.classid}
62
         and erp.subjectid=#{rank.subjectid}
91
         and erp.subjectid=#{rank.subjectid}

+ 12
- 4
sexam/src/main/resources/mapper/report/ERstudentMapper.xml View File

9
         </collection>
9
         </collection>
10
     </resultMap>
10
     </resultMap>
11
     <select id="listSubject" resultType="java.util.Map">
11
     <select id="listSubject" resultType="java.util.Map">
12
-        select s.score,s.classrank,s.classrankpre,s.classmaxscore,s.classavgscore
13
-        ,s.schoolrank,s.schoolmaxscore,s.schoolavgscore,s.goal,s.nextgoal,s.subjectname,s.subjectid,s.bzscore
12
+        select s.score,s.classrank,s.classrankpre
13
+        ,s.schoolrank,s.goal,s.nextgoal,s.subjectname,s.subjectid,s.bzscore
14
         ,eps.device,eps.submittype,eps.endtime
14
         ,eps.device,eps.submittype,eps.endtime
15
         ,(case when s.subjectid='zf' then (select (
15
         ,(case when s.subjectid='zf' then (select (
16
         case when count(eps2.epsid)=count(case when eps2.sstate=3 then eps2.epsid else null end) then 3 else 2 end)
16
         case when count(eps2.epsid)=count(case when eps2.sstate=3 then eps2.epsid else null end) then 3 else 2 end)
362
     <!--班级报告教师成绩单-->
362
     <!--班级报告教师成绩单-->
363
     <select id="listTeacherCjd" resultType="java.util.Map">
363
     <select id="listTeacherCjd" resultType="java.util.Map">
364
         select cs.examid,cs.classid,cs.studentid,u.username,u.loginname,u.usersex,u.examno
364
         select cs.examid,cs.classid,cs.studentid,u.username,u.loginname,u.usersex,u.examno
365
-        ,s.score,s.classrank,s.classrankpre,s.classmaxscore,s.classavgscore
366
-        ,s.schoolrank,s.schoolmaxscore,s.schoolavgscore,s.goal,s.nextgoal,s.subjectname,s.subjectid,s.bzscore
365
+        ,s.score,s.subjectname,s.subjectid
366
+        <if test="stu.showrank==0 or stu.showrank==1">
367
+            ,0 classrank,0 schoolrank
368
+        </if>
369
+        <if test="stu.showrank==2">
370
+            ,s.classrank,0 schoolrank
371
+        </if>
372
+        <if test="stu.showrank==3">
373
+            ,s.classrank,s.schoolrank
374
+        </if>
367
         ,eps.device,eps.submittype,eps.endtime
375
         ,eps.device,eps.submittype,eps.endtime
368
         from e_class_student cs left join t_user u on cs.studentid=u.userid
376
         from e_class_student cs left join t_user u on cs.studentid=u.userid
369
         left join e_rstudent s on cs.classid = s.classid and cs.examid=s.examid and cs.studentid=s.studentid
377
         left join e_rstudent s on cs.classid = s.classid and cs.examid=s.examid and cs.studentid=s.studentid

Loading…
Cancel
Save