Explorar el Código

监考人查看

tags/正式版本
雍文秀 hace 2 años
padre
commit
a979061505

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/ESubjectInvigilateController.java Ver fichero

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

+ 6
- 7
sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectInvigilateService.java Ver fichero

@@ -10,9 +10,9 @@ import org.springframework.stereotype.Service;
10 10
 import org.springframework.transaction.annotation.Transactional;
11 11
 
12 12
 import javax.annotation.Resource;
13
+import java.util.HashMap;
13 14
 import java.util.List;
14 15
 import java.util.Map;
15
-import java.util.stream.Collectors;
16 16
 
17 17
 @Service
18 18
 public class ESubjectInvigilateService {
@@ -48,15 +48,14 @@ 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 53
         Integer examId = eSubjectMapper.getExamIdByEsId(esid);//根据考试科目id获取考试id
53 54
         List<Map> list = eClassMapper.listByExamId(examId);//考试班级
54 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…
Cancelar
Guardar