|
@@ -177,15 +177,30 @@ public class MsBlockCheckService {
|
177
|
177
|
} else {//双评
|
178
|
178
|
//先从ypMap获取教师指定的mpsbid集合,不够的话从epMap获取教师指定的mpsbid集合;还不够的话从ypMap获取剩余的mpsbid集合,还不够的话从epMap获取剩余的mpsbid集合
|
179
|
179
|
List<Integer> ids1 = ypMap.keySet().stream().filter(s -> teacherid.equals(ypMap.get(s))).collect(Collectors.toList());
|
180
|
|
- List<Integer> ids2 = ypMap.keySet().stream().filter(s -> teacherid.equals(epMap.get(s))).collect(Collectors.toList());
|
|
180
|
+ List<Integer> ids2 = epMap.keySet().stream().filter(s -> teacherid.equals(epMap.get(s))).collect(Collectors.toList());
|
181
|
181
|
int num1 = ids1.size();
|
182
|
182
|
int num2 = ids2.size();
|
183
|
183
|
if (taskNum > num1 + num2) {
|
184
|
184
|
//从ypMap获取taskNum-num1-num2个值为null的集合
|
185
|
|
- List<Integer> ids3 = ypMap.keySet().stream().filter(s -> ypMap.get(s) == null).limit(taskNum - num1 - num2).collect(Collectors.toList());
|
|
185
|
+ int num3 = taskNum - num1 - num2;
|
|
186
|
+ //ypMap排除ids2的集合
|
|
187
|
+ LinkedHashMap<Integer, Integer> ypMap2 = new LinkedHashMap<>(ypMap);
|
|
188
|
+ ids2.forEach(ypMap2.keySet()::remove);
|
|
189
|
+ List<Integer> ids3 = ypMap2.keySet().stream().filter(s -> ypMap.get(s) == null).limit(num3).collect(Collectors.toList());
|
186
|
190
|
for (Integer mpsbid : ids3) {
|
187
|
191
|
ypMap.put(mpsbid, teacherid);
|
188
|
192
|
}
|
|
193
|
+ int num4 = num3 - ids3.size();
|
|
194
|
+ if (num4 > 0) {
|
|
195
|
+ //epMap排除ids1、ids3的集合
|
|
196
|
+ LinkedHashMap<Integer, Integer> epMap2 = new LinkedHashMap<>(epMap);
|
|
197
|
+ ids1.forEach(epMap2.keySet()::remove);
|
|
198
|
+ ids3.forEach(epMap2.keySet()::remove);
|
|
199
|
+ List<Integer> ids4 = epMap2.keySet().stream().filter(s -> epMap.get(s) == null).limit(num4).collect(Collectors.toList());
|
|
200
|
+ for (Integer mpsbid : ids4) {
|
|
201
|
+ epMap.put(mpsbid, teacherid);
|
|
202
|
+ }
|
|
203
|
+ }
|
189
|
204
|
} else if (taskNum < num1) {
|
190
|
205
|
setYpAndEpMap(ypMap, epMap, taskNum, ids1, ids2);
|
191
|
206
|
} else if (taskNum < num2) {
|