|
@@ -2,6 +2,7 @@ package com.xhkjedu.sexam.service.report;
|
2
|
2
|
|
3
|
3
|
import com.alibaba.fastjson.JSON;
|
4
|
4
|
import com.xhkjedu.sexam.mapper.exam.EClassMapper;
|
|
5
|
+import com.xhkjedu.sexam.mapper.paper.EPaperAnalyzeMapper;
|
5
|
6
|
import com.xhkjedu.sexam.mapper.paper.EPaperQtypeMapper;
|
6
|
7
|
import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
|
7
|
8
|
import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
|
|
@@ -19,6 +20,7 @@ import com.xhkjedu.sexam.model.report.ERsubject;
|
19
|
20
|
import com.xhkjedu.sexam.model.reportclass.ERclass;
|
20
|
21
|
import com.xhkjedu.sexam.model.reportclass.ERclassQtype;
|
21
|
22
|
import com.xhkjedu.sexam.model.reportclass.ERclassQuestion;
|
|
23
|
+import com.xhkjedu.sexam.model.reportclass.ERclassQuestionPoint;
|
22
|
24
|
import com.xhkjedu.sexam.model.reportstu.ERstudent;
|
23
|
25
|
import com.xhkjedu.sexam.utils.ExamUtil;
|
24
|
26
|
import com.xhkjedu.sexam.vo.paper.EPaperQPointVo;
|
|
@@ -27,6 +29,7 @@ import com.xhkjedu.sexam.vo.paper.EPaperQtypeVo;
|
27
|
29
|
import com.xhkjedu.sexam.vo.report.ERClassScoreVo;
|
28
|
30
|
import com.xhkjedu.sexam.vo.report.ERPaperVo;
|
29
|
31
|
import com.xhkjedu.utils.N_Utils;
|
|
32
|
+import org.bouncycastle.operator.AADProcessor;
|
30
|
33
|
import org.springframework.beans.BeanUtils;
|
31
|
34
|
import org.springframework.stereotype.Service;
|
32
|
35
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -58,6 +61,8 @@ public class EReportGenerateService {
|
58
|
61
|
private EPaperQtypeMapper ePaperQtypeMapper;
|
59
|
62
|
@Resource
|
60
|
63
|
private EPaperStudentQuestionMapper ePaperStudentQuestionMapper;
|
|
64
|
+ @Resource
|
|
65
|
+ private EPaperAnalyzeMapper ePaperAnalyzeMapper;
|
61
|
66
|
|
62
|
67
|
|
63
|
68
|
@Resource
|
|
@@ -335,13 +340,14 @@ public class EReportGenerateService {
|
335
|
340
|
}
|
336
|
341
|
}
|
337
|
342
|
|
338
|
|
- //题型试题
|
|
343
|
+ //题型、试题、知识点
|
339
|
344
|
private void setClassQuestion(Integer examid,List<Map> subjects,List<Map> classes){
|
340
|
345
|
//考试所有学生提交试卷情况
|
341
|
346
|
List<EPaperStudentQuestion> stulist = ePaperStudentQuestionMapper.listExamStudentsAnswer(examid);
|
342
|
347
|
|
343
|
348
|
List<ERclassQtype> rtypelist = new ArrayList<>();
|
344
|
349
|
List<ERclassQuestion> rqlist = new ArrayList<>();
|
|
350
|
+ List<ERclassQuestionPoint> rpointlist = new ArrayList<>();
|
345
|
351
|
|
346
|
352
|
for(Map map : subjects){
|
347
|
353
|
String subjectid = map.get("subjectid").toString();
|
|
@@ -431,12 +437,9 @@ public class EReportGenerateService {
|
431
|
437
|
erClassScoreVo.setTcscore(ExamUtil.add(erClassScoreVo.getTcscore(), qallstu));
|
432
|
438
|
tcmap.put(classid,erClassScoreVo);
|
433
|
439
|
}
|
434
|
|
-
|
435
|
440
|
}
|
436
|
|
-
|
437
|
441
|
}
|
438
|
442
|
|
439
|
|
-
|
440
|
443
|
Double tgavescore = N_Utils.getDoubleDivideAndMulitiply(tgscore,stunum);//题型下年级平均分
|
441
|
444
|
Double tgsrate = N_Utils.getDoubleDivideAndMulitiply(tgscore,eptscore * stunum);//年级得分率
|
442
|
445
|
|
|
@@ -461,9 +464,58 @@ public class EReportGenerateService {
|
461
|
464
|
rtypelist.add(eRclassQtype);
|
462
|
465
|
}
|
463
|
466
|
}
|
|
467
|
+
|
|
468
|
+ //仅有题库试卷有知识点
|
|
469
|
+ if(ptype == 1){
|
|
470
|
+ //获取试卷只是分析
|
|
471
|
+ Map epa = ePaperAnalyzeMapper.getPaperAnalzyeByEpid(epid);
|
|
472
|
+ String pointjson = epa.get("pointjson").toString();
|
|
473
|
+ List<Map> pointlist = JSON.parseArray(pointjson,Map.class);
|
|
474
|
+ //遍历知识点处理年级班级知识点情况
|
|
475
|
+ for(int j=0;j<pointlist.size();j++){
|
|
476
|
+ Map pointmap = pointlist.get(j);
|
|
477
|
+ String pointname = pointmap.get("pointname").toString();
|
|
478
|
+ Double score = Double.parseDouble(pointmap.get("score").toString());
|
|
479
|
+ Double scorerate = Double.parseDouble(pointmap.get("scorerate").toString());
|
|
480
|
+ String qnstr = pointmap.get("order").toString();
|
|
481
|
+
|
|
482
|
+ List<String> qnlst = JSON.parseArray(qnstr,String.class);//题号集合
|
|
483
|
+ List<EPaperStudentQuestion> gstus = stulist.stream().filter(o -> o.getEpid().equals(epid) && qnlst.contains(o.getQn())).collect(Collectors.toList());
|
|
484
|
+ Double gstuscore = gstus.stream().mapToDouble(EPaperStudentQuestion :: getStuscore).sum();
|
|
485
|
+ Double gscore = gstus.stream().mapToDouble(EPaperStudentQuestion :: getQscore).sum();
|
|
486
|
+ Double gavgscore = N_Utils.getDoubleDivideAndMulitiply(gstuscore,gstus.size());//平均分分
|
|
487
|
+ Double gsrate = N_Utils.getDoubleDivideAndMulitiply(gstuscore,gscore);//得分率
|
|
488
|
+ for(Map classm : classes){
|
|
489
|
+ Integer classid = Integer.parseInt(classm.get("classid").toString());
|
|
490
|
+ List<EPaperStudentQuestion> cstus = gstus.stream().filter( o -> o.getClassid().equals(classid)).collect(Collectors.toList());
|
|
491
|
+ Double cstuscore = cstus.stream().mapToDouble(EPaperStudentQuestion::getStuscore).sum();
|
|
492
|
+ Double cscore = cstus.stream().mapToDouble(EPaperStudentQuestion::getQscore).sum();
|
|
493
|
+ Double cavgscore = N_Utils.getDoubleDivideAndMulitiply(cstuscore,cstus.size());//平均分分
|
|
494
|
+ Double csrate = N_Utils.getDoubleDivideAndMulitiply(cstuscore,cscore);//得分率
|
|
495
|
+
|
|
496
|
+ ERclassQuestionPoint pointvo = new ERclassQuestionPoint();
|
|
497
|
+ pointvo.setExamid(examid);
|
|
498
|
+ pointvo.setClassid(classid);
|
|
499
|
+ pointvo.setEpid(epid);
|
|
500
|
+ pointvo.setSubjectid(subjectid);
|
|
501
|
+ pointvo.setPointname(pointname);
|
|
502
|
+ pointvo.setScore(score);
|
|
503
|
+ pointvo.setSrate(scorerate);
|
|
504
|
+ pointvo.setQns(qnstr);
|
|
505
|
+ pointvo.setGradeavgscore(gavgscore);
|
|
506
|
+ pointvo.setGradesrate(gsrate);
|
|
507
|
+ pointvo.setClassavgscore(cavgscore);
|
|
508
|
+ pointvo.setClasssrate(csrate);
|
|
509
|
+ rpointlist.add(pointvo);
|
|
510
|
+ }
|
|
511
|
+
|
|
512
|
+ }
|
|
513
|
+
|
|
514
|
+ }
|
464
|
515
|
}
|
465
|
516
|
eRclassQtypeMapper.insertList(rtypelist);
|
466
|
517
|
eRclassQuestionMapper.insertList(rqlist);
|
|
518
|
+ eRclassQuestionPointMapper.insertList(rpointlist);
|
467
|
519
|
}
|
468
|
520
|
//处理题库试卷中子母题
|
469
|
521
|
private void setEPaperQtypeForQues(List<EPaperQtypeVo> fjtypelist){
|