|
|
@ -1,6 +1,7 @@
|
|
|
|
package com.ibeetl.jlw.service;
|
|
|
|
package com.ibeetl.jlw.service;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
@ -50,6 +51,7 @@ import javax.validation.constraints.NotEmpty;
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
import java.util.concurrent.CopyOnWriteArrayList;
|
|
|
|
import java.util.function.Function;
|
|
|
|
import java.util.function.Function;
|
|
|
|
import java.util.function.Predicate;
|
|
|
|
import java.util.function.Predicate;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
@ -676,10 +678,22 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> logList = getValuesBySettingIds(questionSettingId.toString());
|
|
|
|
List<TeacherOpenCourseQuestionLog> logList = new CopyOnWriteArrayList<>(getValuesBySettingIds(questionSettingId.toString()));
|
|
|
|
|
|
|
|
|
|
|
|
setErrorSuccessCountField(updateList, logList);
|
|
|
|
setErrorSuccessCountField(updateList, logList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 这里是库里查询到多条记录,但只更新改过值的数据
|
|
|
|
|
|
|
|
updateList.forEach(item -> {
|
|
|
|
|
|
|
|
// 直接替换表里查询到的数据
|
|
|
|
|
|
|
|
int index = CollUtil.indexOf(logList, questionLog -> questionLog.getTeacherOpenCourseQuestionLogId().equals(item.getTeacherOpenCourseQuestionLogId()));
|
|
|
|
|
|
|
|
Optional<TeacherOpenCourseQuestionLog> optional = logList.stream()
|
|
|
|
|
|
|
|
.filter(o -> o.getTeacherOpenCourseQuestionLogId().equals(item.getTeacherOpenCourseQuestionLogId())).findFirst();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
optional.ifPresent(c -> {
|
|
|
|
|
|
|
|
logList.set(index, c);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
TeacherOpenCourseQuestionSetting questionSetting = teacherOpenCourseQuestionSettingService.getInfo(questionSettingId);
|
|
|
|
TeacherOpenCourseQuestionSetting questionSetting = teacherOpenCourseQuestionSettingService.getInfo(questionSettingId);
|
|
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(logList) && questionSetting != null) {
|
|
|
|
if (CollectionUtil.isNotEmpty(logList) && questionSetting != null) {
|
|
|
@ -750,7 +764,7 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
sumSuccessCount += successCount;
|
|
|
|
sumSuccessCount += successCount;
|
|
|
|
sumErrorCount += errorCount;
|
|
|
|
sumErrorCount += errorCount;
|
|
|
|
sumDoCount += ObjectUtil.isNotEmpty(questionLog.getTeacherOpenCourseQuestionLogAnswer()) ? 1 : 0;
|
|
|
|
sumDoCount += ObjectUtil.isNotEmpty(questionLog.getTeacherOpenCourseQuestionLogAnswer()) ? 1 : 0;
|
|
|
|
questionTotalScore = questionTotalScore.add(defaultIfNull(questionLog.getQuestionScore(), questionLog.getStudentScore()));
|
|
|
|
questionTotalScore = questionTotalScore.add(defaultIfNull(defaultIfNull(questionLog.getQuestionScore(), questionLog.getStudentScore()), ZERO));
|
|
|
|
myTotalScore = myTotalScore.add(defaultIfNull(questionLog.getStudentScore(), ZERO));
|
|
|
|
myTotalScore = myTotalScore.add(defaultIfNull(questionLog.getStudentScore(), ZERO));
|
|
|
|
idsSet.add(questionLog.getTeacherOpenCourseQuestionLogId().toString());
|
|
|
|
idsSet.add(questionLog.getTeacherOpenCourseQuestionLogId().toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|