|  | @@ -854,8 +854,52 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 学生购买直播课程-成功-回调
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public void refundSuccess(UserOrderDetailVo userOrderDetailVo) {
 | 
	
		
			
				|  |  | +    public void refundSuccess(UserOrderDetailVo orderParam) {
 | 
	
		
			
				|  |  | +        log.info("refundSuccess");
 | 
	
		
			
				|  |  | +        String orderNo = orderParam.getOrderNo();
 | 
	
		
			
				|  |  | +        List<CourseScheduleStudentPayment> studentPaymentList = courseScheduleStudentPaymentService.list(Wrappers.<CourseScheduleStudentPayment>lambdaQuery()
 | 
	
		
			
				|  |  | +                .eq(CourseScheduleStudentPayment::getOrderNo, orderNo)
 | 
	
		
			
				|  |  | +        );
 | 
	
		
			
				|  |  | +        CourseScheduleStudentPayment studentPayment;
 | 
	
		
			
				|  |  | +        if (CollectionUtils.isEmpty(studentPaymentList)) {
 | 
	
		
			
				|  |  | +            log.info("buyLiveCourseSuccess >>> 订单不存在!orderParam: {}", JSON.toJSONString(orderParam));
 | 
	
		
			
				|  |  | +            throw new BizException("订单不存在");
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +            studentPayment = studentPaymentList.get(0);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        // 取消老师课酬
 | 
	
		
			
				|  |  | +        cancelTeacherSalary(studentPayment.getUserId(),studentPayment.getCourseGroupId());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        // 删除学生购买记录
 | 
	
		
			
				|  |  | +        buyLiveCourseCancel(orderParam);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 取消老师课酬
 | 
	
		
			
				|  |  | +     *
 | 
	
		
			
				|  |  | +     * @param userId 学生id
 | 
	
		
			
				|  |  | +     * @param courseGroupId 课程组id
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    private void cancelTeacherSalary(Long userId, Long courseGroupId) {
 | 
	
		
			
				|  |  | +        List<CourseScheduleTeacherSalary> list = courseScheduleTeacherSalaryService.lambdaQuery()
 | 
	
		
			
				|  |  | +                                    .eq(CourseScheduleTeacherSalary::getStudentId,userId)
 | 
	
		
			
				|  |  | +                                    .eq(CourseScheduleTeacherSalary::getCourseGroupId, courseGroupId)
 | 
	
		
			
				|  |  | +                                    .list();
 | 
	
		
			
				|  |  | +        list = list.stream().filter(csts ->
 | 
	
		
			
				|  |  | +             TeacherSalaryEnum.NOT_START.getCode().equals(csts.getStatus())
 | 
	
		
			
				|  |  | +        ).peek(csts -> csts.setStatus(CourseScheduleEnum.CANCEL.getCode()))
 | 
	
		
			
				|  |  | +        .collect(Collectors.toList());
 | 
	
		
			
				|  |  | +        if(CollectionUtils.isEmpty(list)) {
 | 
	
		
			
				|  |  | +            return;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        courseScheduleTeacherSalaryService.saveOrUpdateBatch(list);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 |