|
@@ -74,11 +74,12 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
//本周无课学员编号集合
|
|
|
Set<Integer> noClassStudentIds=new HashSet<>();
|
|
|
for (Map.Entry<Integer, List<StudentServeDto>> studentCoursesEntry : studentCoursesMap.entrySet()) {
|
|
|
- if(CollectionUtils.isEmpty(studentCoursesEntry.getValue())){
|
|
|
+ List<StudentServeDto> haveCourseStudents = studentCoursesEntry.getValue().stream().filter(e -> Objects.nonNull(e.getCourseStartTime())).collect(Collectors.toList());
|
|
|
+ if(CollectionUtils.isEmpty(haveCourseStudents)){
|
|
|
noClassStudentIds.add(studentCoursesEntry.getKey());
|
|
|
continue;
|
|
|
}
|
|
|
- StudentServeDto studentServeDto = studentCoursesEntry.getValue().stream().min(Comparator.comparing(StudentServeDto::getCourseStartTime)).get();
|
|
|
+ StudentServeDto studentServeDto = haveCourseStudents.stream().min(Comparator.comparing(StudentServeDto::getCourseStartTime)).get();
|
|
|
if(Objects.isNull(studentServeDto.getCourseStartTime())){
|
|
|
noClassStudentIds.add(studentCoursesEntry.getKey());
|
|
|
continue;
|
|
@@ -87,8 +88,10 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
dontServeInCurrentWeekStudentIds.add(studentCoursesEntry.getKey());
|
|
|
continue;
|
|
|
}
|
|
|
- if(GroupType.PRACTICE.equals(studentServeDto.getGroupType())||
|
|
|
- (GroupType.MUSIC.equals(studentServeDto.getGroupType())&&TeachModeEnum.OFFLINE.equals(studentServeDto.getTeachMode()))){
|
|
|
+ long count = haveCourseStudents.stream().filter(e -> (GroupType.PRACTICE.equals(e.getGroupType()) ||
|
|
|
+ (GroupType.MUSIC.equals(e.getGroupType()) && TeachModeEnum.OFFLINE.equals(e.getTeachMode())))
|
|
|
+ &&nextMonday.after(e.getCourseStartTime())).count();
|
|
|
+ if(count>0){
|
|
|
haveClassStudentIds.add(studentCoursesEntry.getKey());
|
|
|
}else{
|
|
|
noClassStudentIds.add(studentCoursesEntry.getKey());
|
|
@@ -109,23 +112,23 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
}
|
|
|
|
|
|
List<StudentExtracurricularExercisesSituation> results=new ArrayList<>();
|
|
|
- for (StudentServeDto serviceStudent : serviceStudents) {
|
|
|
+ for (Map.Entry<Integer, List<StudentServeDto>> studentCoursesEntry : studentCoursesMap.entrySet()) {
|
|
|
|
|
|
- if(dontServeInCurrentWeekStudentIds.contains(serviceStudent.getUserId())){
|
|
|
+ if(dontServeInCurrentWeekStudentIds.contains(studentCoursesEntry.getKey())){
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation();
|
|
|
- studentExtracurricularExercisesSituation.setStudentId(serviceStudent.getUserId());
|
|
|
- studentExtracurricularExercisesSituation.setTeacherId(serviceStudent.getTeacherId());
|
|
|
+ studentExtracurricularExercisesSituation.setStudentId(studentCoursesEntry.getKey());
|
|
|
+ studentExtracurricularExercisesSituation.setTeacherId(studentCoursesEntry.getValue().get(0).getTeacherId());
|
|
|
studentExtracurricularExercisesSituation.setExpectExercisesNum(1);
|
|
|
studentExtracurricularExercisesSituation.setWeekOfYear(nowDate.get(DateUtil.weekFields.weekOfYear()));
|
|
|
studentExtracurricularExercisesSituation.setMonday(DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"));
|
|
|
studentExtracurricularExercisesSituation.setSunday(DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"));
|
|
|
|
|
|
- if(haveClassStudentIds.contains(serviceStudent.getUserId())){
|
|
|
+ if(haveClassStudentIds.contains(studentCoursesEntry.getKey())){
|
|
|
studentExtracurricularExercisesSituation.setServeType("HOMEWORK");
|
|
|
- List<StudentServeCourseHomeworkDto> studentHomeworks = studentHomeworkMap.get(serviceStudent.getUserId());
|
|
|
+ List<StudentServeCourseHomeworkDto> studentHomeworks = studentHomeworkMap.get(studentCoursesEntry.getKey());
|
|
|
if(CollectionUtils.isEmpty(studentHomeworks)){
|
|
|
studentExtracurricularExercisesSituation.setActualExercisesNum(0);
|
|
|
studentExtracurricularExercisesSituation.setExercisesReplyNum(0);
|
|
@@ -144,10 +147,10 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
int exercisesMessageNum=0;
|
|
|
int exercisesMessageTimelyNum=0;
|
|
|
for (StudentServeCourseHomeworkDto studentHomework : studentHomeworks) {
|
|
|
- if(!new Integer(1).equals(studentHomework.getStatus())){
|
|
|
+ if(!YesOrNoEnum.YES.equals(studentHomework.getStatus())){
|
|
|
continue;
|
|
|
}
|
|
|
- if(!new Integer(1).equals(studentHomework.getIsReplied())){
|
|
|
+ if(!YesOrNoEnum.YES.equals(studentHomework.getIsReplied())){
|
|
|
continue;
|
|
|
}
|
|
|
exercisesMessageNum+=1;
|
|
@@ -161,9 +164,9 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(noClassStudentIds.contains(serviceStudent.getUserId())){
|
|
|
+ if(noClassStudentIds.contains(studentCoursesEntry.getKey())){
|
|
|
studentExtracurricularExercisesSituation.setServeType("EXERCISE");
|
|
|
- List<ExtracurricularExercisesReply> studentExercises = studentExercisesMap.get(serviceStudent.getUserId());
|
|
|
+ List<ExtracurricularExercisesReply> studentExercises = studentExercisesMap.get(studentCoursesEntry.getKey());
|
|
|
if(CollectionUtils.isEmpty(studentExercises)){
|
|
|
studentExtracurricularExercisesSituation.setActualExercisesNum(0);
|
|
|
studentExtracurricularExercisesSituation.setExercisesReplyNum(0);
|
|
@@ -182,10 +185,10 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
int exercisesMessageNum=0;
|
|
|
int exercisesMessageTimelyNum=0;
|
|
|
for (ExtracurricularExercisesReply studentHomework : studentExercises) {
|
|
|
- if(!new Integer(1).equals(studentHomework.getStatus())){
|
|
|
+ if(!YesOrNoEnum.YES.equals(studentHomework.getStatus())){
|
|
|
continue;
|
|
|
}
|
|
|
- if(!new Integer(1).equals(studentHomework.getIsReplied())){
|
|
|
+ if(!YesOrNoEnum.YES.equals(studentHomework.getIsReplied())){
|
|
|
continue;
|
|
|
}
|
|
|
exercisesMessageNum+=1;
|