|
@@ -3,6 +3,7 @@ package com.ym.mec.biz.service.impl;
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.TeacherRemindTypeEnum;
|
|
@@ -184,6 +185,10 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
|
|
|
PageInfo<TeacherServeDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
MapUtil.populateMap(params, queryInfo);
|
|
|
+ if(Objects.nonNull(queryInfo.getUnDone())){
|
|
|
+ List<Long> serveIds = findTeacherRightServeIds(queryInfo.getMonday(), queryInfo.getSunday());
|
|
|
+ params.put("rightServeIds", serveIds);
|
|
|
+ }
|
|
|
|
|
|
List<TeacherServeDto> dataList = null;
|
|
|
int count = studentExtracurricularExercisesSituationDao.countTeacherServeInfo(params);
|
|
@@ -197,7 +202,7 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
|
|
|
if(!CollectionUtils.isEmpty(teacherReminds)){
|
|
|
mondayTeacherRemindMap = teacherReminds.stream().collect(Collectors.groupingBy(e -> DateUtil.dateToString(e.getMonday(), "yyyy-MM-dd"), Collectors.groupingBy(TeacherRemind::getTeacherId)));
|
|
|
}
|
|
|
- List<StudentExtracurricularExercisesSituation> teacherServeWithDate = studentExtracurricularExercisesSituationDao.findTeacherServeWithDate(queryInfo.getMonday(), queryInfo.getSunday(), teacherIds);
|
|
|
+ List<StudentExtracurricularExercisesSituation> teacherServeWithDate = studentExtracurricularExercisesSituationDao.findTeacherServeWithDate(queryInfo.getMonday(), queryInfo.getSunday(), teacherIds, null);
|
|
|
Map<Integer, List<StudentExtracurricularExercisesSituation>> teacherServeMap = teacherServeWithDate.stream().filter(s -> "HOMEWORK".equals(s.getServeType())).collect(Collectors.groupingBy(StudentExtracurricularExercisesSituation::getTeacherId));
|
|
|
for (TeacherServeDto teacherServeDto : dataList) {
|
|
|
if(teacherServeMap.containsKey(teacherServeDto.getTeacherId())){
|
|
@@ -232,6 +237,44 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
|
|
|
return pageInfo;
|
|
|
}
|
|
|
|
|
|
+ public List<Long> findTeacherRightServeIds(String monday, String sunday){
|
|
|
+ List<Long> serveIds = new ArrayList<>();
|
|
|
+ List<StudentExtracurricularExercisesSituation> teacherServeWithDate = studentExtracurricularExercisesSituationDao.findTeacherServeWithDate(monday, sunday, null, null);
|
|
|
+ if(CollectionUtils.isEmpty(teacherServeWithDate)){
|
|
|
+ return serveIds;
|
|
|
+ }
|
|
|
+ Set<Long> courseIds = new HashSet<>();
|
|
|
+ for (StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation : teacherServeWithDate) {
|
|
|
+ if(StringUtils.isBlank(studentExtracurricularExercisesSituation.getCourseIds())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Set<Long> ids = Arrays.stream(studentExtracurricularExercisesSituation.getCourseIds().split(",")).map(s -> Long.valueOf(s)).collect(Collectors.toSet());
|
|
|
+ courseIds.addAll(ids);
|
|
|
+ }
|
|
|
+ List<CourseSchedule> courseSchedules = courseScheduleDao.findByCourseScheduleIds(new ArrayList<>(courseIds));
|
|
|
+ Set<Long> overCourseIds = courseSchedules.stream().filter(c->CourseStatusEnum.OVER.equals(c.getStatus())).map(CourseSchedule::getId).collect(Collectors.toSet());
|
|
|
+ for (StudentExtracurricularExercisesSituation sees : teacherServeWithDate) {
|
|
|
+ if(sees.getExpectExercisesNum()>=sees.getActualExercisesNum()){
|
|
|
+ serveIds.add(sees.getId());
|
|
|
+ }else{
|
|
|
+ if(StringUtils.isBlank(sees.getCourseIds())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Set<Long> ids = Arrays.stream(sees.getCourseIds().split(",")).map(s -> Long.valueOf(s)).collect(Collectors.toSet());
|
|
|
+ int overCourseNum = 0;
|
|
|
+ for (Long courseId : ids) {
|
|
|
+ if(overCourseIds.contains(courseId)){
|
|
|
+ overCourseNum+=1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(sees.getExpectExercisesNum()>=overCourseNum){
|
|
|
+ serveIds.add(sees.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return serveIds;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<Map<String, Object>> findServiceStudentDetail(StudentServiceDetailQueryInfo queryInfo) {
|
|
|
PageInfo<StudentServiceDetailDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
@@ -443,7 +486,10 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
|
|
|
}
|
|
|
dataList.add(tsed);
|
|
|
}
|
|
|
- List<Subject> subjects = subjectDao.findBySubjectIds(new ArrayList<>(subjectIds));
|
|
|
+ List<Subject> subjects = new ArrayList<>();
|
|
|
+ if(!CollectionUtils.isEmpty(subjectIds)){
|
|
|
+ subjectDao.findBySubjectIds(new ArrayList<>(subjectIds));
|
|
|
+ }
|
|
|
for (TeacherServeExtraDto teacherServeExtraDto : dataList) {
|
|
|
if(idNameMap.containsKey(teacherServeExtraDto.getUserId())){
|
|
|
teacherServeExtraDto.setUsername(idNameMap.get(teacherServeExtraDto.getUserId()));
|