Browse Source

Merge remote-tracking branch 'origin/master'

weifanli 3 years ago
parent
commit
839ac6120e
32 changed files with 1501 additions and 78 deletions
  1. 92 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/CourseGroupController.java
  2. 39 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseGroupDao.java
  3. 7 6
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseScheduleDao.java
  4. 8 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseScheduleRepliedDao.java
  5. 1 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/LiveCourseGroupDto.java
  6. 17 6
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/HomeworkAdminSearch.java
  7. 112 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/LiveCourseGroupSearch.java
  8. 76 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/LiveCourseGroupStudentSearch.java
  9. 22 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/MyCourseSearch.java
  10. 5 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/CourseGroupEnum.java
  11. 30 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CourseGroupService.java
  12. 2 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CourseRepliedService.java
  13. 6 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CourseScheduleService.java
  14. 8 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/LiveRoomService.java
  15. 126 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseGroupServiceImpl.java
  16. 9 7
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseRepliedServiceImpl.java
  17. 62 8
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseScheduleServiceImpl.java
  18. 2 21
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/LiveRoomServiceImpl.java
  19. 101 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/CourseRepliedVo.java
  20. 158 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/CourseStudent.java
  21. 113 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/LiveCourseGroupPlanVo.java
  22. 75 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/LiveCourseGroupStudentVo.java
  23. 143 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/LiveCourseGroupVo.java
  24. 22 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/MyRepliedVo.java
  25. 125 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseGroupMapper.xml
  26. 13 13
      cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseHomeworkMapper.xml
  27. 61 7
      cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  28. 26 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleRepliedMapper.xml
  29. 6 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/PracticeMapper.xml
  30. 2 1
      cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/CourseScheduleController.java
  31. 2 1
      cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/CourseRepliedController.java
  32. 30 2
      cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/CourseScheduleController.java

+ 92 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/CourseGroupController.java

@@ -0,0 +1,92 @@
+package com.yonge.cooleshow.admin.controller;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.dto.CheckCourseTimeDto;
+import com.yonge.cooleshow.biz.dal.dto.LiveCourseGroupDto;
+import com.yonge.cooleshow.biz.dal.dto.search.LiveCourseGroupSearch;
+import com.yonge.cooleshow.biz.dal.dto.search.LiveCourseGroupStudentSearch;
+import com.yonge.cooleshow.biz.dal.entity.AlbumFavorite;
+import com.yonge.cooleshow.biz.dal.entity.CourseTimeEntity;
+import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
+import com.yonge.cooleshow.biz.dal.service.CourseGroupService;
+import com.yonge.cooleshow.biz.dal.support.PageUtil;
+import com.yonge.cooleshow.biz.dal.vo.*;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.cooleshow.common.page.PageInfo;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 课程组表(CourseGroup)表控制层
+ *
+ * @author hgw
+ * @since 2022-03-18 15:29:10
+ */
+@Api(tags = "课程组表")
+@RestController
+@RequestMapping("/courseGroup")
+public class CourseGroupController extends BaseController {
+    /**
+     * 服务对象
+     */
+    @Resource
+    private CourseGroupService courseGroupService;
+
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "直播课列表", httpMethod="POST", consumes="application/json", produces="application/json")
+    @PostMapping(value="/live/list", consumes="application/json", produces="application/json")
+    public HttpResponseResult<PageInfo<LiveCourseGroupVo>> list(@Valid @RequestBody LiveCourseGroupSearch query) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        query.setCourseType(CourseScheduleEnum.LIVE);
+
+        IPage<LiveCourseGroupVo> liveCourseGroupVoIPage = courseGroupService
+                .selectAdminLivePage(PageUtil.getPage(query), query);
+        return succeed(PageUtil.pageInfo(liveCourseGroupVoIPage));
+    }
+
+    @ApiOperation(value = "直播课购买学员信息", httpMethod="POST", consumes="application/json", produces="application/json")
+    @PostMapping(value="/live/student", consumes="application/json", produces="application/json")
+    public HttpResponseResult<PageInfo<LiveCourseGroupStudentVo>> student(@Valid @RequestBody LiveCourseGroupStudentSearch query) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+
+        IPage<LiveCourseGroupStudentVo> liveCourseGroupVoIPage = courseGroupService
+                .selectAdminLiveStudentPage(PageUtil.getPage(query), query);
+        return succeed(PageUtil.pageInfo(liveCourseGroupVoIPage));
+    }
+
+
+    @ApiOperation(value = "教学计划")
+    @PostMapping(value="/live/{courseGroupId}")
+    public HttpResponseResult<List<LiveCourseGroupPlanVo>> student(@ApiParam(value = "课程组编号ID", required = true)
+                                                                              @PathVariable("courseGroupId") Long courseGroupId) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null || sysUser.getId() == null) {
+            return failed("用户信息获取失败");
+        }
+        if (courseGroupId == null) {
+            return failed("课程组id不能为空");
+        }
+
+        List<LiveCourseGroupPlanVo> LiveCourseGroupPlanVoList = courseGroupService.selectAdminLivePlan(courseGroupId);
+        return succeed(LiveCourseGroupPlanVoList);
+    }
+}
+

+ 39 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseGroupDao.java

@@ -3,7 +3,12 @@ package com.yonge.cooleshow.biz.dal.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.yonge.cooleshow.biz.dal.dto.search.LiveCourseGroupSearch;
+import com.yonge.cooleshow.biz.dal.dto.search.LiveCourseGroupStudentSearch;
 import com.yonge.cooleshow.biz.dal.entity.CourseGroup;
+import com.yonge.cooleshow.biz.dal.vo.LiveCourseGroupPlanVo;
+import com.yonge.cooleshow.biz.dal.vo.LiveCourseGroupStudentVo;
+import com.yonge.cooleshow.biz.dal.vo.LiveCourseGroupVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -24,5 +29,39 @@ public interface CourseGroupDao extends BaseMapper<CourseGroup> {
      */
     <T> IPage<T> queryTeacherCourseGroup(Page<T> page, @Param("param") Map<String, Object> param);
 
+    /**
+     * 平台方 老师详情直播课列表
+     *
+     * @param page  分页信息
+     * @param query 查询条件
+     * @return page
+     */
+    IPage<LiveCourseGroupVo> selectAdminLivePage(@Param("page") IPage<LiveCourseGroupVo> page, @Param(
+            "param") LiveCourseGroupSearch query);
+
+    /**
+     * 获取课程组声部
+     *
+     * @param courseGroupIdList 课程组id集合
+     * @return 声部信息
+     */
+    List<LiveCourseGroupVo> selectCourseGroupSubject(@Param("courseGroupIdList") List<Long> courseGroupIdList);
+
+    /**
+     * 直播课购买学生信息
+     *
+     * @param page  分页
+     * @param query 查询条件
+     * @return page
+     */
+    IPage<LiveCourseGroupStudentVo> selectAdminLiveStudentPage(@Param("page") IPage<LiveCourseGroupStudentVo> page, @Param("param") LiveCourseGroupStudentSearch query);
+
+    /**
+     * 直播课程详情 课程计划
+     *
+     * @param courseGroupId 课程组id
+     * @return
+     */
+    List<LiveCourseGroupPlanVo> selectAdminLivePlan(@Param("courseGroupId") Long courseGroupId);
 }
 

+ 7 - 6
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseScheduleDao.java

@@ -7,14 +7,12 @@ import com.yonge.cooleshow.biz.dal.dto.search.HomeworkSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.MyCourseSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonGroupSearch;
 import com.yonge.cooleshow.biz.dal.entity.CourseSchedule;
-import com.yonge.cooleshow.biz.dal.vo.MyCourseVo;
-import com.yonge.cooleshow.biz.dal.vo.StudentTotalVo;
-import com.yonge.cooleshow.biz.dal.vo.TeacherTotalVo;
-import com.yonge.cooleshow.biz.dal.vo.VideoLessonGroupVo;
+import com.yonge.cooleshow.biz.dal.vo.*;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * 老师课程表(CourseSchedule)表数据库访问层
@@ -84,12 +82,15 @@ public interface CourseScheduleDao extends BaseMapper<CourseSchedule> {
     Integer countTeacherNoDecorateHomework(@Param("param") HomeworkSearch param);
 
     //查询老师约课日历
-    List<String> queryCourseSchedule(MyCourseSearch search);
+    Set<String> queryCourseSchedule(MyCourseSearch search);
 
     //根据学生id查询老师
     List<MyCourseVo> queryStudentPracticeCourse(IPage<MyCourseVo> page, @Param("param") MyCourseSearch search);
 
     //查询学生约课日历
-    List<String> queryCourseScheduleStudent(MyCourseSearch search);
+    Set<String> queryCourseScheduleStudent(MyCourseSearch search);
+
+    //老师端-课表-日历-用户
+    List<CourseStudent> queryCourseUser(@Param("param") MyCourseSearch search);
 }
 

+ 8 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseScheduleRepliedDao.java

@@ -5,6 +5,7 @@ import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yonge.cooleshow.biz.dal.dto.search.MyCourseSearch;
+import com.yonge.cooleshow.biz.dal.vo.CourseRepliedVo;
 import com.yonge.cooleshow.biz.dal.vo.MyRepliedVo;
 import org.apache.ibatis.annotations.Param;
 import com.yonge.cooleshow.biz.dal.entity.CourseScheduleReplied;
@@ -51,4 +52,11 @@ public interface CourseScheduleRepliedDao extends BaseMapper<CourseScheduleRepli
 	 * @Date: 2022/4/13
 	 */
 	void insertReplied(@Param("param") CourseScheduleReplied replied);
+
+	/**
+	 * @Description: 查询评价详情
+	 * @Author: cy
+	 * @Date: 2022/4/19
+	 */
+    CourseRepliedVo selectReplied(CourseScheduleReplied replied);
 }

+ 1 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/LiveCourseGroupDto.java

@@ -28,6 +28,7 @@ public class LiveCourseGroupDto implements Serializable {
     private Long teacherId;
 
     @NotNull(message = "课程组名称不能为空")
+    @Size(max = 50, message = "课程组名称长度不能超过50个字")
     @ApiModelProperty(value = "课程组名称")
     private String name;
 

+ 17 - 6
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/HomeworkAdminSearch.java

@@ -17,8 +17,11 @@ import java.util.Date;
  */
 public class HomeworkAdminSearch extends QueryInfo {
 
-    @ApiModelProperty("布置老师、学生,名称/手机号/编号")
-    private String search;
+    @ApiModelProperty("学生 名称/手机号/编号")
+    private String studentSearch;
+
+    @ApiModelProperty("布置老师 名称/手机号/编号")
+    private String teacherSearch;
 
     @ApiModelProperty("布置开始时间")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@@ -39,12 +42,20 @@ public class HomeworkAdminSearch extends QueryInfo {
     @ApiModelProperty(value = "布置作业状态 0:否,1:是",hidden = true)
     private YesOrNoEnum decorate;
 
-    public String getSearch() {
-        return search;
+    public String getStudentSearch() {
+        return studentSearch;
+    }
+
+    public void setStudentSearch(String studentSearch) {
+        this.studentSearch = studentSearch;
+    }
+
+    public String getTeacherSearch() {
+        return teacherSearch;
     }
 
-    public void setSearch(String search) {
-        this.search = search;
+    public void setTeacherSearch(String teacherSearch) {
+        this.teacherSearch = teacherSearch;
     }
 
     public Date getStartTime() {

+ 112 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/LiveCourseGroupSearch.java

@@ -0,0 +1,112 @@
+package com.yonge.cooleshow.biz.dal.dto.search;
+
+import com.yonge.cooleshow.biz.dal.enums.CourseGroupEnum;
+import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
+import com.yonge.cooleshow.common.page.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * Description  平台方 老师详情直播课列表查询条件
+ *
+ * @author liujunchi
+ * @date 2022-04-18
+ */
+@ApiModel("平台方-老师详情-直播课列表查询条件")
+public class LiveCourseGroupSearch extends QueryInfo {
+
+    @ApiModelProperty(value = "老师编号id",required = true)
+    @NotNull(message = "老师编号不能为空")
+    private Long teacherId;
+
+    @ApiModelProperty("课程编号/学员编号/学员姓名/学员手机号")
+    private String search;
+
+    @ApiModelProperty("订单号")
+    private String orderNo;
+
+    @ApiModelProperty("声部id")
+    private Long subjectId;
+
+    @ApiModelProperty("课程状态")
+    private CourseGroupEnum status;
+
+    @ApiModelProperty("开始时间")
+    private Date startTime;
+
+    @ApiModelProperty("结束时间")
+    private Date endTime;
+
+    @ApiModelProperty(value = "课程类型",hidden = true)
+    private CourseScheduleEnum courseType;
+
+    public CourseScheduleEnum getCourseType() {
+        return courseType;
+    }
+
+    public void setCourseType(CourseScheduleEnum courseType) {
+        this.courseType = courseType;
+    }
+
+    public Long getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Long teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    @Override
+    public String getSearch() {
+        return search;
+    }
+
+    @Override
+    public void setSearch(String search) {
+        this.search = search;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public Long getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Long subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public CourseGroupEnum getStatus() {
+        return status;
+    }
+
+    public void setStatus(CourseGroupEnum status) {
+        this.status = status;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+}

+ 76 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/LiveCourseGroupStudentSearch.java

@@ -0,0 +1,76 @@
+package com.yonge.cooleshow.biz.dal.dto.search;
+
+import com.yonge.cooleshow.common.page.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+
+/**
+ * Description 直播课购买学员 查询
+ *
+ * @author liujunchi
+ * @date 2022-04-18
+ */
+@ApiModel("直播课购买学员 查询")
+public class LiveCourseGroupStudentSearch extends QueryInfo {
+
+    @ApiModelProperty(value = "直播课 课程组id",required = true)
+    @NotNull(message = "课程组id不能为空")
+    private Long courseGroupId;
+
+    @ApiModelProperty("课程编号/学员编号/学员姓名/学员手机号")
+    private String search;
+
+    @ApiModelProperty("订单号")
+    private String orderNo;
+
+    @ApiModelProperty("开始时间")
+    private Date startTime;
+
+    @ApiModelProperty("结束时间")
+    private Date endTime;
+
+    public Long getCourseGroupId() {
+        return courseGroupId;
+    }
+
+    public void setCourseGroupId(Long courseGroupId) {
+        this.courseGroupId = courseGroupId;
+    }
+
+    @Override
+    public String getSearch() {
+        return search;
+    }
+
+    @Override
+    public void setSearch(String search) {
+        this.search = search;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+}

+ 22 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/MyCourseSearch.java

@@ -39,6 +39,28 @@ public class MyCourseSearch extends QueryInfo {
     @ApiModelProperty(value = "学生姓名")
     private String studentName;
 
+    @ApiModelProperty(value = "开始时间")
+    private String startDate;
+
+    @ApiModelProperty(value = "结束时间")
+    private String endDate;
+
+    public String getStartDate() {
+        return startDate;
+    }
+
+    public void setStartDate(String startDate) {
+        this.startDate = startDate;
+    }
+
+    public String getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(String endDate) {
+        this.endDate = endDate;
+    }
+
     public Long getStudentId() {
         return studentId;
     }

+ 5 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/CourseGroupEnum.java

@@ -1,6 +1,9 @@
 package com.yonge.cooleshow.biz.dal.enums;
 
-public enum CourseGroupEnum{
+import com.baomidou.mybatisplus.annotation.EnumValue;
+import com.yonge.cooleshow.common.enums.BaseEnum;
+
+public enum CourseGroupEnum implements BaseEnum<String,CourseGroupEnum> {
     ING("ING", "进行中"),
     COMPLETE("COMPLETE", "已完成"),
     DISSOLVE("DISSOLVE", "未成课"),//解散课程
@@ -8,6 +11,7 @@ public enum CourseGroupEnum{
     APPLY("APPLY", "报名中"),
     NOT_SALE("NOT_SALE", "未开售");
 
+    @EnumValue
     private String code;
 
     private String msg;

+ 30 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CourseGroupService.java

@@ -1,13 +1,15 @@
 package com.yonge.cooleshow.biz.dal.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.yonge.cooleshow.biz.dal.dao.CourseGroupDao;
 import com.yonge.cooleshow.biz.dal.dto.CheckCourseTimeDto;
 import com.yonge.cooleshow.biz.dal.dto.LiveCourseGroupDto;
+import com.yonge.cooleshow.biz.dal.dto.search.LiveCourseGroupSearch;
+import com.yonge.cooleshow.biz.dal.dto.search.LiveCourseGroupStudentSearch;
 import com.yonge.cooleshow.biz.dal.entity.CourseGroup;
 import com.yonge.cooleshow.biz.dal.entity.CourseTimeEntity;
-import com.yonge.cooleshow.biz.dal.vo.CourseGroupVo;
-import com.yonge.cooleshow.biz.dal.vo.LiveCourseInfoVo;
+import com.yonge.cooleshow.biz.dal.vo.*;
 import com.yonge.cooleshow.common.page.PageInfo;
 import org.redisson.api.RMap;
 
@@ -62,5 +64,31 @@ public interface CourseGroupService extends IService<CourseGroup> {
      */
     RMap<Long, List<CourseTimeEntity>> getLiveLockTimeCache(Long teacherId);
 
+    /**
+     * 平台方 老师详情直播课列表
+     *
+     * @param page 分页
+     * @param query 查询条件
+     * @return page
+     */
+    IPage<LiveCourseGroupVo> selectAdminLivePage(IPage<LiveCourseGroupVo> page, LiveCourseGroupSearch query);
+
+    /**
+     * 课程详情 购买学生
+     *
+     * @param page 分页
+     * @param query 查询条件
+     * @return page
+     */
+    IPage<LiveCourseGroupStudentVo> selectAdminLiveStudentPage(IPage<LiveCourseGroupStudentVo> page,
+                                                               LiveCourseGroupStudentSearch query);
+
+    /**
+     * 直播课程详情 课程计划
+     *
+     * @param courseGroupId 课程组id
+     * @return
+     */
+    List<LiveCourseGroupPlanVo> selectAdminLivePlan(Long courseGroupId);
 }
 

+ 2 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CourseRepliedService.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dto.search.MyCourseSearch;
 import com.yonge.cooleshow.biz.dal.entity.CourseScheduleReplied;
+import com.yonge.cooleshow.biz.dal.vo.CourseRepliedVo;
 import com.yonge.cooleshow.biz.dal.vo.MyRepliedVo;
 
 /**
@@ -14,7 +15,7 @@ import com.yonge.cooleshow.biz.dal.vo.MyRepliedVo;
 public interface CourseRepliedService extends IService<CourseScheduleReplied> {
     void replied(CourseScheduleReplied replied, SysUser sysUser);
 
-    CourseScheduleReplied selectReplied(CourseScheduleReplied replied);
+    CourseRepliedVo selectReplied(CourseScheduleReplied replied);
 
     IPage<MyRepliedVo> myReplied(IPage<MyRepliedVo> page, MyCourseSearch search);
 }

+ 6 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CourseScheduleService.java

@@ -7,6 +7,7 @@ import com.yonge.cooleshow.biz.dal.dto.search.HomeworkSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.MyCourseSearch;
 import com.yonge.cooleshow.biz.dal.entity.CourseCalendarEntity;
 import com.yonge.cooleshow.biz.dal.entity.CourseSchedule;
+import com.yonge.cooleshow.biz.dal.vo.CourseStudent;
 import com.yonge.cooleshow.biz.dal.vo.MyCourseVo;
 import com.yonge.cooleshow.biz.dal.vo.TeacherLiveCourseInfoVo;
 import com.yonge.cooleshow.common.page.PageInfo;
@@ -15,6 +16,7 @@ import javax.validation.Valid;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.function.Function;
 
 /**
@@ -152,7 +154,7 @@ public interface CourseScheduleService extends IService<CourseSchedule> {
      */
     Integer countTeacherNoDecorateHomework(HomeworkSearch homeworkSearch);
 
-    List<String> queryCourseSchedule(MyCourseSearch search);
+    Set<String> queryCourseSchedule(MyCourseSearch search);
 
     IPage<MyCourseVo> queryStudentPracticeCourse(IPage<MyCourseVo> page, MyCourseSearch search);
 
@@ -165,7 +167,7 @@ public interface CourseScheduleService extends IService<CourseSchedule> {
      */
     boolean checkTeacherCourseSchedule(Long teacherId, Long courseId);
 
-    List<String> queryCourseScheduleStudent(MyCourseSearch search);
+    Set<String> queryCourseScheduleStudent(MyCourseSearch search);
 
     /**
      * 检查学生是否购买课程
@@ -175,5 +177,7 @@ public interface CourseScheduleService extends IService<CourseSchedule> {
      * @return boolean true 购买
      */
     boolean checkStudentCourseSchedule(Long studentId, Long courseId);
+
+    Map<String,Object> queryCourseUser(MyCourseSearch search);
 }
 

+ 8 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/LiveRoomService.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.biz.dal.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.yonge.cooleshow.biz.dal.dao.LiveRoomDao;
+import com.yonge.cooleshow.biz.dal.entity.ImRoomMessage;
 import com.yonge.cooleshow.biz.dal.entity.LiveRoom;
 import com.yonge.cooleshow.biz.dal.entity.RoomInfoCache;
 import com.yonge.cooleshow.biz.dal.entity.RoomUserInfoCache;
@@ -69,6 +70,13 @@ public interface LiveRoomService extends IService<LiveRoom> {
     List<RoomUserInfoCache> queryRoomUserInfo(String roomUid);
 
     /**
+     * 发送消息
+     *
+     * @param message
+     */
+    void publishRoomMessage(ImRoomMessage message);
+
+    /**
      * 方便测试观察房间数据的方法
      */
     Map<String, Object> test(String roomUid);

+ 126 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseGroupServiceImpl.java

@@ -1,4 +1,6 @@
 package com.yonge.cooleshow.biz.dal.service.impl;
+import java.math.BigDecimal;
+import java.util.Date;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -12,11 +14,15 @@ import com.yonge.cooleshow.biz.dal.dao.CourseGroupDao;
 import com.yonge.cooleshow.biz.dal.dto.CheckCourseTimeDto;
 import com.yonge.cooleshow.biz.dal.dto.LiveCourseGroupDto;
 import com.yonge.cooleshow.biz.dal.dto.LiveCourseGroupDto.CoursePlanDto;
+import com.yonge.cooleshow.biz.dal.dto.search.LiveCourseGroupSearch;
+import com.yonge.cooleshow.biz.dal.dto.search.LiveCourseGroupStudentSearch;
 import com.yonge.cooleshow.biz.dal.entity.*;
 import com.yonge.cooleshow.biz.dal.enums.CourseGroupEnum;
 import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
 import com.yonge.cooleshow.biz.dal.service.*;
 import com.yonge.cooleshow.biz.dal.support.PageUtil;
+import com.yonge.cooleshow.biz.dal.vo.*;
+import com.yonge.cooleshow.biz.dal.support.WrapperUtil;
 import com.yonge.cooleshow.biz.dal.vo.CourseGroupVo;
 import com.yonge.cooleshow.biz.dal.vo.LiveCourseInfoVo;
 import com.yonge.cooleshow.common.constant.SysConfigConstant;
@@ -32,6 +38,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import rx.subjects.Subject;
 
 import java.time.LocalDate;
 import java.util.*;
@@ -258,6 +265,22 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
     }
 
     /**
+     * 批量检查学生课时在数据库是否重复
+     *
+     * @param studentId 老师id
+     * @param timeList  时间集合
+     */
+    private <T> void batchCheckStudentCourseTime(Long studentId, List<T> timeList, Function<T, Date> startTimeFun, Function<T, Date> endTimeFun) {
+        //再校验数据库中课程时间和传入时间是否有交集
+        timeList.forEach(o -> {
+            boolean checkDataTime = courseScheduleService.checkStudentCourseTime(studentId, startTimeFun.apply(o), endTimeFun.apply(o));
+            if (checkDataTime) {
+                throw new BizException("预计安排在" + DateUtil.dateToString(startTimeFun.apply(o), "yyyy年MM月dd号 HH点mm分") + "的课程时间存在冲突!");
+            }
+        });
+    }
+
+    /**
      * 自动排课
      * <p>自动排课规则及场景:总5节课,填入2节,需要自动补3节
      * <p>1.把前面2节课的时间循环+1周直到填满5节课为止
@@ -420,6 +443,109 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
         return redissonClient.getMap(key);
     }
 
+    @Override
+    public IPage<LiveCourseGroupVo> selectAdminLivePage(IPage<LiveCourseGroupVo> page, LiveCourseGroupSearch query) {
+
+        IPage<LiveCourseGroupVo> liveCourseGroupVoIPage = baseMapper.selectAdminLivePage(page, query);
+        List<LiveCourseGroupVo> records = liveCourseGroupVoIPage.getRecords();
+
+        if (CollectionUtils.isEmpty(records)) {
+            return liveCourseGroupVoIPage;
+        }
+        List<Long> courseGroupIdList = records.stream()
+                                              .map(LiveCourseGroupVo::getCourseGroupId)
+                                              .collect(Collectors.toList());
+
+        // 获取课程组声部
+        List<LiveCourseGroupVo> subjectList = baseMapper.selectCourseGroupSubject(courseGroupIdList);
+        for (int i = 0; i < records.size(); i++) {
+            records.get(i).setSubjectName(subjectList.get(i).getSubjectName());
+        }
+
+        return liveCourseGroupVoIPage;
+    }
+
+    @Override
+    public IPage<LiveCourseGroupStudentVo> selectAdminLiveStudentPage(IPage<LiveCourseGroupStudentVo> page,
+                                                                      LiveCourseGroupStudentSearch query) {
+        return baseMapper.selectAdminLiveStudentPage(page, query);
+    }
+
+    @Override
+    public List<LiveCourseGroupPlanVo> selectAdminLivePlan(Long courseGroupId) {
+
+        return baseMapper.selectAdminLivePlan(courseGroupId);
+    }
+
+    /**
+     * 学生购买直播课程组
+     *
+     * @param param 传入参数
+     *              <p> - groupId    直播课程组id
+     *              <p> - studentId    学员id
+     */
+    public void buyLiveCourse(Map<String, Object> param) {
+        Long studentId = WrapperUtil.toLong(param, "studentId", "学员id不能为空!");
+        Long groupId = WrapperUtil.toLong(param, "groupId", "课程组id不能为空!");
+        //学生信息
+        getSysUser(studentId);
+        //课程组信息
+        CourseGroup liveCourseGroup = this.getOne(Wrappers.<CourseGroup>lambdaQuery()
+                .eq(CourseGroup::getId, groupId)
+                .eq(CourseGroup::getType, CourseScheduleEnum.LIVE.getCode())
+        );
+        if (Objects.isNull(liveCourseGroup)) {
+            throw new BizException("课程组不存在!");
+        }
+        //课程信息
+        List<CourseSchedule> courseList = courseScheduleService.list(Wrappers.<CourseSchedule>lambdaQuery()
+                .eq(CourseSchedule::getCourseGroupId, groupId)
+        );
+        if (CollectionUtils.isEmpty(courseList)) {
+            throw new BizException("课程组课程不存在!");
+        }
+        //校验购买的课程组每节课时间是否和自己的课时冲突
+        batchCheckStudentCourseTime(studentId, courseList, CourseSchedule::getStartTime, CourseSchedule::getEndTime);
+        //todo 写订单 返回订单号数据(订单号 金额 等等)
+        String orderNo = "";
+        Date now = new Date();
+        //写course_schedule_student_payment表 作为记录锁定时间用,防止重复购买,如果支付失败则删除该数据
+        List<CourseScheduleStudentPayment> studentPaymentList = new ArrayList<>();
+        courseList.forEach(course -> {
+            CourseScheduleStudentPayment studentPayment = new CourseScheduleStudentPayment();
+            studentPayment.setUserId(studentId);
+            studentPayment.setCourseGroupId(groupId);
+            studentPayment.setCourseId(course.getId());
+            studentPayment.setOrderNo(orderNo);
+            studentPayment.setOriginalPrice(liveCourseGroup.getCoursePrice());
+            studentPayment.setExpectPrice(liveCourseGroup.getCoursePrice());
+            studentPayment.setActualPrice(liveCourseGroup.getCoursePrice());
+            studentPayment.setCreatedTime(now);
+            studentPayment.setUpdatedTime(now);
+            studentPayment.setCourseType(liveCourseGroup.getType());
+            studentPaymentList.add(studentPayment);
+        });
+        courseScheduleStudentPaymentService.getDao().insertBatch(studentPaymentList);
+    }
+
+    /**
+     * 学生购买直播课程成功-回调成功
+     */
+    public void buyLiveCourseSuccess() {
+        //写course_group表 pre_student_num_(预计上课人数) +1
+        //写入课酬表计算-根据课程组总金额计算分配到每节课的金额
+        //修改订单为成功
+    }
+
+    /**
+     * 学生购买直播课失败-回调
+     */
+    public void buyLiveCourseFailed() {
+        //修改 course_group表 pre_student_num_(预计上课人数) - 1
+        //删除 course_schedule_student_payment表 数据
+        //修改订单为失败
+    }
+
     private SysUser getSysUser(Long userId) {
         return Optional.ofNullable(userId)
                 .map(sysUserFeignService::queryUserById)

+ 9 - 7
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseRepliedServiceImpl.java

@@ -13,6 +13,7 @@ import com.yonge.cooleshow.biz.dal.entity.CourseScheduleReplied;
 import com.yonge.cooleshow.biz.dal.entity.CourseScheduleStudentPayment;
 import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
 import com.yonge.cooleshow.biz.dal.service.CourseRepliedService;
+import com.yonge.cooleshow.biz.dal.vo.CourseRepliedVo;
 import com.yonge.cooleshow.biz.dal.vo.MyRepliedVo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -123,13 +124,14 @@ public class CourseRepliedServiceImpl extends ServiceImpl<CourseScheduleRepliedD
      * @Date: 2022/4/12
      */
     @Override
-    public CourseScheduleReplied selectReplied(CourseScheduleReplied replied) {
-        QueryWrapper<CourseScheduleReplied> wrapper = new QueryWrapper<>();
-        wrapper.eq("course_group_type_", CourseScheduleEnum.PRACTICE);
-        wrapper.eq("student_id_", replied.getStudentId());
-        wrapper.eq("course_schedule_id_", replied.getCourseScheduleId());
-        wrapper.eq("course_group_id_", replied.getCourseGroupId());
-        return repliedDao.selectOne(wrapper);
+    public CourseRepliedVo selectReplied(CourseScheduleReplied replied) {
+//        QueryWrapper<CourseScheduleReplied> wrapper = new QueryWrapper<>();
+//        wrapper.eq("course_group_type_", CourseScheduleEnum.PRACTICE);
+//        wrapper.eq("student_id_", replied.getStudentId());
+//        wrapper.eq("course_schedule_id_", replied.getCourseScheduleId());
+//        wrapper.eq("course_group_id_", replied.getCourseGroupId());
+        CourseRepliedVo repliedVo=repliedDao.selectReplied(replied);
+        return repliedVo;
     }
 
     /**

+ 62 - 8
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseScheduleServiceImpl.java

@@ -17,6 +17,7 @@ import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
 import com.yonge.cooleshow.biz.dal.service.*;
 import com.yonge.cooleshow.biz.dal.support.PageUtil;
 import com.yonge.cooleshow.biz.dal.support.WrapperUtil;
+import com.yonge.cooleshow.biz.dal.vo.CourseStudent;
 import com.yonge.cooleshow.biz.dal.vo.MyCourseVo;
 import com.yonge.cooleshow.biz.dal.vo.TeacherLiveCourseInfoVo;
 import com.yonge.cooleshow.common.constant.SysConfigConstant;
@@ -90,7 +91,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         if (StringUtils.isNotBlank(status)) {
             CourseScheduleEnum.existCourseState(status, "查询条件错误,课程状态不正确");
         }
-        param.put("status",status);
+        param.put("status", status);
         String classDate = WrapperUtil.toStr(param, "classDate", "查询时间不能为空!");
         //本月的第一天
         LocalDate firstDay;
@@ -257,7 +258,9 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         Integer month = WrapperUtil.toInt(param, "month", "日历的时间月份不能为空!");
         Integer day = WrapperUtil.toInt(param, "month", "日历的时间日期不能为空!");
         Integer singleCourseMinutes = WrapperUtil.toInt(param, "singleCourseMinutes", "单课时时长不能为空!");
-
+        if (singleCourseMinutes < 25) {
+            throw new BizException("单课时时长不能小于25分钟!");
+        }
         //传入的日期+1天开始
         LocalDate firstDay = LocalDate.of(year, month, day).plusDays(1L);
         //根据firstDay计算出该月的最后一天
@@ -628,6 +631,10 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
      * <p>
      * 老师端-课表
      * search:{"classDate":"2022-03-27"}
+     * search:{"classMonth":"2022-03"}
+     * <p>
+     * 老师端-课表-陪练课
+     * search:{"classDate":"2022-03-27"}
      *
      * @Description: 根据老师id查询购课学员
      * @Author: cy
@@ -655,7 +662,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
                 search.setRepliedIds(studentList);
             }
         }
-        return page.setRecords(baseMapper.queryTeacherPracticeCourse(page, search));
+        return page.setRecords(baseMapper.queryTeacherPracticeCourse(page, monthToDate(search)));
     }
 
     @Override
@@ -666,12 +673,34 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
     }
 
     /**
+     * 按月份计算开始结束日期
+     *
+     * @param search
+     * @return
+     */
+    public MyCourseSearch monthToDate(MyCourseSearch search) {
+        String classMonth = search.getClassMonth();
+        String[] classDateSp = classMonth.split("-");
+        LocalDate firstDay;
+        try {
+            firstDay = LocalDate.of(Integer.parseInt(classDateSp[0]), Integer.parseInt(classDateSp[1]), 1);
+        } catch (Exception e) {
+            throw new BizException("查询时间格式不正确 [" + classMonth + "]");
+        }
+        //本月的最后一天
+        LocalDate lastDay = firstDay.with(TemporalAdjusters.lastDayOfMonth());
+        search.setStartDate(firstDay.toString());
+        search.setEndDate(lastDay.toString());
+        return search;
+    }
+
+    /**
      * @Description: 查询老师约课日历
      * @Author: cy
      * @Date: 2022/4/13
      */
-    public List<String> queryCourseSchedule(MyCourseSearch search) {
-        return baseMapper.queryCourseSchedule(search);
+    public Set<String> queryCourseSchedule(MyCourseSearch search) {
+        return baseMapper.queryCourseSchedule(monthToDate(search));
     }
 
     /**
@@ -680,7 +709,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
      * @Date: 2022/4/13
      */
     public IPage<MyCourseVo> queryStudentPracticeCourse(IPage<MyCourseVo> page, MyCourseSearch search) {
-        return page.setRecords(baseMapper.queryStudentPracticeCourse(page, search));
+        return page.setRecords(baseMapper.queryStudentPracticeCourse(page, monthToDate(search)));
     }
 
     @Override
@@ -694,8 +723,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
      * @Author: cy
      * @Date: 2022/4/14
      */
-    public List<String> queryCourseScheduleStudent(MyCourseSearch search) {
-        return baseMapper.queryCourseScheduleStudent(search);
+    public Set<String> queryCourseScheduleStudent(MyCourseSearch search) {
+        return baseMapper.queryCourseScheduleStudent(monthToDate(search));
     }
 
     @Override
@@ -705,5 +734,30 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         return courseScheduleStudentPayment != null && studentId.equals(courseScheduleStudentPayment.getUserId());
 
     }
+
+    /**
+     * @Description: 老师端-课表-日历-用户
+     * @Author: cy
+     * @Date: 2022/4/18
+     */
+    @Override
+    public Map<String,Object> queryCourseUser(MyCourseSearch search) {
+        List<CourseStudent> studentList = baseMapper.queryCourseUser(search);
+
+        Map<String, String> sysConfig = new HashMap<>();
+        //提前XX分钟创建/进入陪练课房间时间
+        sysConfig.put("practiceStartTime",sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_PRACTICE_ROOM_MINUTE));
+        //陪练课结束后,XX分钟关闭房间
+        sysConfig.put("practiceEndTime",sysConfigService.findConfigValue(SysConfigConstant.DESTROY_EXPIRED_PRACTICE_ROOM_MINUTE));
+        //提前XX分钟创建/进入直播房间的时间
+        sysConfig.put("liveStartTime",sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_LIVE_ROOM_MINUTE));
+        //直播结束后,XX分钟关闭房间
+        sysConfig.put("liveEndTime",sysConfigService.findConfigValue(SysConfigConstant.DESTROY_EXPIRED_LIVE_ROOM_MINUTE));
+
+        Map map=new HashMap();
+        map.put("sysConfig",sysConfig);
+        map.put("studentList",studentList);
+        return map;
+    }
 }
 

+ 2 - 21
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/LiveRoomServiceImpl.java

@@ -391,7 +391,8 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
      *
      * @param message
      */
-    private void publishRoomMessage(ImRoomMessage message) {
+    @Override
+    public void publishRoomMessage(ImRoomMessage message) {
         String msgStr = JSONObject.toJSONString(message);
         log.info("publishRoomMessage message : {}", msgStr);
         IMApiResultInfo resultInfo;
@@ -406,26 +407,6 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
         log.info("publishRoomMessage success: {}", msgStr);
     }
 
-    /**
-     * 学生购买直播课程
-     *
-     * @param param 传入参数
-     *              <p> - groupId    直播课程组id
-     *              <p> - studentId    学员id
-     *              <p> - price 价格
-     */
-    public void buyLiveCourse(Map<String, Object> param) {
-        //锁定课程时间
-
-    }
-
-    /**
-     * 学生购买直播课程成功-回调成功
-     */
-    public void buyLiveCourseSuccess() {
-
-    }
-
     private SysUser getSysUser(Long userId) {
         return Optional.ofNullable(userId)
                 .map(sysUserFeignService::queryUserById)

+ 101 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/CourseRepliedVo.java

@@ -0,0 +1,101 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import com.yonge.cooleshow.biz.dal.entity.CourseScheduleReplied;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+
+/**
+ * @Author: cy
+ * @Date: 2022/4/19
+ */
+@ApiModel(value = "CourseRepliedVo")
+public class CourseRepliedVo extends CourseScheduleReplied {
+    @ApiModelProperty("用户名")
+    private String userName;
+
+    @ApiModelProperty("头像地址")
+    private String avatar;
+
+    @ApiModelProperty("上课日期")
+    private String classDate;
+
+    @ApiModelProperty("上课时间")
+    private String startTime;
+
+    @ApiModelProperty("下课时间")
+    private String endTime;
+
+    @ApiModelProperty("课程状态 NOT_START未开始 ING进行中 COMPLETE已完成 CANCEL已取消")
+    private String status;
+
+    @ApiModelProperty("声部id")
+    private Integer subjectId;
+
+    @ApiModelProperty("声部名称")
+    private String subjectName;
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public String getClassDate() {
+        return classDate;
+    }
+
+    public void setClassDate(String classDate) {
+        this.classDate = classDate;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+}

+ 158 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/CourseStudent.java

@@ -0,0 +1,158 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Author: cy
+ * @Date: 2022/4/18
+ */
+@ApiModel(value = "CourseStudent")
+public class CourseStudent implements Serializable {
+    @ApiModelProperty(value = "课程id")
+    private Integer courseId;
+
+    @ApiModelProperty(value = "课程组id")
+    private Integer courseGoupId;
+
+    @ApiModelProperty(value = "上课日期")
+    private Date classDate;
+
+    @ApiModelProperty(value = "上课时间")
+    private Date startTime;
+
+    @ApiModelProperty(value = "下课时间")
+    private Date endTime;
+
+    @ApiModelProperty(value = "课程状态(NOT_START:未开始 ING:进行中 COMPLETE:已完成 CANCEL:已取消)")
+    private String status;
+
+    @ApiModelProperty(value = "课程类型(LIVE:直播课 PRACTICE:陪练课")
+    private String courseType;
+
+    @ApiModelProperty(value = "用户id")
+    private String userId;
+
+    @ApiModelProperty(value = "陪练课:用户名,直播课:课程名")
+    private String name;
+
+    @ApiModelProperty(value = "陪练课:用户头像,直播课:直播背景图")
+    private String cover;
+
+    @ApiModelProperty(value = "直播课购课人数")
+    private String payCount;
+
+    @ApiModelProperty(value = "声部id")
+    private Integer subjectId;
+
+    @ApiModelProperty(value = "声部名称")
+    private String subjectName;
+
+    public Integer getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Integer courseId) {
+        this.courseId = courseId;
+    }
+
+    public Integer getCourseGoupId() {
+        return courseGoupId;
+    }
+
+    public void setCourseGoupId(Integer courseGoupId) {
+        this.courseGoupId = courseGoupId;
+    }
+
+    public Date getClassDate() {
+        return classDate;
+    }
+
+    public void setClassDate(Date classDate) {
+        this.classDate = classDate;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getCourseType() {
+        return courseType;
+    }
+
+    public void setCourseType(String courseType) {
+        this.courseType = courseType;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getCover() {
+        return cover;
+    }
+
+    public void setCover(String cover) {
+        this.cover = cover;
+    }
+
+    public String getPayCount() {
+        return payCount;
+    }
+
+    public void setPayCount(String payCount) {
+        this.payCount = payCount;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+}
+

+ 113 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/LiveCourseGroupPlanVo.java

@@ -0,0 +1,113 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * Description 教学计划信息
+ *
+ * @author liujunchi
+ * @date 2022-04-18
+ */
+@ApiModel("教学计划信息")
+public class LiveCourseGroupPlanVo {
+
+    @ApiModelProperty("课程id")
+    private Long courseId;
+
+    @ApiModelProperty("课堂编号")
+    private Long classNum;
+
+    @ApiModelProperty("上课日期")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
+    private Date classDate;
+
+    @ApiModelProperty("上课时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date startTime;
+
+    @ApiModelProperty("下课时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date endTime;
+
+    @ApiModelProperty("课程状态 NOT_START未开始 ING进行中 COMPLETE已完成 CANCEL已取消")
+    private CourseScheduleEnum courseStatus;
+
+    @ApiModelProperty("教学计划/最多200字")
+    private String planInfo;
+
+    @ApiModelProperty("直播视频地址")
+    private String videoUrl;
+
+    public String getVideoUrl() {
+        return videoUrl;
+    }
+
+    public void setVideoUrl(String videoUrl) {
+        this.videoUrl = videoUrl;
+    }
+
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
+    public Long getClassNum() {
+        return classNum;
+    }
+
+    public void setClassNum(Long classNum) {
+        this.classNum = classNum;
+    }
+
+    public Date getClassDate() {
+        return classDate;
+    }
+
+    public void setClassDate(Date classDate) {
+        this.classDate = classDate;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public CourseScheduleEnum getCourseStatus() {
+        return courseStatus;
+    }
+
+    public void setCourseStatus(CourseScheduleEnum courseStatus) {
+        this.courseStatus = courseStatus;
+    }
+
+    public String getPlanInfo() {
+        return planInfo;
+    }
+
+    public void setPlanInfo(String planInfo) {
+        this.planInfo = planInfo;
+    }
+}

+ 75 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/LiveCourseGroupStudentVo.java

@@ -0,0 +1,75 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * Description 直播课购买学生信息
+ *
+ * @author liujunchi
+ * @date 2022-04-18
+ */
+@ApiModel("直播课签署学生信息")
+public class LiveCourseGroupStudentVo {
+
+    @ApiModelProperty("学生id")
+    private Long studentId;
+
+    @ApiModelProperty("学生姓名")
+    private String studentName;
+
+    @ApiModelProperty("支付金额")
+    private BigDecimal price;
+
+    @ApiModelProperty("订单号")
+    private String orderNo;
+
+    @ApiModelProperty("购买时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date payTime;
+
+
+    public Long getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Long studentId) {
+        this.studentId = studentId;
+    }
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+    public BigDecimal getPrice() {
+        return price;
+    }
+
+    public void setPrice(BigDecimal price) {
+        this.price = price;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public Date getPayTime() {
+        return payTime;
+    }
+
+    public void setPayTime(Date payTime) {
+        this.payTime = payTime;
+    }
+}

+ 143 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/LiveCourseGroupVo.java

@@ -0,0 +1,143 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.yonge.cooleshow.biz.dal.enums.CourseGroupEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * Description 平台方 老师详情直播课列表
+ *
+ * @author liujunchi
+ * @date 2022-04-18
+ */
+@ApiModel("平台方 老师详情直播课列表")
+public class LiveCourseGroupVo {
+
+
+    @ApiModelProperty("课程组编号")
+    private Long courseGroupId;
+
+    @ApiModelProperty("课程名称")
+    private String name;
+
+    @ApiModelProperty("课程声部")
+    private String subjectName;
+
+    @ApiModelProperty("课程数")
+    private Long courseNum;
+
+    @ApiModelProperty("已结束课时数")
+    private Integer endCourseNum;
+
+    @ApiModelProperty("未开始课程数")
+    private Integer noStartCourseNum;
+
+    @ApiModelProperty("销售价格(元)")
+    private BigDecimal coursePrice;
+
+    @ApiModelProperty("购买人数")
+    private Integer preStudentNum;
+
+    @ApiModelProperty("课程状态")
+    private CourseGroupEnum status;
+
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @ApiModelProperty("课程简介")
+    private String courseIntroduce;
+
+
+    public Long getCourseNum() {
+        return courseNum;
+    }
+
+    public void setCourseNum(Long courseNum) {
+        this.courseNum = courseNum;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getCourseIntroduce() {
+        return courseIntroduce;
+    }
+
+    public void setCourseIntroduce(String courseIntroduce) {
+        this.courseIntroduce = courseIntroduce;
+    }
+
+    public Long getCourseGroupId() {
+        return courseGroupId;
+    }
+
+    public void setCourseGroupId(Long courseGroupId) {
+        this.courseGroupId = courseGroupId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public Integer getEndCourseNum() {
+        return endCourseNum;
+    }
+
+    public void setEndCourseNum(Integer endCourseNum) {
+        this.endCourseNum = endCourseNum;
+    }
+
+    public Integer getNoStartCourseNum() {
+        return noStartCourseNum;
+    }
+
+    public void setNoStartCourseNum(Integer noStartCourseNum) {
+        this.noStartCourseNum = noStartCourseNum;
+    }
+
+    public BigDecimal getCoursePrice() {
+        return coursePrice;
+    }
+
+    public void setCoursePrice(BigDecimal coursePrice) {
+        this.coursePrice = coursePrice;
+    }
+
+    public Integer getPreStudentNum() {
+        return preStudentNum;
+    }
+
+    public void setPreStudentNum(Integer preStudentNum) {
+        this.preStudentNum = preStudentNum;
+    }
+
+    public CourseGroupEnum getStatus() {
+        return status;
+    }
+
+    public void setStatus(CourseGroupEnum status) {
+        this.status = status;
+    }
+}

+ 22 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/MyRepliedVo.java

@@ -12,6 +12,12 @@ import java.util.Date;
  */
 @ApiModel(value = "MyRepliedVo")
 public class MyRepliedVo implements Serializable {
+    @ApiModelProperty(value = "课程id")
+    private Long courseId;
+
+    @ApiModelProperty(value = "课程组id")
+    private Long courseGroupId;
+
     @ApiModelProperty(value = "用户id")
     private Long userId;
 
@@ -42,6 +48,22 @@ public class MyRepliedVo implements Serializable {
     @ApiModelProperty(value = "学员课后评价")
     private String studentReplied;
 
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
+    public Long getCourseGroupId() {
+        return courseGroupId;
+    }
+
+    public void setCourseGroupId(Long courseGroupId) {
+        this.courseGroupId = courseGroupId;
+    }
+
     public Long getUserId() {
         return userId;
     }

+ 125 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseGroupMapper.xml

@@ -89,6 +89,131 @@
         </where>
     </select>
 
+    <select id="selectAdminLivePage" resultType="com.yonge.cooleshow.biz.dal.vo.LiveCourseGroupVo">
+        select distinct
+        cg.id_ as courseGroupId,
+        cg.name_ as name,
+        cg.complete_course_num_ as endCourseNum,
+        if(cg.complete_course_num_ = 0 ,cg.course_num_,cg.course_num_ - cg.complete_course_num_) as noStartCourseNum,
+        cg.course_price_ as coursePrice,
+        cg.pre_student_num_ as preStudentNum,
+        cg.status_ as status,
+        cg.course_num_ as courseNum,
+        cg.created_time_ as createTime,
+        cg.course_introduce_ as courseIntroduce
+        from course_group cg
+        left join course_schedule_student_payment cssp on cg.id_ = cssp.course_group_id_
+        <if test="param.search != null and param.search != ''">
+            left join sys_user su on su.id_ = cssp.user_id_
+        </if>
+        <where>
+            <if test="param.teacherId != null">
+                and #{param.teacherId} = cg.teacher_id_
+            </if>
+            <if test="param.search != null and param.search !=''">
+                and  (
+                    cg.id_ like concat('%',#{param.search},'%')
+                    or su.id_ like concat('%',#{param.search},'%')
+                    or su.username_ like concat('%',#{param.search},'%')
+                    or su.phone_  like concat('%',#{param.search},'%')
+                )
+            </if>
+            <if test="param.orderNo != null and param.orderNo != ''">
+                and cssp.order_no_ like concat('%',#{param.orderNo},'%')
+            </if>
+            <if test="param.subjectId != null">
+                and #{param.subjectId} = cg.subject_id_
+            </if>
+            <if test="param.status != null">
+                and #{param.status} = cg.status_
+            </if>
+            <if test="param.startTime != null">
+                and #{param.startTime} &lt;= cg.created_time_
+            </if>
+            <if test="param.endTime != null">
+                and #{param.endTime} &gt;= cg.created_time_
+            </if>
+            <if test="param.courseType != null">
+                and #{param.courseType} = cg.type_
+            </if>
+        </where>
+        order by cg.id_ desc
+    </select>
+
+    <select id="selectCourseGroupSubject" resultType="com.yonge.cooleshow.biz.dal.vo.LiveCourseGroupVo">
+        select
+        cg.id_ as courseGroupId,
+        s.name_ as subjectName
+        from course_group cg
+        left join subject s on cg.subject_id_ = s.id_
+        <where>
+            <if test="courseGroupIdList != null and courseGroupIdList.size() != 0">
+                and cg.id_ in
+                <foreach collection="courseGroupIdList" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        <if test="courseGroupIdList != null and courseGroupIdList.size() != 0">
+            order by  field(cg.id_,
+            <foreach collection="courseGroupIdList" item="item" open="" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+    </select>
 
+    <select id="selectAdminLiveStudentPage" resultType="com.yonge.cooleshow.biz.dal.vo.LiveCourseGroupStudentVo">
+        select
+        su.id_ as studentId,
+        su.username_ as studentName,
+        cssp.actual_price_ as price,
+        cssp.order_no_ as orderNo,
+        cssp.created_time_ as payTime
+        from course_schedule_student_payment cssp
+        left join sys_user su on cssp.user_id_ = su.id_
+        <where>
+            <if test="param.courseGroupId != null">
+                and #{param.courseGroupId} = cssp.course_group_id_
+            </if>
+            <if test="param.search != null and param.search != ''">
+                and (
+                    cssp.course_group_id_ like concat('%',#{param.search},'%')
+                    or su.id_ like concat('%',#{param.search},'%')
+                    or su.username_ like concat('%',#{param.search},'%')
+                    or su.phone_ like concat('%',#{param.search},'%')
+                )
+            </if>
+            <if test="param.orderNo != null and param.orderNo != ''">
+                and cssp.order_no_ like concat('%',#{param.orderNo},'%')
+            </if>
+            <if test="param.startTime != null">
+                and #{param.startTime} &lt;= cssp.created_time_
+            </if>
+            <if test="param.endTime != null">
+                and #{param.endTime} &gt;= cssp.created_time_
+            </if>
+        </where>
+        order by  cssp.id_ desc
+    </select>
 
+    <select id="selectAdminLivePlan" resultType="com.yonge.cooleshow.biz.dal.vo.LiveCourseGroupPlanVo">
+        select
+        cs.id_ as courseId,
+        cs.class_num_ as classNum,
+        cs.class_date_ as classDate,
+        cs.start_time_ as startTime,
+        cs.end_time_ as endTime,
+        cs.status_ as courseStatus,
+        cp.plan_ as planInfo,
+        lrv.url_ as videoUrl
+        from course_schedule cs
+        left join live_room_video lrv on cs.id_ = lrv.course_id_
+        left join course_plan cp on cp.course_group_id_ = cs.course_group_id_ and cp.class_num_ = cs.class_num_
+        <where>
+            <if test="courseGroupId != null">
+                and #{courseGroupId} = cs.course_group_id_
+            </if>
+        </where>
+        order by  cs.class_num_
+    </select>
 </mapper>

+ 13 - 13
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseHomeworkMapper.xml

@@ -68,13 +68,15 @@
             <if test="param.endTime != null">
                 and #{param.endTime} &gt; ch.create_time_
             </if>
-            <if test="param.search != null and param.search != ''">
-                and (su.id_ like concat('%',#{param.search},'%')
-                    or su.username_ like concat('%',#{param.search},'%')
-                    or su.phone_ like concat('%',#{param.search},'%')
-                    or su2.id_ like concat('%',#{param.search},'%')
-                    or su2.username_ like concat('%',#{param.search},'%')
-                    or su2.phone_ like concat('%',#{param.search},'%') )
+            <if test="param.studentSearch != null and param.studentSearch != ''">
+                and ( su2.id_ like concat('%',#{param.studentSearch},'%')
+                    or su2.username_ like concat('%',#{param.studentSearch},'%')
+                    or su2.phone_ like concat('%',#{param.studentSearch},'%') )
+            </if>
+            <if test="param.teacherSearch != null and param.teacherSearch != ''">
+                and ( su.id_ like concat('%',#{param.teacherSearch},'%')
+                or su.username_ like concat('%',#{param.teacherSearch},'%')
+                or su.phone_ like concat('%',#{param.teacherSearch},'%') )
             </if>
         </where>
         order by cs.start_time_ desc
@@ -202,23 +204,21 @@
 	<select id="selectStudentInfo" resultType="com.yonge.cooleshow.biz.dal.vo.CourseHomeworkVo">
         select
         cssp.user_id_ as studentId
-        ,s.name_ as subjectName
         ,su.username_ as studentName
         ,su.avatar_ as studentAvatar
-        from course_schedule_student_payment cssp
-        left join course_group cg on cssp.course_group_id_ = cg.id_
-        left join subject s on s.id_ = cg.subject_id_
+        from course_schedule cs
+        left join  course_schedule_student_payment cssp on cssp.course_id_ = cs.id_
         left join sys_user su on cssp.user_id_ = su.id_
         <where>
             <if test="records != null and records.size() != 0">
-                and cssp.course_id_ in
+                and cs.id_ in
                 <foreach collection="records" separator="," close=")" open="(" item="item" >
                     #{item.courseId}
                 </foreach>
             </if>
         </where>
         <if test="records != null and records.size() != 0">
-            order by field(cssp.course_id_,
+            order by field(cs.id_,
             <foreach collection="records" separator="," close=")" open="" item="item" >
                 #{item.courseId}
             </foreach>

+ 61 - 7
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -166,8 +166,11 @@
         <if test="param.classDate !=null and param.classDate !=''">
             AND cs.class_date_ = #{param.classDate}
         </if>
-        <if test="param.classMonth !=null and param.classMonth !=''">
-            AND DATE_FORMAT(cs.class_date_,'%Y-%m') = #{param.classMonth}
+        <if test="param.startDate !=null and param.startDate !=''">
+            <![CDATA[ AND cs.class_date_  >= #{param.startDate} ]]>
+        </if>
+        <if test="param.endDate !=null and param.endDate !=''">
+            <![CDATA[ AND cs.class_date_  <= #{param.endDate} ]]>
         </if>
         <if test="param.repliedIds !=null">
             AND p.user_id_ IN
@@ -216,8 +219,8 @@
         FROM course_schedule_student_payment p
         LEFT JOIN course_schedule s ON p.course_id_ = s.id_
         WHERE s.teacher_id_=#{teacherId}
-        AND p.course_type_='PRACTICE'
-        AND DATE_FORMAT(s.class_date_,'%Y-%m') = #{classMonth}
+        <![CDATA[ AND s.class_date_  >= #{startDate} ]]>
+        <![CDATA[ AND s.class_date_  <= #{endDate} ]]>
     </select>
     <select id="queryStudentPracticeCourse" resultType="com.yonge.cooleshow.biz.dal.vo.MyCourseVo">
         SELECT
@@ -248,14 +251,65 @@
         <if test="param.classDate !=null and param.classDate !=''">
             AND s.class_date_ = #{param.classDate}
         </if>
-        <if test="param.classMonth !=null and param.classMonth !=''">
-            AND DATE_FORMAT(s.class_date_,'%Y-%m') = #{param.classMonth}
+        <if test="param.startDate !=null and param.startDate !=''">
+            <![CDATA[ AND s.class_date_  >= #{param.startDate} ]]>
+        </if>
+        <if test="param.endDate !=null and param.endDate !=''">
+            <![CDATA[ AND s.class_date_  <= #{param.endDate} ]]>
         </if>
     </select>
+
+    <select id="queryCourseUser" resultType="com.yonge.cooleshow.biz.dal.vo.CourseStudent">
+        SELECT
+            cs.id_ AS courseId,
+            cs.course_group_id_ AS courseGoupId,
+            cs.class_date_ AS classDate,
+            cs.start_time_ AS startTime,
+            cs.end_time_ AS endTime,
+            cs.status_ AS `status`,
+            cs.type_ AS courseType,
+            NULL AS userId,
+            CONCAT(g.name_,'-第',cs.class_num_,'课') AS name,
+            p.payCount AS payCount,
+            g.background_pic_ AS cover,
+            g.subject_id_ AS subjectId,
+            sb.name_ AS subjectName
+        FROM course_schedule cs
+        LEFT JOIN course_group g ON cs.course_group_id_ = g.id_
+        LEFT JOIN (SELECT course_id_ AS pid,count(*) AS payCount FROM course_schedule_student_payment GROUP BY course_id_ ) p ON cs.id_=p.pid
+        LEFT JOIN `subject` sb ON g.subject_id_=sb.id_
+        WHERE cs.type_='LIVE'
+        AND cs.teacher_id_=#{param.teacherId}
+        AND cs.class_date_=#{param.classDate}
+        UNION
+        SELECT
+            p.course_id_ AS courseId,
+            p.course_group_id_ AS courseGoupId,
+            cs.class_date_ AS classDate,
+            cs.start_time_ AS startTime,
+            cs.end_time_ AS endTime,
+            cs.status_ AS `status`,
+            cs.type_ AS courseType,
+            u.id_ AS userId,
+            u.username_ AS name,
+            NULL AS payCount,
+            u.avatar_ AS cover,
+            g.subject_id_ AS subjectId,
+            sb.name_ AS subjectName
+        FROM course_schedule_student_payment p
+        LEFT JOIN sys_user u ON p.user_id_ =u.id_
+        LEFT JOIN course_schedule cs ON p.course_id_=cs.id_
+        LEFT JOIN course_group g ON p.course_group_id_ = g.id_
+        LEFT JOIN `subject` sb ON g.subject_id_=sb.id_
+        WHERE p.course_id_ IN (SELECT s.id_ FROM course_schedule s WHERE s.type_='PRACTICE' AND s.teacher_id_=#{param.teacherId})
+        AND cs.class_date_=#{param.classDate}
+        ORDER BY startTime
+    </select>
     <select id="queryCourseScheduleStudent" resultType="java.lang.String"
             parameterType="com.yonge.cooleshow.biz.dal.dto.search.MyCourseSearch">
         SELECT class_date_ FROM course_schedule
         WHERE id_ IN (SELECT course_id_ FROM course_schedule_student_payment WHERE user_id_ = #{studentId} AND course_type_ = 'PRACTICE')
-        AND DATE_FORMAT(class_date_,'%Y-%m') = #{classMonth}
+        <![CDATA[ AND class_date_  >= #{startDate} ]]>
+        <![CDATA[ AND class_date_  <= #{endDate} ]]>
     </select>
 </mapper>

+ 26 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleRepliedMapper.xml

@@ -107,6 +107,8 @@
     </update>
     <select id="myReplied" resultType="com.yonge.cooleshow.biz.dal.vo.MyRepliedVo">
         SELECT
+            r.course_schedule_id_ AS courseId,
+            r.course_group_id_ AS courseGroupId,
             r.score_ AS score,
             r.student_id_ AS studentId,
             g.subject_id_ AS subjectId,
@@ -131,4 +133,28 @@
             AND DATE_FORMAT(s.class_date_,'%Y-%m') = #{param.classDate}
         </if>
     </select>
+    <select id="selectReplied" resultType="com.yonge.cooleshow.biz.dal.vo.CourseRepliedVo"
+            parameterType="com.yonge.cooleshow.biz.dal.entity.CourseScheduleReplied">
+        SELECT
+            <include refid="baseColumns"/>,
+            u.username_ AS userName,
+            u.avatar_ AS avatar,
+
+            s.class_date_ AS classDate,
+            s.start_time_ AS startTime,
+            s.end_time_ AS endTime,
+            s.status_ AS status,
+
+            g.subject_id_ AS subjectId,
+            sb.name_ AS subjectName
+        FROM course_schedule_replied t
+        LEFT JOIN sys_user u ON t.student_id_=u.id_
+        LEFT JOIN course_schedule s ON t.course_schedule_id_=s.id_
+        LEFT JOIN course_group g ON t.course_group_id_=g.id_
+        LEFT JOIN `subject` sb ON g.subject_id_=sb.id_
+        WHERE t.student_id_=#{studentId}
+        AND t.course_schedule_id_=#{courseScheduleId}
+        AND t.course_group_id_=#{courseGroupId}
+        AND t.course_group_type_=#{courseGroupType}
+    </select>
 </mapper>

+ 6 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/PracticeMapper.xml

@@ -37,6 +37,9 @@
 		<if test="null != param.subjectId">
 			AND s.id_ = #{param.subjectId}
 		</if>
+		<if test="null != param.status and '' != param.status">
+			AND cs.status_ = #{param.status}
+		</if>
 		<if test="param.startTime !=null">
 			<![CDATA[AND p.created_time_ >= #{param.startTime} ]]>
 		</if>
@@ -76,6 +79,9 @@
 		<if test="null != param.orderNo and '' != param.orderNo">
 			AND p.order_no_ = #{param.orderNo}
 		</if>
+		<if test="null != param.status and '' != param.status">
+			AND cs.status_ = #{param.status}
+		</if>
 		<if test="null != param.subjectId">
 			AND s.id_ = #{param.subjectId}
 		</if>

+ 2 - 1
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/CourseScheduleController.java

@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
+import java.util.Set;
 
 /**
  * @Author: cy
@@ -81,7 +82,7 @@ public class CourseScheduleController extends BaseController {
 
     @ApiOperation("学生端-课表-日历")
     @PostMapping("/queryCourseScheduleStudent")
-    public HttpResponseResult<List<String>> queryCourseScheduleStudent(@RequestBody MyCourseSearch search) {
+    public HttpResponseResult<Set<String>> queryCourseScheduleStudent(@RequestBody MyCourseSearch search) {
         SysUser user = sysUserFeignService.queryUserInfo();
         if (user == null || null == user.getId()) {
             return failed(HttpStatus.FORBIDDEN, "请登录");

+ 2 - 1
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/CourseRepliedController.java

@@ -8,6 +8,7 @@ import com.yonge.cooleshow.biz.dal.entity.CourseScheduleReplied;
 import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
 import com.yonge.cooleshow.biz.dal.service.CourseRepliedService;
 import com.yonge.cooleshow.biz.dal.support.PageUtil;
+import com.yonge.cooleshow.biz.dal.vo.CourseRepliedVo;
 import com.yonge.cooleshow.biz.dal.vo.MyRepliedVo;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
@@ -46,7 +47,7 @@ public class CourseRepliedController extends BaseController {
 
     @ApiOperation(value = "首页-我的课程-课程详情-查询陪练课评价")
     @PostMapping(value = "/selectReplied")
-    public HttpResponseResult<CourseScheduleReplied> selectReplied(@Validated @RequestBody CourseScheduleReplied replied) {
+    public HttpResponseResult<CourseRepliedVo> selectReplied(@Validated @RequestBody CourseScheduleReplied replied) {
         replied.setCourseGroupType(CourseScheduleEnum.PRACTICE.getCode());
         return succeed(repliedService.selectReplied(replied));
     }

+ 30 - 2
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/CourseScheduleController.java

@@ -7,6 +7,7 @@ import com.yonge.cooleshow.biz.dal.dto.search.MyCourseSearch;
 import com.yonge.cooleshow.biz.dal.entity.CourseCalendarEntity;
 import com.yonge.cooleshow.biz.dal.service.CourseScheduleService;
 import com.yonge.cooleshow.biz.dal.support.PageUtil;
+import com.yonge.cooleshow.biz.dal.vo.CourseStudent;
 import com.yonge.cooleshow.biz.dal.vo.MyCourseVo;
 import com.yonge.cooleshow.biz.dal.vo.TeacherLiveCourseInfoVo;
 import com.yonge.cooleshow.common.controller.BaseController;
@@ -25,6 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.annotation.Resource;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * 老师课程表(CourseSchedule)表控制层
@@ -83,7 +85,22 @@ public class CourseScheduleController extends BaseController {
         return succeed(courseScheduleService.createPracticeCourseCalender(param));
     }
 
-    @ApiOperation("老师端-首页-我的课程-陪练课")
+    @ApiOperation(value = "陪练课查询",
+            notes = "老师端-首页-我的课程-陪练课\n" +
+            "search:{\"classMonth\":\"2022-03\",\"status\":\"COMPLETE\",\"subjectId\":1}\n" +
+            "\n" +
+            "老师端-首页-课后评价\n" +
+            "search:{\"classMonth\":\"2022-03\",\"replied\":0,\"studentName\":\"测试王\"}\n" +
+            "\n" +
+            "老师端-我的-我的主页\n" +
+            "search:{\"classMonth\":\"2022-03\"}\n" +
+            "\n" +
+            "老师端-课表\n" +
+            "search:{\"classDate\":\"2022-03-27\"}\n" +
+            "     search:{\"classMonth\":\"2022-03\"}\n" +
+            "\n" +
+            "老师端-课表-陪练课\n" +
+            "     search:{\"classDate\":\"2022-03-27\"}")
     @PostMapping("/queryTeacherPracticeCourse")
     public HttpResponseResult<PageInfo<MyCourseVo>> queryTeacherPracticeCourse(@RequestBody MyCourseSearch search) {
         SysUser user = sysUserFeignService.queryUserInfo();
@@ -97,7 +114,7 @@ public class CourseScheduleController extends BaseController {
 
     @ApiOperation("老师端-课表-日历")
     @PostMapping("/queryCourseSchedule")
-    public HttpResponseResult<List<String>> queryCourseSchedule(@RequestBody MyCourseSearch search) {
+    public HttpResponseResult<Set<String>> queryCourseSchedule(@RequestBody MyCourseSearch search) {
         SysUser user = sysUserFeignService.queryUserInfo();
         if (user == null || null == user.getId()) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
@@ -105,5 +122,16 @@ public class CourseScheduleController extends BaseController {
         search.setTeacherId(user.getId());
         return succeed(courseScheduleService.queryCourseSchedule(search));
     }
+
+    @ApiOperation(value = "老师端-课表-日历-用户",notes = "search:{\"classDate\":\"2022-03-27\"}")
+    @PostMapping("/queryCourseUser")
+    public HttpResponseResult<Map<String,Object>> queryCourseUser(@RequestBody MyCourseSearch search) {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || null == user.getId()) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        search.setTeacherId(user.getId());
+        return succeed(courseScheduleService.queryCourseUser(search));
+    }
 }