Browse Source

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

tags/正式版本
王宁 2 years ago
parent
commit
96fdcf0922

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

@@ -47,4 +47,7 @@ public interface EScanbatchMapper extends TkMapper<EScanbatch> {
47 47
 
48 48
     //扫描对应学校id
49 49
     Map getScanBatchSchool(@Param("batchid") Integer batchid);
50
+
51
+    //扫描答题卡详情
52
+    Map getScanDetail(@Param("epid") Integer epid);
50 53
 }

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

@@ -136,24 +136,14 @@ public class EScanbatchService {
136 136
 
137 137
     //扫描答题卡详情
138 138
     public Map getScanDetail(Integer epid, Integer examid) {
139
-        Map map = eScanbatchMapper.listByEpId(epid);
139
+        Map map = eScanbatchMapper.getScanDetail(epid);
140 140
         List<Map> classes = eClassMapper.listByExamId(examid);
141
-        int stunum = classes.stream().mapToInt(m -> (int) m.get("classnum")).sum();
142
-        Integer scantronnum = N_Utils.str2Int(map.get("scantronnum").toString());
143
-        Integer jhnum = stunum * scantronnum;
144
-        EScanbatch scanbatch = eScanbatchMapper.getScanResult(epid);//获取答题卡扫描结果
145
-        Integer scannum = scanbatch.getScannum();
146
-        Integer errornum = scanbatch.getErrornum();
147
-        Integer sbnum = scannum - errornum;
148
-        Integer qknum = scanbatch.getQknum();
149
-        Integer wsnum = ExamUtil.subtractInt(jhnum, scannum);
150
-        map.put("jhnum", jhnum);//计划张数
151
-        map.put("wsnum", wsnum);//未扫张数
152
-        map.put("ysnum", scannum);//已扫张数
153
-        map.put("qknum", qknum);//缺考人数
154
-        map.put("smrate", N_Utils.getIntegerDivideAndMulitiply(scannum, jhnum));//扫描进度
155
-        map.put("sbnum", sbnum);//识别张数
156
-        map.put("sbrate", N_Utils.getIntegerDivideAndMulitiply(sbnum, scannum));//识别比例
141
+        int jhnum = classes.stream().mapToInt(m -> (int) m.get("classnum")).sum();
142
+        Integer ysnum = (Integer) map.get("ysnum");//已扫人数
143
+        Integer wsnum = ExamUtil.subtractInt(jhnum, ysnum);
144
+        map.put("jhnum", jhnum);//计划人数
145
+        map.put("wsnum", wsnum);//未扫人数
146
+        map.put("smrate", N_Utils.getIntegerDivideAndMulitiply(ysnum, jhnum));//扫描进度
157 147
         map.put("classes", classes);//班级列表
158 148
         return map;
159 149
     }

+ 9
- 0
sexam/src/main/resources/mapper/paperstudent/EScanbatchMapper.xml View File

@@ -95,4 +95,13 @@
95 95
         from e_scanbatch b left join e_base e on b.examid=e.examid
96 96
             left join t_school s on e.schoolid=s.schoolid  where b.batchid=#{batchid}
97 97
     </select>
98
+    <!--扫描答题卡详情-->
99
+    <select id="getScanDetail" resultType="java.util.Map">
100
+        select eb.examname,eb.examid,eb.gradeid,es.subjectname
101
+        ,count(distinct case when eps.sstate=3 then eps.epsid else null end)qknum
102
+        ,count(distinct case when eps.sstate!=0 then eps.epsid else null end)ysnum
103
+        from e_paper_student eps left join e_base eb on eps.examid = eb.examid
104
+        left join e_subject es on eps.esid = es.esid
105
+        where eps.epid=#{epid}
106
+    </select>
98 107
 </mapper>

Loading…
Cancel
Save