|
@@ -1,7 +1,7 @@
|
1
|
1
|
package com.xhkjedu.smarking.service.exam;
|
2
|
2
|
|
3
|
|
-import com.xhkjedu.smarking.mapper.exam.*;
|
4
|
|
-import com.xhkjedu.smarking.mapper.system.UserMapper;
|
|
3
|
+import com.xhkjedu.smarking.mapper.exam.MsClassMapper;
|
|
4
|
+import com.xhkjedu.smarking.mapper.exam.MsClassStudentMapper;
|
5
|
5
|
import com.xhkjedu.smarking.vo.exam.CTeacherVo;
|
6
|
6
|
import com.xhkjedu.utils.N_Utils;
|
7
|
7
|
import org.springframework.stereotype.Service;
|
|
@@ -15,12 +15,6 @@ public class MsSubjectSearchService {
|
15
|
15
|
@Resource
|
16
|
16
|
private MsClassMapper classMapper;
|
17
|
17
|
@Resource
|
18
|
|
- private MsExamMapper examMapper;
|
19
|
|
- @Resource
|
20
|
|
- private MsSubjectMapper subjectMapper;
|
21
|
|
- @Resource
|
22
|
|
- private UserMapper userMapper;
|
23
|
|
- @Resource
|
24
|
18
|
private MsClassStudentMapper classStudentMapper;
|
25
|
19
|
|
26
|
20
|
// 查找设置
|
|
@@ -82,69 +76,8 @@ public class MsSubjectSearchService {
|
82
|
76
|
return list;
|
83
|
77
|
}
|
84
|
78
|
|
85
|
|
- public Map listSubject(Integer examid) {
|
86
|
|
- Map map = examMapper.findById(examid);
|
87
|
|
- /*List<Map> subjects = subjectMapper.listSubjectCSet(examid);// 考试科目阅卷设置列表
|
88
|
|
- Integer schoolid = Integer.parseInt(map.get("schoolid").toString());// 发起考试的学校
|
89
|
|
- for (Map s : subjects) {
|
90
|
|
- Integer correcttype = (Integer) s.get("correcttype");
|
91
|
|
- Integer epid = (Integer) s.get("epid");
|
92
|
|
- List<Map> list = new ArrayList<>();
|
93
|
|
- if (correcttype == 1) {
|
94
|
|
- list = classMapper.listSchoolClassByExamId(schoolid, examid);// 考试班级
|
95
|
|
- List<Map> users = ePaperCorrectclassMapper.listByEpId(epid);// 试卷批阅人
|
96
|
|
- for (Map m : list) {
|
97
|
|
- List<Map> cmapList = (List<Map>) m.get("classes");
|
98
|
|
- for (Map c : cmapList) {
|
99
|
|
- List<Map> teachers = users.stream().filter(u -> u.get("classid").equals(c.get("classid")))
|
100
|
|
- .sorted(Comparator.comparing(t -> t.get("username").toString())).collect(Collectors.toList());
|
101
|
|
- c.put("teachers", teachers);
|
102
|
|
- }
|
103
|
|
- }
|
104
|
|
- } else if (correcttype == 2) {
|
105
|
|
- list = ePaperCorrectquestionMapper.listQnByEpId(epid);
|
106
|
|
- List<Map> users = ePaperCorrectquestionMapper.listByEpId(epid);// 试卷批阅人
|
107
|
|
- for (Map q : list) {
|
108
|
|
- Object qorder = q.get("qorder");
|
109
|
|
- List<Map> teachers = users.stream().filter(u -> u.get("qorder").equals(qorder))
|
110
|
|
- .sorted(Comparator.comparing(t -> t.get("username").toString())).collect(Collectors.toList());
|
111
|
|
- q.put("teachers", teachers);
|
112
|
|
- }
|
113
|
|
- }
|
114
|
|
- s.put("correctList", list);
|
115
|
|
- }
|
116
|
|
- map.put("subjects", subjects);*/
|
117
|
|
- return map;
|
118
|
|
- }
|
119
|
|
-
|
120
|
|
- // 主监考人查找
|
121
|
|
- public List<Map> listMasterTeacher(Integer schoolid) {
|
122
|
|
- return userMapper.listMasterTeacher(schoolid);
|
123
|
|
- }
|
124
|
|
-
|
125
|
|
- // 主监考人快捷查找
|
126
|
|
- public Map listQuickMasterTeacher(Integer schoolid, String username) {
|
127
|
|
- Map map = new HashMap();
|
128
|
|
- String[] usernames = username.split(",");
|
129
|
|
- List<Map> teachers = userMapper.listQuickMasterTeacher(usernames, schoolid);
|
130
|
|
- Map<String, Object> nameMap = teachers.stream().map(t -> t.get("username").toString()).distinct().collect(Collectors.toMap(t -> t, t -> t));
|
131
|
|
- StringBuilder sb = new StringBuilder();
|
132
|
|
- for (String name : usernames) {
|
133
|
|
- if (nameMap.get(name) == null) {
|
134
|
|
- sb.append(name).append(",");
|
135
|
|
- }
|
136
|
|
- }
|
137
|
|
- map.put("teachers", teachers);// 匹配的教师
|
138
|
|
- String notExist = sb.toString();// 未匹配的教师
|
139
|
|
- if (N_Utils.isNotEmpty(notExist)) {
|
140
|
|
- notExist = notExist.substring(0, notExist.length() - 1);
|
141
|
|
- }
|
142
|
|
- map.put("notExist", notExist);
|
143
|
|
- return map;
|
144
|
|
- }
|
145
|
|
-
|
146
|
79
|
// 据考号搜索参加考试学生
|
147
|
|
- public List<Map> listStudentByExamno(Integer examid, String examno) {
|
148
|
|
- return classStudentMapper.listStudentByExamIdAnExamno(examid, examno);
|
|
80
|
+ public List<Map> listStudentByExamno(Integer examid, String examno, String subjectid) {
|
|
81
|
+ return classStudentMapper.listStudentByExamIdAnExamno(examid, examno, subjectid);
|
149
|
82
|
}
|
150
|
83
|
}
|