package com.buy507.mall.portal.service;

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

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alipay.api.AlipayApiException;
import com.buy507.mall.common.api.CommonResult;
import com.buy507.mall.model.UmsMemberOrderQueue;
import com.buy507.mall.portal.domain.*;

/**
 * 前台订单管理Service
 */
public interface OmsPortalOrderService {
	
	/**
	 * 获取会员订单信息
	 * @param orderStatus
	 * @param pageSize
	 * @param pageNum
	 * @return
	 */
	List<OrderResult> getMemberOrderList(Integer orderStatus, Integer pageSize, Integer pageNum);
	
	/**
	 * 获取会员订单详细信息
	 * @param orderId
	 * @return
	 */
	OrderResult getMemberOrderDetailInfo(Long orderId);

    /**
     * 根据提交信息生成订单
     */
    CommonResult createCartOrder(CartOrderParam orderParam);

    /**
     * 自动取消超时订单
     */
    CommonResult cancelTimeOutOrder();

    /**
     * 取消订单
     */
    CommonResult cancelOrder(Long orderId);
    
    /**
     * 删除订单
     */
    CommonResult deleteOrder(Long orderId);

    /**
     * 对已付款订单退款
     * @param orderId
     * @return
     */
    CommonResult refundOrder(Long orderId);

    /**
     * 直接购买，根据提交信息生成订单
     */
    CommonResult createOrder(OrderParam orderParam);
    
    /**
     * 获取商家银行账户信息
     */
    SellerBankAccountResult getSellerBankAccount();
    
    /**
     * 线下确认支付接口
     * @param paymentParam
     */
    CommonResult payment(OfflinePaymentParam paymentParam);
    
    CommonResult getLogistics(Long orderId);
    
    CommonResult confirmReceiving(Long orderId);
    
    /**
     * 积分支付
     * @param orderId
     * @return
     */
    CommonResult pointPayment(Long orderId);

    /**
     * 余额支付
     */
    CommonResult balancePayment(Long orderId);

    /**
     * 微信预支付
     * @param orderId
     * @return
     */
    CommonResult<Map<String, String>> wxPrePay(Long orderId);

    /**
     * 支付宝跳转
     * @param orderId
     * @return
     */
    String toAlipayWeb(Long orderId) throws AlipayApiException;
    
    /**
	 * 微信支付成功回调方法
	 * @param request
	 * @param response
	 */
	void wxPayCallback(HttpServletRequest request, HttpServletResponse response) throws Exception;

    //CommonResult outOrderInfo(Integer productId);
    //List<TeamMemberResult> outOrderInfo(Long memberId, Integer pageSize, Integer pageNum);

    /**
     * 支付宝支付成功回调方法
     * @param params
     */
    void alipayCallback(Map<String, String> params);

    /**
     * 加速订单
     * @param orderId
     * @return
     */
    CommonResult accelerateOrder(Long orderId);

    /**
     * 通单队列查询信息
     * @return
     */
    CommonResult orderQueueInfo();
    /**
     * 加速单排队信息
     * @return
     */
    CommonResult accelerateOrderInfo(Long orderId);
    /**
     * 出局名单
     *
     * @return
     */
    List<UmsMemberOrderQueue> outOrderInfo();
    /**
     * 邀请加速出局名单
     *
     * @return
     */
    List<UmsMemberOrderQueue> inviteList(Long oerId);
}
