|  | @@ -20,15 +20,11 @@ import java.util.function.Function;
 | 
	
		
			
				|  |  |  import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dao.*;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dto.CourseHomeworkWrapper;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dto.StudentLessonTrainingDetailWrapper;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dto.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.ELessonTrainingType;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.StandardEnum;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.service.ExtracurricularExercisesService;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.service.MusicGroupService;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.service.StudentLessonTrainingDetailService;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.service.*;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  |  import org.jetbrains.annotations.NotNull;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
	
		
			
				|  | @@ -38,14 +34,6 @@ import org.springframework.util.CollectionUtils;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.client.SysUserFeignService;
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.entity.SysUser;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dto.CourseHomeworkDto;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dto.CourseHomeworkStudentDetailDto;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dto.EduHomeworkCardDto;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dto.EduHomeworkStatDto;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dto.SimpleUserDto;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dto.StudentCourseHomeworkDto;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dto.StudentHomeworkRecordDto;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dto.StudentVisitCourseHomeWorkDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.GroupType;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 | 
	
	
		
			
				|  | @@ -54,12 +42,6 @@ import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.page.CourseHomeworkQueryInfo;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.page.StudentCourseHomeWorkQueryInfo;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.service.CourseHomeworkService;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.service.MusicGroupTrainPlanService;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.service.StudentCourseHomeworkService;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.service.StudentServeService;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.service.SysConfigService;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.service.SysMessageService;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.constant.CommonConstants;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.dal.BaseDAO;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.exception.BizException;
 | 
	
	
		
			
				|  | @@ -124,7 +106,7 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
 | 
	
		
			
				|  |  |      private MusicGroupService musicGroupService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  | -    private ExtracurricularExercisesService  extracurricularExercisesService;
 | 
	
		
			
				|  |  | +    private StudentLessonExaminationDao studentLessonExaminationDao;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private StudentLessonTrainingDetailService studentLessonTrainingDetailService;
 | 
	
	
		
			
				|  | @@ -376,15 +358,40 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public void homeworkRemind() {
 | 
	
		
			
				|  |  | +        // 课后作业通知
 | 
	
		
			
				|  |  |          List<StudentCourseHomework> list = studentCourseHomeworkDao.queryNotDoneHomeworkList();
 | 
	
		
			
				|  |  |          StringBuffer sb;
 | 
	
		
			
				|  |  |          for (StudentCourseHomework sch : list) {
 | 
	
		
			
				|  |  | -            sb = new StringBuffer("courseScheduleID=").append(sch.getCourseScheduleId()).append("&studentCourseHomeworkId=").append(sch.getId());
 | 
	
		
			
				|  |  | +            sb = new StringBuffer("homeworkId=").append(sch.getCourseHomeworkId()).append("&type=HOMEWORK");
 | 
	
		
			
				|  |  |              Map<Integer, String> receivers = new HashMap<Integer, String>(1);
 | 
	
		
			
				|  |  |              receivers.put(sch.getUserId(), sch.getUserId() + "");
 | 
	
		
			
				|  |  | -            sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_JOB_MESSAGE, receivers, null, 0, "3?" + sb, "STUDENT", sch.getCourseHomework()
 | 
	
		
			
				|  |  | -                    .getMusicGroup().getName(), sch.getCourseHomework().getClassGroup().getName());
 | 
	
		
			
				|  |  | +            sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_JOB_MESSAGE_V2, receivers, null, 0, "homework?" + sb, "STUDENT");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        // 课外作业通知
 | 
	
		
			
				|  |  | +        List<ExtracurricularExercisesReply> extraList =  extracurricularExercisesReplyDao.queryNotDoneHomeworkList();
 | 
	
		
			
				|  |  | +        for (ExtracurricularExercisesReply reply : extraList) {
 | 
	
		
			
				|  |  | +            sb = new StringBuffer("homeworkId=").append(reply.getExtracurricularExercisesId())
 | 
	
		
			
				|  |  | +                    .append("&type=")
 | 
	
		
			
				|  |  | +                    .append(reply.getExtracurricularExercises().getGroupType());
 | 
	
		
			
				|  |  | +            Map<Integer, String> receivers = new HashMap<Integer, String>(1);
 | 
	
		
			
				|  |  | +            receivers.put(reply.getUserId(), reply.getUserId() + "");
 | 
	
		
			
				|  |  | +            sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_JOB_MESSAGE_EXTRA_V2, receivers, null, 0, "homework?" + sb, "STUDENT");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        //获取即将截止的测评
 | 
	
		
			
				|  |  | +        String date = DateUtil.dateToString(DateUtil.addDays(new Date(), 1),DateUtil.ISO_EXPANDED_DATE_FORMAT);
 | 
	
		
			
				|  |  | +        List<StudentLessonExamination> examinations = studentLessonExaminationDao.queryEndList(date);
 | 
	
		
			
				|  |  | +        if(!CollectionUtils.isEmpty(examinations)){
 | 
	
		
			
				|  |  | +            Map<Long, List<StudentLessonExamination>> listMap = examinations.stream().collect(Collectors.groupingBy(e -> e.getLessonExaminationId()));
 | 
	
		
			
				|  |  | +            for (Long lessonExaminationId : listMap.keySet()) {
 | 
	
		
			
				|  |  | +                List<StudentLessonExamination> studentLessonExaminations = listMap.get(lessonExaminationId);
 | 
	
		
			
				|  |  | +                Map<Integer, String> receivers = studentLessonExaminations.stream().collect(Collectors.toMap(e -> e.getUserId(), e -> e.getUserId().toString()));
 | 
	
		
			
				|  |  | +                sb = new StringBuffer("evaluating?evaluateId=").append(lessonExaminationId);
 | 
	
		
			
				|  |  | +                sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.PUSH_NO_SUBMIT_LESSON_EXAMINATION, receivers, null, 0, sb.toString(), "STUDENT");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
	
		
			
				|  | @@ -1086,6 +1093,45 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    @Transactional
 | 
	
		
			
				|  |  | +    public void pushEndMsg() {
 | 
	
		
			
				|  |  | +        // 课后作业
 | 
	
		
			
				|  |  | +        List<CourseHomeworkListDto> courseHomeworks = courseHomeworkDao.findEndHomework();
 | 
	
		
			
				|  |  | +        StringBuffer sb;
 | 
	
		
			
				|  |  | +        for (CourseHomeworkListDto courseHomework : courseHomeworks) {
 | 
	
		
			
				|  |  | +            sb = new StringBuffer("homeworkId=").append(courseHomework.getId())
 | 
	
		
			
				|  |  | +                    .append("&type=HOMEWORK");
 | 
	
		
			
				|  |  | +            Map<Integer, String> receivers = new HashMap<Integer, String>(1);
 | 
	
		
			
				|  |  | +            String dateToString = DateUtil.dateToString(courseHomework.getCreateTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT);
 | 
	
		
			
				|  |  | +            receivers.put(courseHomework.getTeacherId(), courseHomework.getTeacherId() + "");
 | 
	
		
			
				|  |  | +            sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.TEACHER_PUSH_JOB_MESSAGE_V2, receivers, null, 0, "homework?" + sb, "TEACHER",dateToString);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (courseHomeworks.size() > 0) {
 | 
	
		
			
				|  |  | +            // id 集合
 | 
	
		
			
				|  |  | +            List<Long> ids = courseHomeworks.stream().map(CourseHomeworkListDto::getId).collect(Collectors.toList());
 | 
	
		
			
				|  |  | +            courseHomeworkDao.updatePushFlag(ids);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        // 课外作业
 | 
	
		
			
				|  |  | +        List<ExtracurricularExercises> extracurricularExercises = extracurricularExercisesDao.findEndHomework();
 | 
	
		
			
				|  |  | +        for (ExtracurricularExercises exercises : extracurricularExercises) {
 | 
	
		
			
				|  |  | +            sb = new StringBuffer("homeworkId=").append(exercises.getId())
 | 
	
		
			
				|  |  | +                    .append("&type=")
 | 
	
		
			
				|  |  | +                    .append(exercises.getGroupType());
 | 
	
		
			
				|  |  | +            Map<Integer, String> receivers = new HashMap<Integer, String>(1);
 | 
	
		
			
				|  |  | +            String dateToString = DateUtil.dateToString(exercises.getCreateTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT);
 | 
	
		
			
				|  |  | +            receivers.put(exercises.getTeacherId(), exercises.getTeacherId() + "");
 | 
	
		
			
				|  |  | +            sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.TEACHER_PUSH_JOB_MESSAGE_EXTRA_V2, receivers, null, 0, "homework?" + sb, "TEACHER",dateToString);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (extracurricularExercises.size() > 0) {
 | 
	
		
			
				|  |  | +            // id 集合
 | 
	
		
			
				|  |  | +            List<Long> ids = extracurricularExercises.stream().map(ExtracurricularExercises::getId).collect(Collectors.toList());
 | 
	
		
			
				|  |  | +            extracurricularExercisesDao.updatePushFlag(ids);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @NotNull
 | 
	
		
			
				|  |  |      private StudentLessonTrainingDetailWrapper.StudentLessonTraining getUserInfo(Long userId) {
 | 
	
		
			
				|  |  |          SysUser sysUser = sysUserFeignService.queryUserById(userId.intValue());
 |