Browse Source

监考人查看

tags/正式版本
雍文秀 2 years ago
parent
commit
a979061505

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/ESubjectInvigilateController.java View File

120
     public ResultVo detail(@RequestBody ESubject vo) {
120
     public ResultVo detail(@RequestBody ESubject vo) {
121
         Integer esid = vo.getEsid();
121
         Integer esid = vo.getEsid();
122
         N_Utils.validation(new Object[]{esid, "考试科目id", 1});
122
         N_Utils.validation(new Object[]{esid, "考试科目id", 1});
123
-        List<Map> list = eSubjectInvigilateService.listByEsId(esid);
123
+        Map list = eSubjectInvigilateService.listByEsId(esid);
124
         return new ResultVo(0, "获取成功", list);
124
         return new ResultVo(0, "获取成功", list);
125
     }
125
     }
126
 
126
 

+ 6
- 7
sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectInvigilateService.java View File

10
 import org.springframework.transaction.annotation.Transactional;
10
 import org.springframework.transaction.annotation.Transactional;
11
 
11
 
12
 import javax.annotation.Resource;
12
 import javax.annotation.Resource;
13
+import java.util.HashMap;
13
 import java.util.List;
14
 import java.util.List;
14
 import java.util.Map;
15
 import java.util.Map;
15
-import java.util.stream.Collectors;
16
 
16
 
17
 @Service
17
 @Service
18
 public class ESubjectInvigilateService {
18
 public class ESubjectInvigilateService {
48
     }
48
     }
49
 
49
 
50
     //监考人查看
50
     //监考人查看
51
-    public List<Map> listByEsId(Integer esid) {
51
+    public Map listByEsId(Integer esid) {
52
+        Map map = new HashMap();
52
         Integer examId = eSubjectMapper.getExamIdByEsId(esid);//根据考试科目id获取考试id
53
         Integer examId = eSubjectMapper.getExamIdByEsId(esid);//根据考试科目id获取考试id
53
         List<Map> list = eClassMapper.listByExamId(examId);//考试班级
54
         List<Map> list = eClassMapper.listByExamId(examId);//考试班级
54
         List<Map> users = eSubjectInvigilateMapper.listByEsId(esid);//考试监考人
55
         List<Map> users = eSubjectInvigilateMapper.listByEsId(esid);//考试监考人
55
-        for (Map map : list) {
56
-            List<Map> teachers = users.stream().filter(u -> u.get("classid").equals(map.get("classid"))).collect(Collectors.toList());
57
-            map.put("teachers", teachers);
58
-        }
59
-        return list;
56
+        map.put("classes", list);
57
+        map.put("teachers", users);
58
+        return map;
60
     }
59
     }
61
 
60
 
62
     //监考人删除
61
     //监考人删除

Loading…
Cancel
Save