cy 3 years ago
parent
commit
bfe58eee75
15 changed files with 544 additions and 45 deletions
  1. 37 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/PracticeController.java
  2. 3 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseScheduleDao.java
  3. 1 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseScheduleRepliedDao.java
  4. 14 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/PracticeDao.java
  5. 110 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/PracticeSearch.java
  6. 1 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CourseScheduleService.java
  7. 11 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/PracticeService.java
  8. 36 30
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseRepliedServiceImpl.java
  9. 9 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseScheduleServiceImpl.java
  10. 29 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/PracticeServiceImpl.java
  11. 168 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/PracticeVo.java
  12. 9 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  13. 14 14
      cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleRepliedMapper.xml
  14. 89 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/PracticeMapper.xml
  15. 13 0
      cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/CourseScheduleController.java

+ 37 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/PracticeController.java

@@ -0,0 +1,37 @@
+package com.yonge.cooleshow.admin.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.dto.search.PracticeSearch;
+import com.yonge.cooleshow.biz.dal.service.PracticeService;
+import com.yonge.cooleshow.biz.dal.support.PageUtil;
+import com.yonge.cooleshow.biz.dal.vo.PracticeVo;
+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.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/pactice")
+@Api(value = "陪练课")
+public class PracticeController extends BaseController {
+
+    @Autowired
+    private PracticeService pacticeService;
+
+    @ApiOperation(value = "陪练课-老师详情")
+    @PostMapping("/teacherPactice")
+    public HttpResponseResult<PageInfo<PracticeVo>> teacherPactice(@RequestBody PracticeSearch search) {
+        IPage<PracticeVo> pages = pacticeService.selectTeacherPactice(PageUtil.getPage(search), search);
+        return succeed(PageUtil.pageInfo(pages));
+    }
+
+    @ApiOperation(value = "陪练课-学生详情")
+    @PostMapping("/studentPactice")
+    public HttpResponseResult<PageInfo<PracticeVo>> studentPactice(@RequestBody PracticeSearch search) {
+        IPage<PracticeVo> pages = pacticeService.selectStudentPactice(PageUtil.getPage(search), search);
+        return succeed(PageUtil.pageInfo(pages));
+    }
+}

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseScheduleDao.java

@@ -88,5 +88,8 @@ public interface CourseScheduleDao extends BaseMapper<CourseSchedule> {
 
     //根据学生id查询老师
     List<MyCourseVo> queryStudentPracticeCourse(IPage<MyCourseVo> page, @Param("param") MyCourseSearch search);
+
+    //查询学生约课日历
+    List<String> queryCourseScheduleStudent(MyCourseSearch search);
 }
 

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

@@ -50,5 +50,5 @@ public interface CourseScheduleRepliedDao extends BaseMapper<CourseScheduleRepli
 	 * @Author: cy
 	 * @Date: 2022/4/13
 	 */
-	void insertReplied(CourseScheduleReplied replied);
+	void insertReplied(@Param("param") CourseScheduleReplied replied);
 }

+ 14 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/PracticeDao.java

@@ -0,0 +1,14 @@
+package com.yonge.cooleshow.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.dto.search.PracticeSearch;
+import com.yonge.cooleshow.biz.dal.vo.PracticeVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface PracticeDao {
+    List<PracticeVo> selectTeacherPactice(IPage page, @Param("param") PracticeSearch search);
+
+    List<PracticeVo> selectStudentPactice(IPage<PracticeVo> page, @Param("param") PracticeSearch search);
+}

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

@@ -0,0 +1,110 @@
+package com.yonge.cooleshow.biz.dal.dto.search;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.yonge.cooleshow.common.page.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @Author: cy
+ * @Date: 2022/4/14
+ */
+@ApiModel(value = "PracticeSearch")
+public class PracticeSearch extends QueryInfo {
+    @ApiModelProperty(value = "老师id")
+    private Long teacherId;
+
+    @ApiModelProperty(value = "学生id")
+    private Long studentId;
+
+    @ApiModelProperty(value = "课程编号/用户编号/用户姓名/用户手机")
+    private String search;
+
+    @ApiModelProperty(value = "订单号")
+    private String orderNo;
+
+    @ApiModelProperty("课程声部id")
+    private Long subjectId;
+
+    @ApiModelProperty(value = "课程状态")
+    private String status;
+
+    @ApiModelProperty(value = "开始时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date startTime;
+
+    @ApiModelProperty(value = "结束时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endTime;
+
+    public Long getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Long teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public Long getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Long studentId) {
+        this.studentId = studentId;
+    }
+
+    @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 String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String 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;
+    }
+}

+ 1 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CourseScheduleService.java

@@ -148,5 +148,6 @@ public interface CourseScheduleService extends IService<CourseSchedule> {
 
     IPage<MyCourseVo> queryStudentPracticeCourse(IPage<MyCourseVo> page, MyCourseSearch search);
 
+    List<String> queryCourseScheduleStudent(MyCourseSearch search);
 }
 

+ 11 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/PracticeService.java

@@ -0,0 +1,11 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.dto.search.PracticeSearch;
+import com.yonge.cooleshow.biz.dal.vo.PracticeVo;
+
+public interface PracticeService {
+    IPage<PracticeVo> selectTeacherPactice(IPage<PracticeVo> page, PracticeSearch search);
+
+    IPage<PracticeVo> selectStudentPactice(IPage<PracticeVo> page, PracticeSearch search);
+}

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

@@ -51,55 +51,45 @@ public class CourseRepliedServiceImpl extends ServiceImpl<CourseScheduleRepliedD
         Long scheduleId = replied.getCourseScheduleId();
         Long studentId = replied.getStudentId();
 
-        CourseSchedule schedule = scheduleDao.selectById(scheduleId);
-        if (schedule == null) {
+        CourseSchedule courseSchedule = scheduleDao.selectById(scheduleId);
+        if (courseSchedule == null) {
             throw new RuntimeException("课程不存在");
         }
-        if (schedule.getStatus().equals(CourseScheduleEnum.NOT_START.getCode())) {
+        if (courseSchedule.getStatus().equals(CourseScheduleEnum.NOT_START.getCode())) {
             throw new RuntimeException("课程未开始无法评论");
         }
 
         //当前用户为老师
-        CourseSchedule courseSchedule = scheduleDao.selectById(scheduleId);
-        if (courseSchedule != null) {
-            Long teacherId = courseSchedule.getTeacherId();
-            if (userId == teacherId) {
-                if (studentId == null) {
-                    throw new RuntimeException("学生id不能为空");
-                }
-                replied.setScore(null);
-                replied.setStudentReplied(null);
-                if (!repliedIsNull(replied)){//评论已存在
-                    repliedDao.updateReplied(replied);
-                    return;
-                }
-                repliedDao.insertReplied(replied);
+        if (userId == courseSchedule.getTeacherId()) {
+            if (studentId == null) {
+                throw new RuntimeException("评价的学生id不能为空");
+            }
+            isPayment(studentId, scheduleId);
+            replied.setScore(null);
+            replied.setStudentReplied(null);
+            if (!repliedIsNull(replied)) {
+                repliedDao.updateReplied(replied);
                 return;
             }
+            repliedDao.insert(replied);
+            return;
         }
 
         //当前用户为学员
-        QueryWrapper<CourseScheduleStudentPayment> wrapper = new QueryWrapper<>();
-        wrapper.eq("user_id_", userId);
-        wrapper.eq("course_id_", scheduleId);
-        wrapper.eq("course_type_", CourseScheduleEnum.PRACTICE);
-        CourseScheduleStudentPayment payment = paymentDao.selectOne(wrapper);
-        if (payment == null) {
-            throw new RuntimeException("未购买该课无法评论");
-        }
+        isPayment(userId, scheduleId);
         replied.setStudentId(userId);
         replied.setTeacherReplied(null);
-        if (!repliedIsNull(replied)){//评论已存在
+        if (!repliedIsNull(replied)) {
             repliedDao.updateReplied(replied);
             return;
         }
-        repliedDao.insertReplied(replied);
+        repliedDao.insert(replied);
     }
 
     /**
-     * @Description: 判断评论是否存在
-     * @Author: cy
-     * @Date: 2022/4/13
+     * 判断评论是否存在
+     * @param replied
+     * @return
      */
     public boolean repliedIsNull(CourseScheduleReplied replied) {
         QueryWrapper<CourseScheduleReplied> queryWrapper = new QueryWrapper<>();
@@ -112,6 +102,22 @@ public class CourseRepliedServiceImpl extends ServiceImpl<CourseScheduleRepliedD
     }
 
     /**
+     * 校验当前用户是否购买课程
+     * @param userId     学员id
+     * @param scheduleId 课程id
+     */
+    public void isPayment(Long userId, Long scheduleId) {
+        QueryWrapper<CourseScheduleStudentPayment> wrapper = new QueryWrapper<>();
+        wrapper.eq("user_id_", userId);
+        wrapper.eq("course_id_", scheduleId);
+        wrapper.eq("course_type_", CourseScheduleEnum.PRACTICE.getCode());
+        CourseScheduleStudentPayment payment = paymentDao.selectOne(wrapper);
+        if (payment == null) {
+            throw new RuntimeException("学生未购买该课无法评论");
+        }
+    }
+
+    /**
      * @Description: 首页-我的课程-课程详情-查询评价
      * @Author: cy
      * @Date: 2022/4/12

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

@@ -675,5 +675,14 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
     public IPage<MyCourseVo> queryStudentPracticeCourse(IPage<MyCourseVo> page, MyCourseSearch search) {
         return page.setRecords(baseMapper.queryStudentPracticeCourse(page, search));
     }
+
+    /**
+     * @Description: 查询学生约课日历
+     * @Author: cy
+     * @Date: 2022/4/14
+     */
+    public List<String> queryCourseScheduleStudent(MyCourseSearch search) {
+        return baseMapper.queryCourseScheduleStudent(search);
+    }
 }
 

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

@@ -0,0 +1,29 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.dao.PracticeDao;
+import com.yonge.cooleshow.biz.dal.dto.search.PracticeSearch;
+import com.yonge.cooleshow.biz.dal.service.PracticeService;
+import com.yonge.cooleshow.biz.dal.vo.PracticeVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author: cy
+ * @date: 2022/4/14 15:04
+ */
+@Service
+public class PracticeServiceImpl implements PracticeService {
+    @Autowired
+    private PracticeDao practiceDao;
+
+    @Override
+    public IPage<PracticeVo> selectTeacherPactice(IPage<PracticeVo> page, PracticeSearch search) {
+        return page.setRecords(practiceDao.selectTeacherPactice(page, search));
+    }
+
+    @Override
+    public IPage<PracticeVo> selectStudentPactice(IPage<PracticeVo> page, PracticeSearch search) {
+        return page.setRecords(practiceDao.selectStudentPactice(page, search));
+    }
+}

+ 168 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/PracticeVo.java

@@ -0,0 +1,168 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @Author: cy
+ * @Date: 2022/4/14
+ */
+@ApiModel(value = "PracticeVo")
+public class PracticeVo implements Serializable {
+    @ApiModelProperty(value = "用户id")
+    private Long userId;
+
+    @ApiModelProperty(value = "课程编号")
+    private Long courseId;
+
+    @ApiModelProperty(value = "用户名")
+    private String userName;
+
+    @ApiModelProperty(value = "用户手机号")
+    private String phone;
+
+    @ApiModelProperty(value = "课程声部")
+    private String subjectName;
+
+    @ApiModelProperty(value = "订单号")
+    private String orderNo;
+
+    @ApiModelProperty(value = "原价")
+    private BigDecimal originalPrice;
+
+    @ApiModelProperty(value = "预计价格")
+    private BigDecimal expectPrice;
+
+    @ApiModelProperty(value = "实际价格")
+    private BigDecimal actualPrice;
+
+    @ApiModelProperty(value = "支付时间")
+    private String paymentTime;
+
+    @ApiModelProperty(value = "上课日期")
+    private String classDate;
+
+    @ApiModelProperty(value = "上课时间")
+    private String startTime;
+
+    @ApiModelProperty(value = "下课时间")
+    private String endTime;
+
+    @ApiModelProperty(value = "课程状态")
+    private String status;
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public BigDecimal getOriginalPrice() {
+        return originalPrice;
+    }
+
+    public void setOriginalPrice(BigDecimal originalPrice) {
+        this.originalPrice = originalPrice;
+    }
+
+    public BigDecimal getExpectPrice() {
+        return expectPrice;
+    }
+
+    public void setExpectPrice(BigDecimal expectPrice) {
+        this.expectPrice = expectPrice;
+    }
+
+    public BigDecimal getActualPrice() {
+        return actualPrice;
+    }
+
+    public void setActualPrice(BigDecimal actualPrice) {
+        this.actualPrice = actualPrice;
+    }
+
+    public String getPaymentTime() {
+        return paymentTime;
+    }
+
+    public void setPaymentTime(String paymentTime) {
+        this.paymentTime = paymentTime;
+    }
+
+    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;
+    }
+}

+ 9 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -235,8 +235,17 @@
         <if test="param.subjectId !=null">
             AND g.subject_id_ = #{param.subjectId}
         </if>
+        <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>
     </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}
+    </select>
 </mapper>

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

@@ -30,48 +30,48 @@
     <insert id="insertReplied" parameterType="com.yonge.cooleshow.biz.dal.entity.CourseScheduleReplied">
         INSERT INTO course_schedule_replied
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="studentId != null">
+            <if test="param.studentId != null">
                 student_id_,
             </if>
-            <if test="courseScheduleId != null">
+            <if test="param.courseScheduleId != null">
                 course_schedule_id_,
             </if>
-            <if test="courseGroupType != null">
+            <if test="param.courseGroupType != null">
                 course_group_type_,
             </if>
-            <if test="courseGroupId != null">
+            <if test="param.courseGroupId != null">
                 course_group_id_,
             </if>
-            <if test="score != null">
+            <if test="param.score != null">
                 score_,
             </if>
-            <if test="studentReplied != null">
+            <if test="param.studentReplied != null">
                 student_replied_,
             </if>
-            <if test="teacherReplied != null">
+            <if test="param.teacherReplied != null">
                 teacher_replied_,
             </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="studentId != null">
+            <if test="param.studentId != null">
                 studentId,
             </if>
-            <if test="courseScheduleId != null">
+            <if test="param.courseScheduleId != null">
                 courseScheduleId,
             </if>
-            <if test="courseGroupType != null">
+            <if test="param.courseGroupType != null">
                 courseGroupType,
             </if>
-            <if test="courseGroupId != null">
+            <if test="param.courseGroupId != null">
                 courseGroupId,
             </if>
-            <if test="score != null">
+            <if test="param.score != null">
                 score,
             </if>
-            <if test="studentReplied != null">
+            <if test="param.studentReplied != null">
                 studentReplied,
             </if>
-            <if test="teacherReplied != null">
+            <if test="param.teacherReplied != null">
                 teacherReplied,
             </if>
         </trim>

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

@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yonge.cooleshow.biz.dal.dao.PracticeDao">
+	<select id="selectTeacherPactice" resultType="com.yonge.cooleshow.biz.dal.vo.PracticeVo">
+		SELECT
+			u.id_ AS userId,
+			u.username_ AS userName,
+			u.phone_ AS phone,
+			s.name_ AS subjectName,
+			p.course_id_ AS courseId,
+			p.order_no_ AS orderNo,
+			p.original_price_ AS originalPrice,
+			p.expect_price_ AS expectPrice,
+			p.actual_price_ AS actualPrice,
+			p.created_time_ AS paymentTime,
+			cs.class_date_ AS classDate,
+			cs.start_time_ AS startTime,
+			cs.end_time_ AS endTime,
+			cs.status_ AS `status`
+		FROM course_schedule_student_payment p
+		LEFT JOIN sys_user u ON p.user_id_ = u.id_
+		LEFT JOIN `subject` s ON p.course_group_id_ = s.id_
+		LEFT JOIN course_schedule cs ON p.course_id_ = cs.id_
+		WHERE p.course_id_ IN (SELECT id_ FROM course_schedule WHERE teacher_id_ = #{param.teacherId} AND type_ = 'PRACTICE')
+		<if test="null != param.search and '' != param.search">
+			AND (
+			cs.id_ LIKE CONCAT('%', #{param.search}, '%') OR
+			u.id_ LIKE CONCAT('%', #{param.search}, '%') OR
+			u.username_ LIKE CONCAT('%', #{param.search}, '%') OR
+			u.phone_ LIKE CONCAT('%', #{param.search}, '%')
+			)
+		</if>
+		<if test="null != param.orderNo and '' != param.orderNo">
+			AND p.order_no_ = #{param.orderNo}
+		</if>
+		<if test="null != param.subjectId">
+			AND s.id_ = #{param.subjectId}
+		</if>
+		<if test="param.startTime !=null">
+			<![CDATA[AND p.created_time_ >= #{param.startTime} ]]>
+		</if>
+		<if test="param.endTime !=null">
+			<![CDATA[AND p.created_time_ <= #{param.endTime} ]]>
+		</if>
+	</select>
+	<select id="selectStudentPactice" resultType="com.yonge.cooleshow.biz.dal.vo.PracticeVo">
+		SELECT
+			u.id_ AS userId,
+			u.username_ AS userName,
+			u.phone_ AS phone,
+			s.name_ AS subjectName,
+			p.course_id_ AS courseId,
+			p.order_no_ AS orderNo,
+			p.original_price_ AS originalPrice,
+			p.expect_price_ AS expectPrice,
+			p.actual_price_ AS actualPrice,
+			p.created_time_ AS paymentTime,
+			cs.class_date_ AS classDate,
+			cs.start_time_ AS startTime,
+			cs.end_time_ AS endTime,
+			cs.status_ AS `status`
+		FROM course_schedule cs
+		LEFT JOIN course_schedule_student_payment p ON cs.id_ = p.course_id_
+		LEFT JOIN sys_user u ON cs.teacher_id_ = u.id_
+		LEFT JOIN `subject` s ON p.course_group_id_ = s.id_
+		WHERE cs.id_ IN (SELECT course_id_ FROM course_schedule_student_payment WHERE user_id_ = #{param.studentId} AND course_type_ = 'PRACTICE')
+		<if test="null != param.search and '' != param.search">
+			AND (
+			cs.id_ LIKE CONCAT('%', #{param.search}, '%') OR
+			u.id_ LIKE CONCAT('%', #{param.search}, '%') OR
+			u.username_ LIKE CONCAT('%', #{param.search}, '%') OR
+			u.phone_ LIKE CONCAT('%', #{param.search}, '%')
+			)
+		</if>
+		<if test="null != param.orderNo and '' != param.orderNo">
+			AND p.order_no_ = #{param.orderNo}
+		</if>
+		<if test="null != param.subjectId">
+			AND s.id_ = #{param.subjectId}
+		</if>
+		<if test="param.startTime !=null">
+			<![CDATA[AND p.created_time_ >= #{param.startTime} ]]>
+		</if>
+		<if test="param.endTime !=null">
+			<![CDATA[AND p.created_time_ <= #{param.endTime} ]]>
+		</if>
+	</select>
+</mapper>

+ 13 - 0
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/CourseScheduleController.java

@@ -23,6 +23,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 /**
  * @Author: cy
  * @Date: 2022/4/13
@@ -76,5 +78,16 @@ public class CourseScheduleController extends BaseController {
         replied.setCourseGroupType(CourseScheduleEnum.PRACTICE.getCode());
         return succeed(repliedService.selectReplied(replied));
     }
+
+    @ApiOperation("学生端-课表-日历")
+    @PostMapping("/queryCourseScheduleStudent")
+    public HttpResponseResult<List<String>> queryCourseScheduleStudent(@RequestBody MyCourseSearch search) {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || null == user.getId()) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        search.setStudentId(user.getId());
+        return succeed(courseScheduleService.queryCourseScheduleStudent(search));
+    }
 }