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
         Integer examid = vo.getExamid();
157
         Integer examid = vo.getExamid();
158
         N_Utils.validation(new Object[]{examid, "考试id", 1});
158
         N_Utils.validation(new Object[]{examid, "考试id", 1});
159
         Map map = correctTeacherService.markProgress(examid);
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
 package com.xhkjedu.sexam.controller.paperstudent;
1
 package com.xhkjedu.sexam.controller.paperstudent;
2
 
2
 
3
+import com.github.pagehelper.PageHelper;
4
+import com.github.pagehelper.PageInfo;
3
 import com.xhkjedu.sexam.model.exam.ESubject;
5
 import com.xhkjedu.sexam.model.exam.ESubject;
4
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
6
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
5
 import com.xhkjedu.sexam.model.paperstudent.EScanbatch;
7
 import com.xhkjedu.sexam.model.paperstudent.EScanbatch;
6
 import com.xhkjedu.sexam.service.paperstudent.EScanbatchService;
8
 import com.xhkjedu.sexam.service.paperstudent.EScanbatchService;
7
 import com.xhkjedu.utils.N_Utils;
9
 import com.xhkjedu.utils.N_Utils;
10
+import com.xhkjedu.utils.PageUtil;
11
+import com.xhkjedu.vo.PageResult;
8
 import com.xhkjedu.vo.ResultVo;
12
 import com.xhkjedu.vo.ResultVo;
9
 import org.springframework.web.bind.annotation.PostMapping;
13
 import org.springframework.web.bind.annotation.PostMapping;
10
 import org.springframework.web.bind.annotation.RequestBody;
14
 import org.springframework.web.bind.annotation.RequestBody;
12
 import org.springframework.web.bind.annotation.RestController;
16
 import org.springframework.web.bind.annotation.RestController;
13
 
17
 
14
 import javax.annotation.Resource;
18
 import javax.annotation.Resource;
19
+import java.util.List;
15
 import java.util.Map;
20
 import java.util.Map;
16
 
21
 
17
 /**
22
 /**
81
         return new ResultVo(0, "获取成功", map);
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
 
34
 
35
     //获取答题卡扫描结果
35
     //获取答题卡扫描结果
36
     EScanbatch getScanResult(@Param("epid") Integer epid);
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
     //扫描答题卡详情
119
     //扫描答题卡详情
120
     public Map getScanDetail(Integer epid, Integer examid) {
120
     public Map getScanDetail(Integer epid, Integer examid) {
121
         Map map = new HashMap();
121
         Map map = new HashMap();
122
+        String examname = eBaseMapper.getNameByExamId(examid);
123
+        map.put("examname", examname);
122
         List<Map> classes = eClassMapper.listByExamId(examid);
124
         List<Map> classes = eClassMapper.listByExamId(examid);
123
         int stunum = classes.stream().mapToInt(m -> (int) m.get("classnum")).sum();
125
         int stunum = classes.stream().mapToInt(m -> (int) m.get("classnum")).sum();
124
         EScanbatch scanbatch = eScanbatchMapper.getScanResult(epid);//获取答题卡扫描结果
126
         EScanbatch scanbatch = eScanbatchMapper.getScanResult(epid);//获取答题卡扫描结果
137
         map.put("classes", classes);//班级列表
139
         map.put("classes", classes);//班级列表
138
         return map;
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
                          count(case when psq.answered=1 then psq.epsqid else null end),2),0)pyrate
39
                          count(case when psq.answered=1 then psq.epsqid else null end),2),0)pyrate
40
         from e_subject es left join e_paper ep on es.esid = ep.esid
40
         from e_subject es left join e_paper ep on es.esid = ep.esid
41
         left join e_paper_student eps on ep.epid = eps.epid
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
         where es.examid=#{examid}
43
         where es.examid=#{examid}
44
         group by es.esid
44
         group by es.esid
45
     </select>
45
     </select>

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

29
     <!--扫描答题卡列表-->
29
     <!--扫描答题卡列表-->
30
     <select id="listScanSubject" resultType="java.util.Map">
30
     <select id="listScanSubject" resultType="java.util.Map">
31
         select a.*,ifnull(truncate(a.smnum*100/a.examnum,2),0)smrate
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
         from(select es.esid,es.esstate,es.subjectname
33
         from(select es.esid,es.esstate,es.subjectname
34
                   ,count(eps.epid)examnum,ep.epid
34
                   ,count(eps.epid)examnum,ep.epid
35
                   ,count(case when eps.sstate!=0 then eps.epsid else null end)smnum
35
                   ,count(case when eps.sstate!=0 then eps.epsid else null end)smnum
37
              from e_subject es left join e_paper ep on es.esid = ep.esid
37
              from e_subject es left join e_paper ep on es.esid = ep.esid
38
                                left join e_paper_student eps on ep.epid = eps.epid
38
                                left join e_paper_student eps on ep.epid = eps.epid
39
              where es.examid=#{examid}
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
                                 left join e_paper_student_question epsq on epsq.eptqid = epqq.eptqid and epsq.answered=1
41
                                 left join e_paper_student_question epsq on epsq.eptqid = epqq.eptqid and epsq.answered=1
42
         group by a.epid
42
         group by a.epid
43
     </select>
43
     </select>
52
         select sum(batchnum)batchnum,sum(scannum)scannum,su(errornum)errornum,sum(es.qknum)qknum,examid
52
         select sum(batchnum)batchnum,sum(scannum)scannum,su(errornum)errornum,sum(es.qknum)qknum,examid
53
         from e_scanbatch where epid=#{epid}
53
         from e_scanbatch where epid=#{epid}
54
     </select>
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
 </mapper>
72
 </mapper>

Loading…
Cancel
Save