|
@@ -69,6 +69,15 @@ public class CourseReviewServiceImpl extends BaseServiceImpl<Integer, CourseSche
|
|
|
@Autowired
|
|
|
private ClassGroupService classGroupService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CourseHomeworkService courseHomeworkService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private StudentCourseHomeworkDao studentCourseHomeworkDao;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Integer, CourseScheduleReview> getDAO() {
|
|
@@ -149,6 +158,36 @@ public class CourseReviewServiceImpl extends BaseServiceImpl<Integer, CourseSche
|
|
|
if (num <= 0) {
|
|
|
throw new BizException("评论提交失败,请重试");
|
|
|
}
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(courseScheduleReview.getHomeWork())){
|
|
|
+ //新增课堂作业
|
|
|
+ CourseHomework courseHomework=new CourseHomework();
|
|
|
+ courseHomework.setCourseScheduleId(courseSchedule.getId());
|
|
|
+ courseHomework.setMusicGroupId(courseSchedule.getMusicGroupId());
|
|
|
+ courseHomework.setGroupType(courseSchedule.getGroupType());
|
|
|
+ courseHomework.setClassGroupId(courseSchedule.getClassGroupId());
|
|
|
+ courseHomework.setExpiryDate(DateUtil.addDays(date,7));
|
|
|
+ courseHomework.setExpectNum(courseScheduleDao.countCourseStudentNum(courseSchedule.getId()));
|
|
|
+ courseHomeworkService.insert(courseHomework);
|
|
|
+ List<CourseScheduleStudentPayment> courseScheduleStudentPayments = courseScheduleStudentPaymentDao.findByCourseSchedule(courseSchedule.getId());
|
|
|
+ if(!CollectionUtils.isEmpty(courseScheduleStudentPayments)){
|
|
|
+ List<StudentCourseHomework> studentCourseHomeworks=new ArrayList<>();
|
|
|
+ for (CourseScheduleStudentPayment courseScheduleStudentPayment : courseScheduleStudentPayments) {
|
|
|
+ StudentCourseHomework studentCourseHomework=new StudentCourseHomework();
|
|
|
+ studentCourseHomework.setCourseHomeworkId(courseHomework.getId());
|
|
|
+ studentCourseHomework.setUserId(courseScheduleStudentPayment.getUserId());
|
|
|
+ studentCourseHomework.setCourseScheduleId(courseSchedule.getId());
|
|
|
+ studentCourseHomework.setCreateTime(date);
|
|
|
+ studentCourseHomework.setUpdateTime(date);
|
|
|
+ studentCourseHomework.setStatus(YesOrNoEnum.NO);
|
|
|
+ studentCourseHomework.setIsView(YesOrNoEnum.NO);
|
|
|
+ studentCourseHomework.setIsReplied(YesOrNoEnum.NO);
|
|
|
+ studentCourseHomeworks.add(studentCourseHomework);
|
|
|
+ }
|
|
|
+ studentCourseHomeworkDao.batchInsertStudentCourseHomeworkRecord(studentCourseHomeworks);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return courseScheduleReview;
|
|
|
}
|
|
|
|