Selaa lähdekoodia

Merge remote-tracking branch 'origin/ywx' into wn

tags/正式3.11.0
王宁 1 vuosi sitten
vanhempi
commit
6cb82fd9c4

+ 10
- 5
sexam/src/main/java/com/xhkjedu/sexam/service/exam/ESubjectBadstudentService.java Näytä tiedosto

@@ -11,7 +11,6 @@ import org.springframework.stereotype.Service;
11 11
 
12 12
 import javax.annotation.Resource;
13 13
 import java.util.ArrayList;
14
-import java.util.Arrays;
15 14
 import java.util.List;
16 15
 import java.util.Map;
17 16
 import java.util.stream.Collectors;
@@ -162,17 +161,23 @@ public class ESubjectBadstudentService {
162 161
             if (claMap == null) {
163 162
                 schoolClasses = new ArrayList<>();
164 163
             } else if (claMap.get("majored").equals(0)) {//教师不是主监考
165
-                List<Map> classes2 = new ArrayList<>();
166 164
                 classids = claMap.get("classids").toString();
167 165
                 String[] classIds = classids.split(",");
168 166
 
169 167
                 List<Map> schoolClasses2 = new ArrayList<>();
170 168
                 for(Map scMap : schoolClasses){
169
+                    List<Map> classes2 = new ArrayList<>();
171 170
                     List<Map> classMap = (List<Map>) scMap.get("classes");//获取学校下班级
172
-                    List<Map> teacherClassMap = classMap.stream().filter(c -> Arrays.asList(classIds).contains(c.get("classid").toString())).collect(Collectors.toList());
173
-                    if(N_Utils.isListNotEmpty(teacherClassMap)){
174
-                        scMap.put("classes",teacherClassMap);
171
+                    for (String classid : classIds) {
172
+                        for (Map cla : classMap) {
173
+                            if(cla.get("classid").toString().equals(classid)){
174
+                                classes2.add(cla);
175
+                                break;
176
+                            }
177
+                        }
175 178
                     }
179
+                    if(N_Utils.isListEmpty(classes2)) continue;
180
+                    scMap.put("classes",classes2);
176 181
                     schoolClasses2.add(scMap);
177 182
                 }
178 183
 

Loading…
Peruuta
Tallenna