package com.ym.mec.biz.service;

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

import com.ym.mec.biz.dal.dto.SporadicChargeInfoDto;
import com.ym.mec.biz.dal.dto.StudentPaymentOrderExportDto;
import com.ym.mec.biz.dal.entity.Goods;
import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
import com.ym.mec.biz.dal.enums.DealStatusEnum;
import com.ym.mec.biz.dal.enums.GroupType;
import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
import com.ym.mec.biz.dal.enums.OrderTypeEnum;
import com.ym.mec.biz.dal.page.SporadicOrderQueryInfo;
import com.ym.mec.common.page.PageInfo;
import com.ym.mec.common.service.BaseService;

public interface StudentPaymentOrderService extends BaseService<Long, StudentPaymentOrder> {

	/**
	 * 查询商品列表
	 * @param musicGroupId
	 * @param type
	 * @return
	 */
	List<Goods> queryApplyGoodsList(String musicGroupId, OrderDetailTypeEnum type);

	/**
	 * 查询订单列表
	 * @param groupType
	 * @param musicGroupId
	 * @param userId
	 * @param status
	 * @param type
	 * @return
	 */
	List<StudentPaymentOrder> queryByCondition(GroupType groupType, String musicGroupId, Integer userId, DealStatusEnum status, OrderTypeEnum type);

	/**
	 * 查询报名缴费订单
	 * @param musicGroupId
	 * @param status
	 * @return
	 */
	StudentPaymentOrder findMusicGroupApplyOrderByStatus(Integer userId, String musicGroupId, DealStatusEnum status);

	/**
	 * 根据orderNo查询订单
	 * @param orderNo
	 * @return
	 */
	StudentPaymentOrder findOrderByOrderNo(String orderNo);

	/**
	 * 查找支付成功和支付中订单
	 * @return
	 */
	int findPayOrderNum();

	/**
	 * 查询支付中订单
	 *
	 * @param status
	 * @return
	 */
	List<StudentPaymentOrder> findOrdersByStatus(DealStatusEnum status, String paymentChannel);

	/**
	 * 查询支付中超时的订单
	 * @param orderNoList
	 * @param status
	 * @param beforeTime
	 * @return
	 */
	List<StudentPaymentOrder> findOrdersOverTime(List<String> orderNoList, DealStatusEnum status, Date beforeTime);

	void queryOrderStatus() throws Exception;

	void updateOrder(Map<String, String> rpMap) throws Exception;

	/**
	 * 获取零星订单
	 * @param userId
	 * @param sporadicId
	 * @param sporadic
	 * @param status
	 * @return
	 */
	Integer findOrderByGroupType(Integer userId, Integer sporadicId, String sporadic, DealStatusEnum status);

	List<StudentPaymentOrderExportDto> ExportQueryPage(Map<String, Object> params);

	/**
	 * 获取零星收费订单列表
	 * @param queryInfo
	 * @return
	 */
	PageInfo<SporadicChargeInfoDto> sporadicQueryPage(SporadicOrderQueryInfo queryInfo);
}