浏览代码

上课记录

chengpeng 5 年之前
父节点
当前提交
6476829c5d
共有 17 个文件被更改,包括 253 次插入8 次删除
  1. 8 0
      mec-education/src/main/java/com/ym/mec/education/controller/CourseScheduleController.java
  2. 12 0
      mec-education/src/main/java/com/ym/mec/education/controller/HomeWorkController.java
  3. 1 1
      mec-education/src/main/java/com/ym/mec/education/mapper/CourseHomeworkMapper.java
  4. 1 1
      mec-education/src/main/java/com/ym/mec/education/mapper/SchoolMapper.java
  5. 1 1
      mec-education/src/main/java/com/ym/mec/education/resp/AttendClassResp.java
  6. 70 0
      mec-education/src/main/java/com/ym/mec/education/resp/CourseHomeworkResp.java
  7. 45 0
      mec-education/src/main/java/com/ym/mec/education/resp/CourseInfoResp.java
  8. 2 0
      mec-education/src/main/java/com/ym/mec/education/resp/HomeWrokResp.java
  9. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/ICourseHomeworkService.java
  10. 10 0
      mec-education/src/main/java/com/ym/mec/education/service/ICourseScheduleService.java
  11. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/ISchoolService.java
  12. 7 0
      mec-education/src/main/java/com/ym/mec/education/service/IStudentCourseHomeworkService.java
  13. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/impl/CourseHomeworkServiceImpl.java
  14. 44 0
      mec-education/src/main/java/com/ym/mec/education/service/impl/CourseScheduleServiceImpl.java
  15. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/impl/SchoolServiceImpl.java
  16. 47 0
      mec-education/src/main/java/com/ym/mec/education/service/impl/StudentCourseHomeworkServiceImpl.java
  17. 1 1
      mec-education/src/main/resources/mapper/StudentAttendanceMapper.xml

+ 8 - 0
mec-education/src/main/java/com/ym/mec/education/controller/CourseScheduleController.java

@@ -49,4 +49,12 @@ public class CourseScheduleController {
     public BaseResponse getStatisticsInfo(@RequestBody ClassGroupReq classGroupReq) {
         return courseScheduleService.getStatisticsInfo(classGroupReq);
     }
+
+
+    @PostMapping("/courseInfo")
+    @ApiOperation("课程详情-头信息")
+    public BaseResponse<CourseScheduleResp> courseInfo(@RequestBody CourseScheduleReq courseScheduleReq) {
+        return courseScheduleService.courseInfo(courseScheduleReq);
+    }
+
 }

+ 12 - 0
mec-education/src/main/java/com/ym/mec/education/controller/HomeWorkController.java

@@ -86,4 +86,16 @@ public class HomeWorkController {
         }
         return studentCourseHomeworkService.getHomeWorkDetail(req);
     }
+
+
+    /**
+     *
+     * @param req
+     * @return
+     */
+    @PostMapping(value = "/homeWorkList")
+    public PageResponse homeWorkList(@RequestBody HomeWorkReq req) {
+
+       return studentCourseHomeworkService.homeWorkList(req);
+    }
 }

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/mapper/CourseHomeworkMapper.java

@@ -1,7 +1,7 @@
 package com.ym.mec.education.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ym.mec.education.entity.CourseHomework;
-import com.baomidou.mybatisplus.mapper.BaseMapper;
 
 /**
  * <p>

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/mapper/SchoolMapper.java

@@ -1,7 +1,7 @@
 package com.ym.mec.education.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ym.mec.education.entity.School;
-import com.baomidou.mybatisplus.mapper.BaseMapper;
 
 /**
  * <p>

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/resp/AttendClassResp.java

@@ -44,7 +44,7 @@ public class AttendClassResp implements Serializable {
     private Integer teacherId;
     private String type;//vip 普通课
     private String name;//乐团名
-    private String coureName;//课程名
+    private String courseName;//课程名
     @ApiModelProperty(value = "老师名")
     private String realName;
 

+ 70 - 0
mec-education/src/main/java/com/ym/mec/education/resp/CourseHomeworkResp.java

@@ -0,0 +1,70 @@
+package com.ym.mec.education.resp;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 课程作业表
+ * </p>
+ *
+ * @author lemeng
+ * @since 2019-09-25
+ */
+@ToString
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class CourseHomeworkResp implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+    private Long courseScheduleId;
+    /**
+     * 附件地址(多个用逗号分隔)
+     */
+    private String attachments;
+    /**
+     * 作业内容
+     */
+    private String content;
+    private Date createTime;
+    private Date updateTime;
+    private Integer musicGroupId;
+    private Integer classGroupId;
+    /**
+     * 截止日期
+     */
+    private Date expiryDate;
+    /**
+     * 完成人数
+     */
+    private Integer completedNum;
+    /**
+     * 预计人数
+     */
+    private Integer expectNum;
+
+    private String courseName;
+
+    /**
+     * 总课时
+     */
+    private Integer totalClassTimes;
+    /**
+     * 当前
+     */
+    private Integer currentClassTimes;
+
+
+
+
+
+}

+ 45 - 0
mec-education/src/main/java/com/ym/mec/education/resp/CourseInfoResp.java

@@ -0,0 +1,45 @@
+package com.ym.mec.education.resp;
+
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 课程作业表
+ * </p>
+ *
+ * @author lemeng
+ * @since 2019-09-25
+ */
+@ToString
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class CourseInfoResp implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+    private Long courseScheduleId;
+    //课程名s
+    private String courseName;
+    //老师名
+    private String realName;
+
+
+    private String startClassTime;
+    private String endClassTime;
+    //课表日期
+    private String classDate;
+
+    private String week;
+
+    private String schoolName;
+}

+ 2 - 0
mec-education/src/main/java/com/ym/mec/education/resp/HomeWrokResp.java

@@ -41,4 +41,6 @@ public class HomeWrokResp implements Serializable {
     private Long id;
 
     private Long courseHomeworkId;
+
+    private String content;
 }

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/ICourseHomeworkService.java

@@ -1,7 +1,7 @@
 package com.ym.mec.education.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.ym.mec.education.entity.CourseHomework;
-import com.baomidou.mybatisplus.service.IService;
 
 /**
  * <p>

+ 10 - 0
mec-education/src/main/java/com/ym/mec/education/service/ICourseScheduleService.java

@@ -37,4 +37,14 @@ public interface ICourseScheduleService extends IService<CourseSchedule> {
      * @return
      */
     BaseResponse getStatisticsInfo(ClassGroupReq classGroupReq);
+
+
+    /**
+     * 根据课程计划id获取课程计划详情
+     * @param courseScheduleReq
+     * @return
+     */
+    BaseResponse courseInfo(CourseScheduleReq courseScheduleReq);
+
+
 }

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/ISchoolService.java

@@ -1,7 +1,7 @@
 package com.ym.mec.education.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.ym.mec.education.entity.School;
-import com.baomidou.mybatisplus.service.IService;
 
 /**
  * <p>

+ 7 - 0
mec-education/src/main/java/com/ym/mec/education/service/IStudentCourseHomeworkService.java

@@ -20,4 +20,11 @@ public interface IStudentCourseHomeworkService extends IService<StudentCourseHom
     PageResponse workList(HomeWorkReq req);
 
     BaseResponse getHomeWorkDetail(HomeWorkDetailReq req);
+
+    /**
+     * 学员列表 作业列表
+     * @param req
+     * @return
+     */
+    PageResponse homeWorkList(HomeWorkReq req);
 }

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/impl/CourseHomeworkServiceImpl.java

@@ -1,9 +1,9 @@
 package com.ym.mec.education.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.education.entity.CourseHomework;
 import com.ym.mec.education.mapper.CourseHomeworkMapper;
 import com.ym.mec.education.service.ICourseHomeworkService;
-import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
 /**

+ 44 - 0
mec-education/src/main/java/com/ym/mec/education/service/impl/CourseScheduleServiceImpl.java

@@ -13,6 +13,7 @@ import com.ym.mec.education.enums.TeachTypeEnum;
 import com.ym.mec.education.mapper.CourseScheduleMapper;
 import com.ym.mec.education.req.ClassGroupReq;
 import com.ym.mec.education.req.CourseScheduleReq;
+import com.ym.mec.education.resp.CourseInfoResp;
 import com.ym.mec.education.resp.CourseScheduleResp;
 import com.ym.mec.education.service.*;
 import com.ym.mec.education.utils.DateUtil;
@@ -52,6 +53,12 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
     @Autowired
     private IMusicGroupQuitService musicGroupQuitService;
 
+    @Autowired
+    private IMusicGroupService musicGroupService;
+
+    @Autowired
+    private ISchoolService schoolService;
+
     @Override
     public PageResponse getPage(ClassGroupReq classGroupReq) {
         if (Objects.isNull(classGroupReq.getGroupId())) {
@@ -172,4 +179,41 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
         }
         return BaseResponse.success(courseScheduleResp);
     }
+
+    @Override
+    public BaseResponse courseInfo(CourseScheduleReq courseScheduleReq) {
+
+
+        if(courseScheduleReq.getCourseScheduleId() == null){
+            return BaseResponse.failParams();
+        }
+        CourseInfoResp resp = new CourseInfoResp();
+        CourseSchedule courseSchedule = this.baseMapper.selectById(courseScheduleReq.getCourseScheduleId());
+        if(courseSchedule != null){
+            resp.setCourseName(courseSchedule.getName());
+            resp.setClassDate(DateUtil.date2String(courseSchedule.getClassDate(),DateUtil.DATE_FORMAT));
+            resp.setCourseScheduleId(courseSchedule.getId());
+            resp.setStartClassTime(DateUtil.date2String(courseSchedule.getStartClassTime(),DateUtil.TIME_FORMAT));
+            resp.setEndClassTime(DateUtil.date2String(courseSchedule.getEndClassTime(),DateUtil.TIME_FORMAT));
+            resp.setWeek(DateUtil.date2Week(courseSchedule.getClassDate()));
+
+            SysUser sysUser = sysUserService.getById(courseSchedule.getTeacherId());
+            if(sysUser != null){
+                resp.setRealName(sysUser.getRealName());
+            }
+            ClassGroup classGroup = groupService.getById(courseSchedule.getClassGroupId());
+            if(classGroup != null){
+                MusicGroup musicGroup = musicGroupService.getById(courseSchedule.getClassGroupId());
+                if(musicGroup != null && musicGroup.getSchoolId()!= null){
+                    School school = schoolService.getById(musicGroup.getSchoolId());
+                    if(school != null){
+                        resp.setSchoolName(school.getName());
+                    }
+                }
+            }
+
+
+        }
+        return BaseResponse.success(resp);
+    }
 }

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/impl/SchoolServiceImpl.java

@@ -1,9 +1,9 @@
 package com.ym.mec.education.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.education.entity.School;
 import com.ym.mec.education.mapper.SchoolMapper;
 import com.ym.mec.education.service.ISchoolService;
-import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
 /**

+ 47 - 0
mec-education/src/main/java/com/ym/mec/education/service/impl/StudentCourseHomeworkServiceImpl.java

@@ -11,6 +11,7 @@ import com.ym.mec.education.enums.ReturnCodeEnum;
 import com.ym.mec.education.mapper.StudentCourseHomeworkMapper;
 import com.ym.mec.education.req.HomeWorkDetailReq;
 import com.ym.mec.education.req.HomeWorkReq;
+import com.ym.mec.education.resp.CourseHomeworkResp;
 import com.ym.mec.education.resp.HomeWrokDetailResp;
 import com.ym.mec.education.resp.HomeWrokResp;
 import com.ym.mec.education.resp.HomeworkReplyResp;
@@ -49,6 +50,12 @@ public class StudentCourseHomeworkServiceImpl extends ServiceImpl<StudentCourseH
     @Autowired
     private IStudentCourseHomeworkReplyService studentCourseHomeworkReplyService;
 
+    @Autowired
+    private ICourseScheduleService courseScheduleService;
+
+    @Autowired
+    private ICourseHomeworkService courseHomeworkService;
+
     @Override
     public PageResponse workList(HomeWorkReq req) {
 
@@ -144,4 +151,44 @@ public class StudentCourseHomeworkServiceImpl extends ServiceImpl<StudentCourseH
         }
         return BaseResponse.success(resp);
     }
+
+    /**
+     * 作业列表
+     * @param req
+     * @return
+     */
+    @Override
+    public PageResponse homeWorkList(HomeWorkReq req) {
+        PageResponse response = new PageResponse();
+        IPage ipage = new Page(req.getPageNo() == null ? 1: req.getPageNo(),req.getPageSize() == null ? 10:req.getPageSize());
+        QueryWrapper<CourseHomework> queryWrapper = new QueryWrapper<>();
+        IPage<CourseHomework> courseScheduleIPage = courseHomeworkService.page(ipage,queryWrapper);
+
+        List<CourseHomework> courseSchedules = courseScheduleIPage.getRecords();
+        List<CourseHomeworkResp> courseHomeworkRespList = new ArrayList<>();
+        if(!CollectionUtils.isEmpty(courseSchedules)){
+            courseSchedules.forEach(e ->{
+                CourseHomeworkResp resp = new CourseHomeworkResp();
+                BeanUtils.copyProperties(e,resp);
+                CourseSchedule courseSchedule =  courseScheduleService.getById(e.getCourseScheduleId());
+                if(courseSchedule != null){
+                    resp.setCourseName(courseSchedule.getName());
+
+                }
+                ClassGroup classGroup = classGroupService.getById(e.getClassGroupId());
+                if(classGroup != null){
+                    resp.setTotalClassTimes(classGroup.getTotalClassTimes());
+                    resp.setCurrentClassTimes(classGroup.getCurrentClassTimes());
+                }
+                courseHomeworkRespList.add(resp);
+            });
+        }
+        response.setRecords(courseHomeworkRespList);
+        response.setTotal(Math.toIntExact(courseScheduleIPage.getTotal()));
+        response.setCurrent(Math.toIntExact(courseScheduleIPage.getCurrent()));
+        response.setSize(Math.toIntExact(courseScheduleIPage.getSize()));
+        response.setReturnCode(ReturnCodeEnum.CODE_200.getCode());
+        response.setMessage(ReturnCodeEnum.CODE_200.getValue());
+        return response;
+    }
 }

+ 1 - 1
mec-education/src/main/resources/mapper/StudentAttendanceMapper.xml

@@ -23,7 +23,7 @@
             resultType="com.ym.mec.education.resp.AttendClassResp">
 
      SELECT
-	s.music_group_id_,s.class_group_id_,s.user_id_,s.teacher_id_,s.current_class_times_,s.status_,g.name_,g.total_class_times_,g.type_,g.teach_mode_,u.real_name_,c.name_ as coureName,c.class_date_,c.start_class_time_,c.end_class_time_
+	s.music_group_id_,s.class_group_id_,s.user_id_,s.teacher_id_,s.current_class_times_,s.status_,g.name_,g.total_class_times_,g.type_,g.teach_mode_,u.real_name_,c.name_ as courseName,c.class_date_,c.start_class_time_,c.end_class_time_
     FROM
 	student_attendance s
     LEFT JOIN course_schedule c