Browse Source

Merge remote-tracking branch 'cloud-schoolapi/ywx'

tags/正式版本
王宁 2 years ago
parent
commit
d5d9148fb3

+ 87
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java View File

@@ -18,6 +18,7 @@ import com.xhkjedu.sexam.mapper.reportstu.ERstudentPointMapper;
18 18
 import com.xhkjedu.sexam.mapper.reportstu.ERstudentQtypeMapper;
19 19
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
20 20
 import com.xhkjedu.sexam.model.report.ERbase;
21
+import com.xhkjedu.sexam.model.report.ERrank;
21 22
 import com.xhkjedu.sexam.model.report.ERsubject;
22 23
 import com.xhkjedu.sexam.model.reportclass.ERclass;
23 24
 import com.xhkjedu.sexam.model.reportclass.ERclassQtype;
@@ -32,7 +33,6 @@ import com.xhkjedu.sexam.vo.paper.EPaperQtypeVo;
32 33
 import com.xhkjedu.sexam.vo.report.ERClassScoreVo;
33 34
 import com.xhkjedu.sexam.vo.report.ERPaperVo;
34 35
 import com.xhkjedu.utils.N_Utils;
35
-import org.bouncycastle.operator.AADProcessor;
36 36
 import org.springframework.beans.BeanUtils;
37 37
 import org.springframework.stereotype.Service;
38 38
 import org.springframework.transaction.annotation.Transactional;
@@ -300,6 +300,92 @@ public class EReportGenerateService {
300 300
         eRstudentMapper.insertList(classSubjectStudents);
301 301
 
302 302
         setClassQuestion(examid, subjects, classes);//题型试题
303
+        setClassGradeRankAll(examid, papers, students);//班级、年级等级分布
304
+    }
305
+
306
+    //班级、年级等级分布
307
+    private void setClassGradeRankAll(Integer examid, List<ERPaperVo> papers, List<ERstudent> students) {
308
+        setClassGradeRank(examid, papers, students, setRrank(1));//班级、年级等级分布--等级
309
+        setClassGradeRank(examid, papers, students, setRrank(2));//班级、年级等级分布--分数段
310
+        setClassGradeRank(examid, papers, students, setRrank(3));//班级、年级等级分布--临界分
311
+        setClassGradeRank(examid, papers, students, setRrank(4));//班级、年级等级分布--临界名次
312
+        setClassGradeRank(examid, papers, students, setRrank(5));//班级、年级等级分布--优秀年级前
313
+        setClassGradeRank(examid, papers, students, setRrank(6));//班级、年级等级分布--学困年级后
314
+    }
315
+
316
+    //等级初始值设置
317
+    private List<ERrank> setRrank(Integer ranktype) {
318
+        List<ERrank> rranks = new ArrayList<>();
319
+        ERrank rrank;
320
+        if (ranktype == 1) {//等级(A[85%~100%],B[70%~85%),C[60%~70%),D[40%~60%),E[0%~40%))
321
+            rrank = new ERrank();
322
+            rrank.setRanktype(ranktype);
323
+            rrank.setRankname("A");
324
+            rrank.setMaxscore(1.0);
325
+            rrank.setMinscore(0.85);
326
+            rranks.add(rrank);
327
+            rrank = new ERrank();
328
+            rrank.setRanktype(ranktype);
329
+            rrank.setRankname("B");
330
+            rrank.setMaxscore(0.85);
331
+            rrank.setMinscore(0.7);
332
+            rranks.add(rrank);
333
+            rranks.add(rrank);
334
+            rrank = new ERrank();
335
+            rrank.setRanktype(ranktype);
336
+            rrank.setRankname("C");
337
+            rrank.setMaxscore(0.7);
338
+            rrank.setMinscore(0.6);
339
+            rranks.add(rrank);
340
+            rranks.add(rrank);
341
+            rrank = new ERrank();
342
+            rrank.setRanktype(ranktype);
343
+            rrank.setRankname("D");
344
+            rrank.setMaxscore(0.6);
345
+            rrank.setMinscore(0.4);
346
+            rranks.add(rrank);
347
+            rranks.add(rrank);
348
+            rrank = new ERrank();
349
+            rrank.setRanktype(ranktype);
350
+            rrank.setRankname("E");
351
+            rrank.setMaxscore(0.4);
352
+            rrank.setMinscore(0.0);
353
+            rranks.add(rrank);
354
+        } else if (ranktype == 2) {//分数段(10分/段)
355
+            rrank = new ERrank();
356
+            rrank.setRanktype(ranktype);
357
+            rrank.setLinescore(10);
358
+            rranks.add(rrank);
359
+        } else if (ranktype == 3) {//临界分(临界分:总分*80%,浮动分:总分*70%)
360
+            rrank = new ERrank();
361
+            rrank.setRanktype(ranktype);
362
+            rrank.setLinescore(80);
363
+            rrank.setFloatscore(70);
364
+            rranks.add(rrank);
365
+        } else if (ranktype == 4) {//临界名次(临界名次10,浮动名次5)
366
+            rrank = new ERrank();
367
+            rrank.setRanktype(ranktype);
368
+            rrank.setLinescore(10);
369
+            rrank.setFloatscore(5);
370
+            rranks.add(rrank);
371
+        } else if (ranktype == 5) {//优秀年级前(10名)
372
+            rrank = new ERrank();
373
+            rrank.setRanktype(ranktype);
374
+            rrank.setLinescore(10);
375
+            rranks.add(rrank);
376
+        } else if (ranktype == 6) {//学困年级后(10名)
377
+            rrank = new ERrank();
378
+            rrank.setRanktype(ranktype);
379
+            rrank.setLinescore(10);
380
+            rranks.add(rrank);
381
+        }
382
+        return rranks;
383
+    }
384
+
385
+    //班级、年级等级分布
386
+    private void setClassGradeRank(Integer examid, List<ERPaperVo> papers, List<ERstudent> students, List<ERrank> rranks) {
387
+        double zfscore = papers.stream().mapToDouble(p -> p.getPscore()).sum();//考试总分
388
+        Integer ranktype = rranks.get(0).getRanktype();
303 389
     }
304 390
 
305 391
     //设置学生目标

Loading…
Cancel
Save