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
         N_Utils.validation(new Object[]{epid, "试卷id", 1, sstate, "扫描状态", 1
103
         N_Utils.validation(new Object[]{epid, "试卷id", 1, sstate, "扫描状态", 1
104
                 , page, "页码", 1, pageSize, "显示条数", 1});
104
                 , page, "页码", 1, pageSize, "显示条数", 1});
105
         PageHelper.startPage(page, pageSize);
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
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
107
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
108
         return new ResultVo(0, "获取成功", pageResult);
108
         return new ResultVo(0, "获取成功", pageResult);
109
     }
109
     }

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

36
     EScanbatch getScanResult(@Param("epid") Integer epid);
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
 
118
 
119
     //扫描答题卡详情
119
     //扫描答题卡详情
120
     public Map getScanDetail(Integer epid, Integer examid) {
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
         List<Map> classes = eClassMapper.listByExamId(examid);
122
         List<Map> classes = eClassMapper.listByExamId(examid);
125
         int stunum = classes.stream().mapToInt(m -> (int) m.get("classnum")).sum();
123
         int stunum = classes.stream().mapToInt(m -> (int) m.get("classnum")).sum();
126
         EScanbatch scanbatch = eScanbatchMapper.getScanResult(epid);//获取答题卡扫描结果
124
         EScanbatch scanbatch = eScanbatchMapper.getScanResult(epid);//获取答题卡扫描结果
127
         Integer batchnum = scanbatch.getBatchnum();
125
         Integer batchnum = scanbatch.getBatchnum();
128
         Integer scannum = scanbatch.getScannum();
126
         Integer scannum = scanbatch.getScannum();
129
         Integer errornum = scanbatch.getErrornum();
127
         Integer errornum = scanbatch.getErrornum();
128
+        Integer sbnum = scannum - errornum;
130
         Integer qknum = scanbatch.getQknum();
129
         Integer qknum = scanbatch.getQknum();
131
         Integer wsnum = ExamUtil.subtractInt(stunum, batchnum);
130
         Integer wsnum = ExamUtil.subtractInt(stunum, batchnum);
132
         map.put("jhnum", stunum);//计划张数
131
         map.put("jhnum", stunum);//计划张数
133
         map.put("wsnum", wsnum);//未扫张数
132
         map.put("wsnum", wsnum);//未扫张数
134
         map.put("ysnum", batchnum);//已扫张数
133
         map.put("ysnum", batchnum);//已扫张数
135
         map.put("qknum", qknum);//缺考人数
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
         map.put("classes", classes);//班级列表
138
         map.put("classes", classes);//班级列表
140
         return map;
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
 
49
 
50
     <!--获取答题卡扫描结果-->
50
     <!--获取答题卡扫描结果-->
51
     <select id="getScanResult" resultType="com.xhkjedu.sexam.model.paperstudent.EScanbatch">
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
         from e_scanbatch where epid=#{epid}
53
         from e_scanbatch where epid=#{epid}
54
     </select>
54
     </select>
55
     <!--扫描答题卡详情-学生列表-->
55
     <!--扫描答题卡详情-学生列表-->
58
         from e_paper_student eps left join e_class ec on eps.examid = ec.examid and eps.classid = ec.classid
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
59
         left join t_user u on eps.studentid = u.userid
60
         <where>
60
         <where>
61
+            <if test="classid!=null and classid!=0">
62
+                and eps.classid=#{classid}
63
+            </if>
61
             <if test="sstate==1">
64
             <if test="sstate==1">
62
                 and eps.batchid is null
65
                 and eps.batchid is null
63
             </if>
66
             </if>

Loading…
Cancel
Save