Browse Source

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

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

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/paper/EPaperCorrectTeacherController.java View File

@@ -157,6 +157,6 @@ public class EPaperCorrectTeacherController {
157 157
         Integer examid = vo.getExamid();
158 158
         N_Utils.validation(new Object[]{examid, "考试id", 1});
159 159
         Map map = correctTeacherService.markProgress(examid);
160
-        return new ResultVo(0, "", map);
160
+        return new ResultVo(0, "获取成功", map);
161 161
     }
162 162
 }

+ 26
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/paperstudent/EScanbatchController.java View File

@@ -1,10 +1,14 @@
1 1
 package com.xhkjedu.sexam.controller.paperstudent;
2 2
 
3
+import com.github.pagehelper.PageHelper;
4
+import com.github.pagehelper.PageInfo;
3 5
 import com.xhkjedu.sexam.model.exam.ESubject;
4 6
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
5 7
 import com.xhkjedu.sexam.model.paperstudent.EScanbatch;
6 8
 import com.xhkjedu.sexam.service.paperstudent.EScanbatchService;
7 9
 import com.xhkjedu.utils.N_Utils;
10
+import com.xhkjedu.utils.PageUtil;
11
+import com.xhkjedu.vo.PageResult;
8 12
 import com.xhkjedu.vo.ResultVo;
9 13
 import org.springframework.web.bind.annotation.PostMapping;
10 14
 import org.springframework.web.bind.annotation.RequestBody;
@@ -12,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
12 16
 import org.springframework.web.bind.annotation.RestController;
13 17
 
14 18
 import javax.annotation.Resource;
19
+import java.util.List;
15 20
 import java.util.Map;
16 21
 
17 22
 /**
@@ -81,4 +86,25 @@ public class EScanbatchController {
81 86
         return new ResultVo(0, "获取成功", map);
82 87
     }
83 88
 
89
+    /**
90
+     * 扫描答题卡详情-学生列表
91
+     *
92
+     * @return com.xhkjedu.vo.ResultVo
93
+     * @Param [eps]
94
+     * @Author ywx
95
+     * @Date 2022/8/15 16:15
96
+     **/
97
+    @PostMapping("/list_ss")
98
+    public ResultVo listScanStu(@RequestBody EPaperStudent eps) {
99
+        Integer epid = eps.getEpid();
100
+        Integer sstate = eps.getSstate();
101
+        Integer page = eps.getPage();
102
+        Integer pageSize = eps.getPageSize();
103
+        N_Utils.validation(new Object[]{epid, "试卷id", 1, sstate, "扫描状态", 1
104
+                , page, "页码", 1, pageSize, "显示条数", 1});
105
+        PageHelper.startPage(page, pageSize);
106
+        List<Map> list = eScanbatchService.listScanStu(epid, sstate, eps.getCreatename());
107
+        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
108
+        return new ResultVo(0, "获取成功", pageResult);
109
+    }
84 110
 }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EScanbatchMapper.java View File

@@ -34,4 +34,7 @@ public interface EScanbatchMapper extends TkMapper<EScanbatch> {
34 34
 
35 35
     //获取答题卡扫描结果
36 36
     EScanbatch getScanResult(@Param("epid") Integer epid);
37
+
38
+    //扫描答题卡详情-学生列表
39
+    List<Map> listScanStu(@Param("epid") Integer epid, @Param("sstate") Integer sstate, @Param("username") String username);
37 40
 }

+ 7
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EScanbatchService.java View File

@@ -119,6 +119,8 @@ public class EScanbatchService {
119 119
     //扫描答题卡详情
120 120
     public Map getScanDetail(Integer epid, Integer examid) {
121 121
         Map map = new HashMap();
122
+        String examname = eBaseMapper.getNameByExamId(examid);
123
+        map.put("examname", examname);
122 124
         List<Map> classes = eClassMapper.listByExamId(examid);
123 125
         int stunum = classes.stream().mapToInt(m -> (int) m.get("classnum")).sum();
124 126
         EScanbatch scanbatch = eScanbatchMapper.getScanResult(epid);//获取答题卡扫描结果
@@ -137,4 +139,9 @@ public class EScanbatchService {
137 139
         map.put("classes", classes);//班级列表
138 140
         return map;
139 141
     }
142
+
143
+    //扫描答题卡详情-学生列表
144
+    public List<Map> listScanStu(Integer epid, Integer sstate, String username) {
145
+        return eScanbatchMapper.listScanStu(epid, sstate, username);
146
+    }
140 147
 }

+ 1
- 1
sexam/src/main/resources/mapper/exam/ESubjectMapper.xml View File

@@ -39,7 +39,7 @@
39 39
                          count(case when psq.answered=1 then psq.epsqid else null end),2),0)pyrate
40 40
         from e_subject es left join e_paper ep on es.esid = ep.esid
41 41
         left join e_paper_student eps on ep.epid = eps.epid
42
-        left join e_paper_student_question psq on psq.epid=ep.epid and psq.ctype in(3,13,14,15)
42
+        left join e_paper_student_question psq on psq.epid=ep.epid
43 43
         where es.examid=#{examid}
44 44
         group by es.esid
45 45
     </select>

+ 19
- 3
sexam/src/main/resources/mapper/paperstudent/EScanbatchMapper.xml View File

@@ -29,7 +29,7 @@
29 29
     <!--扫描答题卡列表-->
30 30
     <select id="listScanSubject" resultType="java.util.Map">
31 31
         select a.*,ifnull(truncate(a.smnum*100/a.examnum,2),0)smrate
32
-             ,ifnull(truncate(count(case when epsq.checked=1 then epsq.epsqid else null end)*100/count(epsq.epsqid),2),0)yjrate
32
+             ,ifnull(truncate(count(case when epsq.checked=2 then epsq.epsqid else null end)*100/count(epsq.epsqid),2),0)yjrate
33 33
         from(select es.esid,es.esstate,es.subjectname
34 34
                   ,count(eps.epid)examnum,ep.epid
35 35
                   ,count(case when eps.sstate!=0 then eps.epsid else null end)smnum
@@ -37,7 +37,7 @@
37 37
              from e_subject es left join e_paper ep on es.esid = ep.esid
38 38
                                left join e_paper_student eps on ep.epid = eps.epid
39 39
              where es.examid=#{examid}
40
-             group by es.esid)a left join e_paper_qtype_question epqq on a.epid = epqq.epid and epqq.ctype in(3,13,14,15)
40
+             group by es.esid)a left join e_paper_qtype_question epqq on a.epid = epqq.epid
41 41
                                 left join e_paper_student_question epsq on epsq.eptqid = epqq.eptqid and epsq.answered=1
42 42
         group by a.epid
43 43
     </select>
@@ -52,5 +52,21 @@
52 52
         select sum(batchnum)batchnum,sum(scannum)scannum,su(errornum)errornum,sum(es.qknum)qknum,examid
53 53
         from e_scanbatch where epid=#{epid}
54 54
     </select>
55
-
55
+    <!--扫描答题卡详情-学生列表-->
56
+    <select id="listScanStu" resultType="java.util.Map">
57
+        select eps.epsid,u.username,u.examno,ec.classname,eps.batchid,eps.sstate,eps.stupic
58
+        from e_paper_student eps left join e_class ec on eps.examid = ec.examid and eps.classid = ec.classid
59
+        left join t_user u on eps.studentid = u.userid
60
+        <where>
61
+            <if test="sstate==1">
62
+                and eps.batchid is null
63
+            </if>
64
+            <if test="sstate==2">
65
+                and eps.batchid is not null
66
+            </if>
67
+            <if test="username!=null and username!=''">
68
+                and (u.username like '%${username}%' or u.examno like '%${username}%')
69
+            </if>
70
+        </where>
71
+    </select>
56 72
 </mapper>

Loading…
Cancel
Save