| | |
| | | import com.dsh.course.model.dto.DiscountJsonDto; |
| | | import com.dsh.course.model.vo.CourseDetailRequest; |
| | | import com.dsh.course.model.vo.RegisterCourseVo; |
| | | import com.dsh.course.model.vo.request.ClasspaymentRequest; |
| | | import com.dsh.course.model.vo.request.CourseOfAfterRequest; |
| | | import com.dsh.course.model.vo.request.CourseWithDetailsRequest; |
| | | import com.dsh.course.model.vo.request.UpdateCourseVideoStatusRequest; |
| | | import com.dsh.course.model.vo.response.AppUserVideoResponse; |
| | | import com.dsh.course.model.vo.response.CourseDetailsResponse; |
| | | import com.dsh.course.model.vo.response.CourseOfVideoResponse; |
| | | import com.dsh.course.service.*; |
| | | import com.dsh.course.util.DateUtil; |
| | |
| | | @ApiOperation(value = "课后视频课表", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(name = "search",value = "视频名称", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<List<AppUserVideoResponse>> queryAfterSourceList(@RequestBody CourseOfAfterRequest search){ |
| | | try { |
| | |
| | | @ApiOperation(value = "课后视频详情", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(name = "search",value = "视频名称", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<CourseOfVideoResponse> queryAfterSourceDetails(@RequestBody CourseWithDetailsRequest detailsRequest){ |
| | | try { |
| | |
| | | @ApiOperation(value = "更新课后视频学习状态", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(name = "search",value = "视频名称", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil updateVideoStatus(@RequestBody UpdateCourseVideoStatusRequest detailsRequest){ |
| | | try { |
| | |
| | | } |
| | | } |
| | | |
| | | // |
| | | // @PostMapping("/base/coursePack/courseOfPurchased") |
| | | // public List<PurchaseVo> getAppUsersCourseData(@RequestBody Integer appUserId){ |
| | | // List<PurchaseVo> voList = new ArrayList<>(); |
| | | //// 查询够课包记录 |
| | | // List<TCoursePackagePayment> tCoursePackagePayments = packagePaymentService.queryAllCoursePackage(null,null,null,null,appUserId); |
| | | // //查询上课记录 |
| | | // List<Integer> coursePackageIds = tCoursePackagePayments.stream().map(TCoursePackagePayment::getCoursePackageId).collect(Collectors.toList()); |
| | | // List<CoursePackageStudent> packageStudents = cpsService.queryAppUserOfStuAttendClass(appUserId,coursePackageIds); |
| | | // Map<Integer, Long> collect = packageStudents.stream() |
| | | // .collect(Collectors.groupingBy(CoursePackageStudent::getCoursePackageId, Collectors.counting())); |
| | | // |
| | | // if (tCoursePackagePayments.size() > 0){ |
| | | // for (TCoursePackagePayment tCoursePackagePayment : tCoursePackagePayments) { |
| | | // TCoursePackage coursePackage = tcpService.getById(tCoursePackagePayment.getCoursePackageId()); |
| | | // PurchaseVo purchaseVo = new PurchaseVo(); |
| | | // purchaseVo.setCourseId(tCoursePackagePayment.getCoursePackageId()); |
| | | // purchaseVo.setCourseName(coursePackage.getName()); |
| | | // purchaseVo.setCourseTime(coursePackage.getClassStartTime()+"-"+coursePackage.getClassEndTime()); |
| | | // purchaseVo.setStoreId(coursePackage.getStoreId()); |
| | | // purchaseVo.setTeacherId(coursePackage.getCoachId()); |
| | | // purchaseVo.setPackageImg(coursePackage.getCoverDrawing()); |
| | | // purchaseVo.setCourseStatus(tCoursePackagePayment.getPayStatus()); |
| | | // purchaseVo.setCourseTypeId(coursePackage.getCoursePackageTypeId()); |
| | | // for (Map.Entry<Integer, Long> entry : collect.entrySet()) { |
| | | // int coursePackageId = entry.getKey(); |
| | | // if (tCoursePackagePayment.getCoursePackageId() == coursePackageId) { |
| | | // purchaseVo.setCourseNums((int) (entry.getValue()*2)); |
| | | // } |
| | | // } |
| | | // voList.add(purchaseVo); |
| | | // } |
| | | // } |
| | | // return voList; |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 已报名课程列表 |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 已报名课程详情 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/startCource/afterSourceDetail") |
| | | @ApiOperation(value = "已报名课程详情", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<CourseDetailsResponse> getRegisteredData(@RequestBody Integer coursePackageId){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(packagePaymentService.queryRegisteredCourseDetails(coursePackageId,appUserId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 已报名课程-支付 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/startCource/payment") |
| | | @ApiOperation(value = "已报名课程-支付", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil continuationOperation(@RequestBody ClasspaymentRequest request){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return packagePaymentService.ContinuationOrpaymentCourse(userIdFormRedis,request); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |