|
@@ -174,28 +174,8 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
|
|
List<Integer> teacherIds = dataList.stream().map(ExtraExerciseStudentsDto::getTeacherId).collect(Collectors.toList());
|
|
List<Integer> teacherIds = dataList.stream().map(ExtraExerciseStudentsDto::getTeacherId).collect(Collectors.toList());
|
|
List<SimpleUserDto> teachers = teacherDao.findSimpleTeachers(teacherIds);
|
|
List<SimpleUserDto> teachers = teacherDao.findSimpleTeachers(teacherIds);
|
|
Map<Integer, String> idNameMap = teachers.stream().collect(Collectors.toMap(SimpleUserDto::getUserId, SimpleUserDto::getUserName));
|
|
Map<Integer, String> idNameMap = teachers.stream().collect(Collectors.toMap(SimpleUserDto::getUserId, SimpleUserDto::getUserName));
|
|
- List<ExtracurricularExercisesMessage> replyTeacherMessages = extracurricularExercisesMessageDao.findReplyTeacherMessages(replyIds);
|
|
|
|
- Map<Long, List<ExtracurricularExercisesMessage>> replyMessagesMap = replyTeacherMessages.stream().collect(Collectors.groupingBy(ExtracurricularExercisesMessage::getExtracurricularExercisesReplyId));
|
|
|
|
- if(Objects.isNull(replyMessagesMap)){
|
|
|
|
- replyMessagesMap=new HashMap<>();
|
|
|
|
- }
|
|
|
|
for (ExtraExerciseStudentsDto extraExerciseStudentsDto : dataList) {
|
|
for (ExtraExerciseStudentsDto extraExerciseStudentsDto : dataList) {
|
|
extraExerciseStudentsDto.setTeacherName(idNameMap.get(extraExerciseStudentsDto.getTeacherId()));
|
|
extraExerciseStudentsDto.setTeacherName(idNameMap.get(extraExerciseStudentsDto.getTeacherId()));
|
|
- extraExerciseStudentsDto.setRepliedTimely(0);
|
|
|
|
- List<ExtracurricularExercisesMessage> replyMessages = replyMessagesMap.get(extraExerciseStudentsDto.getId());
|
|
|
|
- if(CollectionUtils.isEmpty(replyMessages)){
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- for (ExtracurricularExercisesMessage replyMessage : replyMessages) {
|
|
|
|
- if(replyMessage.getCreateTime().before(extraExerciseStudentsDto.getSubmitTime())){
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- int h = DateUtil.hoursBetween(extraExerciseStudentsDto.getSubmitTime(), replyMessage.getCreateTime());
|
|
|
|
- if(h<=12){
|
|
|
|
- extraExerciseStudentsDto.setRepliedTimely(1);
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (count == 0) {
|
|
if (count == 0) {
|