Browse Source

综合报告:总概览、违纪优秀统计

ywx
雍文秀 3 weeks ago
parent
commit
373d03a0e6
18 changed files with 234 additions and 5 deletions
  1. 55
    2
      smarking/src/main/java/com/xhkjedu/smarking/controller/report/ZhReportController.java
  2. 4
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportclass/MsrClassActionMapper.java
  3. 5
    1
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportclass/MsrClassSubjectGradeMapper.java
  4. 6
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportstu/MsrStudentActionMapper.java
  5. 2
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportstu/MsrStudentMapper.java
  6. 6
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportsubject/MsrSubjectClassMapper.java
  7. 4
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportsubject/MsrSubjectMapper.java
  8. 3
    1
      smarking/src/main/java/com/xhkjedu/smarking/model/report/reportsubject/MsrSubject.java
  9. 1
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/report/generate/ReportGenerateSubjectService.java
  10. 33
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrActionService.java
  11. 12
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrClassService.java
  12. 45
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrSubjectService.java
  13. 13
    0
      smarking/src/main/resources/mapper/report/reportclass/MsrClassActionMapper.xml
  14. 7
    1
      smarking/src/main/resources/mapper/report/reportclass/MsrClassSubjectGradeMapper.xml
  15. 17
    0
      smarking/src/main/resources/mapper/report/reportstu/MsrStudentActionMapper.xml
  16. 7
    0
      smarking/src/main/resources/mapper/report/reportstu/MsrStudentMapper.xml
  17. 5
    0
      smarking/src/main/resources/mapper/report/reportsubject/MsrSubjectClassMapper.xml
  18. 9
    0
      smarking/src/main/resources/mapper/report/reportsubject/MsrSubjectMapper.xml

+ 55
- 2
smarking/src/main/java/com/xhkjedu/smarking/controller/report/ZhReportController.java View File

@@ -4,8 +4,9 @@ import com.github.pagehelper.PageHelper;
4 4
 import com.github.pagehelper.PageInfo;
5 5
 import com.xhkjedu.smarking.model.exam.MsSubject;
6 6
 import com.xhkjedu.smarking.model.report.reportclass.MsrClassSubjectGrade;
7
-import com.xhkjedu.smarking.service.report.report.MsrClassQuestionService;
8
-import com.xhkjedu.smarking.service.report.report.MsrStudentService;
7
+import com.xhkjedu.smarking.model.report.reportstu.MsrStudentAction;
8
+import com.xhkjedu.smarking.model.report.reportsubject.MsrSubject;
9
+import com.xhkjedu.smarking.service.report.report.*;
9 10
 import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
10 11
 import com.xhkjedu.utils.N_Utils;
11 12
 import com.xhkjedu.utils.PageUtil;
@@ -33,6 +34,24 @@ public class ZhReportController {
33 34
     private MsrStudentService msrStudentService;
34 35
     @Resource
35 36
     private MsrClassQuestionService msrClassQuestionService;
37
+    @Resource
38
+    private MsrSubjectService msrSubjectService;
39
+    @Resource
40
+    private MsrActionService msrActionService;
41
+
42
+    /**
43
+     * @Description 总概览
44
+     * @Date 2025/1/3 14:59
45
+     * @Author YWX
46
+     * @Param [subject]
47
+     * @Return com.xhkjedu.vo.ResultVo
48
+     **/
49
+    @PostMapping("/zgl")
50
+    public ResultVo listSubjectForZgl(@RequestBody MsrSubject subject) {
51
+        N_Utils.validation(new Object[]{subject.getExamid(), "考试id", 1});
52
+        return new ResultVo(0, "获取成功", msrSubjectService.listSubjectForZgl(subject));
53
+    }
54
+
36 55
     /*
37 56
      * @Description 小分表-列表
38 57
      * @Date 2024/12/24 10:25:06
@@ -104,4 +123,38 @@ public class ZhReportController {
104 123
         return new ResultVo(0,"获取成功",msrClassQuestionService.listQuestionForAllObjsub(params));
105 124
     }
106 125
 
126
+    /**
127
+     * @Description 违纪优秀-班级统计
128
+     * @Date 2025/1/3 14:47
129
+     * @Author YWX
130
+     * @Param [action]
131
+     * @Return com.xhkjedu.vo.ResultVo
132
+     **/
133
+    @PostMapping("/wjyx_bj")
134
+    public ResultVo listXwBj(@RequestBody MsrStudentAction action) {
135
+        N_Utils.validation(new Object[]{action.getExamid(), "考试id", 1, action.getActiontype(), "类型", 1});
136
+        return new ResultVo(0, "获取成功", msrActionService.listXwBj(action));
137
+    }
138
+
139
+    /**
140
+     * @Description 违纪优秀-学生统计
141
+     * @Date 2025/1/3 14:49
142
+     * @Author YWX
143
+     * @Param [action]
144
+     * @Return com.xhkjedu.vo.ResultVo
145
+     **/
146
+    @PostMapping("/wjyx_bj")
147
+    public ResultVo listXwXs(@RequestBody MsrStudentAction action) {
148
+        N_Utils.validation(new Object[]{action.getExamid(), "考试id", 1, action.getActiontype(), "类型", 1});
149
+        Integer page = action.getPage();
150
+        if (N_Utils.isEmptyInteger(page)) {
151
+            return new ResultVo(0, "获取成功", msrActionService.listXwXs(action));
152
+        } else {
153
+            PageHelper.startPage(page, action.getPageSize());
154
+            List<Map> list = msrActionService.listXwXs(action);
155
+            PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
156
+            return new ResultVo(0, "获取成功", pageResult);
157
+        }
158
+    }
159
+
107 160
 }

+ 4
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportclass/MsrClassActionMapper.java View File

@@ -2,6 +2,7 @@ package com.xhkjedu.smarking.mapper.report.reportclass;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.report.reportclass.MsrClassAction;
5
+import com.xhkjedu.smarking.model.report.reportstu.MsrStudentAction;
5 6
 import org.apache.ibatis.annotations.Param;
6 7
 
7 8
 import java.util.List;
@@ -21,4 +22,7 @@ public interface MsrClassActionMapper extends TkMapper<MsrClassAction> {
21 22
 
22 23
     //违规试卷
23 24
     List<Map> listBadQuesActionByExamId(@Param("examid") Integer examid,@Param("subjectids") String subjectids);
25
+
26
+    //行为分析-班级
27
+    List<Map> listXwBj(@Param("action") MsrStudentAction action);
24 28
 }

+ 5
- 1
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportclass/MsrClassSubjectGradeMapper.java View File

@@ -5,6 +5,7 @@ import com.xhkjedu.smarking.model.report.reportclass.MsrClassSubjectGrade;
5 5
 import org.apache.ibatis.annotations.Param;
6 6
 
7 7
 import java.util.List;
8
+import java.util.Map;
8 9
 
9 10
 /**
10 11
  * @Description 阅卷报告-班级学科四率等级分析表 Mapper 接口
@@ -16,6 +17,9 @@ public interface MsrClassSubjectGradeMapper extends TkMapper<MsrClassSubjectGrad
16 17
     //综合报告-试题汇总表-全部班级-科目情况-四率等级分析
17 18
     List<MsrClassSubjectGrade> listSubjectGrade(@Param("sg")MsrClassSubjectGrade sg);
18 19
 
19
-    //综合报告-班级堆积-全科及格率分析
20
+    //综合报告-班级对比-全科及格率分析
20 21
     List<MsrClassSubjectGrade> listSubjectGradeForQk(@Param("examid") Integer examid,@Param("reportcode") String reportcode);
22
+
23
+    //综合报告-整体四率分析
24
+    List<Map<String,Object>> getZfScoreRate(@Param("examid") Integer examid);
21 25
 }

+ 6
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportstu/MsrStudentActionMapper.java View File

@@ -2,6 +2,10 @@ package com.xhkjedu.smarking.mapper.report.reportstu;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.report.reportstu.MsrStudentAction;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
8
+import java.util.Map;
5 9
 
6 10
 /**
7 11
  * @Description 考试报告学生违纪优秀分析表 Mapper 接口
@@ -9,4 +13,6 @@ import com.xhkjedu.smarking.model.report.reportstu.MsrStudentAction;
9 13
  * @Date 2025-01-03
10 14
  */
11 15
 public interface MsrStudentActionMapper extends TkMapper<MsrStudentAction> {
16
+    //行为分析-学生
17
+    List<Map> listXwBj(@Param("action") MsrStudentAction action);
12 18
 }

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportstu/MsrStudentMapper.java View File

@@ -22,4 +22,6 @@ public interface MsrStudentMapper extends TkMapper<MsrStudent> {
22 22
     List<Map<String, Object>> listStuScoreAndRankByExamidAndSubjectid(@Param("examid") int examid, @Param("subjectid") String subjectid);
23 23
     //学生报告-学生学科试题分析
24 24
     List<Map<String, Object>> listStuSubjectQuestions(@Param("params") ExamReportParams params);
25
+    //综合报告-总概览-整体分数分布分析
26
+    List<Map<String, Object>> listScoreForZgl(@Param("examid") Integer examid,@Param("subjectid") String subjectid);
25 27
 }

+ 6
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportsubject/MsrSubjectClassMapper.java View File

@@ -1,7 +1,12 @@
1 1
 package com.xhkjedu.smarking.mapper.report.reportsubject;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4
+import com.xhkjedu.smarking.model.report.reportsubject.MsrSubject;
4 5
 import com.xhkjedu.smarking.model.report.reportsubject.MsrSubjectClass;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
9
+import java.util.Map;
5 10
 
6 11
 /**
7 12
  * @Description 阅卷报告-科目班级分数分布区间分析表 Mapper 接口
@@ -9,4 +14,5 @@ import com.xhkjedu.smarking.model.report.reportsubject.MsrSubjectClass;
9 14
  * @Date 2024-12-09
10 15
  */
11 16
 public interface MsrSubjectClassMapper extends TkMapper<MsrSubjectClass> {
17
+    List<Map> listSubjectClass(@Param("subject") MsrSubject subject);
12 18
 }

+ 4
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportsubject/MsrSubjectMapper.java View File

@@ -4,6 +4,7 @@ import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.report.reportsubject.MsrSubject;
5 5
 import org.apache.ibatis.annotations.Param;
6 6
 
7
+import java.util.List;
7 8
 import java.util.Map;
8 9
 
9 10
 /**
@@ -15,4 +16,7 @@ public interface MsrSubjectMapper extends TkMapper<MsrSubject> {
15 16
 
16 17
     //综合报告-试题汇总表-全部班级-科目情况
17 18
     Map<String, Object> getSubjectBaseInfo(@Param("examid")Integer examid, @Param("subjectid")String subjectid);
19
+
20
+    //科目分析
21
+    List<Map> listSubjectForZgl(@Param("examid") Integer examid);
18 22
 }

+ 3
- 1
smarking/src/main/java/com/xhkjedu/smarking/model/report/reportsubject/MsrSubject.java View File

@@ -39,8 +39,10 @@ public class MsrSubject extends BaseBean {
39 39
     private Double scorerate;
40 40
     //总人数
41 41
     private Integer totalnum;
42
-    //考人数
42
+    //考人数
43 43
     private Integer stunum;
44
+    //参考人数占比
45
+    private Double numrate;
44 46
     //缺考人数
45 47
     private Integer missnum;
46 48
     //标准差

+ 1
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/report/generate/ReportGenerateSubjectService.java View File

@@ -128,6 +128,7 @@ public class ReportGenerateSubjectService {
128 128
         int missnum = totalnum - stunum;
129 129
         msrSubject.setTotalnum(totalnum);
130 130
         msrSubject.setStunum(stunum);
131
+        msrSubject.setNumrate(N_Utils.getIntegerDivideAndMulitiply(stunum, totalnum));
131 132
         msrSubject.setMissnum(missnum);
132 133
         DoubleSummaryStatistics subjectStatistics = studentList2.stream().mapToDouble(MsrStudent::getStuscore).summaryStatistics();
133 134
         double subjectStatisticsMax = N_Utils.handleInfinity(subjectStatistics.getMax());

+ 33
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrActionService.java View File

@@ -0,0 +1,33 @@
1
+package com.xhkjedu.smarking.service.report.report;
2
+
3
+import com.xhkjedu.smarking.mapper.report.reportclass.MsrClassActionMapper;
4
+import com.xhkjedu.smarking.mapper.report.reportstu.MsrStudentActionMapper;
5
+import com.xhkjedu.smarking.model.report.reportstu.MsrStudentAction;
6
+import org.springframework.stereotype.Service;
7
+
8
+import javax.annotation.Resource;
9
+import java.util.List;
10
+import java.util.Map;
11
+
12
+/**
13
+ *@Description 优秀违纪报告查询服务
14
+ *@Author ywx
15
+ *Date 2025/1/3 14:33
16
+ **/
17
+@Service
18
+public class MsrActionService {
19
+    @Resource
20
+    private MsrClassActionMapper msrClassActionMapper;
21
+    @Resource
22
+    private MsrStudentActionMapper msrStudentActionMapper;
23
+
24
+    //行为分析-班级
25
+    public List<Map> listXwBj(MsrStudentAction action) {
26
+        return msrClassActionMapper.listXwBj(action);
27
+    }
28
+
29
+    //行为分析-学生
30
+    public List<Map> listXwXs(MsrStudentAction action) {
31
+        return msrStudentActionMapper.listXwBj(action);
32
+    }
33
+}

+ 12
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrClassService.java View File

@@ -0,0 +1,12 @@
1
+package com.xhkjedu.smarking.service.report.report;
2
+
3
+import org.springframework.stereotype.Service;
4
+
5
+/**
6
+ *@Description 班级报告查询服务
7
+ *@Author ywx
8
+ *Date 2025/1/3 14:31
9
+ **/
10
+@Service
11
+public class MsrClassService {
12
+}

+ 45
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrSubjectService.java View File

@@ -0,0 +1,45 @@
1
+package com.xhkjedu.smarking.service.report.report;
2
+
3
+import com.xhkjedu.smarking.mapper.report.reportclass.MsrClassSubjectGradeMapper;
4
+import com.xhkjedu.smarking.mapper.report.reportstu.MsrStudentMapper;
5
+import com.xhkjedu.smarking.mapper.report.reportsubject.MsrSubjectMapper;
6
+import com.xhkjedu.smarking.model.report.reportsubject.MsrSubject;
7
+import org.springframework.stereotype.Service;
8
+
9
+import javax.annotation.Resource;
10
+import java.util.LinkedHashMap;
11
+import java.util.Map;
12
+
13
+/**
14
+ *@Description 科目报告查询服务
15
+ *@Author ywx
16
+ *Date 2025/1/3 14:32
17
+ **/
18
+@Service
19
+public class MsrSubjectService {
20
+    @Resource
21
+    private MsrSubjectMapper msrSubjectMapper;
22
+    @Resource
23
+    private MsrStudentMapper msrStudentMapper;
24
+    @Resource
25
+    private MsrClassSubjectGradeMapper msrClassSubjectGradeMapper;
26
+
27
+    /**
28
+     * @Description 总概览
29
+     * @Date 2025/1/3 15:49
30
+     * @Author YWX
31
+     * @Param [subject]
32
+     * @Return java.util.Map
33
+     **/
34
+    public Map<String, Object> listSubjectForZgl(MsrSubject subject) {
35
+        Integer examid = subject.getExamid();
36
+        Map<String, Object> map = new LinkedHashMap<>();
37
+        //总人数、平均分、标准差、难度、差异系数分析
38
+        map.put("subjects", msrSubjectMapper.listSubjectForZgl(examid));
39
+        //整体分数分布分析
40
+        map.put("scores", msrStudentMapper.listScoreForZgl(examid,"zf"));
41
+        //整体四率分析
42
+        map.put("scorerates", msrClassSubjectGradeMapper.getZfScoreRate(examid));
43
+        return map;
44
+    }
45
+}

+ 13
- 0
smarking/src/main/resources/mapper/report/reportclass/MsrClassActionMapper.xml View File

@@ -22,4 +22,17 @@
22 22
         where psq.examid=#{examid} and psq.subjectid in(#{subjectids}) and hasbad=1
23 23
         group by psq.studentid, psq.subjectid
24 24
     </select>
25
+    <!--行为分析-班级-->
26
+    <select id="listXwBj" resultType="java.util.Map">
27
+        select c.classname,ca.classid,ca.subjectjson
28
+        from msr_rclass_action ca left join t_class c on ca.classid = c.classid
29
+        where ca.examid=#{action.examid} and ca.actiontype=#{action.actiontype}
30
+        <if test="action.classid!=null and action.classid!=0">
31
+            and ca.classid=#{action.classid}
32
+        </if>
33
+        <foreach collection="action.classids" item="classid" open="and ca.classid in(0," separator="," close=")">
34
+            ${classid}
35
+        </foreach>
36
+        order by c.classtype,c.classorder,c.classid
37
+    </select>
25 38
 </mapper>

+ 7
- 1
smarking/src/main/resources/mapper/report/reportclass/MsrClassSubjectGradeMapper.xml View File

@@ -7,12 +7,18 @@
7 7
         select * from msr_class_subject_grade where examid = #{sg.examid} and subjectid = #{sg.subjectId}
8 8
         and reportcode = #{sg.reportCode} and classid = #{sg.classId}
9 9
     </select>
10
-    <!--综合报告-班级堆积-全科及格率分析-->
10
+    <!--综合报告-班级对比-全科及格率分析-->
11 11
     <select id="listSubjectGradeForQk" resultType="com.xhkjedu.smarking.model.report.reportclass.MsrClassSubjectGrade">
12 12
         select subjectid,rangename,stuids
13 13
         from msr_class_subject_grade
14 14
         where examid = #{examid} and classid = 0 and reportcode = #{reportcode}
15 15
     </select>
16
+    <!--综合报告-整体四率分析-->
17
+    <select id="getZfScoreRate" resultType="java.util.Map">
18
+        select rangename,rangenum,rangerate
19
+        from msr_class_subject_grade
20
+        where examid = #{examid} and reportcode = #{reportcode} and classid = 0 and subjectid = 'zf'
21
+    </select>
16 22
 
17 23
 </mapper>
18 24
 

+ 17
- 0
smarking/src/main/resources/mapper/report/reportstu/MsrStudentActionMapper.xml View File

@@ -1,4 +1,21 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.xhkjedu.smarking.mapper.report.reportstu.MsrStudentActionMapper">
4
+    <!--行为分析-学生-->
5
+    <select id="listXwBj" resultType="java.util.Map">
6
+        select c.classname,sa.classid,sa.studentid,sa.subjectjson,u.username,u.loginname
7
+        from msr_student_action sa left join t_class c on sa.classid = c.classid
8
+        left join t_user u on sa.studentid=u.userid
9
+        where sa.examid=#{action.examid} and sa.actiontype=#{action.actiontype}
10
+        <if test="action.classid!=null and action.classid!=0">
11
+            and sa.classid=#{action.classid}
12
+        </if>
13
+        <foreach collection="action.classids" item="classid" open="and sa.classid in(0," separator="," close=")">
14
+            ${classid}
15
+        </foreach>
16
+        <if test="action.createname!=null and action.createname!=''">
17
+            and (u.username like '%${action.createname}%' or u.loginname like '%${action.createname}%')
18
+        </if>
19
+        order by c.classtype,c.classorder,c.classid
20
+    </select>
4 21
 </mapper>

+ 7
- 0
smarking/src/main/resources/mapper/report/reportstu/MsrStudentMapper.xml View File

@@ -65,4 +65,11 @@
65 65
         where q.examid=#{params.examid} and q.subjectid=#{params.subjectid} and q.studentid=#{params.studentid}
66 66
         order by q.mptqid
67 67
     </select>
68
+    <!--综合报告-总概览-整体分数分布分析-->
69
+    <select id="listScoreForZgl" resultType="java.util.Map">
70
+        select stuscore,count(*) as num
71
+        from msr_student
72
+        where examid=#{examid} and subjectid=#{subjectid}
73
+        group by stuscore
74
+    </select>
68 75
 </mapper>

+ 5
- 0
smarking/src/main/resources/mapper/report/reportsubject/MsrSubjectClassMapper.xml View File

@@ -1,4 +1,9 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.xhkjedu.smarking.mapper.report.reportsubject.MsrSubjectClassMapper">
4
+    <select id="listSubjectClass" resultType="java.util.Map">
5
+        select *
6
+        from msr_subject_class
7
+        where examid = #{subject.examid}
8
+    </select>
4 9
 </mapper>

+ 9
- 0
smarking/src/main/resources/mapper/report/reportsubject/MsrSubjectMapper.xml View File

@@ -7,5 +7,14 @@
7 7
         select sid,examid,subjectid,avgscore,nd,qfd,maxscore,minscore,stunum from msr_subject
8 8
         where examid=#{examid} and subjectid=#{subjectid}
9 9
     </select>
10
+    <!--综合报告-总概览-->
11
+    <select id="listSubjectForZgl" resultType="java.util.Map">
12
+        select sid,subjectid,subjectname
13
+        ,totalnum,stunum,numrate
14
+        ,fullscore,avgscore,scorerate
15
+        ,bzc,nd,cyxs
16
+        from msr_subject
17
+        where examid=#{examid}
18
+    </select>
10 19
 
11 20
 </mapper>

Loading…
Cancel
Save