|
@@ -140,8 +140,21 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
|
throw new BizException("作业不存在");
|
|
|
}
|
|
|
Date now = new Date();
|
|
|
+
|
|
|
+ if (DateUtil.daysBetween(existHomework.getCreateTime(), now) >= 7) {
|
|
|
+ throw new BizException("该作业已超出可提交时间范围,无法提交作业。");
|
|
|
+ }
|
|
|
+ CourseSchedule courseSchedule = courseScheduleDao.get(bean.getCourseScheduleId());
|
|
|
//若本周有当前课程所在乐团的服务指标,那么在课程开始当天之后不能再提交作业
|
|
|
-// studentExtracurricularExercisesSituationDao.getHomeworkSituations(existHomework.getCourseScheduleId(),);
|
|
|
+ DateUtil.getFirstDayOfMonth(now);
|
|
|
+ Date classDate = studentExtracurricularExercisesSituationDao.getHomeworkSituations(courseSchedule.getId(),courseSchedule.getMusicGroupId(),"HOMEWORK",
|
|
|
+ DateUtil.getFirstDayOfMonth(now),bean.getUserId());
|
|
|
+ if(Objects.nonNull(classDate)){
|
|
|
+ int i = classDate.compareTo(DateUtil.stringToDate(DateUtil.format(now, DateUtil.ISO_EXPANDED_DATE_FORMAT), DateUtil.ISO_EXPANDED_DATE_FORMAT));
|
|
|
+ if(i <= 0){
|
|
|
+ throw new BizException("该作业已超出可提交时间范围,无法提交作业。");
|
|
|
+ }
|
|
|
+ }
|
|
|
// List<StudentExtracurricularExercisesSituation> exercisesSituations = studentExtracurricularExercisesSituationDao.findServiceWithCourse(
|
|
|
// DateUtil.format(DateUtil.addDays(DateUtil.getLastDayOfMonth(now), 1), DateUtil.ISO_EXPANDED_DATE_FORMAT),
|
|
|
// existHomework.getCourseScheduleId());
|
|
@@ -152,16 +165,12 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
|
|
|
// throw new BizException("该作业已超出可提交时间范围,无法提交作业。");
|
|
|
// }
|
|
|
// }
|
|
|
- if (DateUtil.daysBetween(existHomework.getCreateTime(), now) >= 7) {
|
|
|
- throw new BizException("该作业已超出可提交时间范围,无法提交作业。");
|
|
|
- }
|
|
|
|
|
|
// boolean push = Objects.isNull(existHomework.getAttachments());
|
|
|
boolean push = true;
|
|
|
bean.setSubmitTime(now);
|
|
|
super.update(bean);
|
|
|
bean = studentCourseHomeworkDao.get(bean.getId());
|
|
|
- CourseSchedule courseSchedule = courseScheduleDao.get(bean.getCourseScheduleId());
|
|
|
|
|
|
CourseHomework courseHomework = courseHomeworkDao.get(bean.getCourseHomeworkId());
|
|
|
courseHomework.setGroupType(courseSchedule.getGroupType());
|