Browse Source

Merge remote-tracking branch 'origin/master'

weifanli 3 năm trước cách đây
mục cha
commit
e1b05b19f8

+ 1 - 7
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/CourseGroupController.java → cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/AdminCourseGroupController.java

@@ -1,16 +1,11 @@
 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.LiveCourseGroupStudentCourseSearch;
 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;
@@ -26,7 +21,6 @@ import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 import javax.validation.Valid;
 import java.util.List;
-import java.util.Map;
 
 /**
  * 课程组表(CourseGroup)表控制层
@@ -37,7 +31,7 @@ import java.util.Map;
 @Api(tags = "课程组表")
 @RestController
 @RequestMapping("/courseGroup")
-public class CourseGroupController extends BaseController {
+public class AdminCourseGroupController extends BaseController {
     /**
      * 服务对象
      */

+ 7 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/CourseGroupService.java

@@ -46,6 +46,7 @@ public interface CourseGroupService extends IService<CourseGroup> {
      *              <p> - groupStatus  课程组状态  ING(进行中)  NOT_SALE(未开售,未上架) APPLY(报名中,销售中) COMPLETE(已完成)
      *              <p> - row 条数
      *              <p> - page 页数
+     *              <p> - search 模糊搜索关键字
      */
     PageInfo<CourseGroupVo> queryPageLiveCourseGroup(Map<String, Object> param);
 
@@ -107,7 +108,7 @@ public interface CourseGroupService extends IService<CourseGroup> {
     /**
      * 直播详情 直播课学生到课状态
      *
-     * @param page 分页信息
+     * @param page  分页信息
      * @param query 查询条件
      * @return
      */
@@ -129,5 +130,10 @@ public interface CourseGroupService extends IService<CourseGroup> {
      *                   <p> - courseGroup   直播课程组信息
      */
     void buyLiveCourseAfter(UserOrderDetailVo afterParam);
+
+    /**
+     * 学生购买直播课程-成功-回调
+     */
+    void buyLiveCourseSuccess(UserOrderDetailVo orderParam);
 }
 

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

@@ -137,14 +137,13 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
      *              <p> - groupStatus  课程组状态  ING(进行中)  NOT_SALE(未开售,未上架) APPLY(报名中,销售中) COMPLETE(已完成)
      *              <p> - row 条数
      *              <p> - page 页数
+     *              <p> - search 模糊搜索关键字
      */
     public PageInfo<CourseGroupVo> queryPageLiveCourseGroup(Map<String, Object> param) {
         //查询该月的所有课程
-        param.put("teacherId", param.get("teacherId"));
-        param.put("groupStatus", param.get("groupStatus"));
         param.put("type", CourseScheduleEnum.LIVE.getCode());
         Page<CourseGroupVo> pageInfo = PageUtil.getPageInfo(param);
-        pageInfo.setAsc("a.start_time_");
+        pageInfo.setAsc("b.created_time_");
         IPage<CourseGroupVo> page = baseMapper.queryTeacherCourseGroup(pageInfo, param);
         return PageUtil.pageInfo(page);
     }
@@ -525,6 +524,7 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
     @Transactional(rollbackFor = Exception.class)
     @Override
     public HttpResponseResult<OrderCreateRes> buyLiveCourse(OrderReq.OrderReqInfo orderReqInfo) {
+        log.info("学生购买直播课程组,请求参数:{}", JSON.toJSONString(orderReqInfo));
         Map<String, Object> param = WrapperUtil.toMap(orderReqInfo.getBizContent());
         Long groupId = WrapperUtil.toLong(param, "groupId", "课程组id不能为空!");
         Long studentId = orderReqInfo.getUserId();
@@ -577,6 +577,7 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void buyLiveCourseAfter(UserOrderDetailVo afterParam) {
+        log.info("学生购买直播课程组 after ,请求参数:{}", JSON.toJSONString(afterParam));
         Map<String, Object> param = WrapperUtil.toMap(afterParam.getBizParam());
         String orderNo = afterParam.getOrderNo();
         Long studentId = (Long) param.get("studentId");
@@ -607,7 +608,10 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
      * 学生购买直播课程-成功-回调
      */
     @Transactional(rollbackFor = Exception.class)
-    public void buyLiveCourseSuccess(String orderNo) {
+    @Override
+    public void buyLiveCourseSuccess( UserOrderDetailVo orderParam) {
+        log.info("学生购买直播课程-成功-回调,请求参数:{}", JSON.toJSONString(orderParam));
+        String orderNo = orderParam.getOrderNo();
         //更新课程组的购买人数+1
         CourseScheduleStudentPayment studentPayment = courseScheduleStudentPaymentService.getOne(Wrappers.<CourseScheduleStudentPayment>lambdaQuery()
                 .eq(CourseScheduleStudentPayment::getOrderNo, orderNo)

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

@@ -83,7 +83,8 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
         /**********订单完成后******************/
         //vip开通缴费
         orderSuccess.put(GoodTypeEnum.VIP, vipCardService::orderSuccess);
-
+        //直播课程购买
+        orderSuccess.put(GoodTypeEnum.LIVE, courseGroupService::buyLiveCourseSuccess);
 
         /**********订单取消后******************/
         //orderCancel.put();

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

@@ -32,7 +32,7 @@ public class CourseGroupVo implements Serializable {
     @ApiModelProperty(value = "单节课时长")
     private Integer singleCourseMinutes;
 
-    @ApiModelProperty(value = "课程状态 NOT_START未开始 ING进行中 COMPLETE已完成 CANCEL已取消")
+    @ApiModelProperty(value = "课程组状态  ING(进行中)  NOT_SALE(未开售,未上架) APPLY(报名中,销售中) COMPLETE(已完成)")
     private String status;
 
     @ApiModelProperty(value = "课程人数")

+ 9 - 17
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseGroupMapper.xml

@@ -50,42 +50,34 @@
         b.id_                         as courseGroupId,
         b.name_                       as courseGroupName,
         s.name_                       as subjectName,
-        a.teacher_id_                 as teacherId,
+        b.teacher_id_                 as teacherId,
         u.real_name_                  as teacherName,
         b.course_start_time_          as courseStartTime,
         b.single_course_minutes_      as singleCourseMinutes,
-        a.status_                     as `status`,
+        b.status_                     as `status`,
         ifnull(b.pre_student_num_, 0) as studentCount,
         b.background_pic_             as backgroundPic,
         b.course_price_               as coursePrice,
         b.course_num_                 as courseNum
         from course_group as b
-        left join course_schedule as a on a.course_group_id_ = b.id_
         left join subject as s on b.subject_id_ = s.id_
-        left join sys_user as u on a.teacher_id_ = u.id_
+        left join sys_user as u on b.teacher_id_ = u.id_
         <where>
-            a.lock_ = 0
             <if test="param.teacherId != null">
                 and b.teacher_id_ = #{param.teacherId}
             </if>
-            <if test="param.status != null">
-                and a.status_ = #{param.status}
-            </if>
             <if test="param.groupStatus != null">
                 and b.status_ = #{param.groupStatus}
             </if>
-            <if test="param.type_ != null">
-                and a.type_ = #{param.type}
-            </if>
-            <if test="param.startDate != null">
-                AND <![CDATA[ a.class_date_  >= #{param.startDate} ]]>
-            </if>
-            <if test="param.endDate != null">
-                AND <![CDATA[ a.class_date_  <= #{param.endDate} ]]>
-            </if>
             <if test="param.subjectId != null">
                 AND b.subject_id_ = #{param.subjectId}
             </if>
+            <if test="param.search != null and param.search !=''">
+                and  (
+                u.real_name_ like concat('%',#{param.search},'%')
+                or b.name_ like concat('%',#{param.search},'%')
+                )
+            </if>
         </where>
     </select>
 

+ 2 - 1
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/CourseGroupController.java → cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/StudentCourseGroupController.java

@@ -21,7 +21,7 @@ import java.util.Map;
 @Api(tags = "课程组表")
 @RestController
 @RequestMapping("/courseGroup")
-public class CourseGroupController extends BaseController {
+public class StudentCourseGroupController extends BaseController {
     /**
      * 服务对象
      */
@@ -36,6 +36,7 @@ public class CourseGroupController extends BaseController {
 
     @ApiImplicitParams({
             @ApiImplicitParam(name = "teacherId", dataType = "Long", value = "老师id"),
+            @ApiImplicitParam(name = "search", dataType = "String", value = "关键字"),
             @ApiImplicitParam(name = "groupStatus", dataType = "String", value = "课程组状态  ING(进行中)  NOT_SALE(未开售,未上架) APPLY(报名中,销售中) COMPLETE(已完成)"),
             @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
             @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),

+ 2 - 1
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/CourseGroupController.java → cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherCourseGroupController.java

@@ -26,7 +26,7 @@ import java.util.Map;
 @Api(tags = "课程组表")
 @RestController
 @RequestMapping("/courseGroup")
-public class CourseGroupController extends BaseController {
+public class TeacherCourseGroupController extends BaseController {
     /**
      * 服务对象
      */
@@ -41,6 +41,7 @@ public class CourseGroupController extends BaseController {
 
     @ApiImplicitParams({
             @ApiImplicitParam(name = "teacherId", dataType = "Long", value = "老师id"),
+            @ApiImplicitParam(name = "search", dataType = "String", value = "关键字"),
             @ApiImplicitParam(name = "groupStatus", dataType = "String", value = "课程组状态  ING(进行中)  NOT_SALE(未开售,未上架) APPLY(报名中,销售中) COMPLETE(已完成)"),
             @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
             @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),