|
@@ -19,8 +19,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
19
|
19
|
import org.springframework.web.bind.annotation.RestController;
|
20
|
20
|
|
21
|
21
|
import javax.annotation.Resource;
|
|
22
|
+import java.util.HashMap;
|
22
|
23
|
import java.util.List;
|
23
|
24
|
import java.util.Map;
|
|
25
|
+import java.util.stream.Collectors;
|
24
|
26
|
|
25
|
27
|
/**
|
26
|
28
|
* @author ywx
|
|
@@ -208,4 +210,37 @@ public class EReportSchoolController {
|
208
|
210
|
return new ResultVo(0, "获取成功", pageResult);
|
209
|
211
|
}
|
210
|
212
|
|
|
213
|
+ /**
|
|
214
|
+ * pdf报告
|
|
215
|
+ *
|
|
216
|
+ * @return com.xhkjedu.vo.ResultVo
|
|
217
|
+ * @Param [rank]
|
|
218
|
+ * @Author ywx
|
|
219
|
+ * @Date 2022/10/9 14:45
|
|
220
|
+ **/
|
|
221
|
+ @PostMapping("/pdf")
|
|
222
|
+ public ResultVo toPdf(@RequestBody ERankParamVo rank) {
|
|
223
|
+ Integer examid = rank.getExamid();
|
|
224
|
+ N_Utils.validation(new Object[]{examid, "考试id", 1});
|
|
225
|
+ Map map = new HashMap();
|
|
226
|
+ Map ksgk = eReportSchoolService.getKsGk(examid);
|
|
227
|
+ map.put("ksgk", ksgk);//考试概况
|
|
228
|
+ List<Map> cjfxList = eReportSchoolService.listCjFxBjCj(rank);
|
|
229
|
+ Map<String, List<Map>> cjfx = cjfxList.stream().collect(Collectors.groupingBy(c -> c.get("subjectname").toString()));
|
|
230
|
+ map.put("cjfx", cjfx);//成绩分析
|
|
231
|
+ List<Map> subjects = (List<Map>) ksgk.get("subjects");
|
|
232
|
+ Map<String, String> subjectMap = subjects.stream().collect(Collectors.toMap(s -> s.get("subjectid").toString(),
|
|
233
|
+ s -> s.get("subjectname").toString()));
|
|
234
|
+ List<Map> djfx = eReportSchoolService.listCjFxByExamId(examid);//考试班级等级分析
|
|
235
|
+ for (Map rc : djfx) {
|
|
236
|
+ rc.put("subjectname", subjectMap.get(rc.get("subjectid").toString()));
|
|
237
|
+ }
|
|
238
|
+ map.put("djfx", djfx);//成绩分析-等级分析
|
|
239
|
+ List<Map> xwList = eReportSchoolService.listXwBjByExamId(examid);
|
|
240
|
+ List<Map> wjxw = xwList.stream().filter(x -> x.get("actiontype").toString().equals("1")).collect(Collectors.toList());
|
|
241
|
+ map.put("wjfx", wjxw);//违纪行为分析
|
|
242
|
+ List<Map> yxsj = xwList.stream().filter(x -> x.get("actiontype").toString().equals("2")).collect(Collectors.toList());
|
|
243
|
+ map.put("yxsj", yxsj);//优秀试卷分析
|
|
244
|
+ return new ResultVo(0, "获取成功", map);
|
|
245
|
+ }
|
211
|
246
|
}
|