package com.fjs.scenic.service.ord;

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

import com.fjs.scenic.dto.OrderDetailModel;
import com.fjs.scenic.dto.OrdersDto;
import com.fjs.scenic.entity.order.OrderNum;
import com.fjs.scenic.entity.order.Orders;
import com.fjs.scenic.utils.ReturnResult;

/**
 * 订单
 * @author Administrator
 *
 */
public interface OrdersService {

	public int insert(Orders record);

	public List<Orders> select(Orders record);

	public int update(Orders record);

	public void delete(Orders record);

	public List<Orders> selectByParam(String field,String param);

	public void updateByParam(String param);

	public void deleteByParam(String param);
	
	public List<Orders> selectByJoin(String field,String param);
	
	public Orders selectByPrimaryKey(Integer id);
	
	public List<OrderNum> selectByCount(String field,String param);

	/**提交订单*/
	public ReturnResult subOrder(Integer goodsId, Integer priceRuleId, Integer dateId,String parkingTime, String linkManIds,
			String buyUserName, String buyPhone, String buyIdCard, Double totlePrice,Double price,Integer num,Integer userId);
	
	/**提交订单*/
	public ReturnResult innerSubOrder(Integer goodsId, String linkManIds,String buyUserName, String buyPhone, String buyIdCard, Double totlePrice,Double price,Integer userId);
	
	/**微信端订单列表*/
	public ReturnResult selectByStatus(Orders orders,String type);
	/**微信端订单详情*/
	public OrderDetailModel selectOrderDetail(Integer id,Integer userID);

	/**发起退款*/
	public ReturnResult refundOrder(Integer id);
	
	/**发起支付*/
	public ReturnResult pay(String orderNo);

	/**发起支付*/
	public void pay(String orderNo,String cashFee);

	/**2.0修改订单状态*/
	public ReturnResult updateOrder(Integer orderId, String status);
	
	/**畅游通异步回掉**/
	public Object ticketNotice(String param,String method);
	
	/**删除过期的订单*/
	public void deleteExpireOrder();

	/**管理平台手动发送出票通知到分销系统*/
	public ReturnResult outTicket(Integer orderId);

	/**管理平台分页查询订单列表*/
	public List<Map<String, String>> selectPage(OrdersDto orders);
	
	/*修改订单状态未已过期**/
	void updateOrderByExpire();


	/**管理平台分页查询订单列表*/
	public List<String> selectIdsPage(OrdersDto orders);


	/**通过订单号 掉分销的取消订单 腾出库存*/
	public ReturnResult refundCytOrderByOrderNo(String orderNo);


	/**通过订单 掉分销的取消订单 腾出库存*/
	public ReturnResult refundCytOrderByOrder(Orders order);
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	/***************************************/
	
	/**改变订单状态*/
	public ReturnResult changeOrderStatus(Integer id,String status);

	/**
	 * 查询订单（根据流水号）
	 * @param orderNo
	 * @return
	 */
    Orders selectByOrderNo(String orderNo);

	/**
	 * 通过id集合获取订单信息
	 * @param ids
	 * @return
	 */
	List<Map<String,Object>> selectByIds(List<String> ids);

	/**
	 * 管理端 订单查询分页
	 * @param orders 查询条件
	 * @param currentPage 页大小
	 * @param pageSize 页码
	 * @return
	 */
	Map<String,Object> selectPage1(OrdersDto orders, int currentPage, int pageSize);

	public void sendMessage(String ordersNo,String phone);
}
