Browse Source

扫描答题卡详情

tags/正式版本
雍文秀 2 years ago
parent
commit
d69d6285d5

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

@@ -103,7 +103,7 @@ public class EScanbatchController {
103 103
         N_Utils.validation(new Object[]{epid, "试卷id", 1, sstate, "扫描状态", 1
104 104
                 , page, "页码", 1, pageSize, "显示条数", 1});
105 105
         PageHelper.startPage(page, pageSize);
106
-        List<Map> list = eScanbatchService.listScanStu(epid, sstate, eps.getCreatename());
106
+        List<Map> list = eScanbatchService.listScanStu(epid, sstate, eps.getCreatename(), eps.getClassid());
107 107
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
108 108
         return new ResultVo(0, "获取成功", pageResult);
109 109
     }

+ 2
- 1
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EScanbatchMapper.java View File

@@ -36,5 +36,6 @@ public interface EScanbatchMapper extends TkMapper<EScanbatch> {
36 36
     EScanbatch getScanResult(@Param("epid") Integer epid);
37 37
 
38 38
     //扫描答题卡详情-学生列表
39
-    List<Map> listScanStu(@Param("epid") Integer epid, @Param("sstate") Integer sstate, @Param("username") String username);
39
+    List<Map> listScanStu(@Param("epid") Integer epid, @Param("sstate") Integer sstate, @Param("username") String username,
40
+                          @Param("classid") Integer classid);
40 41
 }

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

@@ -118,30 +118,29 @@ public class EScanbatchService {
118 118
 
119 119
     //扫描答题卡详情
120 120
     public Map getScanDetail(Integer epid, Integer examid) {
121
-        Map map = new HashMap();
122
-        String examname = eBaseMapper.getNameByExamId(examid);
123
-        map.put("examname", examname);
121
+        Map map = eBaseMapper.findById(examid);
124 122
         List<Map> classes = eClassMapper.listByExamId(examid);
125 123
         int stunum = classes.stream().mapToInt(m -> (int) m.get("classnum")).sum();
126 124
         EScanbatch scanbatch = eScanbatchMapper.getScanResult(epid);//获取答题卡扫描结果
127 125
         Integer batchnum = scanbatch.getBatchnum();
128 126
         Integer scannum = scanbatch.getScannum();
129 127
         Integer errornum = scanbatch.getErrornum();
128
+        Integer sbnum = scannum - errornum;
130 129
         Integer qknum = scanbatch.getQknum();
131 130
         Integer wsnum = ExamUtil.subtractInt(stunum, batchnum);
132 131
         map.put("jhnum", stunum);//计划张数
133 132
         map.put("wsnum", wsnum);//未扫张数
134 133
         map.put("ysnum", batchnum);//已扫张数
135 134
         map.put("qknum", qknum);//缺考人数
136
-        map.put("smrate", N_Utils.getIntegerDivideAndMulitiply(wsnum, stunum));//扫描进度
137
-        map.put("sbnum", scannum);//识别张数
138
-        map.put("sbrate", N_Utils.getIntegerDivideAndMulitiply(scannum - errornum, scannum));//识别比例
135
+        map.put("smrate", N_Utils.getIntegerDivideAndMulitiply(scannum, stunum));//扫描进度
136
+        map.put("sbnum", sbnum);//识别张数
137
+        map.put("sbrate", N_Utils.getIntegerDivideAndMulitiply(sbnum, scannum));//识别比例
139 138
         map.put("classes", classes);//班级列表
140 139
         return map;
141 140
     }
142 141
 
143 142
     //扫描答题卡详情-学生列表
144
-    public List<Map> listScanStu(Integer epid, Integer sstate, String username) {
145
-        return eScanbatchMapper.listScanStu(epid, sstate, username);
143
+    public List<Map> listScanStu(Integer epid, Integer sstate, String username, Integer classid) {
144
+        return eScanbatchMapper.listScanStu(epid, sstate, username, classid);
146 145
     }
147 146
 }

+ 4
- 1
sexam/src/main/resources/mapper/paperstudent/EScanbatchMapper.xml View File

@@ -49,7 +49,7 @@
49 49
 
50 50
     <!--获取答题卡扫描结果-->
51 51
     <select id="getScanResult" resultType="com.xhkjedu.sexam.model.paperstudent.EScanbatch">
52
-        select sum(batchnum)batchnum,sum(scannum)scannum,su(errornum)errornum,sum(es.qknum)qknum,examid
52
+        select sum(batchnum)batchnum,sum(scannum)scannum,sum(errornum)errornum,sum(qknum)qknum,examid
53 53
         from e_scanbatch where epid=#{epid}
54 54
     </select>
55 55
     <!--扫描答题卡详情-学生列表-->
@@ -58,6 +58,9 @@
58 58
         from e_paper_student eps left join e_class ec on eps.examid = ec.examid and eps.classid = ec.classid
59 59
         left join t_user u on eps.studentid = u.userid
60 60
         <where>
61
+            <if test="classid!=null and classid!=0">
62
+                and eps.classid=#{classid}
63
+            </if>
61 64
             <if test="sstate==1">
62 65
                 and eps.batchid is null
63 66
             </if>

Loading…
Cancel
Save