package com.cyksj.service.order;

import com.alipay.api.AlipayApiException;
import com.alipay.api.response.AlipayFundTransCommonQueryResponse;
import com.alipay.api.response.AlipayTradeFastpayRefundQueryResponse;
import com.alipay.api.response.AlipayTradeQueryResponse;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cyksj.model.dto.AliPayParams;
import com.cyksj.model.dto.H5JsPayParams;
import com.cyksj.model.entity.*;
import com.cyksj.model.manage.views.UpgradeOrderDetailView;
import com.cyksj.model.request.AlipayOrderDonReq;
import com.cyksj.model.request.OrderPayRequest;

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

/**
 * @author chan
 * @date 2021/10/11 下午4:07
 */
public interface OrderDonService extends IService<OrderDon> {

    OrderDon submit(OrderPayRequest request) throws Exception;

    /**
     * 订单支付
     */
    H5JsPayParams pay(Long orderId, String tradeType) throws Exception;

    /**
     * 微信pc端支付
     */
    H5JsPayParams wxPcWebPay(Long orderId, String tradeType) throws Exception;

    /**
     * 微信支付回调
     */
    void prepayNotify(Map<String, String> map) throws Exception;

    /**
     * 关闭订单
     */
    void closeOrder(Long orderId, Long userId);

    OrderDon renewal(OrderPayRequest request) throws Exception;

    OrderDetailView getDetail(Long orderId, Long userId);

    List<OrderDon> getAppleOneOrderDons(List<Long> skuIds, List<String> noOrderStatus, Date yesZeroDate, Date thisZeroDate);

    /**
     * 支付宝预支付
     */
    AliPayParams aliPay(AlipayOrderDonReq alipayOrderDonReq, String productCode, String qrPayMode) throws Exception;

    /**
     * 支付宝回调
     */
    void aliPayNotify(Map<String, String> paramsMap) throws Exception;

    List<RealGoodsInterestUser> selectNoPaymentRealGoods();

    Integer updateHasPaymentInterestRealGoods();

    void updateHasPaymentInterestRealGoodsPayTime();

    void saveTransport(Long addressId, Long orderId);

    /**
     * 查询支付宝转账状态
     */
    AlipayFundTransCommonQueryResponse getTransFerStatusByTid(String translationId) throws Exception;

    /**
     * 支付宝订单详情
     */
    AlipayTradeQueryResponse getZfbOrderDetail(String shopId, String orderNo) throws AlipayApiException;

    /**
     * 支付宝退款订单详情
     */
    AlipayTradeFastpayRefundQueryResponse getZfbRefundDetail(String shopId, String orderNo) throws AlipayApiException;

    /**
     * 0元订单确认
     */
    void zeroOrderConfirm(Long orderId);

    void zeroUpgradeOrderConfirm(Long orderId);

    void orderNotify(OrderDon orderDon);

    UpgradeOrderDon submitUpgrade(OrderPayRequest payRequest);

    AliPayParams aliPayUpgrade(AlipayOrderDonReq re, String productCode, String qrPayMode) throws Exception;

    void aliPayUpgradeNotify(Map<String, String> params) throws Exception;

    void closeUpgradeOrder(Long orderId, Long userId);

    UpgradeOrderDetailView getUpgradeOrderDetail(Long orderId, Long userId);

	OrderDon submitRenewUpgrade(OrderPayRequest payRequest);

	OrderDon userBenefitsSubmit(OrderPayRequest orderPayRequest) throws Exception;

    UserPayEquipmentAvailableBenefits getComboOptionalTicketRecord(long userId, Long orderId);

    AliPayParams aliPaySpotifyUpgrade(AlipayOrderDonReq alipayOrderDonReq, String productCode, String qrPayMode) throws Exception;

    void aliPaySpotifyUpgradeNotify(Map<String, String> params) throws Exception;

	void receiveGptMirrorDayCard(Long orderId) throws Exception;
}
