Browse Source

综合报告:分数段、名次比例分析

仲裁完善
ywx
雍文秀 4 days ago
parent
commit
0cc31c4c63

+ 54
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/report/ZhReportController.java View File

@@ -131,6 +131,41 @@ public class ZhReportController {
131 131
         return new ResultVo(0, "获取成功", msrClassService.listClassForBjDb(params));
132 132
     }
133 133
 
134
+    /**
135
+     * @Description 分数段统计-指标
136
+     * @Date 2025/1/8 16:24
137
+     * @Author YWX
138
+     * @Param [params]
139
+     * @Return com.xhkjedu.vo.ResultVo
140
+     **/
141
+    @PostMapping("/fsd_zb")
142
+    public ResultVo getFsdZb(@RequestBody StudentParams params) {
143
+        N_Utils.validation(new Object[]{
144
+                params.getExamid(), "考试id", 1
145
+                , params.getSubjectid(), "科目", 2
146
+        });
147
+        return new ResultVo(0, "获取成功", msrClassService.getFsdZb(params));
148
+    }
149
+
150
+    /**
151
+     * @Description 分数段统计-列表
152
+     * @Date 2025/1/8 16:47
153
+     * @Author YWX
154
+     * @Param [params]
155
+     * @Return com.xhkjedu.vo.ResultVo
156
+     **/
157
+    @PostMapping("/fsd")
158
+    public ResultVo listClassForFsd(@RequestBody StudentParams params) {
159
+        N_Utils.validation(new Object[]{
160
+                params.getExamid(), "考试id", 1
161
+                , params.getSubjectid(), "科目", 2
162
+                , params.getClassids(), "班级", 3
163
+                , params.getType(), "分段类型", 1
164
+        });
165
+        params.setReportcode("zh");
166
+        return new ResultVo(0, "获取成功", msrClassService.listClassForFsd(params));
167
+    }
168
+
134 169
     /*
135 170
      * @Description 试题汇总-全部班-科目情况
136 171
      * @Date 2024/12/24 14:47:43
@@ -184,6 +219,25 @@ public class ZhReportController {
184 219
         return new ResultVo(0,"获取成功",msrClassQuestionService.listQuestionForAllObjsub(params));
185 220
     }
186 221
 
222
+    /**
223
+     * @Description 名次和比例分析-列表
224
+     * @Date 2025/1/9 16:50
225
+     * @Author YWX
226
+     * @Param [params]
227
+     * @Return com.xhkjedu.vo.ResultVo
228
+     **/
229
+    @PostMapping("/mcbl")
230
+    public ResultVo listClassForMcBl(@RequestBody StudentParams params) {
231
+        N_Utils.validation(new Object[]{
232
+                params.getExamid(), "考试id", 1
233
+                , params.getSubjectid(), "科目", 2
234
+                , params.getClassids(), "班级", 3
235
+                , params.getType(), "分段类型", 1
236
+        });
237
+        params.setReportcode("zh");
238
+        return new ResultVo(0, "获取成功", msrClassService.listClassForMcBl(params));
239
+    }
240
+
187 241
     /**
188 242
      * @Description 违纪优秀-班级统计
189 243
      * @Date 2025/1/3 14:47

+ 7
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportclass/MsrClassRankrateMapper.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.MsrClassRankrate;
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.MsrClassRankrate;
9 14
  * @Date 2024-12-09
10 15
  */
11 16
 public interface MsrClassRankrateMapper extends TkMapper<MsrClassRankrate> {
17
+    //综合报告-名次和比例分析-列表
18
+    List<Map> listClassForMcBl(@Param("sql") String sql, @Param("params") StudentParams params);
12 19
 }

+ 7
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/report/reportclass/MsrClassSectionMapper.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.MsrClassSection;
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.MsrClassSection;
9 14
  * @Date 2024-12-09
10 15
  */
11 16
 public interface MsrClassSectionMapper extends TkMapper<MsrClassSection> {
17
+    //综合报告-分数段统计列表
18
+    List<Map> listClassForFsd(@Param("sql") String sql, @Param("params") StudentParams params);
12 19
 }

+ 80
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrClassService.java View File

@@ -1,7 +1,7 @@
1 1
 package com.xhkjedu.smarking.service.report.report;
2 2
 
3 3
 import com.alibaba.fastjson.JSON;
4
-import com.xhkjedu.smarking.mapper.report.reportclass.MsrClassSubjectMapper;
4
+import com.xhkjedu.smarking.mapper.report.reportclass.*;
5 5
 import com.xhkjedu.smarking.model.report.reportother.MsrReportparam;
6 6
 import com.xhkjedu.smarking.service.report.reportother.MsrReportparamService;
7 7
 import com.xhkjedu.smarking.utils.MarkingUtil;
@@ -25,6 +25,10 @@ public class MsrClassService {
25 25
     @Resource
26 26
     private MsrClassSubjectMapper msrClassSubjectMapper;
27 27
     @Resource
28
+    private MsrClassSectionMapper msrClassSectionMapper;
29
+    @Resource
30
+    private MsrClassRankrateMapper msrClassRankrateMapper;
31
+    @Resource
28 32
     private MsrReportparamService msrReportparamService;
29 33
 
30 34
     /**
@@ -72,6 +76,12 @@ public class MsrClassService {
72 76
             sql.append(" and csg.rangename in ('").append(String.join("','", rangeNames)).append("') ");
73 77
         }
74 78
         List<Map> list = msrClassSubjectMapper.listClassForBjDb(sql.toString(), params);
79
+        return formatList(params, list, infoFields, gradeFields);
80
+    }
81
+
82
+    //格式化列表
83
+    private List<Map<String, Object>> formatList(StudentParams params, List<Map> list
84
+            , List<String> infoFields, String[] gradeFields) {
75 85
         Map<Integer, List<Map>> collect = list.stream().collect(Collectors.groupingBy(
76 86
                 m -> N_Utils.obj2Int(m.get("classid")), LinkedHashMap::new, Collectors.toList()));
77 87
         List<Map<String, Object>> result = new ArrayList<>();
@@ -141,4 +151,73 @@ public class MsrClassService {
141 151
         map.put("allrate", JSON.parseObject(reportparam.getSzjson(), SzJsonVo.class));
142 152
         return map;
143 153
     }
154
+
155
+    /**
156
+     * @Description 分数段统计-指标
157
+     * @Date 2025/1/8 16:24
158
+     * @Author YWX
159
+     * @Param [params]
160
+     * @Return java.lang.Object
161
+     **/
162
+    public Object getFsdZb(StudentParams params) {
163
+        MsrReportparam reportParams = msrReportparamService.getOneReportParams(params.getExamid(), "scoresection", "zh", params.getSubjectid());
164
+        Integer rptype = reportParams.getRptype();
165
+        String szjson = reportParams.getSzjson();
166
+        Map<String, Object> map = new HashMap<>();
167
+        map.put("rptype", rptype);
168
+        if (rptype.equals(0)) {
169
+            map.put("params", JSON.parseObject(szjson, Map.class));
170
+        } else {
171
+            map.put("params", JSON.parseArray(szjson, Map.class));
172
+        }
173
+        return map;
174
+    }
175
+
176
+    /**
177
+     * @Description 综合报告-分数段统计-列表
178
+     * @Date 2025/1/8 16:47
179
+     * @Author YWX
180
+     * @Param [params]
181
+     * @Return java.lang.Object
182
+     **/
183
+    public Object listClassForFsd(StudentParams params) {
184
+        StringBuilder sql = new StringBuilder();
185
+        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");
187
+        List<String> infoFields = new ArrayList<>();
188
+        infoFields.add("classid");
189
+        infoFields.add("classname");
190
+        infoFields.add("stunum");
191
+
192
+        String gradeField = "fzfw,fzfwnum,fzfwrate";
193
+        sql.append(",").append(gradeField);
194
+        String[] gradeFields = gradeField.split(",");
195
+        sql.append(" from msr_class_section cs ");
196
+        List<Map> list = msrClassSectionMapper.listClassForFsd(sql.toString(), params);
197
+        return formatList(params, list, infoFields, gradeFields);
198
+    }
199
+
200
+    /**
201
+     * @Description 综合报告-名次和比例分析-列表
202
+     * @Date 2025/1/9 16:51
203
+     * @Author YWX
204
+     * @Param [params]
205
+     * @Return java.lang.Object
206
+     **/
207
+    public Object listClassForMcBl(StudentParams params) {
208
+        StringBuilder sql = new StringBuilder();
209
+        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");
211
+        List<String> infoFields = new ArrayList<>();
212
+        infoFields.add("classid");
213
+        infoFields.add("classname");
214
+        infoFields.add("stunum");
215
+
216
+        String gradeField = "ztname,ctname,rnum,rrate";
217
+        sql.append(",").append(gradeField);
218
+        String[] gradeFields = gradeField.split(",");
219
+        sql.append(" msr_class_rankrate cr ");
220
+        List<Map> list = msrClassRankrateMapper.listClassForMcBl(sql.toString(), params);
221
+        return formatList(params, list, infoFields, gradeFields);
222
+    }
144 223
 }

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

@@ -23,4 +23,6 @@ public class StudentParams extends BaseBean {
23 23
     private String fieldname;//排序字段
24 24
     private String fieldvalue;//排序列值
25 25
     private Integer od;//标识排序类型1升序2降序
26
+    private Integer type;//分段类型(1分段统计 2累计统计)
27
+    private String reportcode;//归属报告模块编码
26 28
 }

+ 3
- 2
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherArbitrateMapper.xml View File

@@ -141,6 +141,7 @@
141 141
         <result property="blockorder" column="blockorder"/>
142 142
         <result property="bqnum" column="bqnum"/>
143 143
         <result property="hidefirstscore" column="hidefirstscore"/>
144
+        <result property="correcttype" column="correcttype"/>
144 145
         <collection property="questions" select="listQuestion" column="mblockid"/>
145 146
     </resultMap>
146 147
     <select id="listQuestion" resultType="java.util.Map">
@@ -151,7 +152,7 @@
151 152
     </select>
152 153
     <select id="listBlockArbitrate" resultMap="arbitrateBlockResultMap">
153 154
         select pb.blockname,pb.blockorder,pb.bqnum
154
-        ,pc.mblockid,pc.hidefirstscore
155
+        ,pc.mblockid,pc.hidefirstscore,pc.correcttype
155 156
         from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
156 157
         inner join ms_paper_block pb on pc.mblockid = pb.mblockid and pb.mpid = pc.mpid
157 158
         where pc.mpid=#{param.mpid} and (psb.arbitratestate=1 or psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid})
@@ -164,7 +165,7 @@
164 165
     <!--待仲裁试题列表-->
165 166
     <select id="listQuestionArbitrate" resultType="java.util.Map">
166 167
         select psb.qorder,psb.qn,psb.qscore
167
-        ,pc.mblockid,pc.hidefirstscore
168
+        ,pc.mblockid,pc.hidefirstscore,pc.correcttype
168 169
         from ms_paper_check pc left join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
169 170
         where pc.mpid=#{param.mpid} and (psb.arbitratestate=1 or psb.arbitratestate=2 and psb.arbitrateid=#{param.handleid})
170 171
         <if test="param.usertype!=null and param.usertype==1">

+ 9
- 0
smarking/src/main/resources/mapper/report/reportclass/MsrClassRankrateMapper.xml View File

@@ -1,4 +1,13 @@
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.MsrClassRankrateMapper">
4
+    <!--综合报告-名次和比例分析-列表-->
5
+    <select id="listClassForMcBl" resultType="java.util.Map">
6
+        select ${sql}
7
+        where examid=#{params.examid} and subjectid=#{params.subjectid}
8
+        and rtype=#{params.type}
9
+        <foreach collection="params.classids" item="classid" open="and classid in (" close=")" separator=",">
10
+            #{classid}
11
+        </foreach>
12
+    </select>
4 13
 </mapper>

+ 9
- 0
smarking/src/main/resources/mapper/report/reportclass/MsrClassSectionMapper.xml View File

@@ -1,4 +1,13 @@
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.MsrClassSectionMapper">
4
+    <!--综合报告-分数段统计列表-->
5
+    <select id="listClassForFsd" resultType="java.util.Map">
6
+        select ${sql}
7
+        where cs.examid=#{params.examid} and cs.subjectid=#{params.subjectid}
8
+        and cs.type=#{params.type} and cs.reportcode=#{params.reportcode}
9
+        <foreach collection="params.classids" item="classid" open="and classid in (" close=")" separator=",">
10
+            #{classid}
11
+        </foreach>
12
+    </select>
4 13
 </mapper>

+ 3
- 0
smarking/src/main/resources/mapper/report/reportclass/MsrClassSubjectMapper.xml View File

@@ -5,5 +5,8 @@
5 5
     <select id="listClassForBjDb" resultType="java.util.Map">
6 6
         select ${sql}
7 7
         where cs.examid=#{params.examid} and cs.subjectid=#{params.subjectid}
8
+        <foreach collection="params.classids" item="classid" open="and cs.classid in (" close=")" separator=",">
9
+            #{classid}
10
+        </foreach>
8 11
     </select>
9 12
 </mapper>

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

@@ -79,5 +79,8 @@
79 79
         <if test="params.subjectid!='zf'">
80 80
             and s.subjectid=#{params.subjectid}
81 81
         </if>
82
+        <foreach collection="params.classids" item="classid" open="and classid in (" close=")" separator=",">
83
+            #{classid}
84
+        </foreach>
82 85
     </select>
83 86
 </mapper>

Loading…
Cancel
Save