|
|
@@ -217,10 +217,14 @@ public class QuestionServiceImpl implements QuestionService {
|
|
|
if (studentAnswerDTO.getRecords() == null || studentAnswerDTO.getRecords().isEmpty()) {
|
|
|
return;
|
|
|
}
|
|
|
- // 获取已有信息
|
|
|
- String userId = String.valueOf(user.getPid());
|
|
|
-
|
|
|
- Map<String, StudentAnswerDTO.AnswerRecordDTO> recordMap = studentAnswerDTO.getRecords();
|
|
|
+ Map<String, StudentAnswerDTO.AnswerRecordDTO> recordMap = studentAnswerDTO.getRecords()
|
|
|
+ .entrySet()
|
|
|
+ .stream()
|
|
|
+ .filter(entry -> entry.getValue().getStartAt().isBefore(entry.getValue().getEndAt()))
|
|
|
+ .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
|
|
+ if (recordMap.isEmpty()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
List<BaseQuestionVO> baseQuestionVOList = questionQueryApi.getQuestionListById(Lists.newArrayList(recordMap.keySet()))
|
|
|
.stream()
|
|
|
.map(questionVO -> BaseQuestionVO.convertBokQuestionToVO(questionVO, true))
|
|
|
@@ -232,6 +236,8 @@ public class QuestionServiceImpl implements QuestionService {
|
|
|
List<RecordDTO> records = Lists.newArrayListWithExpectedSize(size);
|
|
|
|
|
|
// 填充列表
|
|
|
+ String userId = String.valueOf(user.getPid());
|
|
|
+
|
|
|
baseQuestionVOList.forEach(baseQuestionVO -> {
|
|
|
String questionId = baseQuestionVO.getId();
|
|
|
StudentAnswerDTO.AnswerRecordDTO answerRecord = recordMap.get(questionId);
|