|
@@ -28,7 +28,6 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
|
|
|
-import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
|
|
|
import com.ym.mec.biz.dal.dao.CourseScheduleDao;
|
|
|
import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
|
|
|
import com.ym.mec.biz.dal.dao.ExtracurricularExercisesReplyDao;
|
|
@@ -38,11 +37,11 @@ import com.ym.mec.biz.dal.dao.StudentDao;
|
|
|
import com.ym.mec.biz.dal.dao.StudentExtracurricularExercisesSituationDao;
|
|
|
import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
|
|
|
import com.ym.mec.biz.dal.dto.BasicUserDto;
|
|
|
+import com.ym.mec.biz.dal.dto.ClassGroupStudentMapperDto;
|
|
|
import com.ym.mec.biz.dal.dto.IndexBaseDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentServeCourseDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentServeCourseHomeworkDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentServeDto;
|
|
|
-import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
|
|
|
import com.ym.mec.biz.dal.entity.CourseSchedule;
|
|
|
import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
|
|
|
import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
|
|
@@ -56,6 +55,7 @@ import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.CourseStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
import com.ym.mec.biz.dal.enums.IndexDataType;
|
|
|
+import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.TeachTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
import com.ym.mec.biz.service.StudentServeService;
|
|
@@ -95,9 +95,6 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
@Autowired
|
|
|
private StudentRegistrationDao studentRegistrationDao;
|
|
|
|
|
|
- @Autowired
|
|
|
- private ClassGroupTeacherMapperDao classGroupTeacherMapperDao;
|
|
|
-
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void exercisesSituationStatistics(String monday, Integer tenantId) {
|
|
@@ -463,21 +460,24 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
musicGroupId = entry.getKey();
|
|
|
|
|
|
MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
- if(musicGroup == null){
|
|
|
+ if(musicGroup == null || musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS){
|
|
|
continue;
|
|
|
}
|
|
|
+ Map<Integer,Integer> studentTeacherMapper = null;
|
|
|
|
|
|
- teacherType = musicGroup.getExtracurricularTeacher();
|
|
|
- List<ClassGroupTeacherMapper> classGroupTeacherMapperList = classGroupTeacherMapperDao.queryByClassGroupType(musicGroupId, teacherType, TeachTypeEnum.BISHOP);
|
|
|
+ teacherType = musicGroup.getExtracurricularTeacher() == null ? ClassGroupTypeEnum.NORMAL : musicGroup.getExtracurricularTeacher();
|
|
|
+ List<ClassGroupStudentMapperDto> classGroupStudentMapperDtoList = classGroupStudentMapperDao.queryByClassGroupType(musicGroupId, teacherType, TeachTypeEnum.BISHOP, entry.getValue());
|
|
|
+ if(classGroupStudentMapperDtoList != null){
|
|
|
+ studentTeacherMapper = classGroupStudentMapperDtoList.stream().collect(Collectors.toMap(ClassGroupStudentMapperDto :: getUserId, ClassGroupStudentMapperDto :: getTeacherId));
|
|
|
+ }
|
|
|
|
|
|
userCourseMap = musicGroupStudentCurrentWeekCourseMap.get(musicGroupId);
|
|
|
|
|
|
for(Integer studentId : entry.getValue()){
|
|
|
//在当前乐团,学生本周是否有课
|
|
|
- studentServeCourseDto = userCourseMap.get(studentId);
|
|
|
- if(studentServeCourseDto == null){//如果本周没课
|
|
|
+ if(userCourseMap == null || userCourseMap.get(studentId) == null){//如果本周没课
|
|
|
|
|
|
- if(classGroupTeacherMapperList == null || classGroupTeacherMapperList.size() == 0){
|
|
|
+ if(studentTeacherMapper == null || (teacherId = studentTeacherMapper.get(studentId)) == null){
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -488,16 +488,20 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
teacherCourseNumMap.put(teacherId, teacherCourseNumMap.get(teacherId) == null ? 1 : teacherCourseNumMap.get(teacherId) + 1);
|
|
|
studentTeacherCourseNumMap.put(studentId, teacherCourseNumMap);
|
|
|
|
|
|
- teacherId = classGroupTeacherMapperList.get(0).getUserId();
|
|
|
-
|
|
|
//本周没有课,布置课外训练
|
|
|
studentExtracurricularExercisesSituation = new StudentExtracurricularExercisesSituation(studentId, teacherId,
|
|
|
nowDate.get(DateUtil.weekFields.weekOfYear()), DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(
|
|
|
sunDayDate.toString(), "yyyy-MM-dd"), "EXERCISE", null);
|
|
|
+
|
|
|
+
|
|
|
studentExtracurricularExercisesSituation.setExpectExercisesNum(teacherCourseNumMap.get(teacherId));
|
|
|
+ if(results.contains(studentExtracurricularExercisesSituation)){
|
|
|
+ results.remove(studentExtracurricularExercisesSituation);
|
|
|
+ }
|
|
|
results.add(studentExtracurricularExercisesSituation);
|
|
|
}else{//如果本周有课
|
|
|
-
|
|
|
+
|
|
|
+ studentServeCourseDto = userCourseMap.get(studentId);
|
|
|
teacherId = studentServeCourseDto.getActualTeacherId();
|
|
|
|
|
|
teacherCourseMap = studentTeacherCourseMap.get(studentId);
|
|
@@ -533,6 +537,9 @@ public class StudentServeServiceImpl implements StudentServeService {
|
|
|
|
|
|
studentExtracurricularExercisesSituation.setNotOverCourseIds(StringUtils.join(courseIdList, ","));
|
|
|
studentExtracurricularExercisesSituation.setNotOverCourseNum(courseIdList.size());
|
|
|
+ if(results.contains(studentExtracurricularExercisesSituation)){
|
|
|
+ results.remove(studentExtracurricularExercisesSituation);
|
|
|
+ }
|
|
|
results.add(studentExtracurricularExercisesSituation);
|
|
|
}
|
|
|
}
|