package com.yonge.cooleshow.biz.dal.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yonge.cooleshow.auth.api.entity.SysUser;
import com.yonge.cooleshow.biz.dal.dto.req.OrderReq;
import com.yonge.cooleshow.biz.dal.dto.search.MemberPriceSettingsSearch;
import com.yonge.cooleshow.biz.dal.entity.ActivityReward;
import com.yonge.cooleshow.biz.dal.entity.MemberPriceSettings;
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
import com.yonge.cooleshow.biz.dal.vo.MemberPriceSettingsVo;
import com.yonge.cooleshow.biz.dal.vo.MemberPriceVo;
import com.yonge.cooleshow.biz.dal.vo.ShareProfitVo;
import com.yonge.cooleshow.biz.dal.vo.UserOrderDetailVo;
import com.yonge.cooleshow.biz.dal.vo.res.OrderCreateRes;
import com.yonge.cooleshow.biz.dal.wrapper.MemberPriceSettingsWrapper;
import com.yonge.cooleshow.biz.dal.wrapper.UserPaymentOrderWrapper;
import com.yonge.cooleshow.common.entity.HttpResponseResult;

import java.util.List;
import java.util.Map;

/**
 *  服务类
 * @author liweifan
 * @date 2022-04-25
 */
public interface MemberPriceSettingsService extends IService<MemberPriceSettings>  {
    /**
     * 查询详情
     * @author liweifan
     * @date 2022-04-25
     */
    MemberPriceSettingsVo detail(Long id);
    /**
     * 分页查询
     * @author liweifan
     * @date 2022-04-25
     */
    IPage<MemberPriceSettingsVo> selectPage(IPage<MemberPriceSettingsVo> page, MemberPriceSettingsSearch query);
    /***
     * 查询列表
     * @author liweifan
     * @updateTime 2022/4/25 14:55
     * @return: java.util.List<com.yonge.cooleshow.biz.dal.vo.MemberPriceSettingsVo>
     */
    List<MemberPriceSettingsVo> selectList(MemberPriceSettingsSearch query);
    /***
     * 订单下单前操作
     * @author liweifan
     * @param: orderReq
     * @updateTime 2022/3/31 15:47
     * @return: com.yonge.cooleshow.common.entity.HttpResponseResult<java.lang.Boolean>
     */
    HttpResponseResult<OrderCreateRes> orderCreate(OrderReq.OrderReqInfo orderReqInfo);
    /***
     * 订单下单后操作
     * @author liweifan
     * @param: orderVo
     * @updateTime 2022/3/31 17:24
     */
    void orderSuccess(UserOrderDetailVo orderDetailVo);

    /**
     * 活动构建vip card record 对象
     *
     * @param userId 用户id
     * @param client 客户端类型
     * @param activityReward 活动奖品
     * @param activityId 活动id
     * @return
     */
    void activityReward(Long userId, ClientEnum client, ActivityReward activityReward, Long activityId,String activityName);

    /**
     * 老师分享VIP 分润
     *
     * @param sysUser 推荐人信息
     * @param vipId 会员id
     * @return
     */
    ShareProfitVo shareVipProfit(SysUser sysUser, Long vipId);
    /**
     * 添加会员
     *
     * @param vipSubmitReq 会员信息
     * @param client 类型
     * @param sysUser
     * @return
     */
//    Boolean addVip(VipSubmitReq vipSubmitReq, ClientEnum client, SysUser sysUser);

    /**
     * 会员信息
     *
     * @param query
     * @return
     */
    MemberPriceVo getVipShare(MemberPriceSettingsSearch query);

    /**
     * 订单创建前校验
     *
     */
    void orderCreate(UserPaymentOrderWrapper.OrderGoodsInfo orderGoodsInfo);

    void orderSuccess(UserOrderDetailVo userPaymentOrder, boolean messageFlag);

    /**
     * 优惠卡创建检查
     *
     */
    void discountCreate(UserPaymentOrderWrapper.OrderGoodsInfo orderGoodsInfo);

    /**
     * 获取畅学卡信息
     *
     * @param userId       用户id
     */
    MemberPriceSettingsWrapper.UserDiscount getDiscount(Long userId);

    MemberPriceSettingsWrapper.UserDiscount getDiscountByOrder(Long userId, Long orderDetilId);

    Map<Long,MemberPriceSettings> getMapByIds(List<Long> memberPriceSettingsIds);
}