|
@@ -81,6 +81,12 @@ public class CourseReviewServiceImpl extends BaseServiceImpl<Integer, CourseSche
|
|
|
@Autowired
|
|
|
private CourseHomeworkDao courseHomeworkDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysMessageService sysMessageService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TeacherDao teacherDao;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Integer, CourseScheduleReview> getDAO() {
|
|
@@ -163,7 +169,9 @@ public class CourseReviewServiceImpl extends BaseServiceImpl<Integer, CourseSche
|
|
|
throw new BizException("评论提交失败,请重试");
|
|
|
}
|
|
|
|
|
|
- if(StringUtils.isNotBlank(courseScheduleReview.getHomeWork())){
|
|
|
+ CourseHomework existHomework = courseHomeworkDao.findByCourseSchedule(courseScheduleId.longValue());
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(courseScheduleReview.getHomeWork())&&Objects.isNull(existHomework)){
|
|
|
//新增课堂作业
|
|
|
CourseHomework courseHomework=new CourseHomework();
|
|
|
courseHomework.setContent(courseScheduleReview.getHomeWork());
|
|
@@ -179,6 +187,7 @@ public class CourseReviewServiceImpl extends BaseServiceImpl<Integer, CourseSche
|
|
|
|
|
|
if(!CollectionUtils.isEmpty(courseScheduleStudentPayments)){
|
|
|
List<StudentCourseHomework> studentCourseHomeworks=new ArrayList<>();
|
|
|
+ Map<Integer, String> userMap = new HashMap<>();
|
|
|
for (CourseScheduleStudentPayment courseScheduleStudentPayment : courseScheduleStudentPayments) {
|
|
|
StudentCourseHomework studentCourseHomework=new StudentCourseHomework();
|
|
|
studentCourseHomework.setCourseHomeworkId(courseHomework.getId());
|
|
@@ -190,8 +199,14 @@ public class CourseReviewServiceImpl extends BaseServiceImpl<Integer, CourseSche
|
|
|
studentCourseHomework.setIsView(YesOrNoEnum.NO);
|
|
|
studentCourseHomework.setIsReplied(YesOrNoEnum.NO);
|
|
|
studentCourseHomeworks.add(studentCourseHomework);
|
|
|
+ userMap.put(courseScheduleStudentPayment.getUserId(), courseScheduleStudentPayment.getUserId().toString());
|
|
|
}
|
|
|
studentCourseHomeworkDao.batchInsertStudentCourseHomeworkRecord(studentCourseHomeworks);
|
|
|
+ Teacher teacher = teacherDao.get(courseScheduleReview.getTeacherId());
|
|
|
+ String dateStr=DateUtil.dateToString(DateUtil.addDays(date,1), "MM月dd日");
|
|
|
+ String notifyUrl="3?courseScheduleID="+courseSchedule.getId()+"&studentCourseHomeworkId="+courseHomework.getId();
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.HOMEWORK_REMIND,
|
|
|
+ userMap, null, 0, notifyUrl, "STUDENT", teacher.getRealName(), courseSchedule.getName(), dateStr);
|
|
|
}
|
|
|
}
|
|
|
|