Ver código fonte

老师端逻辑调整

zouxuan 3 meses atrás
pai
commit
d13b43e4b5

+ 7 - 1
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherCourseScheduleController.java

@@ -3,6 +3,7 @@ package com.yonge.cooleshow.teacher.controller;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yonge.cooleshow.biz.dal.dto.search.MyCourseSearch;
 import com.yonge.cooleshow.biz.dal.entity.CourseCalendarEntity;
+import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
 import com.yonge.cooleshow.biz.dal.service.CourseScheduleService;
 import com.yonge.cooleshow.biz.dal.service.HolidaysFestivalsService;
 import com.yonge.cooleshow.biz.dal.service.SysUserService;
@@ -17,6 +18,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
@@ -50,12 +52,14 @@ public class TeacherCourseScheduleController extends BaseController {
             @ApiImplicitParam(name = "classDate", dataType = "Integer", value = "年月"),
             @ApiImplicitParam(name = "status", dataType = "String", value = "课程状态 NOT_START未开始 ING进行中 COMPLETE已完成"),
             @ApiImplicitParam(name = "subjectId", dataType = "Long", value = "声部id"),
+            @ApiImplicitParam(name = "courseType", dataType = "String", value = "课程类型"),
             @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
             @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
     })
     @ApiOperation("老师端-首页-我的课程-直播课")
     @PostMapping("/queryTeacherLiveCourse")
     public HttpResponseResult<PageInfo<TeacherLiveCourseInfoVo>> queryTeacherLiveCourse(@RequestBody Map<String, Object> param) {
+        param.put("type",param.get("courseType") == null? CourseScheduleEnum.LIVE.getCode():param.get("courseType").toString());
         return succeed(courseScheduleService.queryTeacherLiveCourse(param));
     }
 
@@ -100,7 +104,9 @@ public class TeacherCourseScheduleController extends BaseController {
     @PostMapping("/queryTeacherPracticeCourse")
     public HttpResponseResult<PageInfo<MyCourseVo>> queryTeacherPracticeCourse(@RequestBody MyCourseSearch search) {
         search.setTeacherId(sysUserService.getUserId());
-        search.setCourseType("VIP,PRACTICE,GROUP");
+        if(StringUtils.isEmpty(search.getCourseType())){
+            search.setCourseType("VIP,PRACTICE,GROUP");
+        }
         IPage<MyCourseVo> pages = courseScheduleService.queryTeacherPracticeCourse(PageUtil.getPage(search), search);
         return succeed(PageUtil.pageInfo(pages));
     }

+ 5 - 1
cooleshow-app/src/main/java/com/yonge/cooleshow/website/controller/CourseGroupController.java

@@ -4,6 +4,7 @@ package com.yonge.cooleshow.website.controller;
 import com.yonge.cooleshow.biz.dal.dto.CheckCourseTimeDto;
 import com.yonge.cooleshow.biz.dal.dto.LiveCourseGroupDto;
 import com.yonge.cooleshow.biz.dal.entity.CourseTimeEntity;
+import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
 import com.yonge.cooleshow.biz.dal.service.AppVersionInfoService;
 import com.yonge.cooleshow.biz.dal.service.CourseGroupService;
 import com.yonge.cooleshow.biz.dal.vo.CourseGroupVo;
@@ -17,6 +18,7 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -70,10 +72,12 @@ public class CourseGroupController extends BaseController {
     @ApiOperation("创建直播课程组-新增课程组")
     @PostMapping("/addLiveCourse")
     public HttpResponseResult<Object> addLiveCourse(@RequestBody LiveCourseGroupDto dto) {
-
         if (dto.getCoursePrice().compareTo(BigDecimal.ZERO) <= 0) {
             return failed("课程价格不能为0元");
         }
+        if(StringUtils.isEmpty(dto.getCourseType())){
+            dto.setCourseType(CourseScheduleEnum.LIVE.getCode());
+        }
         courseGroupService.addLiveCourse(dto);
         return succeed();
     }

+ 4 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/CourseGroup.java

@@ -87,6 +87,10 @@ public class CourseGroup implements Serializable {
     @ApiModelProperty(value = "最少成课人数")
     private Integer mixStudentNum;
 
+    @TableField("max_student_num_")
+    @ApiModelProperty(value = "最大成课人数")
+    private Integer maxStudentNum;
+
     @TableField("pre_student_num_")
     @ApiModelProperty(value = "预计上课人数")
     private Integer preStudentNum;

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

@@ -172,7 +172,6 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         }
         param.put("status", status);
         param.put("teacherId", sysUserService.getUserId());
-        param.put("type", CourseScheduleEnum.LIVE.getCode());
         param.put("groupState", String.join(",", CourseGroupEnum.ING.getCode(), CourseGroupEnum.COMPLETE.getCode()));
         log.info("queryTeacherLiveCourse:{}", param);
         Page<TeacherLiveCourseInfoVo> pageInfo = PageUtil.getPageInfo(param);

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/CourseGroupVo.java

@@ -40,6 +40,9 @@ public class CourseGroupVo implements Serializable {
     @ApiModelProperty(value = "课程人数")
     private Integer studentCount;
 
+    @ApiModelProperty(value = "最大成课人数")
+    private Integer maxStudentCount;
+
     @ApiModelProperty(value = "课程图片")
     private String backgroundPic;
 

+ 5 - 71
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/CourseRepliedVo.java

@@ -3,12 +3,15 @@ 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 lombok.Data;
+
 import java.util.Date;
 
 /**
  * @Author: cy
  * @Date: 2022/4/19
  */
+@Data
 @ApiModel(value = "CourseRepliedVo")
 public class CourseRepliedVo extends CourseScheduleReplied {
     @ApiModelProperty("用户名")
@@ -37,75 +40,6 @@ public class CourseRepliedVo extends CourseScheduleReplied {
     @ApiModelProperty("声部名称")
     private String subjectName;
 
-    public String getRealName() {
-        return realName;
-    }
-
-    public void setRealName(String realName) {
-        this.realName = realName;
-    }
-
-    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;
-    }
+    @ApiModelProperty("课程组名称")
+    private String courseGroupName;
 }

+ 0 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/LiveCourseInfoVo.java

@@ -33,7 +33,6 @@ public class LiveCourseInfoVo extends CourseGroupVo implements Serializable {
     @ApiModelProperty("学位认证 0:未认证 1:已认证 ")
     private YesOrNoEnum degreeFlag;
 
-
     @ApiModelProperty("教师资格认证 0:未认证 1:已认证 ")
     private YesOrNoEnum teacherFlag;
 

+ 4 - 119
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/MyRepliedVo.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.biz.dal.vo;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -11,6 +12,7 @@ import java.util.Date;
  * @Date: 2022/4/13
  */
 @ApiModel(value = "MyRepliedVo")
+@Data
 public class MyRepliedVo implements Serializable {
     @ApiModelProperty(value = "课程id")
     private Long courseId;
@@ -56,123 +58,6 @@ public class MyRepliedVo implements Serializable {
     @ApiModelProperty(value = "学生评价内容")
     private String studentRepliedStr;
 
-    public String getStudentRepliedStr() {
-        return studentRepliedStr;
-    }
-
-    public void setStudentRepliedStr(String studentRepliedStr) {
-        this.studentRepliedStr = studentRepliedStr;
-    }
-
-    public Integer getStudentReplied() {
-        return studentReplied;
-    }
-
-    public void setStudentReplied(Integer studentReplied) {
-        this.studentReplied = studentReplied;
-    }
-
-    public Integer getTeacherReplied() {
-        return teacherReplied;
-    }
-
-    public void setTeacherReplied(Integer teacherReplied) {
-        this.teacherReplied = teacherReplied;
-    }
-
-    public String getRealName() {
-        return realName;
-    }
-
-    public void setRealName(String realName) {
-        this.realName = realName;
-    }
-
-    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;
-    }
-
-    public void setUserId(Long userId) {
-        this.userId = userId;
-    }
-
-    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 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 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;
-    }
-
-    public String getScore() {
-        return score;
-    }
-
-    public void setScore(String score) {
-        this.score = score;
-    }
+    @ApiModelProperty("课程组名称")
+    private String courseGroupName;
 }

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/TeacherLiveCourseInfoVo.java

@@ -49,6 +49,9 @@ public class TeacherLiveCourseInfoVo implements Serializable {
     @ApiModelProperty(value = "课程人数")
     private Integer studentCount;
 
+    @ApiModelProperty(value = "最大成课人数")
+    private Integer maxStudentCount;
+
     @ApiModelProperty(value = "课程图片")
     private String backgroundPic;
 

+ 6 - 3
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseGroupMapper.xml

@@ -17,6 +17,7 @@
         <result column="sales_end_date_" jdbcType="TIMESTAMP" property="salesEndDate"/>
         <result column="background_pic_" jdbcType="VARCHAR" property="backgroundPic"/>
         <result column="mix_student_num_" jdbcType="INTEGER" property="mixStudentNum"/>
+        <result column="max_student_num_" jdbcType="INTEGER" property="maxStudentNum"/>
         <result column="course_start_time_" jdbcType="TIMESTAMP" property="courseStartTime"/>
         <result column="created_by_" jdbcType="INTEGER" property="createdBy"/>
         <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime"/>
@@ -32,7 +33,7 @@
         id_
         , type_, teacher_id_, name_, subject_id_, single_course_minutes_, course_num_,
         complete_course_num_, course_introduce_, course_price_, status_, sales_start_date_,
-        sales_end_date_, background_pic_, mix_student_num_,pre_student_num_, im_group_id_,
+        sales_end_date_, background_pic_, mix_student_num_,max_student_num_,pre_student_num_, im_group_id_,
         course_start_time_, created_by_, created_time_, updated_by_, updated_time_,reason_,course_plan_
     </sql>
 
@@ -40,12 +41,12 @@
             parameterType="com.yonge.cooleshow.biz.dal.entity.CourseGroup">
         insert into course_group(type_, teacher_id_, name_, subject_id_, single_course_minutes_, course_num_,
         complete_course_num_, course_introduce_, course_price_, status_, sales_start_date_, sales_end_date_, background_pic_,
-        mix_student_num_,pre_student_num_,im_group_id_, course_start_time_, created_by_, created_time_, updated_by_, updated_time_,reason_,course_plan_)
+        mix_student_num_,max_student_num_,pre_student_num_,im_group_id_, course_start_time_, created_by_, created_time_, updated_by_, updated_time_,reason_,course_plan_)
         values
         <foreach collection="entities" item="entity" separator=",">
             (#{entity.type}, #{entity.teacherId}, #{entity.name}, #{entity.subjectId}, #{entity.singleCourseMinutes},
             #{entity.courseNum}, #{entity.completeCourseNum}, #{entity.courseIntroduce}, #{entity.coursePrice}, #{entity.status},
-            #{entity.salesStartDate}, #{entity.salesEndDate}, #{entity.backgroundPic}, #{entity.mixStudentNum},
+            #{entity.salesStartDate}, #{entity.salesEndDate}, #{entity.backgroundPic}, #{entity.mixStudentNum},#{entity.maxStudentNum},
             #{entity.preStudentNum},#{entity.imGroupId},#{entity.courseStartTime}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updatedBy},
             #{entity.updatedTime},#{entity.reason},#{entity.coursePlan})
         </foreach>
@@ -69,6 +70,7 @@
         b.sales_start_date_           as salesStartDate,
         b.sales_end_date_             as salesEndDate,
         b.mix_student_num_            as mixStudentNum,
+        b.max_student_num_            as maxStudentNum,
         b.im_group_id_              as imGroupId,
         b.reason_ as                   reason,
         b.course_plan_ as coursePlan,
@@ -118,6 +120,7 @@
                         b.sales_start_date_           as salesStartDate,
                         b.sales_end_date_             as salesEndDate,
                         b.mix_student_num_            as mixStudentNum,
+                        b.max_student_num_            as maxStudentNum,
                         b.im_group_id_                as imGroupId,
                         b.reason_ as                   reason,
                         b.course_plan_ as coursePlan,

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

@@ -206,7 +206,7 @@
             cs.status_ AS `status`,
             g.subject_id_ AS subjectId,
             sb.name_ AS subjectName,
-            g.name_ AS courseGroupName,
+            concat(cg.name_,'-第',cs.class_num_,'课') as courseGroupName,
             u.del_flag_ as delFlag,
             p.course_id_ AS courseId,
             p.course_group_id_ AS courseGoupId,

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

@@ -125,6 +125,7 @@
             r.course_group_id_ AS courseGroupId,
             r.score_ AS score,
             r.student_replied_ AS studentRepliedStr,
+            concat(g.name_,'-第',s.class_num_,'课') as courseGroupName,
             g.subject_id_ AS subjectId,
             sb.name_ AS subjectName,
             s.class_date_ AS classDate,
@@ -166,7 +167,7 @@
             s.start_time_ AS startTime,
             s.end_time_ AS endTime,
             s.status_ AS status,
-
+            concat(g.name_,'-第',s.class_num_,'课') as courseGroupName,
             g.subject_id_ AS subjectId,
             sb.name_ AS subjectName
         FROM course_schedule_replied t