Browse Source

组件-阅卷进度

tags/正式3.14.0
王宁 5 months ago
parent
commit
95fba8f0ff

+ 14
- 0
sapi/src/main/java/com/xhkjedu/sapi/controller/component/ComponentController.java View File

397
         N_Utils.validation(new Object[]{userid, "用户ID", 1});
397
         N_Utils.validation(new Object[]{userid, "用户ID", 1});
398
         return new ResultVo(0, componentService.getExamReportSingle(params));
398
         return new ResultVo(0, componentService.getExamReportSingle(params));
399
     }
399
     }
400
+
401
+    /*
402
+     * @Description 考试-阅卷进度
403
+     * @Date 2024/7/24 10:49:38
404
+     * @Author WN
405
+     * @Param [params]
406
+     * @Return com.xhkjedu.vo.ResultVo
407
+     **/
408
+    @PostMapping("/exam_check_progress")
409
+    public ResultVo listExamCheckProgress(@RequestBody ComponentParams params) {
410
+        Integer userid = params.getUserid();
411
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
412
+        return new ResultVo(0, componentService.listExamCheckProgress(params));
413
+    }
400
 }
414
 }

+ 8
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/component/ComponentMapper.java View File

3
 import com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo;
3
 import com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo;
4
 import com.xhkjedu.sapi.vo.component.ComponentParams;
4
 import com.xhkjedu.sapi.vo.component.ComponentParams;
5
 import com.xhkjedu.sapi.vo.component.ExamInfoVo;
5
 import com.xhkjedu.sapi.vo.component.ExamInfoVo;
6
+import com.xhkjedu.sapi.vo.component.PaperStudentQuestionVo;
6
 import com.xhkjedu.sapi.vo.component.StudyStatisticVo;
7
 import com.xhkjedu.sapi.vo.component.StudyStatisticVo;
7
 import com.xhkjedu.sapi.vo.notice.NoticeVo;
8
 import com.xhkjedu.sapi.vo.notice.NoticeVo;
9
+import com.xhkjedu.vo.exam.EPaperVo;
8
 import com.xhkjedu.vo.paper.PaperListVo;
10
 import com.xhkjedu.vo.paper.PaperListVo;
9
 import org.apache.ibatis.annotations.Param;
11
 import org.apache.ibatis.annotations.Param;
10
 
12
 
114
     Map<String,Object> getExamReportSingleBase(@Param("params")ComponentParams params);
116
     Map<String,Object> getExamReportSingleBase(@Param("params")ComponentParams params);
115
     //考试-单科报告-成绩等级分布
117
     //考试-单科报告-成绩等级分布
116
     List<Map<String,Object>> listExamReportSingleRank(@Param("params")ComponentParams params);
118
     List<Map<String,Object>> listExamReportSingleRank(@Param("params")ComponentParams params);
119
+    //考试-阅卷进度-考试信息
120
+    ExamInfoVo getExamCheckProgressBase(@Param("params")ComponentParams params);
121
+    //考试-阅卷进度-试卷
122
+    List<EPaperVo> listExamCheckProgressPaper(@Param("examid")Integer examid);
123
+    //考试-阅卷进度-学生试题
124
+    List<PaperStudentQuestionVo> listExamCheckProgressStuQuestion(@Param("epids")String epids);
117
 }
125
 }

+ 54
- 0
sapi/src/main/java/com/xhkjedu/sapi/service/component/ComponentService.java View File

11
 import com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo;
11
 import com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo;
12
 import com.xhkjedu.sapi.vo.component.ComponentParams;
12
 import com.xhkjedu.sapi.vo.component.ComponentParams;
13
 import com.xhkjedu.sapi.vo.component.ExamInfoVo;
13
 import com.xhkjedu.sapi.vo.component.ExamInfoVo;
14
+import com.xhkjedu.sapi.vo.component.PaperStudentQuestionVo;
14
 import com.xhkjedu.sapi.vo.component.StudyStatisticVo;
15
 import com.xhkjedu.sapi.vo.component.StudyStatisticVo;
15
 import com.xhkjedu.sapi.vo.notice.NoticeVo;
16
 import com.xhkjedu.sapi.vo.notice.NoticeVo;
16
 import com.xhkjedu.sapi.vo.subjectbook.SubjectVo;
17
 import com.xhkjedu.sapi.vo.subjectbook.SubjectVo;
17
 import com.xhkjedu.utils.N_Utils;
18
 import com.xhkjedu.utils.N_Utils;
19
+import com.xhkjedu.vo.exam.EPaperVo;
18
 import com.xhkjedu.vo.paper.PaperClassVo;
20
 import com.xhkjedu.vo.paper.PaperClassVo;
19
 import com.xhkjedu.vo.paper.PaperListVo;
21
 import com.xhkjedu.vo.paper.PaperListVo;
20
 import com.xhkjedu.vo.system.UserVo;
22
 import com.xhkjedu.vo.system.UserVo;
824
         return map;
826
         return map;
825
     }
827
     }
826
 
828
 
829
+    /*
830
+     * @Description 考试-阅卷进度
831
+     * @Date 2024/7/24 10:49:22
832
+     * @Author WN
833
+     * @Param [params]
834
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
835
+     **/
836
+    public List<Map<String,Object>> listExamCheckProgress(ComponentParams params){
837
+        UserVo userVo = userMapper.getUserAndSchoolInfo(params.getUserid());
838
+        params.setSchoolid(userVo.getSchoolid());
839
+        params.setUsertype(userVo.getUsertype());
840
+        //获取最新的一个考试阅卷
841
+        ExamInfoVo examInfoVo = componentMapper.getExamCheckProgressBase(params);
842
+        List<Map<String,Object>> mapList = new ArrayList<>();
843
+
844
+        if(examInfoVo!=null){
845
+            List<EPaperVo> papers = componentMapper.listExamCheckProgressPaper(examInfoVo.getExamid());
846
+            String epids = papers.stream().map(p -> p.getEpid().toString()).collect(Collectors.joining(","));
847
+            List<PaperStudentQuestionVo> questions = componentMapper.listExamCheckProgressStuQuestion(epids);//获取考试学生试题
848
+
849
+            for (EPaperVo paper : papers) {
850
+                //单科统计
851
+                Integer epid = paper.getEpid();
852
+                List<PaperStudentQuestionVo> qlist =
853
+                        questions.stream().filter(q -> q.getEpid().equals(epid)).collect(Collectors.toList());
854
+
855
+                List<Integer> qtlist = qlist.stream().filter(q -> !N_Utils.isObjectiveQuestion(q.getCtype()))
856
+                                            .map(q -> q.getQorder()).distinct().collect(Collectors.toList());
857
+                List<PaperStudentQuestionVo> zdlist =//作答集合
858
+                        qlist.stream().filter(q -> q.getAnswered().equals(1)).collect(Collectors.toList());
859
+                List<PaperStudentQuestionVo> pylist =//批阅集合
860
+                        zdlist.stream().filter(q -> q.getChecked().equals(2)).collect(Collectors.toList());
861
+                Integer zgtnum = qtlist.size();
862
+                Integer stunum = zdlist.stream().map(q -> q.getStudentid()).distinct().collect(Collectors.toList()).size();
863
+                Integer zpynum = pylist.size();//试卷批阅试题数量
864
+
865
+                Map<String,Object> map = new LinkedHashMap<>();
866
+
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()));//批阅进度
873
+
874
+                mapList.add(map);
875
+            }
876
+        }
877
+
878
+        return mapList;
879
+    }
880
+
827
 
881
 
828
 }
882
 }

+ 3
- 0
sapi/src/main/java/com/xhkjedu/sapi/vo/component/ExamInfoVo.java View File

26
 
26
 
27
     //// 科目id
27
     //// 科目id
28
     private String subjectid;
28
     private String subjectid;
29
+
30
+    //计划考试人数
31
+    private Integer examnum;
29
 }
32
 }

+ 114
- 0
sapi/src/main/java/com/xhkjedu/sapi/vo/component/PaperStudentQuestionVo.java View File

1
+package com.xhkjedu.sapi.vo.component;
2
+
3
+import com.xhkjedu.model.BaseBean;
4
+import lombok.Data;
5
+
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
8
+import javax.persistence.Transient;
9
+import java.util.List;
10
+
11
+@Table(name = "e_paper_student_question")
12
+@Data
13
+public class PaperStudentQuestionVo extends BaseBean {
14
+    @Id
15
+    //考试试卷学生题库试题表
16
+    private Integer epsqid;
17
+
18
+    //班级id
19
+    private Integer classid;
20
+
21
+    //学生id
22
+    private Integer studentid;
23
+
24
+    //考试id
25
+    private Integer examid;
26
+
27
+    //科目id
28
+    private String subjectid;
29
+
30
+    //试卷id
31
+    private Integer epid;
32
+
33
+    //试卷学生id
34
+    private Integer epsid;
35
+
36
+    private Integer eptqid;//试卷中试题id
37
+
38
+    //处理题型
39
+    private Integer ctype;
40
+
41
+    //试题id
42
+    private String questionid;
43
+
44
+    //题号
45
+    private String qn;
46
+
47
+    //试题排序
48
+    private Integer qorder;
49
+
50
+    //是否作答0未作答1已作做答
51
+    private Integer answered;
52
+
53
+    //答案类型1选择题、图片2纯文本
54
+    private Integer answertype;
55
+
56
+    //学生答案(选项、图片)
57
+    private String stuanswer;
58
+
59
+    //学生答案(纯文本)
60
+    private String stuanswertxt;
61
+
62
+    //是否转换0未转换1已转换2转换失败
63
+    private Integer converted;
64
+
65
+    //提交时间
66
+    private Integer answertime;
67
+
68
+    //单题花费时间(单位秒)
69
+    private Integer costtime;
70
+
71
+    //试题分值
72
+    private Double qscore;
73
+
74
+    //学生得分
75
+    private Double stuscore;
76
+
77
+    //是否批改0未批改1批改中2已批改
78
+    private Integer checked;
79
+
80
+    //批改人
81
+    private Integer checkid;
82
+
83
+    //批改时间
84
+    private Integer checktime;
85
+
86
+    //优秀试卷0默认1优秀
87
+    private Integer good;
88
+
89
+    //违纪试卷0默认1违纪
90
+    private Integer bad;
91
+
92
+    //客观题是否需要重新批改0不需要1需要
93
+    private Integer needdeal;
94
+
95
+    @Transient
96
+    private String stuname;//学生姓名
97
+
98
+    @Transient
99
+    private String checkname;//批阅人
100
+
101
+    @Transient
102
+    private String answer;//试题正确答案
103
+
104
+    @Transient
105
+    private List<Integer> eptqids;//试卷试题ids
106
+
107
+    @Transient
108
+    private String classids;//班级ids
109
+
110
+    //学生试卷得分
111
+    @Transient
112
+    private Double stupaperscore;
113
+
114
+}

+ 25
- 0
sapi/src/main/resources/mapper/component/ComponentMapper.xml View File

521
         where err.examid=#{params.examid} and err.classid=#{params.classid}
521
         where err.examid=#{params.examid} and err.classid=#{params.classid}
522
         and err.subjectid=#{params.subjectid} and err.ranktype=1
522
         and err.subjectid=#{params.subjectid} and err.ranktype=1
523
     </select>
523
     </select>
524
+    <!--考试-阅卷进度-考试-->
525
+    <select id="getExamCheckProgressBase" resultType="com.xhkjedu.sapi.vo.component.ExamInfoVo">
526
+        select e.examid,(select sum(c.classnum) from e_class c where c.examid=e.examid)examnum from e_base e
527
+        where e.deleted=1 and e.schoolid=#{params.schoolid}  and e.examstate>0
528
+        <if test="params.usertype == 1">
529
+            and e.createid=#{params.userid}
530
+        </if>
531
+        group by e.examid order by e.examdate desc limit 1
532
+    </select>
533
+    <!--考试-阅卷进度-试卷-->
534
+    <select id="listExamCheckProgressPaper" resultType="com.xhkjedu.vo.exam.EPaperVo">
535
+        select ep.epid,ep.pnum,es.subjectid,es.subjectname,ep.correcttype
536
+        ,(case when ep.correcttype=1
537
+        then (select concat('[',group_concat(json_object('classid',epc.classid,'teacherid',epc.teacherid)),']')
538
+        from e_paper_correctclass epc where epc.epid=ep.epid)
539
+        else (select concat('[',group_concat(json_object('eptqid',epc.eptqid,'teacherid',epc.teacherid)),']')
540
+        from e_paper_correctquestion epc where epc.epid=ep.epid) end)correctJson
541
+        from e_paper ep left join e_subject es on ep.esid = es.esid
542
+        where ep.examid=#{examid}
543
+    </select>
544
+    <!--考试-阅卷进度-学生试题-->
545
+    <select id="listExamCheckProgressStuQuestion" resultType="com.xhkjedu.sapi.vo.component.PaperStudentQuestionVo">
546
+        select studentid,epid,eptqid,qn,answered,checked,checkid,ctype,qorder
547
+        from e_paper_student_question where epid in(${epids})
548
+    </select>
524
 
549
 
525
 </mapper>
550
 </mapper>

sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EPCTeacherVo.java → scommons/src/main/java/com/xhkjedu/vo/exam/EPCTeacherVo.java View File

1
-package com.xhkjedu.sexam.vo.paper;
1
+package com.xhkjedu.vo.exam;
2
 
2
 
3
 import lombok.Data;
3
 import lombok.Data;
4
 
4
 

sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EPaperVo.java → scommons/src/main/java/com/xhkjedu/vo/exam/EPaperVo.java View File

1
-package com.xhkjedu.sexam.vo.paper;
1
+package com.xhkjedu.vo.exam;
2
 
2
 
3
 import lombok.Data;
3
 import lombok.Data;
4
 
4
 

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java View File

15
 import com.xhkjedu.sexam.service.report.EReportGenerateService;
15
 import com.xhkjedu.sexam.service.report.EReportGenerateService;
16
 import com.xhkjedu.sexam.vo.exam.EBaseVo;
16
 import com.xhkjedu.sexam.vo.exam.EBaseVo;
17
 import com.xhkjedu.sexam.vo.exam.ExamVo;
17
 import com.xhkjedu.sexam.vo.exam.ExamVo;
18
-import com.xhkjedu.sexam.vo.paper.EPaperVo;
18
+import com.xhkjedu.vo.exam.EPaperVo;
19
 import com.xhkjedu.utils.DatesUtil;
19
 import com.xhkjedu.utils.DatesUtil;
20
 import com.xhkjedu.utils.N_Utils;
20
 import com.xhkjedu.utils.N_Utils;
21
 import com.xhkjedu.utils.PageUtil;
21
 import com.xhkjedu.utils.PageUtil;

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/mapper/paper/EPaperCorrectTeacherMapper.java View File

2
 
2
 
3
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
3
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
4
 import com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo;
4
 import com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo;
5
-import com.xhkjedu.sexam.vo.paper.EPaperVo;
5
+import com.xhkjedu.vo.exam.EPaperVo;
6
 import org.apache.ibatis.annotations.Param;
6
 import org.apache.ibatis.annotations.Param;
7
 
7
 
8
 import java.util.List;
8
 import java.util.List;

+ 2
- 2
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperCorrectTeacherService.java View File

7
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
7
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
8
 import com.xhkjedu.sexam.mapper.system.UserMapper;
8
 import com.xhkjedu.sexam.mapper.system.UserMapper;
9
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
9
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
10
-import com.xhkjedu.sexam.vo.paper.EPCTeacherVo;
10
+import com.xhkjedu.vo.exam.EPCTeacherVo;
11
 import com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo;
11
 import com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo;
12
-import com.xhkjedu.sexam.vo.paper.EPaperVo;
12
+import com.xhkjedu.vo.exam.EPaperVo;
13
 import com.xhkjedu.utils.N_Utils;
13
 import com.xhkjedu.utils.N_Utils;
14
 import com.xhkjedu.vo.ResultVo;
14
 import com.xhkjedu.vo.ResultVo;
15
 import com.xhkjedu.vo.system.UserVo;
15
 import com.xhkjedu.vo.system.UserVo;

+ 1
- 1
sexam/src/main/resources/mapper/paper/EPaperCorrectTeacherMapper.xml View File

136
         from e_subject es left join e_base eb on eb.examid = es.examid where es.esid=#{esid}
136
         from e_subject es left join e_base eb on eb.examid = es.examid where es.esid=#{esid}
137
     </select>
137
     </select>
138
     <!--获取考试试卷-->
138
     <!--获取考试试卷-->
139
-    <select id="listPaperByExamId" resultType="com.xhkjedu.sexam.vo.paper.EPaperVo">
139
+    <select id="listPaperByExamId" resultType="com.xhkjedu.vo.exam.EPaperVo">
140
         select ep.epid,ep.pnum,es.subjectid,es.subjectname,ep.correcttype
140
         select ep.epid,ep.pnum,es.subjectid,es.subjectname,ep.correcttype
141
         ,(case when ep.correcttype=1
141
         ,(case when ep.correcttype=1
142
         then (select concat('[',group_concat(json_object('classid',epc.classid,'teacherid',epc.teacherid)),']')
142
         then (select concat('[',group_concat(json_object('classid',epc.classid,'teacherid',epc.teacherid)),']')

Loading…
Cancel
Save