|
@@ -1,14 +1,16 @@
|
1
|
1
|
package com.xhkjedu.sexam.service.paperstudent;
|
2
|
2
|
|
|
3
|
+import com.xhkjedu.sexam.mapper.exam.EClassMapper;
|
3
|
4
|
import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
|
4
|
5
|
import com.xhkjedu.sexam.mapper.paperstudent.EScanbatchMapper;
|
5
|
6
|
import com.xhkjedu.sexam.model.paperstudent.EScanbatch;
|
|
7
|
+import com.xhkjedu.sexam.utils.ExamUtil;
|
6
|
8
|
import com.xhkjedu.utils.N_Utils;
|
7
|
|
-import org.springframework.stereotype.Repository;
|
8
|
9
|
import org.springframework.stereotype.Service;
|
9
|
10
|
|
10
|
11
|
import javax.annotation.Resource;
|
11
|
12
|
import java.util.HashMap;
|
|
13
|
+import java.util.List;
|
12
|
14
|
import java.util.Map;
|
13
|
15
|
|
14
|
16
|
/**
|
|
@@ -22,6 +24,8 @@ public class EScanbatchService {
|
22
|
24
|
private EScanbatchMapper eScanbatchMapper;
|
23
|
25
|
@Resource
|
24
|
26
|
private EPaperMapper ePaperMapper;
|
|
27
|
+ @Resource
|
|
28
|
+ private EClassMapper eClassMapper;
|
25
|
29
|
|
26
|
30
|
/**
|
27
|
31
|
* @description: 保持扫描试卷批次信息
|
|
@@ -56,4 +60,26 @@ public class EScanbatchService {
|
56
|
60
|
rtnmap.put("batchname",batchname);
|
57
|
61
|
return rtnmap;
|
58
|
62
|
}
|
|
63
|
+
|
|
64
|
+ //扫描答题卡详情
|
|
65
|
+ public Map getScanDetail(Integer epid, Integer examid) {
|
|
66
|
+ Map map = new HashMap();
|
|
67
|
+ List<Map> classes = eClassMapper.listByExamId(examid);
|
|
68
|
+ int stunum = classes.stream().mapToInt(m -> (int) m.get("classnum")).sum();
|
|
69
|
+ EScanbatch scanbatch = eScanbatchMapper.getScanResult(epid);//获取答题卡扫描结果
|
|
70
|
+ Integer batchnum = scanbatch.getBatchnum();
|
|
71
|
+ Integer scannum = scanbatch.getScannum();
|
|
72
|
+ Integer errornum = scanbatch.getErrornum();
|
|
73
|
+ Integer qknum = scanbatch.getQknum();
|
|
74
|
+ Integer wsnum = ExamUtil.subtractInt(stunum, batchnum);
|
|
75
|
+ map.put("jhnum", stunum);//计划张数
|
|
76
|
+ map.put("wsnum", wsnum);//未扫张数
|
|
77
|
+ map.put("ysnum", batchnum);//已扫张数
|
|
78
|
+ map.put("qknum", qknum);//缺考人数
|
|
79
|
+ map.put("smrate", N_Utils.getIntegerDivideAndMulitiply(wsnum, stunum));//扫描进度
|
|
80
|
+ map.put("sbnum", scannum);//识别张数
|
|
81
|
+ map.put("sbrate", N_Utils.getIntegerDivideAndMulitiply(scannum - errornum, scannum));//识别比例
|
|
82
|
+ map.put("classes", classes);//班级列表
|
|
83
|
+ return map;
|
|
84
|
+ }
|
59
|
85
|
}
|