|  | @@ -90,12 +90,12 @@ public class VideoLessonPurchaseRecordServiceImpl extends ServiceImpl<VideoLesso
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          //校验课程是否购买
 | 
	
		
			
				|  |  | -        VideoLessonPurchaseRecord isAlreadyBuy = videoLessonPurchaseRecordDao.selectOne(Wrappers.<VideoLessonPurchaseRecord>lambdaQuery()
 | 
	
		
			
				|  |  | -                .eq(VideoLessonPurchaseRecord::getStudentId, studentId)
 | 
	
		
			
				|  |  | -                .eq(VideoLessonPurchaseRecord::getVideoLessonGroupId, groupId));
 | 
	
		
			
				|  |  | -        if (!ObjectUtil.isEmpty(isAlreadyBuy)) {
 | 
	
		
			
				|  |  | -            throw new BizException("已购买过该课程");
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +//        VideoLessonPurchaseRecord isAlreadyBuy = videoLessonPurchaseRecordDao.selectOne(Wrappers.<VideoLessonPurchaseRecord>lambdaQuery()
 | 
	
		
			
				|  |  | +//                .eq(VideoLessonPurchaseRecord::getStudentId, studentId)
 | 
	
		
			
				|  |  | +//                .eq(VideoLessonPurchaseRecord::getVideoLessonGroupId, groupId));
 | 
	
		
			
				|  |  | +//        if (!ObjectUtil.isEmpty(isAlreadyBuy)) {
 | 
	
		
			
				|  |  | +//            throw new BizException("已购买过该课程");
 | 
	
		
			
				|  |  | +//        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          purchaseRecord.setOrderNo(orderNo);
 | 
	
		
			
				|  |  |          purchaseRecord.setStudentId(studentId);
 | 
	
	
		
			
				|  | @@ -142,7 +142,7 @@ public class VideoLessonPurchaseRecordServiceImpl extends ServiceImpl<VideoLesso
 | 
	
		
			
				|  |  |              throw new BizException("订单不存在!");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          //修改支付状态
 | 
	
		
			
				|  |  | -        videoLessonPurchaseRecordDao.updateStatus(orderNo, userOrder.getStatus().getCode());
 | 
	
		
			
				|  |  | +        videoLessonPurchaseRecordDao.updateStatus(orderNo, OrderStatusEnum.PAID.getCode());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          //查询直播课服务费
 | 
	
		
			
				|  |  |          String videoServiceRateStr = sysConfigService.findConfigValue(SysConfigConstant.VIDEO_LESSON_SERVICE_FEE);
 | 
	
	
		
			
				|  | @@ -170,6 +170,36 @@ public class VideoLessonPurchaseRecordServiceImpl extends ServiceImpl<VideoLesso
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | +     * @Description: 购买视频课-失败-回调
 | 
	
		
			
				|  |  | +     * @Author: cy
 | 
	
		
			
				|  |  | +     * @Date: 2022/4/24
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | +    public void buyVideoCourseFailed(UserOrderDetailVo orderParam) {
 | 
	
		
			
				|  |  | +        String orderNo = orderParam.getOrderNo();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        VideoLessonPurchaseRecord videoGroup = videoLessonPurchaseRecordDao.selectOne(Wrappers.<VideoLessonPurchaseRecord>lambdaQuery()
 | 
	
		
			
				|  |  | +                .eq(VideoLessonPurchaseRecord::getOrderNo, orderNo));
 | 
	
		
			
				|  |  | +        if (videoGroup == null) {
 | 
	
		
			
				|  |  | +            throw new BizException("课程组不存在!");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        //删除video_lesson_purchase_record数据
 | 
	
		
			
				|  |  | +        videoLessonPurchaseRecordDao.delete(Wrappers.<VideoLessonPurchaseRecord>lambdaQuery()
 | 
	
		
			
				|  |  | +                .eq(VideoLessonPurchaseRecord::getOrderNo, orderNo));
 | 
	
		
			
				|  |  | +        log.info("buyVideoCourseFailed ok");
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 获取用户信息
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    private SysUser getSysUser(Long userId) {
 | 
	
		
			
				|  |  | +        return Optional.ofNullable(userId)
 | 
	
		
			
				|  |  | +                .map(sysUserFeignService::queryUserById)
 | 
	
		
			
				|  |  | +                .orElseThrow(() -> new BizException("用户不存在"));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  |       * @Description: 购买视频课消息推送
 | 
	
		
			
				|  |  |       * @Author: cy
 | 
	
		
			
				|  |  |       * @Date: 2022/5/6
 | 
	
	
		
			
				|  | @@ -221,34 +251,4 @@ public class VideoLessonPurchaseRecordServiceImpl extends ServiceImpl<VideoLesso
 | 
	
		
			
				|  |  |              e.printStackTrace();
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    /**
 | 
	
		
			
				|  |  | -     * @Description: 购买视频课-失败-回调
 | 
	
		
			
				|  |  | -     * @Author: cy
 | 
	
		
			
				|  |  | -     * @Date: 2022/4/24
 | 
	
		
			
				|  |  | -     */
 | 
	
		
			
				|  |  | -    @Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | -    public void buyVideoCourseFailed(UserOrderDetailVo orderParam) {
 | 
	
		
			
				|  |  | -        String orderNo = orderParam.getOrderNo();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        VideoLessonPurchaseRecord videoGroup = videoLessonPurchaseRecordDao.selectOne(Wrappers.<VideoLessonPurchaseRecord>lambdaQuery()
 | 
	
		
			
				|  |  | -                .eq(VideoLessonPurchaseRecord::getOrderNo, orderNo));
 | 
	
		
			
				|  |  | -        if (videoGroup == null) {
 | 
	
		
			
				|  |  | -            throw new BizException("课程组不存在!");
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        //删除video_lesson_purchase_record数据
 | 
	
		
			
				|  |  | -        videoLessonPurchaseRecordDao.delete(Wrappers.<VideoLessonPurchaseRecord>lambdaQuery()
 | 
	
		
			
				|  |  | -                .eq(VideoLessonPurchaseRecord::getOrderNo, orderNo));
 | 
	
		
			
				|  |  | -        log.info("buyVideoCourseFailed ok");
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    /**
 | 
	
		
			
				|  |  | -     * 获取用户信息
 | 
	
		
			
				|  |  | -     */
 | 
	
		
			
				|  |  | -    private SysUser getSysUser(Long userId) {
 | 
	
		
			
				|  |  | -        return Optional.ofNullable(userId)
 | 
	
		
			
				|  |  | -                .map(sysUserFeignService::queryUserById)
 | 
	
		
			
				|  |  | -                .orElseThrow(() -> new BizException("用户不存在"));
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  |  }
 |