Przeglądaj źródła

1、添加教务老师字段
2、布置作业

Joburgess 5 lat temu
rodzic
commit
eac094eae0

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MessageTypeEnum.java

@@ -46,6 +46,7 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     STUDENT_SMS_TEACHING_SCHOOL_CHANGE("STUDENT_SMS_TEACHING_SCHOOL_CHANGE", "教学点变动"),
     STUDENT_PUSH_TEACHING_SCHOOL_CHANGE("STUDENT_PUSH_TEACHING_SCHOOL_CHANGE", "教学点变动"),
     STUDENT_PUSH_JOB_MESSAGE("STUDENT_PUSH_JOB_MESSAGE", "作业提醒"),
+    HOMEWORK_REMIND("HOMEWORK_REMIND", "作业提醒-网管课"),
     STUDENT_PUSH_CLASS_MESSAGE("STUDENT_PUSH_CLASS_MESSAGE", "班级消息"),
 
     TEACHER_PUSH_MUSIC_GROUP_COURSE_ADD_PLAN("TEACHER_PUSH_MUSIC_GROUP_COURSE_ADD_PLAN", "乐团课新增安排"),

+ 16 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseReviewServiceImpl.java

@@ -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);
             }
         }
 

+ 6 - 0
mec-student/src/main/java/com/ym/mec/student/controller/CourseGroupController.java

@@ -9,6 +9,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -29,6 +30,11 @@ public class CourseGroupController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
 
+    @ApiOperation(value = "获取课程组详情")
+    @GetMapping("/getGroupDetail")
+    public HttpResponseResult getGroupDetail(Long groupId){
+        return succeed(coursesGroupService.getGroupDetail(groupId));
+    }
 
     @ApiOperation(value = "购买课程组")
     @PostMapping("/buyCourseGroup")