Przeglądaj źródła

审核状态改枚举

cy 3 lat temu
rodzic
commit
ae7f265511
26 zmienionych plików z 924 dodań i 545 usunięć
  1. 9 1
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/VideoLessonController.java
  2. 109 109
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/VideoLessonEvaluateController.java
  3. 108 108
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/VideoLessonPurchaseRecordController.java
  4. 108 108
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/VideoLessonStudyRecordController.java
  5. 3 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/SubjectDao.java
  6. 9 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/VideoLessonEvaluateDao.java
  7. 6 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/VideoLessonPurchaseRecordDao.java
  8. 23 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/VideoLessonEvaluateSearch.java
  9. 6 6
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/VideoLessonGroupSearch.java
  10. 5 4
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/VideoLessonSearch.java
  11. 18 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/VideoLessonEvaluate.java
  12. 159 147
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/VideoLessonGroup.java
  13. 6 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/VideoLessonEvaluateService.java
  14. 4 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/VideoLessonGroupService.java
  15. 56 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/VideoLessonEvaluateServiceImpl.java
  16. 3 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/VideoLessonGroupDetailServiceImpl.java
  17. 19 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/VideoLessonGroupServiceImpl.java
  18. 93 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/VideoLessonEvaluateVo.java
  19. 11 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/VideoLessonStudentDetailVo.java
  20. 17 5
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/VideoLessonTeacherVo.java
  21. 5 1
      cooleshow-user/user-biz/src/main/resources/config/mybatis/SubjectMapper.xml
  22. 14 3
      cooleshow-user/user-biz/src/main/resources/config/mybatis/VideoLessonEvaluateMapper.xml
  23. 4 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/VideoLessonGroupMapper.xml
  24. 10 3
      cooleshow-user/user-biz/src/main/resources/config/mybatis/VideoLessonPurchaseRecordMapper.xml
  25. 52 10
      cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/VideoLessonController.java
  26. 67 31
      cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/VideoLessonGroupDetailController.java

+ 9 - 1
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/VideoLessonController.java

@@ -1,7 +1,7 @@
 package com.yonge.cooleshow.admin.controller;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonSearch;
+import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup;
 import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroupDetail;
 import com.yonge.cooleshow.biz.dal.service.VideoLessonGroupDetailService;
 import com.yonge.cooleshow.biz.dal.service.VideoLessonGroupService;
@@ -20,6 +20,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import javax.validation.constraints.NotNull;
+
 /**
  * @Author: cy
  * @Date: 2022/4/2
@@ -34,6 +36,12 @@ public class VideoLessonController extends BaseController {
     @Autowired
     private VideoLessonGroupDetailService videoLessonGroupDetailService;
 
+    @ApiOperation(value = "根据视频课组id查详情")
+    @GetMapping(value = "/selectGroupById")
+    public HttpResponseResult<VideoLessonGroup> selectGroupById(@NotNull Long groupId) {
+        return succeed(lessonGroupService.selectGroup(groupId));
+    }
+
     /**
      * @Description: 学员详情-查询视频课列表
      * @Author: cy

+ 109 - 109
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/VideoLessonEvaluateController.java

@@ -1,109 +1,109 @@
-package com.yonge.cooleshow.admin.controller;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import javax.validation.Valid;
-
-import com.yonge.cooleshow.biz.dal.dto.VideoLessonEvaluateDto;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import com.yonge.cooleshow.common.controller.BaseController;
-import com.yonge.cooleshow.common.entity.HttpResponseResult;
-import com.yonge.cooleshow.biz.dal.entity.VideoLessonEvaluate;
-import com.yonge.cooleshow.biz.dal.service.VideoLessonEvaluateService;
-import com.yonge.cooleshow.auth.api.entity.SysUser;
-import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
-
-/**
- * 视频课学员评价 web 控制层
- * @author yzp
- * @date 2022-03-26 00:21:46
- * @version v1.0
- **/
-@RestController
-@RequestMapping("/video/lesson/evaluate")
-@Api(tags = "视频课学员评价 API接口")
-public class VideoLessonEvaluateController extends BaseController {
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
-
-	@Autowired
-	private VideoLessonEvaluateService videoLessonEvaluateService;
-
-	@ApiOperation(value = "新增", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping(value="/create", consumes="application/json", produces="application/json")
-    public HttpResponseResult<Object> create(@Valid @RequestBody VideoLessonEvaluate videoLessonEvaluate) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-
-        //videoLessonEvaluate.setCreateBy(sysUser.getId());
-        //videoLessonEvaluate.setCreateTime(new Date());
-        videoLessonEvaluateService.save(videoLessonEvaluate);
-        return succeed();
-    }
-
-    @ApiOperation(value = "删除", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping("/delete/{id}")
-    public Object delete(@PathVariable Long id) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-
-        videoLessonEvaluateService.removeById(id);
-        return succeed();
-    }
-
-    @ApiOperation(value = "修改", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping(value="/update", consumes="application/json", produces="application/json")
-    public HttpResponseResult<Object> update(@Valid @RequestBody VideoLessonEvaluate videoLessonEvaluate) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        if (videoLessonEvaluate.getId()==null){
-            return failed("缺少ID");
-        }
-
-        //videoLessonEvaluate.setUpdateBy(sysUser.getId());
-        //videoLessonEvaluate.setUpdateTime(new Date());
-        videoLessonEvaluateService.updateById(videoLessonEvaluate);
-        return succeed();
-    }
-
-    @ApiOperation(value = "分页查询", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping(value="/list", consumes="application/json", produces="application/json")
-    public HttpResponseResult<Object> list(@RequestBody VideoLessonEvaluateDto videoLessonEvaluateDto) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-
-        int pageNo = videoLessonEvaluateDto.getPageNo();
-        int pageSize = videoLessonEvaluateDto.getPageSize();
-
-        try {
-            if (pageNo==0) {
-                pageNo = 1;
-            }
-            if (pageSize==0) {
-                pageSize = 10;
-            }
-
-            LambdaQueryWrapper<VideoLessonEvaluate> lambdaQueryWrapper = Wrappers.lambdaQuery();
-            //lambdaQueryWrapper.like(VideoLessonEvaluate::getName , "k");
-
-            Page<VideoLessonEvaluate> page = new Page<>(pageNo,pageSize);
-            return succeed(videoLessonEvaluateService.page(page, lambdaQueryWrapper));
-        } catch (Exception e) {
-            e.printStackTrace();
-            return HttpResponseResult.failed(e.getMessage());
-        }
-    }
-}
+//package com.yonge.cooleshow.admin.controller;
+//
+//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+//import javax.validation.Valid;
+//
+//import com.yonge.cooleshow.biz.dal.dto.VideoLessonEvaluateDto;
+//import io.swagger.annotations.Api;
+//import io.swagger.annotations.ApiOperation;
+//import org.springframework.web.bind.annotation.*;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import com.yonge.cooleshow.common.controller.BaseController;
+//import com.yonge.cooleshow.common.entity.HttpResponseResult;
+//import com.yonge.cooleshow.biz.dal.entity.VideoLessonEvaluate;
+//import com.yonge.cooleshow.biz.dal.service.VideoLessonEvaluateService;
+//import com.yonge.cooleshow.auth.api.entity.SysUser;
+//import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+//
+///**
+// * 视频课学员评价 web 控制层
+// * @author yzp
+// * @date 2022-03-26 00:21:46
+// * @version v1.0
+// **/
+//@RestController
+//@RequestMapping("/video/lesson/evaluate")
+//@Api(tags = "视频课学员评价 API接口")
+//public class VideoLessonEvaluateController extends BaseController {
+//    @Autowired
+//    private SysUserFeignService sysUserFeignService;
+//
+//	@Autowired
+//	private VideoLessonEvaluateService videoLessonEvaluateService;
+//
+//	@ApiOperation(value = "新增", httpMethod="POST", consumes="application/json", produces="application/json")
+//    @PostMapping(value="/create", consumes="application/json", produces="application/json")
+//    public HttpResponseResult<Object> create(@Valid @RequestBody VideoLessonEvaluate videoLessonEvaluate) {
+//        SysUser sysUser = sysUserFeignService.queryUserInfo();
+//        if (sysUser == null) {
+//            return failed("用户信息获取失败");
+//        }
+//
+//        //videoLessonEvaluate.setCreateBy(sysUser.getId());
+//        //videoLessonEvaluate.setCreateTime(new Date());
+//        videoLessonEvaluateService.save(videoLessonEvaluate);
+//        return succeed();
+//    }
+//
+//    @ApiOperation(value = "删除", httpMethod="POST", consumes="application/json", produces="application/json")
+//    @PostMapping("/delete/{id}")
+//    public Object delete(@PathVariable Long id) {
+//        SysUser sysUser = sysUserFeignService.queryUserInfo();
+//        if (sysUser == null) {
+//            return failed("用户信息获取失败");
+//        }
+//
+//        videoLessonEvaluateService.removeById(id);
+//        return succeed();
+//    }
+//
+//    @ApiOperation(value = "修改", httpMethod="POST", consumes="application/json", produces="application/json")
+//    @PostMapping(value="/update", consumes="application/json", produces="application/json")
+//    public HttpResponseResult<Object> update(@Valid @RequestBody VideoLessonEvaluate videoLessonEvaluate) {
+//        SysUser sysUser = sysUserFeignService.queryUserInfo();
+//        if (sysUser == null) {
+//            return failed("用户信息获取失败");
+//        }
+//        if (videoLessonEvaluate.getId()==null){
+//            return failed("缺少ID");
+//        }
+//
+//        //videoLessonEvaluate.setUpdateBy(sysUser.getId());
+//        //videoLessonEvaluate.setUpdateTime(new Date());
+//        videoLessonEvaluateService.updateById(videoLessonEvaluate);
+//        return succeed();
+//    }
+//
+//    @ApiOperation(value = "分页查询", httpMethod="POST", consumes="application/json", produces="application/json")
+//    @PostMapping(value="/list", consumes="application/json", produces="application/json")
+//    public HttpResponseResult<Object> list(@RequestBody VideoLessonEvaluateDto videoLessonEvaluateDto) {
+//        SysUser sysUser = sysUserFeignService.queryUserInfo();
+//        if (sysUser == null) {
+//            return failed("用户信息获取失败");
+//        }
+//
+//        int pageNo = videoLessonEvaluateDto.getPageNo();
+//        int pageSize = videoLessonEvaluateDto.getPageSize();
+//
+//        try {
+//            if (pageNo==0) {
+//                pageNo = 1;
+//            }
+//            if (pageSize==0) {
+//                pageSize = 10;
+//            }
+//
+//            LambdaQueryWrapper<VideoLessonEvaluate> lambdaQueryWrapper = Wrappers.lambdaQuery();
+//            //lambdaQueryWrapper.like(VideoLessonEvaluate::getName , "k");
+//
+//            Page<VideoLessonEvaluate> page = new Page<>(pageNo,pageSize);
+//            return succeed(videoLessonEvaluateService.page(page, lambdaQueryWrapper));
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return HttpResponseResult.failed(e.getMessage());
+//        }
+//    }
+//}

+ 108 - 108
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/VideoLessonPurchaseRecordController.java

@@ -1,108 +1,108 @@
-package com.yonge.cooleshow.admin.controller;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import javax.validation.Valid;
-import com.yonge.cooleshow.biz.dal.dto.VideoLessonPurchaseRecordDto;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import com.yonge.cooleshow.common.controller.BaseController;
-import com.yonge.cooleshow.common.entity.HttpResponseResult;
-import com.yonge.cooleshow.biz.dal.entity.VideoLessonPurchaseRecord;
-import com.yonge.cooleshow.biz.dal.service.VideoLessonPurchaseRecordService;
-import com.yonge.cooleshow.auth.api.entity.SysUser;
-import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
-
-/**
- * 视频课购买记录表 web 控制层
- * @author yzp
- * @date 2022-03-26 00:21:46
- * @version v1.0
- **/
-@RestController
-@RequestMapping("/video/lesson/purchase/record")
-@Api(tags = "视频课购买记录表 API接口")
-public class VideoLessonPurchaseRecordController extends BaseController {
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
-
-	@Autowired
-	private VideoLessonPurchaseRecordService videoLessonPurchaseRecordService;
-
-	@ApiOperation(value = "新增", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping(value="/create", consumes="application/json", produces="application/json")
-    public HttpResponseResult<Object> create(@Valid @RequestBody VideoLessonPurchaseRecord videoLessonPurchaseRecord) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-
-        //videoLessonPurchaseRecord.setCreateBy(sysUser.getId());
-        //videoLessonPurchaseRecord.setCreateTime(new Date());
-        videoLessonPurchaseRecordService.save(videoLessonPurchaseRecord);
-        return succeed();
-    }
-
-    @ApiOperation(value = "删除", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping("/delete/{id}")
-    public Object delete(@PathVariable Long id) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-
-        videoLessonPurchaseRecordService.removeById(id);
-        return succeed();
-    }
-
-    @ApiOperation(value = "修改", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping(value="/update", consumes="application/json", produces="application/json")
-    public HttpResponseResult<Object> update(@Valid @RequestBody VideoLessonPurchaseRecord videoLessonPurchaseRecord) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        if (videoLessonPurchaseRecord.getId()==null){
-            return failed("缺少ID");
-        }
-
-        //videoLessonPurchaseRecord.setUpdateBy(sysUser.getId());
-        //videoLessonPurchaseRecord.setUpdateTime(new Date());
-        videoLessonPurchaseRecordService.updateById(videoLessonPurchaseRecord);
-        return succeed();
-    }
-
-    @ApiOperation(value = "分页查询", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping(value="/list", consumes="application/json", produces="application/json")
-    public HttpResponseResult<Object> list(@RequestBody VideoLessonPurchaseRecordDto videoLessonPurchaseRecordDto) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-
-        int pageNo = videoLessonPurchaseRecordDto.getPageNo();
-        int pageSize = videoLessonPurchaseRecordDto.getPageSize();
-
-        try {
-            if (pageNo==0) {
-                pageNo = 1;
-            }
-            if (pageSize==0) {
-                pageSize = 10;
-            }
-
-            LambdaQueryWrapper<VideoLessonPurchaseRecord> lambdaQueryWrapper = Wrappers.lambdaQuery();
-            //lambdaQueryWrapper.like(VideoLessonPurchaseRecord::getName , "k");
-
-            Page<VideoLessonPurchaseRecord> page = new Page<>(pageNo,pageSize);
-            return succeed(videoLessonPurchaseRecordService.page(page, lambdaQueryWrapper));
-        } catch (Exception e) {
-            e.printStackTrace();
-            return HttpResponseResult.failed(e.getMessage());
-        }
-    }
-}
+//package com.yonge.cooleshow.admin.controller;
+//
+//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+//import javax.validation.Valid;
+//import com.yonge.cooleshow.biz.dal.dto.VideoLessonPurchaseRecordDto;
+//import io.swagger.annotations.Api;
+//import io.swagger.annotations.ApiOperation;
+//import org.springframework.web.bind.annotation.*;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import com.yonge.cooleshow.common.controller.BaseController;
+//import com.yonge.cooleshow.common.entity.HttpResponseResult;
+//import com.yonge.cooleshow.biz.dal.entity.VideoLessonPurchaseRecord;
+//import com.yonge.cooleshow.biz.dal.service.VideoLessonPurchaseRecordService;
+//import com.yonge.cooleshow.auth.api.entity.SysUser;
+//import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+//
+///**
+// * 视频课购买记录表 web 控制层
+// * @author yzp
+// * @date 2022-03-26 00:21:46
+// * @version v1.0
+// **/
+//@RestController
+//@RequestMapping("/video/lesson/purchase/record")
+//@Api(tags = "视频课购买记录表 API接口")
+//public class VideoLessonPurchaseRecordController extends BaseController {
+//    @Autowired
+//    private SysUserFeignService sysUserFeignService;
+//
+//	@Autowired
+//	private VideoLessonPurchaseRecordService videoLessonPurchaseRecordService;
+//
+//	@ApiOperation(value = "新增", httpMethod="POST", consumes="application/json", produces="application/json")
+//    @PostMapping(value="/create", consumes="application/json", produces="application/json")
+//    public HttpResponseResult<Object> create(@Valid @RequestBody VideoLessonPurchaseRecord videoLessonPurchaseRecord) {
+//        SysUser sysUser = sysUserFeignService.queryUserInfo();
+//        if (sysUser == null) {
+//            return failed("用户信息获取失败");
+//        }
+//
+//        //videoLessonPurchaseRecord.setCreateBy(sysUser.getId());
+//        //videoLessonPurchaseRecord.setCreateTime(new Date());
+//        videoLessonPurchaseRecordService.save(videoLessonPurchaseRecord);
+//        return succeed();
+//    }
+//
+//    @ApiOperation(value = "删除", httpMethod="POST", consumes="application/json", produces="application/json")
+//    @PostMapping("/delete/{id}")
+//    public Object delete(@PathVariable Long id) {
+//        SysUser sysUser = sysUserFeignService.queryUserInfo();
+//        if (sysUser == null) {
+//            return failed("用户信息获取失败");
+//        }
+//
+//        videoLessonPurchaseRecordService.removeById(id);
+//        return succeed();
+//    }
+//
+//    @ApiOperation(value = "修改", httpMethod="POST", consumes="application/json", produces="application/json")
+//    @PostMapping(value="/update", consumes="application/json", produces="application/json")
+//    public HttpResponseResult<Object> update(@Valid @RequestBody VideoLessonPurchaseRecord videoLessonPurchaseRecord) {
+//        SysUser sysUser = sysUserFeignService.queryUserInfo();
+//        if (sysUser == null) {
+//            return failed("用户信息获取失败");
+//        }
+//        if (videoLessonPurchaseRecord.getId()==null){
+//            return failed("缺少ID");
+//        }
+//
+//        //videoLessonPurchaseRecord.setUpdateBy(sysUser.getId());
+//        //videoLessonPurchaseRecord.setUpdateTime(new Date());
+//        videoLessonPurchaseRecordService.updateById(videoLessonPurchaseRecord);
+//        return succeed();
+//    }
+//
+//    @ApiOperation(value = "分页查询", httpMethod="POST", consumes="application/json", produces="application/json")
+//    @PostMapping(value="/list", consumes="application/json", produces="application/json")
+//    public HttpResponseResult<Object> list(@RequestBody VideoLessonPurchaseRecordDto videoLessonPurchaseRecordDto) {
+//        SysUser sysUser = sysUserFeignService.queryUserInfo();
+//        if (sysUser == null) {
+//            return failed("用户信息获取失败");
+//        }
+//
+//        int pageNo = videoLessonPurchaseRecordDto.getPageNo();
+//        int pageSize = videoLessonPurchaseRecordDto.getPageSize();
+//
+//        try {
+//            if (pageNo==0) {
+//                pageNo = 1;
+//            }
+//            if (pageSize==0) {
+//                pageSize = 10;
+//            }
+//
+//            LambdaQueryWrapper<VideoLessonPurchaseRecord> lambdaQueryWrapper = Wrappers.lambdaQuery();
+//            //lambdaQueryWrapper.like(VideoLessonPurchaseRecord::getName , "k");
+//
+//            Page<VideoLessonPurchaseRecord> page = new Page<>(pageNo,pageSize);
+//            return succeed(videoLessonPurchaseRecordService.page(page, lambdaQueryWrapper));
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return HttpResponseResult.failed(e.getMessage());
+//        }
+//    }
+//}

+ 108 - 108
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/VideoLessonStudyRecordController.java

@@ -1,108 +1,108 @@
-package com.yonge.cooleshow.admin.controller;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import javax.validation.Valid;
-import com.yonge.cooleshow.biz.dal.dto.VideoLessonStudyRecordDto;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import com.yonge.cooleshow.common.controller.BaseController;
-import com.yonge.cooleshow.common.entity.HttpResponseResult;
-import com.yonge.cooleshow.biz.dal.entity.VideoLessonStudyRecord;
-import com.yonge.cooleshow.biz.dal.service.VideoLessonStudyRecordService;
-import com.yonge.cooleshow.auth.api.entity.SysUser;
-import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
-
-/**
- * 视频课学习记录表 web 控制层
- * @author yzp
- * @date 2022-03-26 00:21:46
- * @version v1.0
- **/
-@RestController
-@RequestMapping("/video/lesson/study/record")
-@Api(tags = "视频课学习记录表 API接口")
-public class VideoLessonStudyRecordController extends BaseController {
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
-
-	@Autowired
-	private VideoLessonStudyRecordService videoLessonStudyRecordService;
-
-	@ApiOperation(value = "新增", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping(value="/create", consumes="application/json", produces="application/json")
-    public HttpResponseResult<Object> create(@Valid @RequestBody VideoLessonStudyRecord videoLessonStudyRecord) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-
-        //videoLessonStudyRecord.setCreateBy(sysUser.getId());
-        //videoLessonStudyRecord.setCreateTime(new Date());
-        videoLessonStudyRecordService.save(videoLessonStudyRecord);
-        return succeed();
-    }
-
-    @ApiOperation(value = "删除", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping("/delete/{id}")
-    public Object delete(@PathVariable Long id) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-
-        videoLessonStudyRecordService.removeById(id);
-        return succeed();
-    }
-
-    @ApiOperation(value = "修改", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping(value="/update", consumes="application/json", produces="application/json")
-    public HttpResponseResult<Object> update(@Valid @RequestBody VideoLessonStudyRecord videoLessonStudyRecord) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        if (videoLessonStudyRecord.getId()==null){
-            return failed("缺少ID");
-        }
-
-        //videoLessonStudyRecord.setUpdateBy(sysUser.getId());
-        //videoLessonStudyRecord.setUpdateTime(new Date());
-        videoLessonStudyRecordService.updateById(videoLessonStudyRecord);
-        return succeed();
-    }
-
-    @ApiOperation(value = "分页查询", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping(value="/list", consumes="application/json", produces="application/json")
-    public HttpResponseResult<Object> list(@RequestBody VideoLessonStudyRecordDto videoLessonStudyRecordDto) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-
-        int pageNo = videoLessonStudyRecordDto.getPageNo();
-        int pageSize = videoLessonStudyRecordDto.getPageSize();
-
-        try {
-            if (pageNo==0) {
-                pageNo = 1;
-            }
-            if (pageSize==0) {
-                pageSize = 10;
-            }
-
-            LambdaQueryWrapper<VideoLessonStudyRecord> lambdaQueryWrapper = Wrappers.lambdaQuery();
-            //lambdaQueryWrapper.like(VideoLessonStudyRecord::getName , "k");
-
-            Page<VideoLessonStudyRecord> page = new Page<>(pageNo,pageSize);
-            return succeed(videoLessonStudyRecordService.page(page, lambdaQueryWrapper));
-        } catch (Exception e) {
-            e.printStackTrace();
-            return HttpResponseResult.failed(e.getMessage());
-        }
-    }
-}
+//package com.yonge.cooleshow.admin.controller;
+//
+//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+//import javax.validation.Valid;
+//import com.yonge.cooleshow.biz.dal.dto.VideoLessonStudyRecordDto;
+//import io.swagger.annotations.Api;
+//import io.swagger.annotations.ApiOperation;
+//import org.springframework.web.bind.annotation.*;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import com.yonge.cooleshow.common.controller.BaseController;
+//import com.yonge.cooleshow.common.entity.HttpResponseResult;
+//import com.yonge.cooleshow.biz.dal.entity.VideoLessonStudyRecord;
+//import com.yonge.cooleshow.biz.dal.service.VideoLessonStudyRecordService;
+//import com.yonge.cooleshow.auth.api.entity.SysUser;
+//import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+//
+///**
+// * 视频课学习记录表 web 控制层
+// * @author yzp
+// * @date 2022-03-26 00:21:46
+// * @version v1.0
+// **/
+//@RestController
+//@RequestMapping("/video/lesson/study/record")
+//@Api(tags = "视频课学习记录表 API接口")
+//public class VideoLessonStudyRecordController extends BaseController {
+//    @Autowired
+//    private SysUserFeignService sysUserFeignService;
+//
+//	@Autowired
+//	private VideoLessonStudyRecordService videoLessonStudyRecordService;
+//
+//	@ApiOperation(value = "新增", httpMethod="POST", consumes="application/json", produces="application/json")
+//    @PostMapping(value="/create", consumes="application/json", produces="application/json")
+//    public HttpResponseResult<Object> create(@Valid @RequestBody VideoLessonStudyRecord videoLessonStudyRecord) {
+//        SysUser sysUser = sysUserFeignService.queryUserInfo();
+//        if (sysUser == null) {
+//            return failed("用户信息获取失败");
+//        }
+//
+//        //videoLessonStudyRecord.setCreateBy(sysUser.getId());
+//        //videoLessonStudyRecord.setCreateTime(new Date());
+//        videoLessonStudyRecordService.save(videoLessonStudyRecord);
+//        return succeed();
+//    }
+//
+//    @ApiOperation(value = "删除", httpMethod="POST", consumes="application/json", produces="application/json")
+//    @PostMapping("/delete/{id}")
+//    public Object delete(@PathVariable Long id) {
+//        SysUser sysUser = sysUserFeignService.queryUserInfo();
+//        if (sysUser == null) {
+//            return failed("用户信息获取失败");
+//        }
+//
+//        videoLessonStudyRecordService.removeById(id);
+//        return succeed();
+//    }
+//
+//    @ApiOperation(value = "修改", httpMethod="POST", consumes="application/json", produces="application/json")
+//    @PostMapping(value="/update", consumes="application/json", produces="application/json")
+//    public HttpResponseResult<Object> update(@Valid @RequestBody VideoLessonStudyRecord videoLessonStudyRecord) {
+//        SysUser sysUser = sysUserFeignService.queryUserInfo();
+//        if (sysUser == null) {
+//            return failed("用户信息获取失败");
+//        }
+//        if (videoLessonStudyRecord.getId()==null){
+//            return failed("缺少ID");
+//        }
+//
+//        //videoLessonStudyRecord.setUpdateBy(sysUser.getId());
+//        //videoLessonStudyRecord.setUpdateTime(new Date());
+//        videoLessonStudyRecordService.updateById(videoLessonStudyRecord);
+//        return succeed();
+//    }
+//
+//    @ApiOperation(value = "分页查询", httpMethod="POST", consumes="application/json", produces="application/json")
+//    @PostMapping(value="/list", consumes="application/json", produces="application/json")
+//    public HttpResponseResult<Object> list(@RequestBody VideoLessonStudyRecordDto videoLessonStudyRecordDto) {
+//        SysUser sysUser = sysUserFeignService.queryUserInfo();
+//        if (sysUser == null) {
+//            return failed("用户信息获取失败");
+//        }
+//
+//        int pageNo = videoLessonStudyRecordDto.getPageNo();
+//        int pageSize = videoLessonStudyRecordDto.getPageSize();
+//
+//        try {
+//            if (pageNo==0) {
+//                pageNo = 1;
+//            }
+//            if (pageSize==0) {
+//                pageSize = 10;
+//            }
+//
+//            LambdaQueryWrapper<VideoLessonStudyRecord> lambdaQueryWrapper = Wrappers.lambdaQuery();
+//            //lambdaQueryWrapper.like(VideoLessonStudyRecord::getName , "k");
+//
+//            Page<VideoLessonStudyRecord> page = new Page<>(pageNo,pageSize);
+//            return succeed(videoLessonStudyRecordService.page(page, lambdaQueryWrapper));
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return HttpResponseResult.failed(e.getMessage());
+//        }
+//    }
+//}

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

@@ -42,4 +42,7 @@ public interface SubjectDao extends BaseDAO<Long, Subject> {
      * @return: int
      */
     int deleteById(Long id);
+
+    //根据声部id查详情
+    Subject selectSubjectById(String lessonSubject);
 }

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

@@ -1,7 +1,14 @@
 package com.yonge.cooleshow.biz.dal.dao;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonEvaluateSearch;
+import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonGroupSearch;
 import com.yonge.cooleshow.biz.dal.entity.VideoLessonEvaluate;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yonge.cooleshow.biz.dal.vo.VideoLessonEvaluateVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * VideoLessonEvaluateDao数据库访问类
@@ -10,5 +17,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @version v1.0
  **/
 public interface VideoLessonEvaluateDao extends BaseMapper<VideoLessonEvaluate> {
-
+    //查询视频课评论
+    List<VideoLessonEvaluateVo> selectEvaluate(IPage<VideoLessonEvaluateVo> page, @Param("param") VideoLessonEvaluateSearch search);
 }

+ 6 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/VideoLessonPurchaseRecordDao.java

@@ -3,6 +3,8 @@ package com.yonge.cooleshow.biz.dal.dao;
 import com.yonge.cooleshow.biz.dal.entity.VideoLessonPurchaseRecord;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * VideoLessonPurchaseRecordDao数据库访问类
  * @author yzp
@@ -10,5 +12,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @version v1.0
  **/
 public interface VideoLessonPurchaseRecordDao extends BaseMapper<VideoLessonPurchaseRecord> {
+    //根据视频课id查购买学生
+    List<Long> selectStudentByDetail(Long videoId);
 
+    //根据课程id查询老师id
+    Long selectTeacherByDetail(Long videoId);
 }

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

@@ -0,0 +1,23 @@
+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;
+
+/**
+ * @Author: cy
+ * @Date: 2022/4/11
+ */
+@ApiModel(value = "VideoLessonEvaluateSearch")
+public class VideoLessonEvaluateSearch extends QueryInfo{
+    @ApiModelProperty(value = "视频课id")
+    private Long videoId;
+
+    public Long getVideoId() {
+        return videoId;
+    }
+
+    public void setVideoId(Long videoId) {
+        this.videoId = videoId;
+    }
+}

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

@@ -1,6 +1,6 @@
 package com.yonge.cooleshow.biz.dal.dto.search;
 
-import com.yonge.cooleshow.biz.dal.enums.AuditEnum;
+import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 import com.yonge.cooleshow.common.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -10,18 +10,18 @@ import io.swagger.annotations.ApiModelProperty;
  * @date: 2022/3/30 11:32
  */
 @ApiModel(value = "VideoLessonGroupSearch", description = "视频课组列表查询")
-public class VideoLessonGroupSearch extends QueryInfo{
-    @ApiModelProperty(value = "审核状态(0:待审核 1:通过 2:未通过)")
-    private AuditEnum auditStatus;
+public class VideoLessonGroupSearch extends QueryInfo {
+    @ApiModelProperty(value = "审核状态(DOING:待审核 PASS:通过 UNPASS:未通过)")
+    private AuthStatusEnum auditStatus;
 
     @ApiModelProperty(value = "视频课组id")
     private Long groupId;
 
-    public AuditEnum getAuditStatus() {
+    public AuthStatusEnum getAuditStatus() {
         return auditStatus;
     }
 
-    public void setAuditStatus(AuditEnum auditStatus) {
+    public void setAuditStatus(AuthStatusEnum auditStatus) {
         this.auditStatus = auditStatus;
     }
 

+ 5 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/VideoLessonSearch.java

@@ -1,6 +1,7 @@
 package com.yonge.cooleshow.biz.dal.dto.search;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 import com.yonge.cooleshow.biz.dal.valid.AddGroup;
 import com.yonge.cooleshow.biz.dal.valid.SelectGroup;
 import com.yonge.cooleshow.common.page.QueryInfo;
@@ -34,8 +35,8 @@ public class VideoLessonSearch extends QueryInfo {
     @ApiModelProperty("课程声部")
     private String lessonSubject;
 
-    @ApiModelProperty(value = "审核状态(0:待审核 1:通过 2:未通过)")
-    private Integer auditStatus;
+    @ApiModelProperty(value = "审核状态(DOING:待审核 PASS:通过 UNPASS:未通过)")
+    private AuthStatusEnum auditStatus;
 
     @ApiModelProperty(value = "申请开始时间")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@@ -89,11 +90,11 @@ public class VideoLessonSearch extends QueryInfo {
         this.lessonSubject = lessonSubject;
     }
 
-    public Integer getAuditStatus() {
+    public AuthStatusEnum getAuditStatus() {
         return auditStatus;
     }
 
-    public void setAuditStatus(Integer auditStatus) {
+    public void setAuditStatus(AuthStatusEnum auditStatus) {
         this.auditStatus = auditStatus;
     }
 

+ 18 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/VideoLessonEvaluate.java

@@ -1,5 +1,6 @@
 package com.yonge.cooleshow.biz.dal.entity;
 
+import com.yonge.cooleshow.biz.dal.enums.YesOrNoEnum;
 import com.yonge.cooleshow.common.entity.BaseEntity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
@@ -7,6 +8,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 import java.util.Date;
 
 /**
@@ -24,20 +28,33 @@ public class VideoLessonEvaluate extends BaseEntity {
 
     @TableField("video_id_")
     @ApiModelProperty(value = "视频ID")
+	@NotNull(message = "视频id不能为空;")
     private Long videoId;  //视频ID
 
     @TableField("student_id_")
     @ApiModelProperty(value = "学生ID")
-    private Long studentId;  //学生ID
+    private Long studentId;
+
+	@TableField("is_teacher_")
+	@ApiModelProperty(value = "是否为老师 0:否 1:是")
+    private YesOrNoEnum isTeacher;
 
     @TableField("content_")
     @ApiModelProperty(value = "评价内容")
+	@NotBlank(message = "评价内容不能为空;")
     private String content;  //评价内容
 
     @TableField("evaluate_time_")
     @ApiModelProperty(value = "评价时间")
     private java.util.Date evaluateTime;  //评价时间
 
+	public YesOrNoEnum getIsTeacher() {
+		return isTeacher;
+	}
+
+	public void setIsTeacher(YesOrNoEnum isTeacher) {
+		this.isTeacher = isTeacher;
+	}
 
 	public VideoLessonEvaluate setId(Long id) {
 	    this.id = id;

+ 159 - 147
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/VideoLessonGroup.java

@@ -1,5 +1,6 @@
 package com.yonge.cooleshow.biz.dal.entity;
 
+import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 import com.yonge.cooleshow.biz.dal.valid.AddGroup;
 import com.yonge.cooleshow.biz.dal.valid.UpdateGroup;
 import com.yonge.cooleshow.common.entity.BaseEntity;
@@ -15,40 +16,45 @@ import javax.validation.constraints.NotNull;
 
 /**
  * 视频课基本信息表
+ *
  * @author yzp
- * @date 2022-03-25 23:46:28
  * @version v1.0
+ * @date 2022-03-25 23:46:28
  **/
 @ApiModel(value = "video_lesson_group-视频课基本信息表")
 public class VideoLessonGroup extends BaseEntity {
 
     @TableId(value = "id_", type = IdType.AUTO)
     @ApiModelProperty(value = "主键id")
-	@NotNull(message = "组id不能为空;",groups = {UpdateGroup.class})
+    @NotNull(message = "组id不能为空;", groups = {UpdateGroup.class})
     private Long id;  //主键ID
 
     @TableField("lesson_name_")
-    @ApiModelProperty(value = "课程名称",required = true)
-	@NotBlank(message = "课程名称不能为空;",groups = {AddGroup.class,UpdateGroup.class})
+    @ApiModelProperty(value = "课程名称", required = true)
+    @NotBlank(message = "课程名称不能为空;", groups = {AddGroup.class, UpdateGroup.class})
     private String lessonName;  //课程名称
 
     @TableField("lesson_subject_")
-    @ApiModelProperty(value = "课程声部")
+    @ApiModelProperty(value = "课程声部id")
     private String lessonSubject;  //课程声部
 
+    @TableField(exist = false)
+    @ApiModelProperty(value = "声部名称")
+    private String lessonSubjectName;
+
     @TableField("lesson_desc_")
-    @ApiModelProperty(value = "课程介绍",required = true)
-	@NotBlank(message = "课程介绍不能为空;",groups = {AddGroup.class,UpdateGroup.class})
+    @ApiModelProperty(value = "课程介绍", required = true)
+    @NotBlank(message = "课程介绍不能为空;", groups = {AddGroup.class, UpdateGroup.class})
     private String lessonDesc;  //课程介绍
 
     @TableField("lesson_price_")
-    @ApiModelProperty(value = "课程价格",required = true)
-	@NotNull(message = "课程价格不能为空;",groups = {AddGroup.class,UpdateGroup.class})
+    @ApiModelProperty(value = "课程价格", required = true)
+    @NotNull(message = "课程价格不能为空;", groups = {AddGroup.class, UpdateGroup.class})
     private Integer lessonPrice;  //课程价格
 
     @TableField("lesson_cover_url_")
-    @ApiModelProperty(value = "课程封面图片URL",required = true)
-	@NotBlank(message = "课程封面图片URL不能为空;",groups = {AddGroup.class,UpdateGroup.class})
+    @ApiModelProperty(value = "课程封面图片URL", required = true)
+    @NotBlank(message = "课程封面图片URL不能为空;", groups = {AddGroup.class, UpdateGroup.class})
     private String lessonCoverUrl;  //课程封面图片URL
 
     @TableField("teacher_id_")
@@ -76,8 +82,8 @@ public class VideoLessonGroup extends BaseEntity {
     private Integer hotFlag;  //是否热门课程
 
     @TableField("audit_status_")
-    @ApiModelProperty(value = "审核状态(0:待审核;1:通过;2:未通过)")
-    private Integer auditStatus;  //审核状态
+    @ApiModelProperty(value = "审核状态(DOING:待审核 PASS:通过 UNPASS:未通过)")
+    private AuthStatusEnum auditStatus;  //审核状态
 
     @TableField("create_time_")
     @ApiModelProperty(value = "创建时间")
@@ -87,141 +93,147 @@ public class VideoLessonGroup extends BaseEntity {
     @ApiModelProperty(value = "更新时间")
     private java.util.Date updateTime;  //更新时间
 
-	public VideoLessonGroup setId(Long id) {
-	    this.id = id;
-	    return this;
-	}
-
-	public Long getId() {
-	    return this.id;
-	}
-
-	public VideoLessonGroup setLessonName(String lessonName) {
-	    this.lessonName = lessonName;
-	    return this;
-	}
-
-	public String getLessonName() {
-	    return this.lessonName;
-	}
-
-	public VideoLessonGroup setLessonSubject(String lessonSubject) {
-	    this.lessonSubject = lessonSubject;
-	    return this;
-	}
-
-	public String getLessonSubject() {
-	    return this.lessonSubject;
-	}
-
-	public VideoLessonGroup setLessonDesc(String lessonDesc) {
-	    this.lessonDesc = lessonDesc;
-	    return this;
-	}
-
-	public String getLessonDesc() {
-	    return this.lessonDesc;
-	}
-
-	public VideoLessonGroup setLessonPrice(Integer lessonPrice) {
-	    this.lessonPrice = lessonPrice;
-	    return this;
-	}
-
-	public Integer getLessonPrice() {
-	    return this.lessonPrice;
-	}
-
-	public VideoLessonGroup setLessonCoverUrl(String lessonCoverUrl) {
-	    this.lessonCoverUrl = lessonCoverUrl;
-	    return this;
-	}
-
-	public String getLessonCoverUrl() {
-	    return this.lessonCoverUrl;
-	}
-
-	public VideoLessonGroup setTeacherId(Long teacherId) {
-	    this.teacherId = teacherId;
-	    return this;
-	}
-
-	public Long getTeacherId() {
-	    return this.teacherId;
-	}
-
-	public VideoLessonGroup setLessonCount(Integer lessonCount) {
-	    this.lessonCount = lessonCount;
-	    return this;
-	}
-
-	public Integer getLessonCount() {
-	    return this.lessonCount;
-	}
-
-	public VideoLessonGroup setSortNumber(Integer sortNumber) {
-	    this.sortNumber = sortNumber;
-	    return this;
-	}
-
-	public Integer getSortNumber() {
-	    return this.sortNumber;
-	}
-
-	public VideoLessonGroup setLessonTag(String lessonTag) {
-	    this.lessonTag = lessonTag;
-	    return this;
-	}
-
-	public String getLessonTag() {
-	    return this.lessonTag;
-	}
-
-	public VideoLessonGroup setTopFlag(Integer topFlag) {
-	    this.topFlag = topFlag;
-	    return this;
-	}
-
-	public Integer getTopFlag() {
-	    return this.topFlag;
-	}
-
-	public VideoLessonGroup setHotFlag(Integer hotFlag) {
-	    this.hotFlag = hotFlag;
-	    return this;
-	}
-
-	public Integer getHotFlag() {
-	    return this.hotFlag;
-	}
-
-	public VideoLessonGroup setAuditStatus(Integer auditStatus) {
-	    this.auditStatus = auditStatus;
-	    return this;
-	}
-
-	public Integer getAuditStatus() {
-	    return this.auditStatus;
-	}
-
-	public VideoLessonGroup setCreateTime(java.util.Date createTime) {
-	    this.createTime = createTime;
-	    return this;
-	}
-
-	public java.util.Date getCreateTime() {
-	    return this.createTime;
-	}
-
-	public VideoLessonGroup setUpdateTime(java.util.Date updateTime) {
-	    this.updateTime = updateTime;
-	    return this;
-	}
-
-	public java.util.Date getUpdateTime() {
-	    return this.updateTime;
-	}
+    public VideoLessonGroup setId(Long id) {
+        this.id = id;
+        return this;
+    }
 
+    public String getLessonSubjectName() {
+        return lessonSubjectName;
+    }
+
+    public void setLessonSubjectName(String lessonSubjectName) {
+        this.lessonSubjectName = lessonSubjectName;
+    }
+
+    public Long getId() {
+        return this.id;
+    }
+
+    public VideoLessonGroup setLessonName(String lessonName) {
+        this.lessonName = lessonName;
+        return this;
+    }
+
+    public String getLessonName() {
+        return this.lessonName;
+    }
+
+    public VideoLessonGroup setLessonSubject(String lessonSubject) {
+        this.lessonSubject = lessonSubject;
+        return this;
+    }
+
+    public String getLessonSubject() {
+        return this.lessonSubject;
+    }
+
+    public VideoLessonGroup setLessonDesc(String lessonDesc) {
+        this.lessonDesc = lessonDesc;
+        return this;
+    }
+
+    public String getLessonDesc() {
+        return this.lessonDesc;
+    }
+
+    public VideoLessonGroup setLessonPrice(Integer lessonPrice) {
+        this.lessonPrice = lessonPrice;
+        return this;
+    }
+
+    public Integer getLessonPrice() {
+        return this.lessonPrice;
+    }
+
+    public VideoLessonGroup setLessonCoverUrl(String lessonCoverUrl) {
+        this.lessonCoverUrl = lessonCoverUrl;
+        return this;
+    }
+
+    public String getLessonCoverUrl() {
+        return this.lessonCoverUrl;
+    }
+
+    public VideoLessonGroup setTeacherId(Long teacherId) {
+        this.teacherId = teacherId;
+        return this;
+    }
+
+    public Long getTeacherId() {
+        return this.teacherId;
+    }
+
+    public VideoLessonGroup setLessonCount(Integer lessonCount) {
+        this.lessonCount = lessonCount;
+        return this;
+    }
+
+    public Integer getLessonCount() {
+        return this.lessonCount;
+    }
+
+    public VideoLessonGroup setSortNumber(Integer sortNumber) {
+        this.sortNumber = sortNumber;
+        return this;
+    }
+
+    public Integer getSortNumber() {
+        return this.sortNumber;
+    }
+
+    public VideoLessonGroup setLessonTag(String lessonTag) {
+        this.lessonTag = lessonTag;
+        return this;
+    }
+
+    public String getLessonTag() {
+        return this.lessonTag;
+    }
+
+    public VideoLessonGroup setTopFlag(Integer topFlag) {
+        this.topFlag = topFlag;
+        return this;
+    }
+
+    public Integer getTopFlag() {
+        return this.topFlag;
+    }
+
+    public VideoLessonGroup setHotFlag(Integer hotFlag) {
+        this.hotFlag = hotFlag;
+        return this;
+    }
+
+    public Integer getHotFlag() {
+        return this.hotFlag;
+    }
+
+    public AuthStatusEnum getAuditStatus() {
+        return auditStatus;
+    }
+
+    public void setAuditStatus(AuthStatusEnum auditStatus) {
+        this.auditStatus = auditStatus;
+    }
+
+    public VideoLessonGroup setCreateTime(java.util.Date createTime) {
+        this.createTime = createTime;
+        return this;
+    }
+
+    public java.util.Date getCreateTime() {
+        return this.createTime;
+    }
+
+    public VideoLessonGroup setUpdateTime(java.util.Date updateTime) {
+        this.updateTime = updateTime;
+        return this;
+    }
+
+    public java.util.Date getUpdateTime() {
+        return this.updateTime;
+    }
 
     @Override
     public String toString() {

+ 6 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/VideoLessonEvaluateService.java

@@ -1,7 +1,11 @@
 package com.yonge.cooleshow.biz.dal.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonEvaluateSearch;
 import com.yonge.cooleshow.biz.dal.entity.VideoLessonEvaluate;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.biz.dal.vo.VideoLessonEvaluateVo;
 
 /**
  * VideoLessonEvaluateService服务类
@@ -10,5 +14,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @version v1.0
  **/
 public interface VideoLessonEvaluateService extends IService<VideoLessonEvaluate> {
-
+    void evaluate(VideoLessonEvaluate evaluate, SysUser sysUser);
+    IPage<VideoLessonEvaluateVo> selectEvaluate(IPage<VideoLessonEvaluateVo> page, VideoLessonEvaluateSearch search);
 }

+ 4 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/VideoLessonGroupService.java

@@ -10,13 +10,16 @@ import com.yonge.cooleshow.biz.dal.vo.*;
 
 /**
  * VideoLessonGroupService服务类
+ *
  * @author yzp
- * @date 2022-03-25 23:46:28
  * @version v1.0
+ * @date 2022-03-25 23:46:28
  **/
 public interface VideoLessonGroupService extends IService<VideoLessonGroup> {
     IPage<VideoLessonGroupVo> selectPage(IPage<VideoLessonGroupVo> page, VideoLessonGroupSearch query);
 
+    VideoLessonGroup selectGroup(Long groupId);
+
     void updateGroup(VideoLessonGroupUpVo lessonGroupUpVo);
 
     void deleteGroup(Long id);

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

@@ -1,29 +1,83 @@
 package com.yonge.cooleshow.biz.dal.service.impl;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.dao.VideoLessonPurchaseRecordDao;
+import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonEvaluateSearch;
+import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonSearch;
 import com.yonge.cooleshow.biz.dal.entity.VideoLessonEvaluate;
 import com.yonge.cooleshow.biz.dal.dao.VideoLessonEvaluateDao;
+import com.yonge.cooleshow.biz.dal.enums.YesOrNoEnum;
 import com.yonge.cooleshow.biz.dal.service.VideoLessonEvaluateService;
+import com.yonge.cooleshow.biz.dal.vo.VideoLessonEvaluateVo;
+import com.yonge.cooleshow.biz.dal.vo.VideoLessonPurchaseStudent;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.factory.annotation.Autowired;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * VideoLessonEvaluateService服务实现类
+ *
  * @author yzp
- * @date 2022-03-26 00:01:38
  * @version v1.0
+ * @date 2022-03-26 00:01:38
  **/
 @Service
-public class VideoLessonEvaluateServiceImpl extends ServiceImpl<VideoLessonEvaluateDao,VideoLessonEvaluate> implements VideoLessonEvaluateService {
+public class VideoLessonEvaluateServiceImpl extends ServiceImpl<VideoLessonEvaluateDao, VideoLessonEvaluate> implements VideoLessonEvaluateService {
 
     private final static Logger log = LoggerFactory.getLogger(VideoLessonEvaluateServiceImpl.class);
 
     @Autowired
     private VideoLessonEvaluateDao videoLessonEvaluateDao;
+    @Autowired
+    private VideoLessonPurchaseRecordDao videoLessonPurchaseRecordDao;
 
     public VideoLessonEvaluateDao getDao() {
         return videoLessonEvaluateDao;
     }
+
+    /**
+     * @Description: 视频课评价
+     * @Author: cy
+     * @Date: 2022/4/8
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void evaluate(VideoLessonEvaluate evaluate, SysUser sysUser) {
+        Long userId = sysUser.getId();
+        String userType = sysUser.getUserType();
+        Long videoId = evaluate.getVideoId();
+
+        //根据课程id查询已购学生id
+        List<Long> studentIdList = videoLessonPurchaseRecordDao.selectStudentByDetail(videoId);
+        //根据课程id查询老师id
+        Long teacherId = videoLessonPurchaseRecordDao.selectTeacherByDetail(videoId);
+
+        //校验用户是否已购该课或未本课老师
+        if (userId != teacherId && !studentIdList.contains(userId)) {
+            throw new RuntimeException("未购买该课程无法参与讨论");
+        }
+
+        List<String> typeList = Arrays.asList(userType.split(","));
+        if (typeList.contains("TEACHER")) {
+            evaluate.setIsTeacher(YesOrNoEnum.YES);
+        }
+        evaluate.setStudentId(userId);
+        videoLessonEvaluateDao.insert(evaluate);
+    }
+
+    /**
+     * @Description: 查询视频课评论
+     * @Author: cy
+     * @Date: 2022/4/11
+     */
+    public IPage<VideoLessonEvaluateVo> selectEvaluate(IPage<VideoLessonEvaluateVo> page, VideoLessonEvaluateSearch search) {
+        return page.setRecords(baseMapper.selectEvaluate(page,search));
+    }
 }

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

@@ -9,6 +9,7 @@ import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup;
 import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroupDetail;
 import com.yonge.cooleshow.biz.dal.dao.VideoLessonGroupDetailDao;
 import com.yonge.cooleshow.biz.dal.enums.AuditEnum;
+import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 import com.yonge.cooleshow.biz.dal.service.VideoLessonGroupDetailService;
 import com.yonge.cooleshow.biz.dal.vo.*;
 import org.slf4j.Logger;
@@ -134,7 +135,8 @@ public class VideoLessonGroupDetailServiceImpl extends ServiceImpl<VideoLessonGr
         VideoLessonStudentVo lessonStudentVo = new VideoLessonStudentVo();
 
         VideoLessonGroupSearch query = new VideoLessonGroupSearch();
-        query.setAuditStatus(AuditEnum.OPEN);
+        //筛选已审核的视频课
+        query.setAuditStatus(AuthStatusEnum.PASS);
         query.setGroupId(groupId);
         List<VideoLessonGroupVo> lessonGroup = videoLessonGroupDao.selectPage(null, query);
         if (lessonGroup.isEmpty()){

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

@@ -2,9 +2,11 @@ package com.yonge.cooleshow.biz.dal.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.dao.SubjectDao;
 import com.yonge.cooleshow.biz.dal.dao.VideoLessonGroupDetailDao;
 import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonGroupSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonSearch;
+import com.yonge.cooleshow.biz.dal.entity.Subject;
 import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup;
 import com.yonge.cooleshow.biz.dal.dao.VideoLessonGroupDao;
 import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroupDetail;
@@ -21,9 +23,10 @@ import java.util.List;
 
 /**
  * VideoLessonGroupService服务实现类
+ *
  * @author yzp
- * @date 2022-03-26 00:01:38
  * @version v1.0
+ * @date 2022-03-26 00:01:38
  **/
 @Service
 public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao, VideoLessonGroup> implements VideoLessonGroupService {
@@ -34,6 +37,8 @@ public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao
     private VideoLessonGroupDao videoLessonGroupDao;
     @Autowired
     private VideoLessonGroupDetailDao videoLessonGroupDetailDao;
+    @Autowired
+    private SubjectDao subjectDao;
 
     public VideoLessonGroupDao getDao() {
         return videoLessonGroupDao;
@@ -50,6 +55,18 @@ public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao
     }
 
     /**
+     * @Description: 根据组id查详情
+     * @Author: cy
+     * @Date: 2022/4/11
+     */
+    public VideoLessonGroup selectGroup(Long groupId) {
+        VideoLessonGroup lessonGroup = videoLessonGroupDao.selectById(groupId);
+        Subject subject=subjectDao.selectSubjectById(lessonGroup.getLessonSubject());
+        lessonGroup.setLessonName(subject.getName());
+        return lessonGroup;
+    }
+
+    /**
      * @Description: 修改视频课组
      * @Author: cy
      * @Date: 2022/3/31
@@ -143,7 +160,7 @@ public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao
         VideoLessonGroupSearch query = new VideoLessonGroupSearch();
         query.setGroupId(groupId);
         List<VideoLessonGroupVo> lessonGroup = videoLessonGroupDao.selectPage(null, query);
-        if (lessonGroup.isEmpty()){
+        if (lessonGroup.isEmpty()) {
             return lessonStudentVo;
         }
         lessonStudentVo.setLessonGroup(lessonGroup.get(0));

+ 93 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/VideoLessonEvaluateVo.java

@@ -0,0 +1,93 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import com.yonge.cooleshow.biz.dal.enums.YesOrNoEnum;
+import com.yonge.cooleshow.common.entity.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+
+/**
+ * @Description: 视频课学员评价
+ * @Author: cy
+ * @Date: 2022/4/11
+ */
+@ApiModel(value = "VideoLessonEvaluateVo-视频课学员评价")
+public class VideoLessonEvaluateVo extends BaseEntity {
+
+    @ApiModelProperty(value = "用户id")
+    private Long userId;
+
+	@ApiModelProperty(value = "用户名")
+	private String userName;
+
+	@ApiModelProperty(value = "头像地址")
+	private String avatar;
+
+	@ApiModelProperty(value = "是否为老师 0:否 1:是")
+	private YesOrNoEnum isTeacher;
+
+    @ApiModelProperty(value = "评论id")
+    private Long evaluateId;
+
+	@ApiModelProperty(value = "评价内容")
+	private String content;
+
+    @ApiModelProperty(value = "评论时间")
+    private Date evaluateTime;
+
+	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 YesOrNoEnum getIsTeacher() {
+		return isTeacher;
+	}
+
+	public void setIsTeacher(YesOrNoEnum isTeacher) {
+		this.isTeacher = isTeacher;
+	}
+
+	public Long getEvaluateId() {
+		return evaluateId;
+	}
+
+	public void setEvaluateId(Long evaluateId) {
+		this.evaluateId = evaluateId;
+	}
+
+	public String getContent() {
+		return content;
+	}
+
+	public void setContent(String content) {
+		this.content = content;
+	}
+
+	public Date getEvaluateTime() {
+		return evaluateTime;
+	}
+
+	public void setEvaluateTime(Date evaluateTime) {
+		this.evaluateTime = evaluateTime;
+	}
+}

+ 11 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/VideoLessonStudentDetailVo.java

@@ -19,6 +19,9 @@ public class VideoLessonStudentDetailVo extends BaseEntity {
     @ApiModelProperty("课程声部")
     private String lessonSubject;
 
+    @ApiModelProperty("课程声部")
+    private String lessonSubjectName;
+
     @ApiModelProperty("课程数")
     private Integer lessonCount;
 
@@ -31,6 +34,14 @@ public class VideoLessonStudentDetailVo extends BaseEntity {
     @ApiModelProperty("购买时间")
     private String purchaseTime;
 
+    public String getLessonSubjectName() {
+        return lessonSubjectName;
+    }
+
+    public void setLessonSubjectName(String lessonSubjectName) {
+        this.lessonSubjectName = lessonSubjectName;
+    }
+
     public String getGroupId() {
         return groupId;
     }

+ 17 - 5
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/VideoLessonTeacherVo.java

@@ -1,5 +1,6 @@
 package com.yonge.cooleshow.biz.dal.vo;
 
+import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 import com.yonge.cooleshow.common.entity.BaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -16,9 +17,12 @@ public class VideoLessonTeacherVo extends BaseEntity {
     @ApiModelProperty("课程名称")
     private String lessonName;
 
-    @ApiModelProperty("课程声部")
+    @ApiModelProperty("课程声部id")
     private String lessonSubject;
 
+    @ApiModelProperty("课程声部")
+    private String lessonSubjectName;
+
     @ApiModelProperty("课时数")
     private Integer lessonCount;
 
@@ -28,8 +32,8 @@ public class VideoLessonTeacherVo extends BaseEntity {
     @ApiModelProperty("购买人数")
     private Integer countStudent;
 
-    @ApiModelProperty("审核状态(0:待审核 1:通过 2:未通过)")
-    private Integer auditStatus;
+    @ApiModelProperty("审核状态(DOING:待审核 PASS:通过 UNPASS:未通过)")
+    private AuthStatusEnum auditStatus;
 
     @ApiModelProperty("创建时间")
     private String createTime;
@@ -37,6 +41,14 @@ public class VideoLessonTeacherVo extends BaseEntity {
     @ApiModelProperty("课程介绍")
     private String lessonDesc;
 
+    public String getLessonSubjectName() {
+        return lessonSubjectName;
+    }
+
+    public void setLessonSubjectName(String lessonSubjectName) {
+        this.lessonSubjectName = lessonSubjectName;
+    }
+
     public String getGroupId() {
         return groupId;
     }
@@ -85,11 +97,11 @@ public class VideoLessonTeacherVo extends BaseEntity {
         this.countStudent = countStudent;
     }
 
-    public Integer getAuditStatus() {
+    public AuthStatusEnum getAuditStatus() {
         return auditStatus;
     }
 
-    public void setAuditStatus(Integer auditStatus) {
+    public void setAuditStatus(AuthStatusEnum auditStatus) {
         this.auditStatus = auditStatus;
     }
 

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

@@ -123,8 +123,12 @@
           #{subjectId}
       </foreach>
     </select>
+    <select id="selectSubjectById" resultType="com.yonge.cooleshow.biz.dal.entity.Subject"
+            parameterType="java.lang.String">
+        SELECT * FROM subject WHERE id_=#{lessonSubject}
+    </select>
 
-	<delete id="deleteById">
+    <delete id="deleteById">
 		update subject set del_flag_ = 1 where id_ = #{id} or parent_subject_id_ = #{id}
 	</delete>
 </mapper>

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

@@ -14,7 +14,18 @@
 	<sql id="Base_Column_List">
 		id_, video_id_, student_id_, content_, evaluate_time_
 	</sql>
-
-
-
+    <select id="selectEvaluate" resultType="com.yonge.cooleshow.biz.dal.vo.VideoLessonEvaluateVo"
+            parameterType="com.baomidou.mybatisplus.core.metadata.IPage">
+		SELECT
+			u.id_ AS userId,
+			u.username_ AS userName,
+			u.avatar_ AS avatar,
+			e.is_teacher_ AS isTeacher,
+			e.id_	AS evaluateId,
+			e.content_ AS content,
+			e.evaluate_time_ AS evaluateTime
+		FROM video_lesson_evaluate e
+				 LEFT JOIN sys_user u ON e.student_id_ = u.id_
+		WHERE video_id_ = #{param.videoId}
+	</select>
 </mapper>

+ 4 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/VideoLessonGroupMapper.xml

@@ -78,6 +78,7 @@
 			g.id_ AS groupId,
 			g.lesson_name_ AS lessonName,
 			g.lesson_subject_ AS lessonSubject,
+			j.name_ AS lessonSubjectName,
 			g.lesson_count_ AS lessonCount,
 			p.pay_money_ AS payMoney,
 			p.order_no_ AS orderNo,
@@ -85,6 +86,7 @@
 		FROM video_lesson_group g
 		LEFT JOIN video_lesson_purchase_record p ON g.id_ = p.video_lesson_group_id_
 		LEFT JOIN sys_user s ON g.teacher_id_ = s.id_
+		LEFT JOIN subject j ON g.lesson_subject_ = j.id_
 		<where>
 			<if test="param.userId !=null">
 				AND p.student_id_ = #{param.userId}
@@ -119,6 +121,7 @@
 			g.id_ AS groupId,
 			g.lesson_name_ AS lessonName,
 			g.lesson_subject_ AS lessonSubject,
+			j.name_ AS lessonSubjectName,
 			g.lesson_count_ AS lessonCount,
 			g.lesson_price_ AS lessonPrice,
 			g.audit_status_ AS auditStatus,
@@ -126,6 +129,7 @@
 			g.create_time_ AS createTime,
 			g.lesson_desc_ AS lessonDesc
 		FROM video_lesson_group g
+		LEFT JOIN subject j ON g.lesson_subject_ = j.id_
 		<where>
 			<if test="param.userId !=null">
 				AND g.teacher_id_ = #{param.userId}

+ 10 - 3
cooleshow-user/user-biz/src/main/resources/config/mybatis/VideoLessonPurchaseRecordMapper.xml

@@ -16,7 +16,14 @@
 	<sql id="Base_Column_List">
 		id_, video_lesson_group_id_, student_id_, purchase_time_, pay_money_, order_no_, order_status_
 	</sql>
-
-
-
+    <select id="selectStudentByDetail" resultType="java.lang.Long" parameterType="java.lang.Long">
+		SELECT student_id_ FROM video_lesson_purchase_record
+		WHERE video_lesson_group_id_=
+		(SELECT video_lesson_group_id_ FROM video_lesson_group_detail WHERE id_=#{videoId})
+	</select>
+	<select id="selectTeacherByDetail" resultType="java.lang.Long" parameterType="java.lang.Long">
+		SELECT teacher_id_ FROM video_lesson_group
+		WHERE id_=
+		(SELECT video_lesson_group_id_ FROM video_lesson_group_detail WHERE id_=#{videoId})
+	</select>
 </mapper>

+ 52 - 10
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/VideoLessonController.java

@@ -1,9 +1,18 @@
 package com.yonge.cooleshow.student.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.search.VideoLessonEvaluateSearch;
+import com.yonge.cooleshow.biz.dal.entity.VideoLessonEvaluate;
+import com.yonge.cooleshow.biz.dal.service.VideoLessonEvaluateService;
 import com.yonge.cooleshow.biz.dal.service.VideoLessonGroupDetailService;
+import com.yonge.cooleshow.biz.dal.support.PageUtil;
+import com.yonge.cooleshow.biz.dal.vo.VideoLessonEvaluateVo;
 import com.yonge.cooleshow.biz.dal.vo.VideoLessonStudentVo;
 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;
@@ -13,25 +22,58 @@ import org.springframework.web.bind.annotation.*;
 import javax.validation.constraints.NotNull;
 
 /**
-* @Author: cy
-* @Date: 2022/4/2
-*/
+ * @Author: cy
+ * @Date: 2022/4/2
+ */
 @RestController
 @RequestMapping("/videoLesson")
 @Api(tags = "视频课")
 @Validated
 public class VideoLessonController extends BaseController {
-	@Autowired
-	private VideoLessonGroupDetailService detailService;
+    @Autowired
+    private VideoLessonGroupDetailService detailService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private VideoLessonEvaluateService evaluateService;
 
     /**
-    * @Description: 根据组id查询视频课
-    * @Author: cy
-    * @Date: 2022/4/2
-    */
+     * @Description: 根据组id查询视频课
+     * @Author: cy
+     * @Date: 2022/4/2
+     */
     @ApiOperation(value = "根据组id查询视频课")
-    @GetMapping(value="/selectVideoLesson")
+    @GetMapping(value = "/selectVideoLesson")
     public HttpResponseResult<VideoLessonStudentVo> selectVideoLesson(@NotNull(message = "视频组id不能为空") Long groupId) {
         return succeed(detailService.selectVideoLesson(groupId));
     }
+
+    /**
+     * @Description: 视频课评价
+     * @Author: cy
+     * @Date: 2022/4/11
+     */
+    @ApiOperation(value = "视频课评价", httpMethod = "POST", consumes = "application/json", produces = "application/json")
+    @PostMapping(value = "/evaluate", consumes = "application/json", produces = "application/json")
+    public HttpResponseResult<Object> evaluate(@Validated @RequestBody VideoLessonEvaluate evaluate) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+
+        evaluateService.evaluate(evaluate, sysUser);
+        return succeed();
+    }
+
+    /**
+     * @Description: 根据视频课id查评论
+     * @Author: cy
+     * @Date: 2022/4/11
+     */
+    @ApiOperation(value = "根据视频课id查评论")
+    @PostMapping(value = "/page")
+    public HttpResponseResult<PageInfo<VideoLessonEvaluateVo>> selectEvaluate(@RequestBody VideoLessonEvaluateSearch query) {
+        IPage<VideoLessonEvaluateVo> pages = evaluateService.selectEvaluate(PageUtil.getPage(query), query);
+        return succeed(PageUtil.pageInfo(pages));
+    }
 }

+ 67 - 31
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/VideoLessonGroupDetailController.java

@@ -1,9 +1,13 @@
 package com.yonge.cooleshow.teacher.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonEvaluateSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonSearch;
+import com.yonge.cooleshow.biz.dal.entity.VideoLessonEvaluate;
+import com.yonge.cooleshow.biz.dal.service.VideoLessonEvaluateService;
 import com.yonge.cooleshow.biz.dal.support.PageUtil;
 import com.yonge.cooleshow.biz.dal.valid.impl.ValidList;
+import com.yonge.cooleshow.biz.dal.vo.VideoLessonEvaluateVo;
 import com.yonge.cooleshow.biz.dal.vo.VideoLessonGroupDetailUpVo;
 import com.yonge.cooleshow.biz.dal.vo.VideoLessonPurchaseStudent;
 import com.yonge.cooleshow.common.page.PageInfo;
@@ -22,9 +26,10 @@ import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 
 /**
  * 视频课明细表 web 控制层
+ *
  * @author yzp
- * @date 2022-03-26 00:21:46
  * @version v1.0
+ * @date 2022-03-26 00:21:46
  **/
 @RestController
 @RequestMapping("/videoLesson")
@@ -32,77 +37,108 @@ import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 public class VideoLessonGroupDetailController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private VideoLessonEvaluateService evaluateService;
 
-	@Autowired
-	private VideoLessonGroupDetailService videoLessonGroupDetailService;
+    @Autowired
+    private VideoLessonGroupDetailService videoLessonGroupDetailService;
 
     /**
      * @Description: 查询视频课
      * @Author: cy
      * @Date: 2022/3/31
      */
-    @ApiOperation(value = "查询视频课", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping(value="/page", consumes="application/json", produces="application/json")
+    @ApiOperation(value = "查询视频课", httpMethod = "POST", consumes = "application/json", produces = "application/json")
+    @PostMapping(value = "/page", consumes = "application/json", produces = "application/json")
     public HttpResponseResult<PageInfo<VideoLessonGroupDetail>> page(@RequestBody VideoLessonSearch query) {
         IPage<VideoLessonGroupDetail> pages = videoLessonGroupDetailService.selectPage(PageUtil.getPage(query), query);
         return succeed(PageUtil.pageInfo(pages));
     }
 
     /**
-    * @Description: 根据组id查询购买用户
-    * @Author: cy
-    * @Date: 2022/4/1
-    */
-    @ApiOperation(value = "根据组id查询购买用户", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping(value="/pageStudent", consumes="application/json", produces="application/json")
+     * @Description: 根据组id查询购买用户
+     * @Author: cy
+     * @Date: 2022/4/1
+     */
+    @ApiOperation(value = "根据组id查询购买用户", httpMethod = "POST", consumes = "application/json", produces = "application/json")
+    @PostMapping(value = "/pageStudent", consumes = "application/json", produces = "application/json")
     public HttpResponseResult<PageInfo<VideoLessonPurchaseStudent>> pageStudent(@RequestBody VideoLessonSearch query) {
         IPage<VideoLessonPurchaseStudent> pages = videoLessonGroupDetailService.selectPageStudent(PageUtil.getPage(query), query);
         return succeed(PageUtil.pageInfo(pages));
     }
 
     /**
-    * @Description: 新增视频课
-    * @Author: cy
-    * @Date: 2022/3/31
-    */
-	@ApiOperation(value = "新增视频课", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping(value="/create", consumes="application/json", produces="application/json")
+     * @Description: 新增视频课
+     * @Author: cy
+     * @Date: 2022/3/31
+     */
+    @ApiOperation(value = "新增视频课", httpMethod = "POST", consumes = "application/json", produces = "application/json")
+    @PostMapping(value = "/create", consumes = "application/json", produces = "application/json")
     public HttpResponseResult<Object> create(@Validated @RequestBody ValidList<VideoLessonGroupDetail> videoLessonList) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
 
-        videoLessonGroupDetailService.insertVideoLesson(videoLessonList,sysUser);
+        videoLessonGroupDetailService.insertVideoLesson(videoLessonList, sysUser);
         return succeed();
     }
 
-    /** 
-    * @Description: 修改视频课 
-    * @Author: cy 
-    * @Date: 2022/3/31
-    */
-    @ApiOperation(value = "修改视频课", httpMethod="POST", consumes="application/json", produces="application/json")
-    @PostMapping(value="/update", consumes="application/json", produces="application/json")
+    /**
+     * @Description: 修改视频课
+     * @Author: cy
+     * @Date: 2022/3/31
+     */
+    @ApiOperation(value = "修改视频课", httpMethod = "POST", consumes = "application/json", produces = "application/json")
+    @PostMapping(value = "/update", consumes = "application/json", produces = "application/json")
     public HttpResponseResult<Object> update(@Validated @RequestBody VideoLessonGroupDetailUpVo detailUpVo) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
 
-        videoLessonGroupDetailService.updateDetail(detailUpVo,sysUser);
+        videoLessonGroupDetailService.updateDetail(detailUpVo, sysUser);
         return succeed();
     }
 
     /**
-    * @Description: 删除视频课
-    * @Author: cy
-    * @Date: 2022/3/31
-    */
-    @ApiOperation(value = "删除视频课", httpMethod="POST", consumes="application/json", produces="application/json")
+     * @Description: 删除视频课
+     * @Author: cy
+     * @Date: 2022/3/31
+     */
+    @ApiOperation(value = "删除视频课", httpMethod = "POST", consumes = "application/json", produces = "application/json")
     @PostMapping("/delete/{id}")
     public Object delete(@PathVariable Long id) {
         videoLessonGroupDetailService.deleteDetail(id);
         return succeed();
     }
+
+    /**
+     * @Description: 视频课评价
+     * @Author: cy
+     * @Date: 2022/4/8
+     */
+    @ApiOperation(value = "视频课评价", httpMethod = "POST", consumes = "application/json", produces = "application/json")
+    @PostMapping(value = "/evaluate", consumes = "application/json", produces = "application/json")
+    public HttpResponseResult<Object> evaluate(@Validated @RequestBody VideoLessonEvaluate evaluate) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+
+        evaluateService.evaluate(evaluate, sysUser);
+        return succeed();
+    }
+
+    /**
+     * @Description: 根据视频id查评论
+     * @Author: cy
+     * @Date: 2022/4/11
+     */
+    @ApiOperation(value = "根据视频id查评论")
+    @PostMapping(value = "/page")
+    public HttpResponseResult<PageInfo<VideoLessonEvaluateVo>> selectEvaluate(@RequestBody VideoLessonEvaluateSearch query) {
+        IPage<VideoLessonEvaluateVo> pages = evaluateService.selectEvaluate(PageUtil.getPage(query), query);
+        return succeed(PageUtil.pageInfo(pages));
+    }
 }