package com.qs.mp.channel.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qs.mp.admin.domain.param.ChannelOrderCancelParam;
import com.qs.mp.admin.domain.vo.IndexVO;
import com.qs.mp.admin.domain.vo.TicketCntVO;
import com.qs.mp.channel.domain.ChannelOrder;
import com.qs.mp.channel.domain.ChannelOrderDetail;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qs.mp.channel.domain.vo.ChannelOrderSettleVO;
import com.qs.mp.channel.domain.vo.ChannelOrderVO;
import com.qs.mp.pay.domain.PayOrder;
import com.qs.mp.user.domain.UserDeliverOrder;
import com.qs.mp.user.domain.vo.UserDeliverOrderVO;

/**
 * <p>
 * 经销商盲票采购订单 服务类
 * </p>
 *
 * @author quanshu
 * @since 2022-03-02
 */
public interface IChannelOrderService extends IService<ChannelOrder> {

  /**
   * 提交订单
   * @param channelId
   * @param memo
   * @param orderSettleVO
   * @return
   */
  String submitOrder(Long channelId, String memo, ChannelOrderSettleVO orderSettleVO);

  /**
   * 取消订单
   * @param channelId
   * @param orderId
   * @return
   */
  boolean cancelOrder(Long channelId, String orderId);

  /**
   * 支付成功回调
   * @param payOrder
   */
  void paySuccess(PayOrder payOrder);
  
	/**
	 * 渠道订单发货
	 * 
	 * @param orderId
	 * @param pkgIds
	 * @return
	 */
	boolean channelOrderShip(ChannelOrder channelOrder, List<String> pkgIdList);
	
	
	/**
	 * 获取经销商订单列表信息，支持翻页
	 * 
	 * @param wrapper
	 * @return
	 */
	public List<ChannelOrderVO> selectChannelOrderVoList(Wrapper<ChannelOrder> wrapper);
	
	
	/**
	 * 查询满足筛选条件的经销商订单数量
	 *
	 * @param wrapper
	 * @return
	 */
	int selectChannelOrderCount(Wrapper<ChannelOrder> wrapper);

	/**
	 * 后台经销商取消订单
	 * @param param
	 * @return
	 */
    boolean cancelOrderByAdmin(ChannelOrderCancelParam param);

	/**
	 * 订单确认收货
	 * @param order
	 */
    void confirm(ChannelOrder order);

	/**
	 * 统计实时交易数据
	 * @param wrapper
	 * @return
	 */
	List<IndexVO> selectIndexChannelOrderDailyInfoList(QueryWrapper<ChannelOrder> wrapper);

	/**
	 * 预付金额统计
	 * @param channelOrderQueryWrapper
	 * @return
	 */
    int selectPreSaleAmtByQueryWrapper(QueryWrapper<ChannelOrder> channelOrderQueryWrapper);
}
