Bladeren bron

校级报告试题分析

ywx
王宁 2 dagen geleden
bovenliggende
commit
208e0614c6
20 gewijzigde bestanden met toevoegingen van 466 en 0 verwijderingen
  1. 14
    0
      smarking/src/main/java/com/xhkjedu/smarking/controller/report/XkReportController.java
  2. 108
    0
      smarking/src/main/java/com/xhkjedu/smarking/controller/report/ZhReportController.java
  3. 2
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsClassMapper.java
  4. 11
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportclass/MsrClassQuestionMapper.java
  5. 6
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportclass/MsrClassSubjectGradeMapper.java
  6. 2
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportother/MsrReportparamMapper.java
  7. 3
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportstu/MsrStudentMapper.java
  8. 6
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportsubject/MsrSubjectMapper.java
  9. 2
    0
      smarking/src/main/java/com/xhkjedu/smarking/model/report/reportclass/MsrClassQuestion.java
  10. 2
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/report/generate/ReportGenerateQuestionService.java
  11. 117
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrClassQuestionService.java
  12. 24
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrStudentService.java
  13. 22
    0
      smarking/src/main/java/com/xhkjedu/smarking/vo/report/reportother/ExamReportParams.java
  14. 5
    0
      smarking/src/main/resources/mapper/exam/MsClassMapper.xml
  15. 69
    0
      smarking/src/main/resources/mapper/report/reportclass/MsrClassQuestionMapper.xml
  16. 8
    0
      smarking/src/main/resources/mapper/report/reportclass/MsrClassSubjectGradeMapper.xml
  17. 6
    0
      smarking/src/main/resources/mapper/report/reportother/MsrReportparamMapper.xml
  18. 41
    0
      smarking/src/main/resources/mapper/report/reportstu/MsrStudentMapper.xml
  19. 7
    0
      smarking/src/main/resources/mapper/report/reportsubject/MsrSubjectMapper.xml
  20. 11
    0
      smarking/src/test/java/com/xhkjedu/smarking/SmarkingApplicationTests.java

+ 14
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/report/XkReportController.java Bestand weergeven

@@ -0,0 +1,14 @@
1
+package com.xhkjedu.smarking.controller.report;
2
+
3
+import org.springframework.web.bind.annotation.RequestMapping;
4
+import org.springframework.web.bind.annotation.RestController;
5
+
6
+/**
7
+ * @Description:学科报告
8
+ * @Author: WN
9
+ * @Date: 2024/12/24 17:36:06
10
+ **/
11
+@RestController
12
+@RequestMapping("/rxk")
13
+public class XkReportController {
14
+}

+ 108
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/report/ZhReportController.java Bestand weergeven

@@ -0,0 +1,108 @@
1
+package com.xhkjedu.smarking.controller.report;
2
+
3
+import com.github.pagehelper.PageHelper;
4
+import com.github.pagehelper.PageInfo;
5
+import com.xhkjedu.smarking.model.exam.MsSubject;
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;
9
+import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
10
+import com.xhkjedu.utils.N_Utils;
11
+import com.xhkjedu.utils.PageUtil;
12
+import com.xhkjedu.vo.PageResult;
13
+import com.xhkjedu.vo.ResultVo;
14
+import org.springframework.web.bind.annotation.PostMapping;
15
+import org.springframework.web.bind.annotation.RequestBody;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RestController;
18
+
19
+import javax.annotation.Resource;
20
+import java.util.List;
21
+import java.util.Map;
22
+
23
+/**
24
+ * @Description:综合报告
25
+ * @Author: WN
26
+ * @Date: 2024/12/24 9:25:37
27
+ **/
28
+@RestController
29
+@RequestMapping("/rzh")
30
+public class ZhReportController {
31
+
32
+    @Resource
33
+    private MsrStudentService msrStudentService;
34
+    @Resource
35
+    private MsrClassQuestionService msrClassQuestionService;
36
+
37
+    /*
38
+     * @Description 校级报告-小分表-列表
39
+     * @Date 2024/12/24 10:25:06
40
+     * @Author WN
41
+     * @Param [subject]
42
+     * @Return com.xhkjedu.vo.ResultVo
43
+     **/
44
+    @PostMapping("/xfb")
45
+    public ResultVo listStudentForxfb(@RequestBody MsSubject subject){
46
+        Integer page = subject.getPage();
47
+        Integer pageSize = subject.getPageSize();
48
+        N_Utils.validation(new Object[]{subject.getExamid(),"考试id",1,subject.getSubjectid(),"科目id",2,page,"显示页码",1,pageSize,"显示条数",1});
49
+        PageHelper.startPage(page, pageSize);
50
+        List<Map<String,Object>> rtnlst = msrStudentService.listStuScoreAndRank(subject.getExamid(), subject.getSubjectid());
51
+        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(rtnlst));
52
+        return new ResultVo(0,"获取成功",pageResult);
53
+    }
54
+
55
+    /*
56
+     * @Description 校级报告-试题汇总-全部班-科目情况
57
+     * @Date 2024/12/24 14:47:43
58
+     * @Author WN
59
+     * @Param [subject]
60
+     * @Return com.xhkjedu.vo.ResultVo
61
+     **/
62
+    @PostMapping("/sthz_qbb_km")
63
+    public ResultVo getSubjectSummary(@RequestBody MsrClassSubjectGrade subject){
64
+        N_Utils.validation(new Object[]{subject.getExamid(),"考试id",1,subject.getSubjectid(),"科目id",2});
65
+        Map<String,Object> rtnMap = msrClassQuestionService.getSubjectForAllSmall(subject);
66
+        return new ResultVo(0,"获取成功",rtnMap);
67
+    }
68
+
69
+    /*
70
+     * @Description 综合报告-试题汇总表-全部分类-按小题分析
71
+     * @Date 2024/12/24 15:46:14
72
+     * @Author WN
73
+     * @Param [params]
74
+     * @Return com.xhkjedu.vo.ResultVo
75
+     **/
76
+    @PostMapping("/sthz_q")
77
+    public ResultVo listQuestionForAllSmall(@RequestBody ExamReportParams params){
78
+        N_Utils.validation(new Object[]{params.getExamid(),"考试id",1,params.getSubjectid(),"科目id",2});
79
+        return new ResultVo(0,"获取成功",msrClassQuestionService.listQuestionForAllSmall(params));
80
+    }
81
+
82
+    /*
83
+     * @Description 综合报告-试题汇总表-全部分类-按大题分析
84
+     * @Date 2024/12/24 17:19:02
85
+     * @Author WN
86
+     * @Param [params]
87
+     * @Return com.xhkjedu.vo.ResultVo
88
+     **/
89
+    @PostMapping("/sthz_qt")
90
+    public ResultVo listQuestionForAllQtype(@RequestBody ExamReportParams params){
91
+        N_Utils.validation(new Object[]{params.getExamid(),"考试id",1,params.getSubjectid(),"科目id",2});
92
+        return new ResultVo(0,"获取成功",msrClassQuestionService.listQuestionForAllQtype(params));
93
+    }
94
+
95
+    /*
96
+     * @Description 综合报告-试题汇总表-全部分类-按主(客)题分析
97
+     * @Date 2024/12/24 17:27:44
98
+     * @Author WN
99
+     * @Param [params]
100
+     * @Return com.xhkjedu.vo.ResultVo
101
+     **/
102
+    @PostMapping("/sthz_os")
103
+    public ResultVo listQuestionForAllObjsub(@RequestBody ExamReportParams params){
104
+        N_Utils.validation(new Object[]{params.getExamid(),"考试id",1,params.getSubjectid(),"科目id",2});
105
+        return new ResultVo(0,"获取成功",msrClassQuestionService.listQuestionForAllObjsub(params));
106
+    }
107
+
108
+}

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsClassMapper.java Bestand weergeven

@@ -51,4 +51,6 @@ public interface MsClassMapper extends TkMapper<MsClass> {
51 51
 
52 52
     //获取考试关联班级
53 53
     List<MsClass> listClassByExamId(@Param("examid") Integer examid);
54
+    //考试科目关联不安及
55
+    List<MsClass> listClassByExamidAndSubjectid(@Param("examid") Integer examid, @Param("subjectid") String subjectid);
54 56
 }

+ 11
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportclass/MsrClassQuestionMapper.java Bestand weergeven

@@ -2,9 +2,11 @@ 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.MsrClassQuestion;
5
+import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
5 6
 import org.apache.ibatis.annotations.Param;
6 7
 
7 8
 import java.util.List;
9
+import java.util.Map;
8 10
 
9 11
 /**
10 12
  * @Description 阅卷报告-班级试题小题分析表 Mapper 接口
@@ -21,4 +23,13 @@ public interface MsrClassQuestionMapper extends TkMapper<MsrClassQuestion> {
21 23
     void updateBatchNdById(@Param("list") List<MsrClassQuestion> list);
22 24
     //修改区分度
23 25
     void updateBatchQfdById(@Param("list") List<MsrClassQuestion> list);
26
+
27
+    //综合报告-试题汇总表-全部班级-按小题分析
28
+    List<Map<String, Object>> listQuestionSummaryForSmall(@Param("param") ExamReportParams param);
29
+    //综合报告-试题汇总表-全部班级-按大题分析
30
+    List<Map<String, Object>> listQuestionSummaryForQtype(@Param("param") ExamReportParams param);
31
+    //综合报告-试题汇总表-全部分类-按主(客)题分析
32
+    List<Map<String, Object>> listQuestionSummaryForObjsub(@Param("param") ExamReportParams param);
33
+    //学科报告-各班学科试题分析
34
+    List<MsrClassQuestion> listQuestionForXh(@Param("param") ExamReportParams param);
24 35
 }

+ 6
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportclass/MsrClassSubjectGradeMapper.java Bestand weergeven

@@ -2,6 +2,9 @@ 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.MsrClassSubjectGrade;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
5 8
 
6 9
 /**
7 10
  * @Description 阅卷报告-班级学科四率等级分析表 Mapper 接口
@@ -9,4 +12,7 @@ import com.xhkjedu.smarking.model.report.reportclass.MsrClassSubjectGrade;
9 12
  * @Date 2024-12-09
10 13
  */
11 14
 public interface MsrClassSubjectGradeMapper extends TkMapper<MsrClassSubjectGrade> {
15
+
16
+    //综合报告-试题汇总表-全部班级-科目情况-四率等级分析
17
+    List<MsrClassSubjectGrade> listSubjectGrade(@Param("sg")MsrClassSubjectGrade sg);
12 18
 }

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportother/MsrReportparamMapper.java Bestand weergeven

@@ -15,6 +15,8 @@ public interface MsrReportparamMapper extends TkMapper<MsrReportparam> {
15 15
 
16 16
     //获取考试指定图例对应参数
17 17
     List<MsrReportparam> listReportparamByRpbelong(@Param("examid") Integer examid, @Param("rpbelong") String rpbelong, @Param("reportcode") String reportcode);
18
+    //获取指定科目参数
19
+    MsrReportparam getReportparamByRpbelongSubject(@Param("examid") Integer examid, @Param("rpbelong") String rpbelong, @Param("reportcode") String reportcode, @Param("subjectid") String subjectid);
18 20
 
19 21
     //批量删除
20 22
     int deleteBatchReportparam(@Param("list") List<Integer> list);

+ 3
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportstu/MsrStudentMapper.java Bestand weergeven

@@ -5,6 +5,7 @@ import com.xhkjedu.smarking.model.report.reportstu.MsrStudent;
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,4 +17,6 @@ public interface MsrStudentMapper extends TkMapper<MsrStudent> {
16 17
     List<MsrStudent> listStuScoreAndRankByExamid(@Param("examid") int examid);
17 18
     //批量修改学生主观题、客观题分值
18 19
     void updateBatchObjSubScore(@Param("list") List<MsrStudent> list);
20
+    //综合报告-小分表-学生分数排名
21
+    List<Map<String, Object>> listStuScoreAndRankByExamidAndSubjectid(@Param("examid") int examid, @Param("subjectid") String subjectid);
19 22
 }

+ 6
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportsubject/MsrSubjectMapper.java Bestand weergeven

@@ -2,6 +2,9 @@ package com.xhkjedu.smarking.mapper.report.reportsubject;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.report.reportsubject.MsrSubject;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.Map;
5 8
 
6 9
 /**
7 10
  * @Description 阅卷报告-科目分析表 Mapper 接口
@@ -9,4 +12,7 @@ import com.xhkjedu.smarking.model.report.reportsubject.MsrSubject;
9 12
  * @Date 2024-12-09
10 13
  */
11 14
 public interface MsrSubjectMapper extends TkMapper<MsrSubject> {
15
+
16
+    //综合报告-试题汇总表-全部班级-科目情况
17
+    Map<String, Object> getSubjectBaseInfo(@Param("examid")Integer examid, @Param("subjectid")String subjectid);
12 18
 }

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/report/reportclass/MsrClassQuestion.java Bestand weergeven

@@ -27,6 +27,8 @@ public class MsrClassQuestion extends BaseBean {
27 27
     private Integer mptqid;
28 28
     //题号
29 29
     private String qn;
30
+    //试题排序
31
+    private Integer qorder;
30 32
     //试题类型(1客观题 2主观题)
31 33
     private Integer qtype;
32 34
     //满分

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/report/generate/ReportGenerateQuestionService.java Bestand weergeven

@@ -174,6 +174,7 @@ public class ReportGenerateQuestionService {
174 174
             schoolQ.setSchoolavgscore(avgScore);
175 175
             schoolQ.setSchoolavgrate(avgScoreRate);
176 176
             schoolQ.setMptqid(question.getMptqid());
177
+            schoolQ.setQorder(question.getQorder());
177 178
             schoolQ.setZqda(question.getQanswer());
178 179
             schoolQ.setQn(question.getMptqn() + "." + question.getQn());
179 180
             // 全校班级试题情况
@@ -260,6 +261,7 @@ public class ReportGenerateQuestionService {
260 261
         classQ.setMptqid(question.getMptqid());
261 262
         classQ.setQtype(question.getQtype());
262 263
         classQ.setQn(question.getMptqn() + "." + question.getQn());
264
+        classQ.setQorder(question.getQorder());
263 265
         classQ.setFullscore(question.getQscore());
264 266
         classQ.setStunum(stunum);
265 267
         classQ.setClassmaxscore(maxScore);

+ 117
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrClassQuestionService.java Bestand weergeven

@@ -0,0 +1,117 @@
1
+package com.xhkjedu.smarking.service.report.report;
2
+
3
+import com.xhkjedu.smarking.mapper.exam.MsClassMapper;
4
+import com.xhkjedu.smarking.mapper.report.reportclass.MsrClassQuestionMapper;
5
+import com.xhkjedu.smarking.mapper.report.reportclass.MsrClassSubjectGradeMapper;
6
+import com.xhkjedu.smarking.mapper.report.reportother.MsrReportparamMapper;
7
+import com.xhkjedu.smarking.mapper.report.reportsubject.MsrSubjectMapper;
8
+import com.xhkjedu.smarking.model.exam.MsClass;
9
+import com.xhkjedu.smarking.model.report.reportclass.MsrClassSubjectGrade;
10
+import com.xhkjedu.smarking.model.report.reportother.MsrReportparam;
11
+import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
12
+import org.springframework.stereotype.Service;
13
+
14
+import javax.annotation.Resource;
15
+import java.util.ArrayList;
16
+import java.util.HashMap;
17
+import java.util.List;
18
+import java.util.Map;
19
+import java.util.stream.Collectors;
20
+
21
+/**
22
+ * @Description:试题表
23
+ * @Author: WN
24
+ * @Date: 2024/12/24 9:47:39
25
+ **/
26
+@Service
27
+public class MsrClassQuestionService {
28
+    @Resource
29
+    private MsrClassSubjectGradeMapper msrClassSubjectGradeMapper;
30
+    @Resource
31
+    private MsrSubjectMapper msrSubjectMapper;
32
+    @Resource
33
+    private MsrReportparamMapper msrReportparamMapper;
34
+    @Resource
35
+    private MsrClassQuestionMapper msrClassQuestionMapper;
36
+    @Resource
37
+    private MsClassMapper msClassMapper;
38
+
39
+
40
+    //综合报告-试题汇总表-全部班级-科目情况
41
+    public Map<String,Object> getSubjectForAllSmall(MsrClassSubjectGrade subjectGrade){
42
+        //获取科目基础信息
43
+        Map<String,Object> subjectMap = msrSubjectMapper.getSubjectBaseInfo(subjectGrade.getExamid(),subjectGrade.getSubjectid());
44
+        subjectGrade.setClassid(0);
45
+        subjectGrade.setReportcode("zh");
46
+        //获取科目四率
47
+        List<MsrClassSubjectGrade> subjectGradeList = msrClassSubjectGradeMapper.listSubjectGrade(subjectGrade);
48
+        subjectMap.put("subjectGradeList",subjectGradeList);
49
+
50
+        //获取四率参数
51
+        MsrReportparam reportparam = msrReportparamMapper.getReportparamByRpbelongSubject(subjectGrade.getExamid(),"scorerate","zh",subjectGrade.getSubjectid());
52
+
53
+        Map<String,Object> rtnMap = new HashMap<>();
54
+        rtnMap.put("reportparam",reportparam);
55
+        rtnMap.put("subject",subjectMap);
56
+
57
+        return rtnMap;
58
+    }
59
+    //综合报告-试题汇总表-全部分类-按小题分析
60
+    public Map<String,Object> listQuestionForAllSmall(ExamReportParams params){
61
+        List<Map<String,Object>> questionList = msrClassQuestionMapper.listQuestionSummaryForSmall(params);
62
+        List<Map<String,Object>> objlist;
63
+        List<Map<String,Object>> sublist;
64
+        if(params.getSelclass() == 2){//选择班级类型1全体 2全部班级对比 3指定班级对比 4单个班级
65
+            //获取考试关联班级
66
+            List<MsClass> classList= msClassMapper.listClassByExamidAndSubjectid(params.getExamid(),params.getSubjectid());
67
+
68
+            objlist = new ArrayList<>();
69
+            sublist = new ArrayList<>();
70
+
71
+            //初始化学校全体
72
+            List<Map<String,Object>> allSchool = questionList.stream().filter(m -> m.get("classid").equals(0)).collect(Collectors.toList());
73
+            for(Map<String,Object> school : allSchool){
74
+                school.put("classname","学校全体");
75
+                if(school.get("qtype").equals("1")){
76
+                    objlist.add(school);
77
+                }else{
78
+                    sublist.add(school);
79
+                }
80
+            }
81
+
82
+            for(MsClass c : classList){
83
+                List<Map<String,Object>> classQues = questionList.stream().filter(m -> m.get("classid").equals(c.getClassid())).collect(Collectors.toList());
84
+                for(Map<String,Object> cq : classQues){
85
+                    cq.put("classname",c.getClassname());
86
+                    if(cq.get("qtype").equals("1")){
87
+                        objlist.add(cq);
88
+                    }else{
89
+                        sublist.add(cq);
90
+                    }
91
+                }
92
+            }
93
+        }else{
94
+            objlist = questionList.stream().filter(m -> m.get("qtype").equals("1")).collect(Collectors.toList());
95
+            sublist = questionList.stream().filter(m -> m.get("qtype").equals("2")).collect(Collectors.toList());
96
+        }
97
+
98
+        Map<String,Object> rtnMap = new HashMap<>();
99
+        rtnMap.put("objlist",objlist);
100
+        rtnMap.put("sublist",sublist);
101
+        return rtnMap;
102
+    }
103
+    //综合报告-试题汇总表-全部分类-按大题分析
104
+    public List<Map<String,Object>> listQuestionForAllQtype(ExamReportParams params){
105
+        return msrClassQuestionMapper.listQuestionSummaryForQtype(params);
106
+    }
107
+
108
+    //综合报告-试题汇总表-全部分类-按主(客)题分析
109
+    public List<Map<String,Object>> listQuestionForAllObjsub(ExamReportParams params){
110
+        return msrClassQuestionMapper.listQuestionSummaryForObjsub(params);
111
+    }
112
+
113
+    public void listQuestionForXh(ExamReportParams params){
114
+
115
+    }
116
+
117
+}

+ 24
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrStudentService.java Bestand weergeven

@@ -0,0 +1,24 @@
1
+package com.xhkjedu.smarking.service.report.report;
2
+
3
+import com.xhkjedu.smarking.mapper.report.reportstu.MsrStudentMapper;
4
+import org.springframework.stereotype.Service;
5
+
6
+import javax.annotation.Resource;
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+/**
11
+ * @Description:学生报告信息
12
+ * @Author: WN
13
+ * @Date: 2024/12/24 9:50:38
14
+ **/
15
+@Service
16
+public class MsrStudentService {
17
+    @Resource
18
+    private MsrStudentMapper msrStudentMapper;
19
+
20
+    //综合报告-小分表-列表
21
+    public List<Map<String,Object>> listStuScoreAndRank(Integer examid, String subjectid){
22
+        return msrStudentMapper.listStuScoreAndRankByExamidAndSubjectid(examid,subjectid);
23
+    }
24
+}

+ 22
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/report/reportother/ExamReportParams.java Bestand weergeven

@@ -0,0 +1,22 @@
1
+package com.xhkjedu.smarking.vo.report.reportother;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @Description:考试报告参数接受类
7
+ * @Author: WN
8
+ * @Date: 2024/12/24 15:36:48
9
+ **/
10
+@Data
11
+public class ExamReportParams {
12
+
13
+    private Integer examid;//考试ID
14
+
15
+    private String subjectid;//科目ID
16
+
17
+    private Integer selclass;//选择班级类型1全体 2全部班级对比 3指定班级对比 4单个班级
18
+
19
+    private Integer classid;//班级ID
20
+
21
+    private String classids;//多个班级id
22
+}

+ 5
- 0
smarking/src/main/resources/mapper/exam/MsClassMapper.xml Bestand weergeven

@@ -114,4 +114,9 @@
114 114
         from ms_class where examid=#{examid}
115 115
         order by mcid
116 116
     </select>
117
+
118
+    <!--获取考试科目关联班级-->
119
+    <select id="listClassByExamidAndSubjectid" resultType="com.xhkjedu.smarking.model.exam.MsClass">
120
+        select classid,classname,classtype from ms_class where examid=#{examid} and subjectid=#{subjectid} order by mcid
121
+    </select>
117 122
 </mapper>

+ 69
- 0
smarking/src/main/resources/mapper/report/reportclass/MsrClassQuestionMapper.xml Bestand weergeven

@@ -32,5 +32,74 @@
32 32
             update msr_class_question set qfdms = #{item.ndms},qfdfw = #{item.ndfw} where cqid = #{item.cqid}
33 33
         </foreach>
34 34
     </update>
35
+    
36
+    <resultMap id="zhQuestionSummary" type="java.util.Map">
37
+        <result property="cqid" column="cqid"/>
38
+        <result property="classid" column="classid"/>
39
+        <result property="mptqid" column="mptqid"/>
40
+        <result property="qn" column="qn"/>
41
+        <result property="qtype" column="qtype"/>
42
+        <result property="fullscore" column="fullscore"/>
43
+        <result property="schoolavgscore" column="schoolavgscore"/>
44
+        <result property="nd" column="nd"/>
45
+        <result property="ndms" column="ndms"/>
46
+        <result property="qfd" column="qfd"/>
47
+        <result property="qfdms" column="qfdms"/>
48
+        <result property="zqda" column="zqda"/>
49
+        <result property="zqrate" column="zqrate"/>
50
+        <result property="lfnum" column="lfnum"/>
51
+        <result property="lfrate" column="lfrate"/>
52
+        <result property="mfnum" column="mfnum"/>
53
+        <result property="mfrate" column="mfrate"/>
54
+        <collection property="objs" ofType="java.util.Map" javaType="java.util.ArrayList">
55
+            <result property="cqoid" column="cqoid"/>
56
+            <result property="xxda" column="xxda"/>
57
+            <result property="xxnum" column="xxnum"/>
58
+            <result property="xxnum" column="xxnum"/>
59
+            <result property="xxrate" column="xxrate"/>
60
+        </collection>
61
+    </resultMap>
62
+    <!--综合报告-试题汇总表-全部分类-按小题分析-->
63
+    <select id="listQuestionSummaryForSmall" resultMap="zhQuestionSummary">
64
+        select q.cqid,q.classid,q.mptqid,q.qn,q.qtype,q.fullscore,q.schoolavgscore,q.bzc,q.nd,q.ndms,q.qfd,q.qfdms,q.zqda,q.zqrate,q.lfnum,q.lfrate,q.mfnum,q.mfrate,qo.cqoid,qo.xxda,xxnum,qo.xxrate
65
+        from msr_class_question q
66
+        left join msr_class_question_obj qo on q.mptqid=qo.mptqid
67
+        where q.examid=#{param.examid} and q.subjectid=#{param.subjectid}
68
+        <if test="param.selclass == 1">and q.classid=0</if>
69
+        <if test="param.selclass == 4">and q.classid=#{param.classid}</if>
70
+        order by q.qorder
71
+    </select>
72
+    <!--综合报告-试题汇总表-全部分类-按大题分析-->
73
+    <select id="listQuestionSummaryForQtype" resultType="java.util.Map">
74
+        select t.cqtid,t.classid,t.mptid,t.mptqn,t.avgscore,t.bzc,t.nd,t.ndms,t.qfd,t.qfdms,t.fullscore,
75
+            t.mfnum,t.mfrate,t.lfnum,t.lfrate,c.classname from msr_class_qtype t
76
+            left join ms_class c on t.examid=c.examid and t.subjectid=c.subjectid and t.classid=c.classid
77
+        where t.examid=#{param.examid} and t.subjectid=#{param.subjectid}
78
+        <if test="param.selclass == 1">and t.classid=0</if>
79
+        <if test="param.selclass == 4">and t.classid=#{param.classid}</if>
80
+        order by t.cqtid,t.mptorder
81
+    </select>
82
+    <!--综合报告-试题汇总表-全部分类-按主(客)题分析-->
83
+    <select id="listQuestionSummaryForObjsub" resultType="java.util.Map">
84
+        select q.coid,q.classid,q.qtype,q.stunum,q.fullscore,q.avgscore,q.avgrate,nd,q.mfnum,q.mfrate,
85
+        q.lfnum,q.lfrate,c.classname from msr_class_qobjsub q
86
+        left join ms_class c on q.examid=c.examid and q.subjectid=c.subjectid and q.classid=c.classid
87
+        where q.examid=#{param.examid} and q.subjectid=#{param.subjectid}
88
+        <if test="param.selclass == 1">and q.classid=0</if>
89
+        <if test="param.selclass == 4">and q.classid=#{param.classid}</if>
90
+        order by q.coid
91
+    </select>
92
+
93
+    <!--学科报告-各班学科试题分析-->
94
+    <select id="listQuestionForXh" resultType="com.xhkjedu.smarking.model.report.reportclass.MsrClassQuestion">
95
+        select q.mptqid,q.classid,q.qn,q.qtype,
96
+        q.classavgrate,q.schoolavgrate,q.scorerate,q.scoreratec,q.qfd,q.qfdms,c.classname
97
+        from msr_class_question q left join ms_class c on q.examid=c.examid
98
+        and q.subjectid=c.subjectid and q.classid=c.classid
99
+        where q.examid=#{param.examid} and q.subjectid=#{param.subjectid} and q.classid in
100
+        <foreach collection="param.classids" item="item" open="(" separator="," close=")">#{item}</foreach>
101
+        order by q.mptqid
102
+    </select>
103
+
35 104
 
36 105
 </mapper>

+ 8
- 0
smarking/src/main/resources/mapper/report/reportclass/MsrClassSubjectGradeMapper.xml Bestand weergeven

@@ -1,4 +1,12 @@
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.reportclass.MsrClassSubjectGradeMapper">
4
+
5
+    <!--综合报告-试题汇总表-全部班级-科目情况-四率等级分析-->
6
+    <select id="listSubjectGrade" resultType="com.xhkjedu.smarking.model.report.reportclass.MsrClassSubjectGrade">
7
+        select * from msr_class_subject_grade where examid = #{sg.examid} and subjectid = #{sg.subjectId}
8
+        and reportcode = #{sg.reportCode} and classid = #{sg.classId}
9
+    </select>
10
+
4 11
 </mapper>
12
+

+ 6
- 0
smarking/src/main/resources/mapper/report/reportother/MsrReportparamMapper.xml Bestand weergeven

@@ -14,6 +14,12 @@
14 14
         order by rpid
15 15
     </select>
16 16
 
17
+    <!--获取科目对应参数-->
18
+    <select id="getReportparamByRpbelongSubject" resultType="com.xhkjedu.smarking.model.report.reportother.MsrReportparam">
19
+        select * from msr_reportparam where examid=#{examid} and rpbelong = #{rpbelong} and
20
+                                            reportcode = #{reportcode} and subjectid = #{subjectid} limit 1
21
+    </select>
22
+
17 23
     <!--删除-->
18 24
     <delete id="deleteBatchReportparam">
19 25
         delete from msp_reportparam where rpid in

+ 41
- 0
smarking/src/main/resources/mapper/report/reportstu/MsrStudentMapper.xml Bestand weergeven

@@ -12,4 +12,45 @@
12 12
             update msr_student set objscore = #{item.objscore},subscore = #{item.subscore} where rsid = #{item.rsid}
13 13
         </foreach>
14 14
     </update>
15
+
16
+    <!--综合报告-小分表-学生分数排名-->
17
+    <resultMap id="studentChengji" type="java.util.Map">
18
+        <id property="rsid" column="rsid"/>
19
+        <result property="examid" column="examid"/>
20
+        <result property="subjectid" column="subjectid"/>
21
+        <result property="studentid" column="studentid"/>
22
+        <result property="username" column="username"/>
23
+        <result property="examno" column="examno"/>
24
+        <result property="classid" column="classid"/>
25
+        <result property="classname" column="classname"/>
26
+        <result property="stuscore" column="stuscore"/>
27
+        <result property="classrank" column="classrank"/>
28
+        <result property="schoolrank" column="schoolrank"/>
29
+        <result property="objscore" column="objscore"/>
30
+        <result property="subscore" column="subscore"/>
31
+        <result property="totalscore" column="totalscore"/>
32
+        <collection property="questions" ofType="java.util.Map" javaType="java.util.ArrayList">
33
+            <result property="mpsqid" column="mpsqid"/>
34
+            <result property="qn" column="qn"/>
35
+            <result property="stuscore" column="xtscore"/>
36
+            <result property="answertype" column="answertype"/>
37
+            <result property="stuanswer" column="stuanswer"/>
38
+            <result property="qanswer" column="qanswer"/>
39
+            <result property="qscore" column="qscore"/>
40
+            <result property="qtype" column="qtype"/>
41
+            <result property="mptqn" column="mptqn"/>
42
+        </collection>
43
+    </resultMap>
44
+    <select id="listStuScoreAndRankByExamidAndSubjectid" resultMap="studentChengji">
45
+        select distinct s.rsid,s.examid,s.subjectid,s.studentid,s.classid,c.classname,s.stuscore,s.classrank,
46
+        s.schoolrank,s.objscore,s.subscore,sq.mpsqid,sq.qn,sq.stuscore as xtscore,sq.answertype,sq.stuanswer,
47
+        q.qanswer,q.qscore,q.qtype,qt.mptqn
48
+        from msr_student s left join ms_class c on s.classid=c.classid
49
+        left join ms_paper_student_question sq on s.examid=sq.examid
50
+        and s.subjectid=sq.subjectid and s.studentid=sq.studentid
51
+        left join ms_paper_qtype_question q on sq.mptqid=q.mptqid
52
+        left join ms_paper_qtype qt on q.mptid=qt.mptid
53
+        where s.examid=#{examid} and s.subjectid=#{subjectid}
54
+        order by s.schoolrank,s.rsid,qt.mptorder,q.qorder
55
+    </select>
15 56
 </mapper>

+ 7
- 0
smarking/src/main/resources/mapper/report/reportsubject/MsrSubjectMapper.xml Bestand weergeven

@@ -1,4 +1,11 @@
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.MsrSubjectMapper">
4
+
5
+    <!--综合报告-试题汇总表-全部班级-科目情况-->
6
+    <select id="getSubjectBaseInfo" resultType="java.util.Map">
7
+        select sid,examid,subjectid,avgscore,nd,qfd,maxscore,minscore,stunum from msr_subject
8
+        where examid=#{examid} and subjectid=#{subjectid}
9
+    </select>
10
+
4 11
 </mapper>

+ 11
- 0
smarking/src/test/java/com/xhkjedu/smarking/SmarkingApplicationTests.java Bestand weergeven

@@ -1,13 +1,24 @@
1 1
 package com.xhkjedu.smarking;
2 2
 
3
+import com.xhkjedu.smarking.service.report.generate.ReportGenerateQuestionService;
3 4
 import org.junit.jupiter.api.Test;
4 5
 import org.springframework.boot.test.context.SpringBootTest;
5 6
 
7
+import javax.annotation.Resource;
8
+
6 9
 @SpringBootTest
7 10
 class SmarkingApplicationTests {
8 11
 
12
+    @Resource
13
+    private ReportGenerateQuestionService reportGenerateQuestionService;
14
+
9 15
     @Test
10 16
     void contextLoads() {
17
+        try {
18
+            reportGenerateQuestionService.generateQuestion(1,3);
19
+        } catch (Exception e) {
20
+            throw new RuntimeException(e);
21
+        }
11 22
     }
12 23
 
13 24
 }

Laden…
Annuleren
Opslaan