|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.ibeetl.jlw.service;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
@ -814,10 +815,23 @@ public class GeneralQuestionLogService extends CoreBaseService<GeneralQuestionLo
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<GeneralQuestionLog> logList = getValuesBySettingIds(questionSettingId.toString());
|
|
|
|
|
GeneralQuestionSetting questionSetting = generalQuestionSettingService.getInfo(questionSettingId);
|
|
|
|
|
|
|
|
|
|
setErrorSuccessCountField(updateList, logList);
|
|
|
|
|
|
|
|
|
|
// 这里是库里查询到多条记录,但只更新改过值的数据
|
|
|
|
|
updateList.forEach(item -> {
|
|
|
|
|
// 直接替换表里查询到的数据
|
|
|
|
|
int index = CollUtil.indexOf(logList, questionLog -> questionLog.getGeneralQuestionLogId().equals(item.getGeneralQuestionLogId()));
|
|
|
|
|
Optional<GeneralQuestionLog> optional = logList.stream()
|
|
|
|
|
.filter(o -> o.getGeneralQuestionLogId().equals(item.getGeneralQuestionLogId())).findFirst();
|
|
|
|
|
|
|
|
|
|
optional.ifPresent(c -> {
|
|
|
|
|
logList.set(index, c);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
GeneralQuestionSetting questionSetting = generalQuestionSettingService.getInfo(questionSettingId);
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(logList) && questionSetting != null) {
|
|
|
|
|
String logIds = logList.stream().map(GeneralQuestionLog::getGeneralQuestionLogId).map(Objects::toString).collect(joining(","));
|
|
|
|
|
addQuestionLogSummary(logIds, logList, student, questionSetting.getGeneralQuestionSettingName(), questionSetting.getBusinessType(), questionSetting.getGeneralQuestionSettingType());
|
|
|
|
|