Browse Source

Merge remote-tracking branch 'origin/ywx' into wn

wn
王宁 9 hours ago
parent
commit
bc7079a0d8
18 changed files with 371 additions and 14 deletions
  1. 66
    0
      smarking/src/main/java/com/xhkjedu/smarking/controller/report/XjReportController.java
  2. 55
    5
      smarking/src/main/java/com/xhkjedu/smarking/controller/report/ZhReportController.java
  3. 7
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportclass/MsrClassNearlineMapper.java
  4. 8
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportother/MsrExamMapper.java
  5. 3
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportstu/MsrStudentMapper.java
  6. 3
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportsubject/MsrSubjectMapper.java
  7. 4
    0
      smarking/src/main/java/com/xhkjedu/smarking/model/report/reportother/MsrExam.java
  8. 64
    5
      smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrClassService.java
  9. 40
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrStudentService.java
  10. 41
    2
      smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrSubjectService.java
  11. 2
    0
      smarking/src/main/java/com/xhkjedu/smarking/service/report/reportother/MsrExamService.java
  12. 27
    2
      smarking/src/main/java/com/xhkjedu/smarking/utils/MarkingUtil.java
  13. 17
    0
      smarking/src/main/java/com/xhkjedu/smarking/vo/report/reportother/ScoreGroupVo.java
  14. 1
    0
      smarking/src/main/java/com/xhkjedu/smarking/vo/report/reportstu/StudentParams.java
  15. 16
    0
      smarking/src/main/resources/mapper/report/reportclass/MsrClassNearlineMapper.xml
  16. 9
    0
      smarking/src/main/resources/mapper/report/reportother/MsrExamMapper.xml
  17. 4
    0
      smarking/src/main/resources/mapper/report/reportstu/MsrStudentMapper.xml
  18. 4
    0
      smarking/src/main/resources/mapper/report/reportsubject/MsrSubjectMapper.xml

+ 66
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/report/XjReportController.java View File

@@ -0,0 +1,66 @@
1
+package com.xhkjedu.smarking.controller.report;
2
+
3
+import com.xhkjedu.smarking.model.report.reportsubject.MsrSubject;
4
+import com.xhkjedu.smarking.service.report.report.MsrStudentService;
5
+import com.xhkjedu.smarking.service.report.report.MsrSubjectService;
6
+import com.xhkjedu.smarking.vo.report.reportstu.StudentParams;
7
+import com.xhkjedu.utils.N_Utils;
8
+import com.xhkjedu.vo.ResultVo;
9
+import org.springframework.web.bind.annotation.*;
10
+
11
+import javax.annotation.Resource;
12
+
13
+/**
14
+ *@Description 校级报告
15
+ *@Author ywx
16
+ *Date 2025/1/10 14:31
17
+ **/
18
+@RestController
19
+@RequestMapping("/rxj")
20
+public class XjReportController {
21
+    @Resource
22
+    private MsrSubjectService msrSubjectService;
23
+    @Resource
24
+    private MsrStudentService msrStudentService;
25
+
26
+    /**
27
+     * @Description 总体情况汇总分析-总分基本情况成绩分析
28
+     * @Date 2025/1/10 14:54
29
+     * @Author YWX
30
+     * @Param [subject]
31
+     * @Return com.xhkjedu.vo.ResultVo
32
+     **/
33
+    @PostMapping("/hz_zf")
34
+    public ResultVo getExamForHzZf(@RequestBody MsrSubject subject) {
35
+        Integer examid = subject.getExamid();
36
+        N_Utils.validation(new Object[]{examid, "考试id", 1});
37
+        return new ResultVo(0, "获取成功", msrSubjectService.getExamForHzZf(examid));
38
+    }
39
+
40
+    /**
41
+     * @Description 总体情况汇总分析-各学科基本数据对比情况
42
+     * @Date 2025/1/10 15:04
43
+     * @Author YWX
44
+     * @Param [params]
45
+     * @Return com.xhkjedu.vo.ResultVo
46
+     **/
47
+    @PostMapping("/hz_xk")
48
+    public ResultVo listSubjectForHzXk(@RequestBody StudentParams params) {
49
+        N_Utils.validation(new Object[]{params.getExamid(), "考试id", 1});
50
+        return new ResultVo(0, "获取成功", msrSubjectService.listSubjectForHzXk(params));
51
+    }
52
+
53
+    /**
54
+     * @Description 总分分布
55
+     * @Date 2025/1/10 17:28
56
+     * @Author YWX
57
+     * @Param [params]
58
+     * @Return com.xhkjedu.vo.ResultVo
59
+     **/
60
+    @PostMapping("/zffb")
61
+    public ResultVo listScoreForZfFb(@RequestBody StudentParams params) {
62
+        N_Utils.validation(new Object[]{params.getExamid(), "考试id", 1});
63
+        return new ResultVo(0, "获取成功", msrStudentService.listScoreForZfFb(params));
64
+    }
65
+
66
+}

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

@@ -55,6 +55,13 @@ public class ZhReportController {
55 55
         return new ResultVo(0, "获取成功", msrSubjectService.listSubjectForZgl(subject));
56 56
     }
57 57
 
58
+    /**
59
+     * @Description 排行榜-指标
60
+     * @Date 2025/1/10 14:49
61
+     * @Author YWX
62
+     * @Param []
63
+     * @Return com.xhkjedu.vo.ResultVo
64
+     **/
58 65
     @PostMapping("/phb_zb")
59 66
     public ResultVo listPhbZb() {
60 67
         return new ResultVo(0, "获取成功", msrStudentService.listPhbZb());
@@ -121,12 +128,14 @@ public class ZhReportController {
121 128
      **/
122 129
     @PostMapping("/bjdb")
123 130
     public ResultVo listClassForBjDb(@RequestBody StudentParams params) {
131
+        List<Integer> classids = params.getClassids();
124 132
         N_Utils.validation(new Object[]{
125 133
                 params.getExamid(), "考试id", 1
126 134
                 , params.getSubjectid(), "科目", 2
127
-                , params.getClassids(), "班级", 3
135
+                , classids, "班级", 3
128 136
                 , params.getLabels(), "指标", 3
129 137
         });
138
+        classids.add(0);
130 139
         return new ResultVo(0, "获取成功", msrClassService.listClassForBjDb(params));
131 140
     }
132 141
 
@@ -155,12 +164,14 @@ public class ZhReportController {
155 164
      **/
156 165
     @PostMapping("/fsd")
157 166
     public ResultVo listClassForFsd(@RequestBody StudentParams params) {
167
+        List<Integer> classids = params.getClassids();
158 168
         N_Utils.validation(new Object[]{
159 169
                 params.getExamid(), "考试id", 1
160 170
                 , params.getSubjectid(), "科目", 2
161
-                , params.getClassids(), "班级", 3
171
+                , classids, "班级", 3
162 172
                 , params.getType(), "分段类型", 1
163 173
         });
174
+        classids.add(0);
164 175
         params.setReportcode("zh");
165 176
         return new ResultVo(0, "获取成功", msrClassService.listClassForFsd(params));
166 177
     }
@@ -227,16 +238,55 @@ public class ZhReportController {
227 238
      **/
228 239
     @PostMapping("/mcbl")
229 240
     public ResultVo listClassForMcBl(@RequestBody StudentParams params) {
241
+        List<Integer> classids = params.getClassids();
230 242
         N_Utils.validation(new Object[]{
231 243
                 params.getExamid(), "考试id", 1
232 244
                 , params.getSubjectid(), "科目", 2
233
-                , params.getClassids(), "班级", 3
234
-                , params.getType(), "分段类型", 1
245
+                , classids, "班级", 3
246
+                , params.getType(), "类型", 1
235 247
         });
236
-        params.setReportcode("zh");
248
+        classids.add(0);
237 249
         return new ResultVo(0, "获取成功", msrClassService.listClassForMcBl(params));
238 250
     }
239 251
 
252
+    /**
253
+     * @Description 总分分档上线-列表
254
+     * @Date 2025/1/10 9:26
255
+     * @Author YWX
256
+     * @Param [params]
257
+     * @Return com.xhkjedu.vo.ResultVo
258
+     **/
259
+    @PostMapping("/fdsx_zf")
260
+    public ResultVo listClassForFdSxZf(@RequestBody StudentParams params) {
261
+        List<Integer> classids = params.getClassids();
262
+        N_Utils.validation(new Object[]{
263
+                params.getExamid(), "考试id", 1
264
+                , classids, "班级", 3
265
+        });
266
+        classids.add(0);
267
+        params.setSubjectid("zf");
268
+        return new ResultVo(0, "获取成功", msrClassService.listClassForFdSxZf(params));
269
+    }
270
+
271
+    /**
272
+     * @Description 学科分档上线-列表
273
+     * @Date 2025/1/10 11:35
274
+     * @Author YWX
275
+     * @Param [params]
276
+     * @Return com.xhkjedu.vo.ResultVo
277
+     **/
278
+    @PostMapping("/fdsx_xk")
279
+    public ResultVo listClassForFdSxXk(@RequestBody StudentParams params) {
280
+        List<Integer> classids = params.getClassids();
281
+        N_Utils.validation(new Object[]{
282
+                params.getExamid(), "考试id", 1
283
+                , classids, "班级", 3
284
+                ,params.getDworder(), "档位序号", 1
285
+        });
286
+        classids.add(0);
287
+        return new ResultVo(0, "获取成功", msrClassService.listClassForFdSxXk(params));
288
+    }
289
+
240 290
     /**
241 291
      * @Description 违纪优秀-班级统计
242 292
      * @Date 2025/1/3 14:47

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

@@ -2,6 +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.MsrClassNearline;
5
+import com.xhkjedu.smarking.vo.report.reportstu.StudentParams;
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,6 @@ import com.xhkjedu.smarking.model.report.reportclass.MsrClassNearline;
9 14
  * @Date 2024-12-09
10 15
  */
11 16
 public interface MsrClassNearlineMapper extends TkMapper<MsrClassNearline> {
17
+    //分档上线-列表
18
+    List<Map> listClassForFdSx(@Param("sql") String sql, @Param("params") StudentParams params);
12 19
 }

+ 8
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportother/MsrExamMapper.java View File

@@ -4,6 +4,8 @@ import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.report.reportother.MsrExam;
5 5
 import org.apache.ibatis.annotations.Param;
6 6
 
7
+import java.util.Map;
8
+
7 9
 /**
8 10
  * @Description 阅卷报告-总体分析表 Mapper 接口
9 11
  * @Author auto
@@ -13,4 +15,10 @@ public interface MsrExamMapper extends TkMapper<MsrExam> {
13 15
 
14 16
     //清除单次考试所有报告
15 17
     void deleteReportByExamid(@Param("examid") int examid);
18
+
19
+    //获取单次考试的总分和最高分
20
+    Map<String, Object> getFullAndMaxScoreByExamId(@Param("examid") Integer examid);
21
+
22
+    //总分基本情况成绩分析
23
+    Map getExamForHzZf(@Param("examid") Integer examid);
16 24
 }

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

@@ -27,4 +27,7 @@ public interface MsrStudentMapper extends TkMapper<MsrStudent> {
27 27
 
28 28
     //综合报告-排行榜
29 29
     List<Map> listStudentForPhb(@Param("sql") String sql, @Param("params") StudentParams params);
30
+
31
+    //学生成绩分析
32
+    List<MsrStudent> listStudentBySql(@Param("sql") String sql);
30 33
 }

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

@@ -19,4 +19,7 @@ public interface MsrSubjectMapper extends TkMapper<MsrSubject> {
19 19
 
20 20
     //科目分析
21 21
     List<Map> listSubjectForZgl(@Param("examid") Integer examid);
22
+
23
+    //科目分析列表
24
+    List<Map> listSubjectBySql(@Param("sql") String sql);
22 25
 }

+ 4
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/report/reportother/MsrExam.java View File

@@ -31,10 +31,14 @@ public class MsrExam extends BaseBean {
31 31
     private Integer missnum;
32 32
     //考试科目数量
33 33
     private Integer subjectnum;
34
+    //满分
35
+    private Double fullscore;
34 36
     //最高分
35 37
     private Double maxscore;
36 38
     //最低分
37 39
     private Double minscore;
40
+    //平均分
41
+    private Double avgscore;
38 42
     //标准差
39 43
     private Double bzc;
40 44
     //保存时间

+ 64
- 5
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrClassService.java View File

@@ -2,6 +2,7 @@ package com.xhkjedu.smarking.service.report.report;
2 2
 
3 3
 import com.alibaba.fastjson.JSON;
4 4
 import com.xhkjedu.smarking.mapper.report.reportclass.*;
5
+import com.xhkjedu.smarking.mapper.report.reportother.MsrExamMapper;
5 6
 import com.xhkjedu.smarking.model.report.reportother.MsrReportparam;
6 7
 import com.xhkjedu.smarking.service.report.reportother.MsrReportparamService;
7 8
 import com.xhkjedu.smarking.utils.MarkingUtil;
@@ -29,6 +30,10 @@ public class MsrClassService {
29 30
     @Resource
30 31
     private MsrClassRankrateMapper msrClassRankrateMapper;
31 32
     @Resource
33
+    private MsrClassNearlineMapper msrClassNearlineMapper;
34
+    @Resource
35
+    private MsrExamMapper msrExamMapper;
36
+    @Resource
32 37
     private MsrReportparamService msrReportparamService;
33 38
 
34 39
     /**
@@ -42,7 +47,7 @@ public class MsrClassService {
42 47
         List<LabelVo> labels = params.getLabels();
43 48
         StringBuilder sql = new StringBuilder();
44 49
         sql.append("cs.classid,cs.stunum");
45
-        sql.append(",if(cs.classid=0,'学校全体',(select c.classname from t_class c where c.classid=cs.classid)) as classname");
50
+        sql.append(",if(cs.classid=0,'全体',(select c.classname from t_class c where c.classid=cs.classid)) as classname");
46 51
         List<String> infoFields = new ArrayList<>();
47 52
         infoFields.add("classid");
48 53
         infoFields.add("classname");
@@ -113,7 +118,7 @@ public class MsrClassService {
113 118
 
114 119
         String fieldname = params.getFieldname();
115 120
         if (N_Utils.isNotEmpty(fieldname)) {
116
-            result = MarkingUtil.sortBySubjectField(result, params.getSubjectid(), fieldname, params.getOd(), "gradeList");
121
+            result = MarkingUtil.sortBySubjectField(result, params.getFieldvalue(), fieldname, params.getOd(), "gradeList");
117 122
         }
118 123
         return result;
119 124
     }
@@ -183,7 +188,7 @@ public class MsrClassService {
183 188
     public Object listClassForFsd(StudentParams params) {
184 189
         StringBuilder sql = new StringBuilder();
185 190
         sql.append("cs.classid,cs.stunum");
186
-        sql.append(",if(cs.classid=0,'学校全体',(select c.classname from t_class c where c.classid=cs.classid)) as classname");
191
+        sql.append(",if(cs.classid=0,'全体',(select c.classname from t_class c where c.classid=cs.classid)) as classname");
187 192
         List<String> infoFields = new ArrayList<>();
188 193
         infoFields.add("classid");
189 194
         infoFields.add("classname");
@@ -207,7 +212,7 @@ public class MsrClassService {
207 212
     public Object listClassForMcBl(StudentParams params) {
208 213
         StringBuilder sql = new StringBuilder();
209 214
         sql.append("cr.classid,cr.stunum");
210
-        sql.append(",if(cr.classid=0,'学校全体',(select c.classname from t_class c where c.classid=cr.classid)) as classname");
215
+        sql.append(",if(cr.classid=0,'全体',(select c.classname from t_class c where c.classid=cr.classid)) as classname");
211 216
         List<String> infoFields = new ArrayList<>();
212 217
         infoFields.add("classid");
213 218
         infoFields.add("classname");
@@ -216,8 +221,62 @@ public class MsrClassService {
216 221
         String gradeField = "ztname,ctname,rnum,rrate";
217 222
         sql.append(",").append(gradeField);
218 223
         String[] gradeFields = gradeField.split(",");
219
-        sql.append(" msr_class_rankrate cr ");
224
+        sql.append(" from msr_class_rankrate cr ");
220 225
         List<Map> list = msrClassRankrateMapper.listClassForMcBl(sql.toString(), params);
221 226
         return formatList(params, list, infoFields, gradeFields);
222 227
     }
228
+
229
+    /**
230
+     * @Description 总分分档上线-列表
231
+     * @Date 2025/1/10 9:26
232
+     * @Author YWX
233
+     * @Param [params]
234
+     * @Return java.lang.Object
235
+     **/
236
+    public Object listClassForFdSxZf(StudentParams params) {
237
+        StringBuilder sql = new StringBuilder();
238
+        sql.append("cn.classid");
239
+        sql.append(",if(cn.classid=0,'全体',(select c.classname from t_class c where c.classid=cn.classid)) as classname");
240
+        List<String> infoFields = new ArrayList<>();
241
+        infoFields.add("classid");
242
+        infoFields.add("classname");
243
+
244
+        String gradeField = "dwname,dworder,dwscore,sxnum,ljsnum,ljsxrate";
245
+        sql.append(",").append(gradeField);
246
+        String[] gradeFields = gradeField.split(",");
247
+        sql.append(" from msr_class_nearline cn ");
248
+        List<Map> list = msrClassNearlineMapper.listClassForFdSx(sql.toString(), params);
249
+        List<Map<String, Object>> data = formatList(params, list, infoFields, gradeFields);
250
+        Map<String, Object> map = msrExamMapper.getFullAndMaxScoreByExamId(params.getExamid());
251
+        map.put("list", data);
252
+        return map;
253
+    }
254
+
255
+    /**
256
+     * @Description 学科分档上线-列表
257
+     * @Date 2025/1/10 11:34
258
+     * @Author YWX
259
+     * @Param [params]
260
+     * @Return java.lang.Object
261
+     **/
262
+    public Object listClassForFdSxXk(StudentParams params) {
263
+        StringBuilder sql = new StringBuilder();
264
+        sql.append("cn.classid");
265
+        sql.append(",if(cn.classid=0,'全体',(select c.classname from t_class c where c.classid=cn.classid)) as classname");
266
+        sql.append(",if(cn.subjectid='zf','总分',(select s.subjectname from t_subject s where s.subjectid=cn.subjectid)) as subjectname");
267
+        List<String> infoFields = new ArrayList<>();
268
+        infoFields.add("classid");
269
+        infoFields.add("classname");
270
+
271
+        String gradeField = "subjectid,dwscore,sxnum,ssxnum,gxrate,mzxrate";
272
+        sql.append(",").append(gradeField);
273
+        String[] gradeFields = gradeField.split(",");
274
+        sql.append(" from msr_class_nearline cn ");
275
+        List<String> fields = new ArrayList<>();
276
+        fields.add("subjectname");
277
+        Collections.addAll(fields, gradeFields);
278
+        gradeFields = fields.toArray(new String[0]);
279
+        List<Map> list = msrClassNearlineMapper.listClassForFdSx(sql.toString(), params);
280
+        return formatList(params, list, infoFields, gradeFields);
281
+    }
223 282
 }

+ 40
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrStudentService.java View File

@@ -2,8 +2,10 @@ package com.xhkjedu.smarking.service.report.report;
2 2
 
3 3
 import com.xhkjedu.smarking.mapper.report.reportstu.MsrStudentMapper;
4 4
 import com.xhkjedu.smarking.mapper.report.reportstu.MsrStudentPointMapper;
5
+import com.xhkjedu.smarking.model.report.reportstu.MsrStudent;
5 6
 import com.xhkjedu.smarking.utils.MarkingUtil;
6 7
 import com.xhkjedu.smarking.vo.report.reportother.ExamReportParams;
8
+import com.xhkjedu.smarking.vo.report.reportother.ScoreGroupVo;
7 9
 import com.xhkjedu.smarking.vo.report.reportstu.LabelVo;
8 10
 import com.xhkjedu.smarking.vo.report.reportstu.StudentParams;
9 11
 import com.xhkjedu.utils.N_Utils;
@@ -137,4 +139,42 @@ public class MsrStudentService {
137 139
         labels.add(new LabelVo("超均率", 2, "cjl"));
138 140
         return labels;
139 141
     }
142
+
143
+    /**
144
+     * @Description 校级报告-总分分布
145
+     * @Date 2025/1/10 17:29
146
+     * @Author YWX
147
+     * @Param [params]
148
+     * @Return java.lang.Object
149
+     **/
150
+    public Object listScoreForZfFb(StudentParams params) {
151
+        StringBuilder sql = new StringBuilder();
152
+        sql.append("s.fullscore,s.stuscore,s.studentid");
153
+        sql.append(" from msr_student s ");
154
+        sql.append(" where s.examid=").append(params.getExamid());
155
+        sql.append(" and s.subjectid='zf'");
156
+        sql.append(" group by s.studentid");
157
+        List<MsrStudent> list = msrStudentMapper.listStudentBySql(sql.toString());
158
+        if (N_Utils.isListEmpty(list)) {
159
+            return new ArrayList<>();
160
+        }
161
+        Double fullscore = list.get(0).getFullscore();
162
+        int totalNum = list.size();
163
+        List<ScoreGroupVo> groups = MarkingUtil.scoreGroup(fullscore, 12);
164
+        long num;
165
+        for (ScoreGroupVo group : groups) {
166
+            Double minvalue = group.getMinvalue();
167
+            Double maxvalue = group.getMaxvalue();
168
+            if (minvalue.equals(0.0)) {
169
+                num = list.stream().filter(s -> s.getStuscore().compareTo(maxvalue) < 0).count();
170
+            } else if (maxvalue.equals(fullscore)) {
171
+                num = list.stream().filter(s -> s.getStuscore().compareTo(minvalue) >= 0).count();
172
+            } else {
173
+                num = list.stream().filter(s -> s.getStuscore().compareTo(minvalue) >= 0 && s.getStuscore().compareTo(maxvalue) < 0).count();
174
+            }
175
+            group.setNum((int) num);
176
+            group.setNumrate(N_Utils.getIntegerDivideAndMulitiply(group.getNum(), totalNum));
177
+        }
178
+        return groups;
179
+    }
140 180
 }

+ 41
- 2
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrSubjectService.java View File

@@ -1,14 +1,16 @@
1 1
 package com.xhkjedu.smarking.service.report.report;
2 2
 
3 3
 import com.xhkjedu.smarking.mapper.report.reportclass.MsrClassSubjectGradeMapper;
4
+import com.xhkjedu.smarking.mapper.report.reportother.MsrExamMapper;
4 5
 import com.xhkjedu.smarking.mapper.report.reportstu.MsrStudentMapper;
5 6
 import com.xhkjedu.smarking.mapper.report.reportsubject.MsrSubjectMapper;
6 7
 import com.xhkjedu.smarking.model.report.reportsubject.MsrSubject;
8
+import com.xhkjedu.smarking.vo.report.reportstu.StudentParams;
9
+import com.xhkjedu.utils.N_Utils;
7 10
 import org.springframework.stereotype.Service;
8 11
 
9 12
 import javax.annotation.Resource;
10
-import java.util.LinkedHashMap;
11
-import java.util.Map;
13
+import java.util.*;
12 14
 
13 15
 /**
14 16
  *@Description 科目报告查询服务
@@ -23,6 +25,8 @@ public class MsrSubjectService {
23 25
     private MsrStudentMapper msrStudentMapper;
24 26
     @Resource
25 27
     private MsrClassSubjectGradeMapper msrClassSubjectGradeMapper;
28
+    @Resource
29
+    private MsrExamMapper msrExamMapper;
26 30
 
27 31
     /**
28 32
      * @Description 总概览
@@ -42,4 +46,39 @@ public class MsrSubjectService {
42 46
         map.put("scorerates", msrClassSubjectGradeMapper.getZfScoreRate(examid));
43 47
         return map;
44 48
     }
49
+
50
+    /**
51
+     * @Description 总分基本情况成绩分析
52
+     * @Date 2025/1/10 15:00
53
+     * @Author YWX
54
+     * @Param [examid]
55
+     * @Return java.util.Map
56
+     **/
57
+    public Map getExamForHzZf(Integer examid) {
58
+        return msrExamMapper.getExamForHzZf(examid);
59
+    }
60
+
61
+    /**
62
+     * @Description 总体情况汇总分析-各学科基本数据对比情况
63
+     * @Date 2025/1/10 15:05
64
+     * @Author YWX
65
+     * @Param [params]
66
+     * @Return java.lang.Object
67
+     **/
68
+    public Object listSubjectForHzXk(StudentParams params) {
69
+        StringBuilder sql = new StringBuilder();
70
+        sql.append("s.subjectid,s.subjectname,s.stunum,s.fullscore,s.maxscore,s.minscore,s.avgscore,s.bzc,s.cyxs,s.nd,s.axdxs");
71
+        sql.append(" from msr_subject s ");
72
+        sql.append(" where s.examid = " + params.getExamid());
73
+        String fieldname = params.getFieldname();
74
+        if (N_Utils.isNotEmpty(fieldname)) {
75
+            Integer od = params.getOd();
76
+            String order = "desc";
77
+            if (N_Utils.isTrueInteger(od) && od.equals(1)) {
78
+                order = "asc";
79
+            }
80
+            sql.append(" order by ").append(fieldname).append(" ").append(order);
81
+        }
82
+        return msrSubjectMapper.listSubjectBySql(sql.toString());
83
+    }
45 84
 }

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/report/reportother/MsrExamService.java View File

@@ -138,8 +138,10 @@ public class MsrExamService {
138 138
         msrExam.setStunum(msrSubject.getStunum());
139 139
         msrExam.setMissnum(msrSubject.getMissnum());
140 140
         msrExam.setSubjectnum(subjectnum);
141
+        msrExam.setFullscore(msrSubject.getFullscore());
141 142
         msrExam.setMaxscore(msrSubject.getMaxscore());
142 143
         msrExam.setMinscore(msrSubject.getMinscore());
144
+        msrExam.setAvgscore(msrSubject.getAvgscore());
143 145
         msrExam.setBzc(msrSubject.getBzc());
144 146
         msrExam.setCreatetime(N_Utils.getSecondTimestamp());
145 147
         msrExamMapper.insert(msrExam);

+ 27
- 2
smarking/src/main/java/com/xhkjedu/smarking/utils/MarkingUtil.java View File

@@ -7,8 +7,7 @@ import com.xhkjedu.smarking.mapper.report.reportother.MsrReportparamMapper;
7 7
 import com.xhkjedu.smarking.model.report.reportother.MsrReportparam;
8 8
 import com.xhkjedu.smarking.model.report.reportstu.MsrStudent;
9 9
 import com.xhkjedu.smarking.vo.paper.PaperFileVo;
10
-import com.xhkjedu.smarking.vo.report.reportother.RankGroupVo;
11
-import com.xhkjedu.smarking.vo.report.reportother.SzJsonVo;
10
+import com.xhkjedu.smarking.vo.report.reportother.*;
12 11
 import com.xhkjedu.smarking.vo.report.reportsubject.SectionScoreVo;
13 12
 import com.xhkjedu.utils.N_Utils;
14 13
 import com.xhkjedu.vo.PageResult;
@@ -655,6 +654,32 @@ public class MarkingUtil {
655 654
         return rtnList;
656 655
     }
657 656
 
657
+    //分数分组
658
+    public static List<ScoreGroupVo> scoreGroup(Double fullScore, Integer groupNum) {
659
+        List<ScoreGroupVo> groups = new ArrayList<>();
660
+        double groupScore = Math.ceil(fullScore / groupNum);
661
+        double min = 0;
662
+        double max;
663
+        String start = "[";
664
+        String end = ")";
665
+        for (int i = 1; i <= groupNum; i++) {
666
+            ScoreGroupVo vo = new ScoreGroupVo();
667
+            max = min + groupScore;
668
+            if (i == groupNum) {
669
+                if (max > fullScore) {
670
+                    max = fullScore;
671
+                }
672
+                end = "]";
673
+            }
674
+            vo.setGroupname(start + N_Utils.formatDouble(min) + "," + N_Utils.formatDouble(max) + end);
675
+            vo.setMinvalue(min);
676
+            vo.setMaxvalue(max);
677
+            groups.add(vo);
678
+            min = max;
679
+        }
680
+        return groups;
681
+    }
682
+
658 683
     //处于年级20%得分(v=0.2)
659 684
     public static Double cynjdf(List<Double> scores, double v) {
660 685
         if (N_Utils.isListEmpty(scores)) return 0.0;

+ 17
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/report/reportother/ScoreGroupVo.java View File

@@ -0,0 +1,17 @@
1
+package com.xhkjedu.smarking.vo.report.reportother;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @Description 分数分组
7
+ * @Author YWX
8
+ * @Date 2025/1/10 16:48
9
+ **/
10
+@Data
11
+public class ScoreGroupVo {
12
+    private String groupname; //组名
13
+    private Double maxvalue;//最大值
14
+    private Double minvalue;//最小值
15
+    private Integer num;//人数
16
+    private Double numrate;//人数占比
17
+}

+ 1
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/report/reportstu/StudentParams.java View File

@@ -25,4 +25,5 @@ public class StudentParams extends BaseBean {
25 25
     private Integer od;//标识排序类型1升序2降序
26 26
     private Integer type;//分段类型(1分段统计 2累计统计)
27 27
     private String reportcode;//归属报告模块编码
28
+    private Integer dworder;//档位序号
28 29
 }

+ 16
- 0
smarking/src/main/resources/mapper/report/reportclass/MsrClassNearlineMapper.xml View File

@@ -1,4 +1,20 @@
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.MsrClassNearlineMapper">
4
+    <!--分档上线-列表-->
5
+    <select id="listClassForFdSx" resultType="java.util.Map">
6
+        select ${sql}
7
+        where examid=#{params.examid}
8
+        <if test="params.subjectid!= null and params.subjectid!= ''">
9
+            and subjectid=#{params.subjectid}
10
+        </if>
11
+        <if test="params.classids!= null and params.classids.size() > 0">
12
+            <foreach collection="params.classids" item="classid" open="and classid in (" close=")" separator=",">
13
+                #{classid}
14
+            </foreach>
15
+        </if>
16
+        <if test="params.dworder!= null and params.dworder!= 0">
17
+            and dworder=#{params.dworder}
18
+        </if>
19
+    </select>
4 20
 </mapper>

+ 9
- 0
smarking/src/main/resources/mapper/report/reportother/MsrExamMapper.xml View File

@@ -26,4 +26,13 @@
26 26
         delete from msr_subject_question_rankgroup where examid = #{examid};
27 27
         delete from msr_subject_question_section where examid = #{examid};
28 28
     </delete>
29
+    <!--获取单次考试的总分和最高分-->
30
+    <select id="getFullAndMaxScoreByExamId" resultType="java.util.Map">
31
+        select fullscore,maxscore from msr_exam where examid = #{examid} limit 1
32
+    </select>
33
+    <!--总分基本情况成绩分析-->
34
+    <select id="getExamForHzZf" resultType="java.util.Map">
35
+        select stunum,classnum,fullscore,maxscore,minscore,avgscore,bzc
36
+        from msr_exam where examid = #{examid} limit 1
37
+    </select>
29 38
 </mapper>

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

@@ -81,4 +81,8 @@
81 81
             #{classid}
82 82
         </foreach>
83 83
     </select>
84
+    <!--学生成绩分析-->
85
+    <select id="listStudentBySql" resultType="com.xhkjedu.smarking.model.report.reportstu.MsrStudent">
86
+        select ${sql}
87
+    </select>
84 88
 </mapper>

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

@@ -16,5 +16,9 @@
16 16
         from msr_subject
17 17
         where examid=#{examid}
18 18
     </select>
19
+    <!--科目分析列表-->
20
+    <select id="listSubjectBySql" resultType="java.util.Map">
21
+        select ${sql}
22
+    </select>
19 23
 
20 24
 </mapper>

Loading…
Cancel
Save