|
@@ -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
|
}
|