|
@@ -1,7 +1,6 @@
|
1
|
1
|
package com.xhkjedu.sapi.service.component;
|
2
|
2
|
|
3
|
3
|
import com.alibaba.fastjson.JSON;
|
4
|
|
-import com.xhkjedu.sapi.mapper.analyze.SchoolPeopleMapper;
|
5
|
4
|
import com.xhkjedu.sapi.mapper.component.ComponentMapper;
|
6
|
5
|
import com.xhkjedu.sapi.mapper.gradeclass.ClassMapper;
|
7
|
6
|
import com.xhkjedu.sapi.mapper.subjectbook.SubjectMapper;
|
|
@@ -43,8 +42,6 @@ public class ComponentService {
|
43
|
42
|
private SubjectMapper subjectMapper;
|
44
|
43
|
@Resource
|
45
|
44
|
private ClassMapper classMapper;
|
46
|
|
- @Resource
|
47
|
|
- SchoolPeopleMapper schoolPeopleMapper;
|
48
|
45
|
|
49
|
46
|
|
50
|
47
|
/*
|
|
@@ -57,24 +54,45 @@ public class ComponentService {
|
57
|
54
|
public List<PaperListVo> listCorrectPages(Integer userid, Integer limitSize) {
|
58
|
55
|
Integer schoolid = userMapper.getSchoolIdByUserId(userid);
|
59
|
56
|
List<PaperListVo> list = componentMapper.listCorrectPages(userid, schoolid, limitSize);
|
|
57
|
+ return setPaperListVo(list);
|
|
58
|
+ }
|
|
59
|
+
|
|
60
|
+ /*
|
|
61
|
+ * @Description 作业-我的
|
|
62
|
+ * @Date 2024/7/25 16:25:33
|
|
63
|
+ * @Author WN
|
|
64
|
+ * @Param [params]
|
|
65
|
+ * @Return java.util.List<com.xhkjedu.vo.paper.PaperListVo>
|
|
66
|
+ **/
|
|
67
|
+ public List<PaperListVo> listPaperForMy(ComponentParams params) {
|
|
68
|
+ Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
|
|
69
|
+ params.setSchoolid(schoolid);
|
|
70
|
+ List<PaperListVo> list = componentMapper.listPaperForMy(params);
|
|
71
|
+ return setPaperListVo(list);
|
|
72
|
+ }
|
|
73
|
+
|
|
74
|
+ public List<PaperListVo> setPaperListVo(List<PaperListVo> list) {
|
60
|
75
|
for (PaperListVo p : list) {
|
61
|
|
- List<Map> schools = p.getSchools();
|
62
|
|
- List<PaperClassVo> classes = new ArrayList<>();
|
63
|
|
- for (Map school : schools) {
|
64
|
|
- List<PaperClassVo> classList = (List<PaperClassVo>) school.get("classes");
|
65
|
|
- classes.addAll(classList);
|
66
|
|
- for (PaperClassVo c : classList) {
|
67
|
|
- if (!N_Utils.isEmptyInteger(c.getClassnum())) {
|
68
|
|
- c.setWtjnum(c.getClassnum() - c.getYtjnum());
|
|
76
|
+ if (p.getPaperstate() == 21) {// 未布置
|
|
77
|
+ p.setClasses(null);
|
|
78
|
+ p.setChecklist(null);
|
|
79
|
+ } else {
|
|
80
|
+ List<Map> schools = p.getSchools();
|
|
81
|
+ List<PaperClassVo> classes = new ArrayList<>();
|
|
82
|
+ for (Map school : schools) {
|
|
83
|
+ List<PaperClassVo> classList = (List<PaperClassVo>) school.get("classes");
|
|
84
|
+ classes.addAll(classList);
|
|
85
|
+ for (PaperClassVo c : classList) {
|
|
86
|
+ if (!N_Utils.isEmptyInteger(c.getClassnum())) {
|
|
87
|
+ c.setWtjnum(c.getClassnum() - c.getYtjnum());
|
|
88
|
+ }
|
69
|
89
|
}
|
70
|
90
|
}
|
|
91
|
+ p.setClassnum(classes.stream().mapToInt(c -> c.getClassnum()).sum());
|
|
92
|
+ p.setYtjnum(classes.stream().mapToInt(c -> c.getYtjnum()).sum());
|
|
93
|
+ p.setYpgnum(classes.stream().mapToInt(c -> c.getYpgnum()).sum());
|
71
|
94
|
}
|
72
|
|
- p.setClassnum(classes.stream().mapToInt(c -> c.getClassnum()).sum());
|
73
|
|
- p.setYtjnum(classes.stream().mapToInt(c -> c.getYtjnum()).sum());
|
74
|
|
- p.setYpgnum(classes.stream().mapToInt(c -> c.getYpgnum()).sum());
|
75
|
|
- p.setSchools(null);
|
76
|
95
|
}
|
77
|
|
-
|
78
|
96
|
return list;
|
79
|
97
|
}
|
80
|
98
|
|
|
@@ -434,23 +452,23 @@ public class ComponentService {
|
434
|
452
|
* @Param [params]
|
435
|
453
|
* @Return void
|
436
|
454
|
**/
|
437
|
|
- public Map<String,Object> getClassErrorQuestion(ComponentParams params) {
|
438
|
|
- long[] yeartimestamp = ApiUtil.getNowhalfYearTimestamp();//近半年
|
|
455
|
+ public Map<String, Object> getClassErrorQuestion(ComponentParams params) {
|
|
456
|
+ long[] yeartimestamp = ApiUtil.getNowhalfYearTimestamp();// 近半年
|
439
|
457
|
params.setStarttime(yeartimestamp[0]);
|
440
|
458
|
params.setStoptime(yeartimestamp[1]);
|
441
|
459
|
|
442
|
460
|
// 获取当前教师班级最近一次已生成报告作业
|
443
|
461
|
Integer lastError = componentMapper.getClassErrorQuesLastPaper(params);
|
444
|
|
- Map<String,Object> map = componentMapper.getClassErrorQuesAndExplain(params);
|
445
|
|
- if(map == null || map.isEmpty()) {
|
|
462
|
+ Map<String, Object> map = componentMapper.getClassErrorQuesAndExplain(params);
|
|
463
|
+ if (map == null || map.isEmpty()) {
|
446
|
464
|
map = new HashMap<>();
|
447
|
|
- map.put("quesnum",0);
|
448
|
|
- map.put("explainnum",0);
|
|
465
|
+ map.put("quesnum", 0);
|
|
466
|
+ map.put("explainnum", 0);
|
449
|
467
|
}
|
450
|
|
- if(lastError == null){
|
|
468
|
+ if (lastError == null) {
|
451
|
469
|
lastError = 0;
|
452
|
470
|
}
|
453
|
|
- map.put("lasterror",lastError);
|
|
471
|
+ map.put("lasterror", lastError);
|
454
|
472
|
return map;
|
455
|
473
|
}
|
456
|
474
|
|
|
@@ -461,29 +479,29 @@ public class ComponentService {
|
461
|
479
|
* @Param [params]
|
462
|
480
|
* @Return java.util.Map<java.lang.String,java.lang.Integer>
|
463
|
481
|
**/
|
464
|
|
- public Map<String,Integer> getClassForTeacher(ComponentParams params){
|
|
482
|
+ public Map<String, Integer> getClassForTeacher(ComponentParams params) {
|
465
|
483
|
Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
|
466
|
484
|
params.setSchoolid(schoolid);
|
467
|
|
- List<Integer> classids = componentMapper.listClassidsForTeacher(params);//权限班级
|
|
485
|
+ List<Integer> classids = componentMapper.listClassidsForTeacher(params);// 权限班级
|
468
|
486
|
int classnum = 0;
|
469
|
487
|
int stunum = 0;
|
470
|
488
|
int groupnum = 0;
|
471
|
|
- if(classids != null && classids.size() > 0) {
|
|
489
|
+ if (classids != null && classids.size() > 0) {
|
472
|
490
|
classnum = classids.size();
|
473
|
491
|
String classidsStr = classids.stream()
|
474
|
|
- .map(Object::toString)
|
475
|
|
- .collect(Collectors.joining(","));
|
476
|
|
- List<Integer> stuGroups = componentMapper.listClassStuAndGroup(params.getUserid(),classidsStr);
|
477
|
|
- if(stuGroups != null && stuGroups.size() > 0) {
|
|
492
|
+ .map(Object::toString)
|
|
493
|
+ .collect(Collectors.joining(","));
|
|
494
|
+ List<Integer> stuGroups = componentMapper.listClassStuAndGroup(params.getUserid(), classidsStr);
|
|
495
|
+ if (stuGroups != null && stuGroups.size() > 0) {
|
478
|
496
|
stunum = stuGroups.get(0);
|
479
|
497
|
groupnum = stuGroups.get(1);
|
480
|
498
|
}
|
481
|
499
|
}
|
482
|
500
|
|
483
|
|
- Map<String,Integer> map = new HashMap<>();
|
484
|
|
- map.put("classnum",classnum);
|
485
|
|
- map.put("stunum",stunum);
|
486
|
|
- map.put("groupnum",groupnum);
|
|
501
|
+ Map<String, Integer> map = new HashMap<>();
|
|
502
|
+ map.put("classnum", classnum);
|
|
503
|
+ map.put("stunum", stunum);
|
|
504
|
+ map.put("groupnum", groupnum);
|
487
|
505
|
return map;
|
488
|
506
|
}
|
489
|
507
|
|
|
@@ -494,25 +512,25 @@ public class ComponentService {
|
494
|
512
|
* @Param [params]
|
495
|
513
|
* @Return java.util.Map<java.lang.String,java.lang.Integer>
|
496
|
514
|
**/
|
497
|
|
- public Map<String,Integer> getQuestionStatistic(ComponentParams params){
|
|
515
|
+ public Map<String, Integer> getQuestionStatistic(ComponentParams params) {
|
498
|
516
|
UserVo uservo = userMapper.getUserAndSchoolInfo(params.getUserid());
|
499
|
517
|
params.setSchoolid(uservo.getSchoolid());
|
500
|
518
|
params.setSchoollevel(uservo.getSchoollevel());
|
501
|
519
|
|
502
|
|
- Map<String,Integer> map = componentMapper.getQuestionStatistic(params);
|
503
|
|
- if(map == null || map.isEmpty()){
|
|
520
|
+ Map<String, Integer> map = componentMapper.getQuestionStatistic(params);
|
|
521
|
+ if (map == null || map.isEmpty()) {
|
504
|
522
|
map = new HashMap<>();
|
505
|
|
- map.put("totalnum",0);
|
506
|
|
- map.put("todaynum",0);
|
|
523
|
+ map.put("totalnum", 0);
|
|
524
|
+ map.put("todaynum", 0);
|
507
|
525
|
}
|
508
|
|
- //获取当前学科试题数量
|
|
526
|
+ // 获取当前学科试题数量
|
509
|
527
|
Integer subjectnum = componentMapper.getQuestionStatisticSubejct(params);
|
510
|
|
- if(subjectnum == null){
|
|
528
|
+ if (subjectnum == null) {
|
511
|
529
|
subjectnum = 0;
|
512
|
530
|
}
|
513
|
|
- map.put("subjectnum",subjectnum);
|
|
531
|
+ map.put("subjectnum", subjectnum);
|
514
|
532
|
|
515
|
|
- return map;
|
|
533
|
+ return map;
|
516
|
534
|
}
|
517
|
535
|
|
518
|
536
|
/*
|
|
@@ -522,54 +540,54 @@ public class ComponentService {
|
522
|
540
|
* @Param [params]
|
523
|
541
|
* @Return java.util.Map<java.lang.String,java.lang.Object>
|
524
|
542
|
**/
|
525
|
|
- public Map<String,Object> getTeachingStatistic(ComponentParams params){
|
|
543
|
+ public Map<String, Object> getTeachingStatistic(ComponentParams params) {
|
526
|
544
|
UserVo uservo = userMapper.getUserAndSchoolInfo(params.getUserid());
|
527
|
545
|
params.setSchoolid(uservo.getSchoolid());
|
528
|
546
|
params.setSchoollevel(uservo.getSchoollevel());
|
529
|
547
|
params.setYear(uservo.getYear());
|
530
|
548
|
|
531
|
|
- //近半年
|
|
549
|
+ // 近半年
|
532
|
550
|
long[] yeartimestamp = ApiUtil.getNowhalfYearTimestamp();
|
533
|
551
|
params.setStarttime(yeartimestamp[0]);
|
534
|
552
|
params.setStoptime(yeartimestamp[1]);
|
535
|
553
|
|
536
|
554
|
params.setTimestamp(N_Utils.getSecondTimestamp());
|
537
|
555
|
|
538
|
|
- Map<String,Object> map = componentMapper.getTeachingSchoolClassNum(params);//班级总数量
|
|
556
|
+ Map<String, Object> map = componentMapper.getTeachingSchoolClassNum(params);// 班级总数量
|
539
|
557
|
|
540
|
|
- //作业
|
|
558
|
+ // 作业
|
541
|
559
|
List<SchoolWorkSubjectVo> lst = componentMapper.listTeachingPapers(params);
|
542
|
560
|
Integer paperTotalnum = 0;
|
543
|
561
|
double paperCommitRate = 0;
|
544
|
562
|
double paperCheckRate = 0;
|
545
|
563
|
|
546
|
|
- if(lst!=null && lst.size()>0){
|
547
|
|
- for(SchoolWorkSubjectVo subject : lst){
|
548
|
|
- subject.setCommitrate(N_Utils.getIntegerDivideAndMulitiply(subject.getCommitnum(),subject.getStunum()));
|
549
|
|
- subject.setCheckrate(N_Utils.getIntegerDivideAndMulitiply(subject.getChecknum(),subject.getCommitnum()));
|
|
564
|
+ if (lst != null && lst.size() > 0) {
|
|
565
|
+ for (SchoolWorkSubjectVo subject : lst) {
|
|
566
|
+ subject.setCommitrate(N_Utils.getIntegerDivideAndMulitiply(subject.getCommitnum(), subject.getStunum()));
|
|
567
|
+ subject.setCheckrate(N_Utils.getIntegerDivideAndMulitiply(subject.getChecknum(), subject.getCommitnum()));
|
550
|
568
|
subject.setWorklist(new ArrayList<>());
|
551
|
569
|
}
|
552
|
570
|
|
553
|
571
|
paperTotalnum = lst.stream().mapToInt(SchoolWorkSubjectVo::getFabunum).sum();
|
554
|
|
- Integer totalcommit = lst.stream().mapToInt(SchoolWorkSubjectVo::getCommitnum).sum();
|
|
572
|
+ Integer totalcommit = lst.stream().mapToInt(SchoolWorkSubjectVo::getCommitnum).sum();
|
555
|
573
|
Integer totalcheck = lst.stream().mapToInt(SchoolWorkSubjectVo::getChecknum).sum();
|
556
|
574
|
Integer totalstunum = lst.stream().mapToInt(SchoolWorkSubjectVo::getStunum).sum();
|
557
|
|
- paperCommitRate = N_Utils.getIntegerDivideAndMulitiply(totalcommit,totalstunum);
|
558
|
|
- if(totalcommit>0){
|
559
|
|
- paperCheckRate = N_Utils.getIntegerDivideAndMulitiply(totalcheck,totalcommit);
|
|
575
|
+ paperCommitRate = N_Utils.getIntegerDivideAndMulitiply(totalcommit, totalstunum);
|
|
576
|
+ if (totalcommit > 0) {
|
|
577
|
+ paperCheckRate = N_Utils.getIntegerDivideAndMulitiply(totalcheck, totalcommit);
|
560
|
578
|
}
|
561
|
579
|
}
|
562
|
|
- map.put("paperTotalnum",paperTotalnum);
|
563
|
|
- map.put("paperCommitRate",paperCommitRate);
|
564
|
|
- map.put("paperCheckRate",paperCheckRate);
|
|
580
|
+ map.put("paperTotalnum", paperTotalnum);
|
|
581
|
+ map.put("paperCommitRate", paperCommitRate);
|
|
582
|
+ map.put("paperCheckRate", paperCheckRate);
|
565
|
583
|
|
566
|
|
- //预习
|
|
584
|
+ // 预习
|
567
|
585
|
List<SchoolWorkSubjectVo> guideList = componentMapper.listTeachingGuides(params);
|
568
|
586
|
Integer guideTotalnum = 0;
|
569
|
587
|
double guideCommitRate = 0;
|
570
|
|
- if(guideList!=null && guideList.size()>0){
|
571
|
|
- for(SchoolWorkSubjectVo subject : guideList){
|
572
|
|
- subject.setCommitrate(N_Utils.getIntegerDivideAndMulitiply(subject.getCommitnum(),subject.getStunum()));
|
|
588
|
+ if (guideList != null && guideList.size() > 0) {
|
|
589
|
+ for (SchoolWorkSubjectVo subject : guideList) {
|
|
590
|
+ subject.setCommitrate(N_Utils.getIntegerDivideAndMulitiply(subject.getCommitnum(), subject.getStunum()));
|
573
|
591
|
|
574
|
592
|
subject.setWorklist(new ArrayList<>());
|
575
|
593
|
}
|
|
@@ -577,14 +595,14 @@ public class ComponentService {
|
577
|
595
|
guideTotalnum = lst.stream().mapToInt(SchoolWorkSubjectVo::getFabunum).sum();
|
578
|
596
|
Integer totalstunum = lst.stream().mapToInt(SchoolWorkSubjectVo::getStunum).sum();
|
579
|
597
|
Integer totalcommit = lst.stream().mapToInt(SchoolWorkSubjectVo::getCommitnum).sum();
|
580
|
|
- if(totalcommit>0){
|
581
|
|
- guideCommitRate = N_Utils.getIntegerDivideAndMulitiply(totalcommit,totalstunum);
|
|
598
|
+ if (totalcommit > 0) {
|
|
599
|
+ guideCommitRate = N_Utils.getIntegerDivideAndMulitiply(totalcommit, totalstunum);
|
582
|
600
|
}
|
583
|
601
|
}
|
584
|
|
- map.put("guideTotalnum",guideTotalnum);
|
585
|
|
- map.put("guideCommitRate",guideCommitRate);
|
|
602
|
+ map.put("guideTotalnum", guideTotalnum);
|
|
603
|
+ map.put("guideCommitRate", guideCommitRate);
|
586
|
604
|
|
587
|
|
- //背诵
|
|
605
|
+ // 背诵
|
588
|
606
|
// List<SchoolWorkSubjectVo> reciteList = componentMapper.listTeachingRecites(params);
|
589
|
607
|
// int reciteTotalnum = 0;
|
590
|
608
|
// double reciteCommitRate = 0;
|
|
@@ -604,7 +622,7 @@ public class ComponentService {
|
604
|
622
|
// map.put("reciteTotalnum",reciteTotalnum);
|
605
|
623
|
// map.put("reciteCommitRate",reciteCommitRate);
|
606
|
624
|
|
607
|
|
- return map;
|
|
625
|
+ return map;
|
608
|
626
|
}
|
609
|
627
|
|
610
|
628
|
/*
|
|
@@ -614,7 +632,7 @@ public class ComponentService {
|
614
|
632
|
* @Param [params]
|
615
|
633
|
* @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
616
|
634
|
**/
|
617
|
|
- public List<Map<String,Object>> listUserModules(ComponentParams params){
|
|
635
|
+ public List<Map<String, Object>> listUserModules(ComponentParams params) {
|
618
|
636
|
return componentMapper.listUserModules(params);
|
619
|
637
|
}
|
620
|
638
|
|
|
@@ -625,7 +643,7 @@ public class ComponentService {
|
625
|
643
|
* @Param [params]
|
626
|
644
|
* @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
627
|
645
|
**/
|
628
|
|
- public List<Map<String,Object>> listExamPaperGiv(ComponentParams params){
|
|
646
|
+ public List<Map<String, Object>> listExamPaperGiv(ComponentParams params) {
|
629
|
647
|
params.setTodayDatetime(LocalDateTime.now());
|
630
|
648
|
return componentMapper.listExamPaperGiv(params);
|
631
|
649
|
}
|
|
@@ -637,7 +655,7 @@ public class ComponentService {
|
637
|
655
|
* @Param [params]
|
638
|
656
|
* @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
639
|
657
|
**/
|
640
|
|
- public List<Map<String,Object>> listExamPaperCheck(ComponentParams params){
|
|
658
|
+ public List<Map<String, Object>> listExamPaperCheck(ComponentParams params) {
|
641
|
659
|
return componentMapper.listExamPaperCheck(params);
|
642
|
660
|
}
|
643
|
661
|
|
|
@@ -648,16 +666,16 @@ public class ComponentService {
|
648
|
666
|
* @Param [params]
|
649
|
667
|
* @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
650
|
668
|
**/
|
651
|
|
- public List<Map<String,Object>> listExamInvigilate(ComponentParams params){
|
|
669
|
+ public List<Map<String, Object>> listExamInvigilate(ComponentParams params) {
|
652
|
670
|
params.setTodayDatetime(LocalDateTime.now());
|
653
|
671
|
Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
|
654
|
672
|
|
655
|
|
- List<Map<String,Object>> list = componentMapper.listExamInvigilate(params);
|
|
673
|
+ List<Map<String, Object>> list = componentMapper.listExamInvigilate(params);
|
656
|
674
|
for (Map map : list) {
|
657
|
675
|
List<Map> classes = JSON.parseArray(map.get("classnames").toString(), Map.class);
|
658
|
676
|
List<Map> classList = new ArrayList<>();
|
659
|
677
|
Integer majored = (Integer) map.get("majored");
|
660
|
|
- if (majored == 1) {//主监考
|
|
678
|
+ if (majored == 1) {// 主监考
|
661
|
679
|
classList.addAll(classes);
|
662
|
680
|
} else {
|
663
|
681
|
String[] classids2 = map.get("classids").toString().split(",");
|
|
@@ -686,7 +704,7 @@ public class ComponentService {
|
686
|
704
|
schools.add(school);
|
687
|
705
|
}
|
688
|
706
|
if (schools.size() > 1) {
|
689
|
|
- //把本校放在第一个位置
|
|
707
|
+ // 把本校放在第一个位置
|
690
|
708
|
for (int i = 0; i < schools.size(); i++) {
|
691
|
709
|
Map rtnMap = schools.get(i);
|
692
|
710
|
Integer schoolid2 = Integer.parseInt(rtnMap.get("schoolid").toString());
|
|
@@ -709,27 +727,25 @@ public class ComponentService {
|
709
|
727
|
* @Param [params]
|
710
|
728
|
* @Return java.util.Map<java.lang.String,java.lang.Object>
|
711
|
729
|
**/
|
712
|
|
- public Map<String,Object> getExamReportSchool(ComponentParams params){
|
|
730
|
+ public Map<String, Object> getExamReportSchool(ComponentParams params) {
|
713
|
731
|
Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
|
714
|
|
- //获取最新近一次有报告的考试
|
715
|
|
- Map<String,Object> map = componentMapper.getExamReportSchoolBase(schoolid);
|
716
|
|
- if(map!=null && !map.isEmpty()){
|
717
|
|
- Integer examid = Integer.parseInt(map.get("examid").toString());
|
718
|
|
- List<Map<String,Object>> subjects = componentMapper.listExamReportSchoolStatistic(examid);
|
719
|
|
- map.put("subjects",subjects);
|
720
|
|
- }else {
|
721
|
|
- map = new HashMap<>();
|
722
|
|
- map.put("classnum", 0);
|
723
|
|
- map.put("stunum", 0);
|
724
|
|
- map.put("missnum", 0);
|
725
|
|
- map.put("subjectnum", 0);
|
726
|
|
- map.put("maxscore", 0);
|
727
|
|
- map.put("avgscore", 0);
|
728
|
|
- map.put("mixscore", 0);
|
729
|
|
-
|
730
|
|
- map.put("subjects",new ArrayList<>());
|
|
732
|
+ // 获取最新近一次有报告的考试
|
|
733
|
+ Map<String, Object> map = componentMapper.getExamReportSchoolBase(schoolid);
|
|
734
|
+ if (map != null && !map.isEmpty()) {
|
|
735
|
+ Integer examstate = Integer.parseInt(map.get("examstate").toString());
|
|
736
|
+ if (examstate == 3) {
|
|
737
|
+ Integer examid = Integer.parseInt(map.get("examid").toString());
|
|
738
|
+ List<Map<String, Object>> subjects = componentMapper.listExamReportSchoolStatistic(examid);
|
|
739
|
+ map.put("subjects", subjects);
|
|
740
|
+ return map;
|
|
741
|
+ } else {
|
|
742
|
+ return null;
|
|
743
|
+ }
|
|
744
|
+
|
|
745
|
+ } else {
|
|
746
|
+ return null;
|
731
|
747
|
}
|
732
|
|
- return map;
|
|
748
|
+
|
733
|
749
|
}
|
734
|
750
|
|
735
|
751
|
/*
|
|
@@ -739,44 +755,40 @@ public class ComponentService {
|
739
|
755
|
* @Param [params]
|
740
|
756
|
* @Return java.util.Map<java.lang.String,java.lang.Object>
|
741
|
757
|
**/
|
742
|
|
- public Map<String,Object> getExamReportClass(ComponentParams params){
|
|
758
|
+ public Map<String, Object> getExamReportClass(ComponentParams params) {
|
743
|
759
|
Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
|
744
|
760
|
params.setSchoolid(schoolid);
|
745
|
761
|
|
746
|
|
- Map<String,Object> map = new HashMap<>();
|
747
|
762
|
ExamInfoVo examInfoVo = componentMapper.getExamReportClassInfo(params);
|
748
|
|
- if(examInfoVo != null){
|
749
|
|
- params.setSubjectid("zf");
|
750
|
|
- params.setClassid(examInfoVo.getClassid());
|
751
|
|
- params.setShowrank(examInfoVo.getTeashowrank());
|
752
|
|
- params.setExamid(examInfoVo.getExamid());
|
|
763
|
+ if (examInfoVo != null) {
|
|
764
|
+ if(examInfoVo.getExamstate() == 3){
|
|
765
|
+ params.setSubjectid("zf");
|
|
766
|
+ params.setShowrank(examInfoVo.getTeashowrank());
|
|
767
|
+ params.setExamid(examInfoVo.getExamid());
|
|
768
|
+ if (!N_Utils.isTrueInteger(params.getClassid())) {
|
|
769
|
+ params.setClassid(examInfoVo.getClassid());
|
|
770
|
+ }
|
753
|
771
|
|
754
|
|
- map = componentMapper.getExamReportSingleBase(params);
|
|
772
|
+ Map<String, Object> map = componentMapper.getExamReportSingleBase(params);
|
755
|
773
|
|
756
|
|
- //获取考试关联的班级信息
|
757
|
|
- List<Map<String,Object>> classList = componentMapper.listExamReportClass(examInfoVo.getExamid(),params.getUserid());
|
758
|
|
- map.put("classlist",classList);
|
|
774
|
+ // 获取考试关联的班级信息
|
|
775
|
+ List<Map<String, Object>> classList = componentMapper.listExamReportClass(examInfoVo.getExamid(), params.getUserid());
|
|
776
|
+ map.put("classlist", classList);
|
759
|
777
|
|
760
|
778
|
|
761
|
|
- List<Map<String,Object>> subjectList = new ArrayList<>();
|
762
|
|
- if(examInfoVo.getTeashowrank() == 3){
|
763
|
|
- subjectList = componentMapper.listExamReportClassScore(params);
|
|
779
|
+ List<Map<String, Object>> subjectList = new ArrayList<>();
|
|
780
|
+ if (examInfoVo.getTeashowrank() == 3) {
|
|
781
|
+ subjectList = componentMapper.listExamReportClassScore(params);
|
|
782
|
+ }
|
|
783
|
+ map.put("subjectlist", subjectList);
|
|
784
|
+ map.put("teashowrank", examInfoVo.getTeashowrank());
|
|
785
|
+ return map;
|
|
786
|
+ }else{
|
|
787
|
+ return null;
|
764
|
788
|
}
|
765
|
|
- map.put("subjectlist",subjectList);
|
766
|
|
- }else{
|
767
|
|
- map = new HashMap<>();
|
768
|
|
- map.put("classlist", new ArrayList<>());
|
769
|
|
- map.put("subjectlist", new ArrayList<>());
|
770
|
|
- map.put("yxrate", 0);
|
771
|
|
- map.put("jgrate", 0);
|
772
|
|
- map.put("classmaxscore", 0);
|
773
|
|
- map.put("classavgscore", 0);
|
774
|
|
- map.put("classavgscorerank", 0);
|
775
|
|
- map.put("schoolmaxscore", 0);
|
776
|
|
- map.put("schoolavgscore", 0);
|
|
789
|
+ } else {
|
|
790
|
+ return null;
|
777
|
791
|
}
|
778
|
|
-
|
779
|
|
- return map;
|
780
|
792
|
}
|
781
|
793
|
|
782
|
794
|
/*
|
|
@@ -786,44 +798,42 @@ public class ComponentService {
|
786
|
798
|
* @Param [params]
|
787
|
799
|
* @Return java.util.Map<java.lang.String,java.lang.Object>
|
788
|
800
|
**/
|
789
|
|
- public Map<String,Object> getExamReportSingle(ComponentParams params){
|
|
801
|
+ public Map<String, Object> getExamReportSingle(ComponentParams params) {
|
790
|
802
|
Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
|
791
|
803
|
params.setSchoolid(schoolid);
|
792
|
804
|
|
793
|
|
- Map<String,Object> map = new HashMap<>();
|
794
|
805
|
ExamInfoVo examInfoVo = componentMapper.getExamReportSingleInfo(params);
|
795
|
806
|
|
796
|
|
- if(examInfoVo != null){
|
797
|
|
- params.setSubjectid(examInfoVo.getSubjectid());
|
798
|
|
- params.setClassid(examInfoVo.getClassid());
|
799
|
|
- params.setShowrank(examInfoVo.getTeashowrank());
|
800
|
|
- params.setExamid(examInfoVo.getExamid());
|
|
807
|
+ if (examInfoVo != null) {
|
|
808
|
+ if(examInfoVo.getExamstate() == 3){
|
|
809
|
+ params.setSubjectid(examInfoVo.getSubjectid());
|
|
810
|
+ params.setShowrank(examInfoVo.getTeashowrank());
|
|
811
|
+ params.setExamid(examInfoVo.getExamid());
|
801
|
812
|
|
802
|
|
- map = componentMapper.getExamReportSingleBase(params);
|
|
813
|
+ if (!N_Utils.isTrueInteger(params.getClassid())) {
|
|
814
|
+ params.setClassid(examInfoVo.getClassid());
|
|
815
|
+ }
|
803
|
816
|
|
804
|
|
- //获取考试关联的班级信息
|
805
|
|
- List<Map<String,Object>> classList = componentMapper.listExamReportClass(examInfoVo.getExamid(),params.getUserid());
|
806
|
|
- map.put("classlist",classList);
|
|
817
|
+ Map<String, Object> map = componentMapper.getExamReportSingleBase(params);
|
807
|
818
|
|
808
|
|
- List<Map<String,Object>> rankList = new ArrayList<>();
|
809
|
|
- if(examInfoVo.getTeashowrank() == 3){
|
810
|
|
- rankList = componentMapper.listExamReportSingleRank(params);
|
|
819
|
+ // 获取考试关联的班级信息
|
|
820
|
+ List<Map<String, Object>> classList = componentMapper.listExamReportClass(examInfoVo.getExamid(), params.getUserid());
|
|
821
|
+ map.put("classlist", classList);
|
|
822
|
+
|
|
823
|
+ List<Map<String, Object>> rankList = new ArrayList<>();
|
|
824
|
+ if (examInfoVo.getTeashowrank() == 3) {
|
|
825
|
+ rankList = componentMapper.listExamReportSingleRank(params);
|
|
826
|
+ }
|
|
827
|
+ map.put("ranklist", rankList);
|
|
828
|
+ map.put("teashowrank", examInfoVo.getTeashowrank());
|
|
829
|
+ return map;
|
|
830
|
+ }else{
|
|
831
|
+ return null;
|
811
|
832
|
}
|
812
|
|
- map.put("ranklist",rankList);
|
813
|
|
- }else{
|
814
|
|
- map = new HashMap<>();
|
815
|
|
- map.put("classlist", new ArrayList<>());
|
816
|
|
- map.put("ranklist", new ArrayList<>());
|
817
|
|
- map.put("yxrate", 0);
|
818
|
|
- map.put("jgrate", 0);
|
819
|
|
- map.put("classmaxscore", 0);
|
820
|
|
- map.put("classavgscore", 0);
|
821
|
|
- map.put("classavgscorerank", 0);
|
822
|
|
- map.put("schoolmaxscore", 0);
|
823
|
|
- map.put("schoolavgscore", 0);
|
824
|
|
- }
|
825
|
833
|
|
826
|
|
- return map;
|
|
834
|
+ } else {
|
|
835
|
+ return null;
|
|
836
|
+ }
|
827
|
837
|
}
|
828
|
838
|
|
829
|
839
|
/*
|
|
@@ -833,43 +843,43 @@ public class ComponentService {
|
833
|
843
|
* @Param [params]
|
834
|
844
|
* @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
835
|
845
|
**/
|
836
|
|
- public List<Map<String,Object>> listExamCheckProgress(ComponentParams params){
|
|
846
|
+ public List<Map<String, Object>> listExamCheckProgress(ComponentParams params) {
|
837
|
847
|
UserVo userVo = userMapper.getUserAndSchoolInfo(params.getUserid());
|
838
|
848
|
params.setSchoolid(userVo.getSchoolid());
|
839
|
849
|
params.setUsertype(userVo.getUsertype());
|
840
|
|
- //获取最新的一个考试阅卷
|
|
850
|
+ // 获取最新的一个考试阅卷
|
841
|
851
|
ExamInfoVo examInfoVo = componentMapper.getExamCheckProgressBase(params);
|
842
|
|
- List<Map<String,Object>> mapList = new ArrayList<>();
|
|
852
|
+ List<Map<String, Object>> mapList = new ArrayList<>();
|
843
|
853
|
|
844
|
|
- if(examInfoVo!=null){
|
|
854
|
+ if (examInfoVo != null) {
|
845
|
855
|
List<EPaperVo> papers = componentMapper.listExamCheckProgressPaper(examInfoVo.getExamid());
|
846
|
856
|
String epids = papers.stream().map(p -> p.getEpid().toString()).collect(Collectors.joining(","));
|
847
|
|
- List<PaperStudentQuestionVo> questions = componentMapper.listExamCheckProgressStuQuestion(epids);//获取考试学生试题
|
|
857
|
+ List<PaperStudentQuestionVo> questions = componentMapper.listExamCheckProgressStuQuestion(epids);// 获取考试学生试题
|
848
|
858
|
|
849
|
859
|
for (EPaperVo paper : papers) {
|
850
|
|
- //单科统计
|
|
860
|
+ // 单科统计
|
851
|
861
|
Integer epid = paper.getEpid();
|
852
|
862
|
List<PaperStudentQuestionVo> qlist =
|
853
|
863
|
questions.stream().filter(q -> q.getEpid().equals(epid)).collect(Collectors.toList());
|
854
|
864
|
|
855
|
865
|
List<Integer> qtlist = qlist.stream().filter(q -> !N_Utils.isObjectiveQuestion(q.getCtype()))
|
856
|
866
|
.map(q -> q.getQorder()).distinct().collect(Collectors.toList());
|
857
|
|
- List<PaperStudentQuestionVo> zdlist =//作答集合
|
|
867
|
+ List<PaperStudentQuestionVo> zdlist =// 作答集合
|
858
|
868
|
qlist.stream().filter(q -> q.getAnswered().equals(1)).collect(Collectors.toList());
|
859
|
|
- List<PaperStudentQuestionVo> pylist =//批阅集合
|
|
869
|
+ List<PaperStudentQuestionVo> pylist =// 批阅集合
|
860
|
870
|
zdlist.stream().filter(q -> q.getChecked().equals(2)).collect(Collectors.toList());
|
861
|
871
|
Integer zgtnum = qtlist.size();
|
862
|
872
|
Integer stunum = zdlist.stream().map(q -> q.getStudentid()).distinct().collect(Collectors.toList()).size();
|
863
|
|
- Integer zpynum = pylist.size();//试卷批阅试题数量
|
|
873
|
+ Integer zpynum = pylist.size();// 试卷批阅试题数量
|
864
|
874
|
|
865
|
|
- Map<String,Object> map = new LinkedHashMap<>();
|
|
875
|
+ Map<String, Object> map = new LinkedHashMap<>();
|
866
|
876
|
|
867
|
|
- map.put("subjectid",paper.getSubjectid());
|
868
|
|
- map.put("subjectname",paper.getSubjectname());
|
869
|
|
- map.put("examnum",examInfoVo.getExamnum());
|
870
|
|
- map.put("stunum",stunum);//实际人数
|
871
|
|
- map.put("zgtnum",zgtnum);//主观题数量
|
872
|
|
- map.put("pyrate",N_Utils.getIntegerDivideAndMulitiply(zpynum, zdlist.size()));//批阅进度
|
|
877
|
+ map.put("subjectid", paper.getSubjectid());
|
|
878
|
+ map.put("subjectname", paper.getSubjectname());
|
|
879
|
+ map.put("examnum", examInfoVo.getExamnum());
|
|
880
|
+ map.put("stunum", stunum);// 实际人数
|
|
881
|
+ map.put("zgtnum", zgtnum);// 主观题数量
|
|
882
|
+ map.put("pyrate", N_Utils.getIntegerDivideAndMulitiply(zpynum, zdlist.size()));// 批阅进度
|
873
|
883
|
|
874
|
884
|
mapList.add(map);
|
875
|
885
|
}
|