|
@@ -1,22 +1,24 @@
|
1
|
1
|
package com.xhkjedu.sexam.service.exam;
|
2
|
2
|
|
3
|
|
-import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
|
4
|
3
|
import com.xhkjedu.sexam.mapper.exam.EClassMapper;
|
5
|
4
|
import com.xhkjedu.sexam.mapper.exam.ESubjectBadstudentMapper;
|
|
5
|
+import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
|
6
|
6
|
import com.xhkjedu.sexam.model.exam.ESubjectBadstudent;
|
7
|
7
|
import com.xhkjedu.utils.N_Utils;
|
8
|
8
|
import org.springframework.stereotype.Service;
|
9
|
9
|
|
10
|
10
|
import javax.annotation.Resource;
|
|
11
|
+import java.util.ArrayList;
|
11
|
12
|
import java.util.List;
|
12
|
13
|
import java.util.Map;
|
|
14
|
+import java.util.stream.Collectors;
|
13
|
15
|
|
14
|
16
|
@Service
|
15
|
17
|
public class ESubjectBadstudentService {
|
16
|
18
|
@Resource
|
17
|
19
|
private ESubjectBadstudentMapper eSubjectBadstudentMapper;
|
18
|
20
|
@Resource
|
19
|
|
- private EBaseMapper eBaseMapper;
|
|
21
|
+ private ESubjectMapper eSubjectMapper;
|
20
|
22
|
@Resource
|
21
|
23
|
private EClassMapper eClassMapper;
|
22
|
24
|
|
|
@@ -27,18 +29,34 @@ public class ESubjectBadstudentService {
|
27
|
29
|
}
|
28
|
30
|
|
29
|
31
|
//试卷学生
|
30
|
|
- public List<Map> listStu(Integer esid, Integer classid, String studentname) {
|
31
|
|
- List<Map> students = eSubjectBadstudentMapper.listStu(esid, classid, studentname);
|
|
32
|
+ public List<Map> listStu(Integer esid, String classids, Integer classid, String studentname) {
|
|
33
|
+ List<Map> students = eSubjectBadstudentMapper.listStu(esid, classids, classid, studentname);
|
32
|
34
|
return students;
|
33
|
35
|
}
|
34
|
36
|
|
35
|
|
- public Map getJkDetail(Integer examid, Integer esid) {
|
36
|
|
- Map map = eBaseMapper.findById(examid);
|
37
|
|
- List<Map> classes = eClassMapper.listByExamId(examid);
|
|
37
|
+ //监控详情
|
|
38
|
+ public Map getJkDetail(Integer esid, Integer teacherid) {
|
|
39
|
+ Map map = eSubjectMapper.getESubjectByEsId(esid);//考试科目基本信息
|
|
40
|
+ List<Map> classes = eClassMapper.listByExamId((Integer) map.get("examid"));//考试班级
|
|
41
|
+ Map claMap = eSubjectBadstudentMapper.getClass(esid, teacherid);//教师监考班级
|
|
42
|
+ String classids;
|
|
43
|
+ if (claMap.get("majored").equals(0)) {//教师不是主监考
|
|
44
|
+ List<Map> classes2 = new ArrayList<>();
|
|
45
|
+ classids = claMap.get("classids").toString();
|
|
46
|
+ String[] classIds = classids.split(",");
|
|
47
|
+ for (String classid : classIds) {
|
|
48
|
+ Map cla = classes.stream().filter(c -> c.get("classid").toString().equals(classid)).findFirst().orElse(null);
|
|
49
|
+ if (cla != null) classes2.add(cla);
|
|
50
|
+ }
|
|
51
|
+ classes = classes2;
|
|
52
|
+ } else {//教师是主监考
|
|
53
|
+ classids = classes.stream().map(m -> m.get("classid").toString()).collect(Collectors.joining(","));
|
|
54
|
+ }
|
|
55
|
+ map.put("classids", classids);
|
38
|
56
|
map.put("classes", classes);
|
39
|
57
|
Integer errnum = eSubjectBadstudentMapper.getErrNumByEsId(esid);//试卷异常次数
|
40
|
58
|
map.put("errnum", errnum);
|
41
|
|
- Map rate = eSubjectBadstudentMapper.getPaperRate(esid);
|
|
59
|
+ Map rate = eSubjectBadstudentMapper.getPaperRate(esid);//学生进场概况
|
42
|
60
|
map.putAll(rate);
|
43
|
61
|
return map;
|
44
|
62
|
}
|