|
@@ -354,13 +354,12 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
results.add(studentExtracurricularExercisesSituation);
|
|
|
}else{
|
|
|
Map<Integer, List<StudentServeCourseDto>> teacherCourseMap = weekCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getActualTeacherId));
|
|
|
- Map<Integer, Set<Long>> teacherServiceCourseIdMap = new HashMap<>();
|
|
|
for (Map.Entry<Integer, List<StudentServeCourseDto>> teacherCourseMapEntry : teacherCourseMap.entrySet()) {
|
|
|
StudentServeCourseDto courseInfo = teacherCourseMapEntry.getValue().stream().min(Comparator.comparing(StudentServeCourseDto::getCourseStartTime)).get();
|
|
|
StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation;
|
|
|
if(TeachModeEnum.OFFLINE.equals(courseInfo.getTeachMode())){
|
|
|
studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
|
|
|
- futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
|
+ teacherCourseMapEntry.getKey(),nowDate.get(DateUtil.weekFields.weekOfYear()),
|
|
|
DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
|
|
|
"EXERCISE", null);
|
|
|
}else{
|
|
@@ -445,15 +444,19 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
for (StudentExtracurricularExercisesSituation result : results) {
|
|
|
if(codeServeMap.containsKey(result.getStuAndTeaCode())){
|
|
|
StudentExtracurricularExercisesSituation s = codeServeMap.get(result.getStuAndTeaCode());
|
|
|
- List<Long> courseIds = new ArrayList<>();
|
|
|
+ Set<Long> courseIds = new HashSet<>();
|
|
|
if(StringUtils.isNotBlank(s.getCourseIds())&&s.getActualExercisesNum()>0){
|
|
|
- courseIds = Arrays.stream(s.getCourseIds().split(",")).map(id->Long.valueOf(id)).collect(Collectors.toList());
|
|
|
+ courseIds = Arrays.stream(s.getCourseIds().split(",")).map(id->Long.valueOf(id)).collect(Collectors.toSet());
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(result.getCourseIds())){
|
|
|
- courseIds.addAll(Arrays.stream(result.getCourseIds().split(",")).map(id->Long.valueOf(id)).collect(Collectors.toList()));
|
|
|
+ courseIds.addAll(Arrays.stream(result.getCourseIds().split(",")).map(id->Long.valueOf(id)).collect(Collectors.toSet()));
|
|
|
}
|
|
|
s.setServeType(result.getServeType());
|
|
|
- s.setCourseIds(StringUtils.join(courseIds, ","));
|
|
|
+ if(s.getServeType().equals("HOMEWORK")){
|
|
|
+ s.setCourseIds(StringUtils.join(courseIds, ","));
|
|
|
+ }else{
|
|
|
+ s.setCourseIds("");
|
|
|
+ }
|
|
|
if(StringUtils.isBlank(s.getCourseIds())){
|
|
|
s.setExpectExercisesNum(1);
|
|
|
}else{
|
|
@@ -518,13 +521,13 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
}
|
|
|
|
|
|
List<StudentExtracurricularExercisesSituation> weekServiceWithStudents = studentExtracurricularExercisesSituationDao.findWeekServiceWithStudents(monDayDate.toString(), teacherId, studentIds);
|
|
|
- if(!CollectionUtils.isEmpty(weekServiceWithStudents)){
|
|
|
+ if(CollectionUtils.isEmpty(weekServiceWithStudents)){
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
for (StudentExtracurricularExercisesSituation weekServiceWithStudent : weekServiceWithStudents) {
|
|
|
List<StudentServeCourseHomeworkDto> studentHomeworks = studentHomeworkMap.get(weekServiceWithStudent.getStudentId());
|
|
|
- if(!CollectionUtils.isEmpty(studentHomeworks)){
|
|
|
+ if(!CollectionUtils.isEmpty(studentHomeworks)&&weekServiceWithStudent.getServeType().equals("HOMEWORK")){
|
|
|
weekServiceWithStudent.setActualExercisesNum(1);
|
|
|
long replyNum = studentHomeworks.stream().filter(e -> YesOrNoEnum.YES.equals(e.getStatus())).count();
|
|
|
weekServiceWithStudent.setExercisesReplyNum(replyNum>0?1:0);
|
|
@@ -552,7 +555,7 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
}
|
|
|
|
|
|
List<ExtracurricularExercisesReply> studentExercises = studentExercisesMap.get(weekServiceWithStudent.getStudentId());
|
|
|
- if(!CollectionUtils.isEmpty(studentExercises)){
|
|
|
+ if(!CollectionUtils.isEmpty(studentExercises)&&weekServiceWithStudent.getServeType().equals("EXERCISE")){
|
|
|
weekServiceWithStudent.setActualExercisesNum(1);
|
|
|
long replyNum = studentExercises.stream().filter(e -> e.getStatus()==1).count();
|
|
|
if(weekServiceWithStudent.getExercisesReplyNum()<=0){
|