package com.iamberry.wechat.face.order;

import com.iamberry.wechat.core.entity.admin.ShopSystemRule;
import com.iamberry.wechat.core.entity.member.CashLog;
import com.iamberry.wechat.core.entity.member.Member;
import com.iamberry.wechat.core.entity.order.Order;
import com.iamberry.wechat.core.entity.order.OrderItem;
import com.iamberry.wechat.core.entity.order.OrderRebackMoney;
import com.iamberry.wechat.core.entity.statictics.StatisticsSalesOrder;

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

public interface AdminOrderService {
	
	/**
	 * 根据订单编号，获取该订单的返利信息
	 * @param orderId  订单编号
	 * @return List<OrderRebackMoney> 返利信息
	 */
	public List<OrderRebackMoney> selectOrderRebackByOrderId(String orderId);

	//后台订单列表查询
	public List<Order> selectShopOrder(Order order);

	//根据页面条件查询订单列表
	public List<Order> selectShopOrderByOrderId(Order order);

	//根据订单id查询订单
	public Order getShopOrderByOrderId(String orderId);

	//根据订单id查询订单项
	public List<OrderItem> getShopOrderItemByOrderId(String orderId);

	//根据条件获取订单总数
	public Integer selectShopOrderCount(Order order);

	//根据orderId查询订单的状态
	public Order selectOrderStatusByOrderId(String orderId);

	//根据orderId修改订单状态
	public boolean updateOrderStatusByOrderId(Order order);

	//根据orderid添加发货信息并修改状态
	public boolean deliverOrderByOrderId(Order order);

	//修改备注信息
	public boolean updateOrderAdminRemarkByOrderId(String remark, String orderId, Integer remarkColor);

	//获取没有奖励积分但可以奖励的数据
	public List<Order> selectOrderByIntegral(Order order);

	//按条件查询订单总数量
	public Integer getOrderNum(Order order);

	//对客户进行积分奖励
	public void updateOrderIntegral(Order order,ShopSystemRule shopSystemRule);

	//根据id获取系统规则
	public ShopSystemRule getReluByRid(int rId);

	// 根据订单号，获取订单的所属人
	public String selectSalesOpenIdByOrderId(String orderId);

	//根据创建时间查询订单
	public List<Order> getOrderByCreateTime(Order order);

	//根据穿件时间查询订单-5分钟未支付的订单
	public List<Order> getOrderByCreateTimeAndFiveMinutes(Order order);

	//根据order集合对象批量修改订单状态
	public Integer updateOrderByOrderId(List<String> list);

	// 根据订单号和订单状态修改订单状态
	public Integer updateOrderStatusByOrderIdAndToStatus(Order order);

	/**
	 * 获取某个订单的所有产品的总个数
	 * @param orderId
	 * @return
	 */
	public List<OrderItem> getItemsNumByOrderId(String orderId);

	/**
	 * 根据orderId和oldStatus修改发货信息和状态
	 * @param order
	 * @return
	 */
	public Integer updateOrderDeliver(Order order);

	/**
	 * 查询状态为待发货的所有订单号
	 * @return
	 */
	public List<Order> getOrderList(Order order);

	/**
	 * 批量修改订单状态
	 * @param list
	 * @return
	 */
	public Integer updateOrderListStatus(List<Order> list);

	/**
	 * 通过userid修改会员积分信息
	 * @param member
	 * @return
	 */
	public Integer updateUserByUserId(Member member);

	/**
	 * 添加一条现金记录
	 * @param cashLog
	 * @return
	 */
	public Integer addCashLog(CashLog cashLog);


	/**
	 * 获取销售数量
	 * @param map
	 * @return
	 */
	public Integer getSalesVolumes(Map map);

	/**
	 * 获取个人已购买的机器台数
	 * @param map
	 * @return
	 */
	public Integer getPersonalPurchase(Map map);

	/**
	 * 获取个人消费总额
	 * @param map
	 * @return
	 */
	public Integer getTotalConsume(Map map);

	/**
	 * 获取已购买的总人数
	 * @param member
	 * @return
	 */
	public Integer getAlreadyNumber(Member member);

	/**
	 * 获取购买的机器台数
	 * @param member
	 * @return
	 */
	public Integer getUnitsNumber(Member member);

	/**
	 * 获取总的消费金额
	 * @param member
	 * @return
	 */
	public Integer getTotalAmount(Member member);

	/**
	 * 查询本周销售数量
	 * @return
	 */
	List<StatisticsSalesOrder> listWeekNum();

	/**
	 * 查询上周销售数量
	 * @return
	 */
	List<StatisticsSalesOrder> listLastWeekNum();

	/**
	 * 按月查询销售数量
	 * @return
	 */
	List<StatisticsSalesOrder> listMonthNum(StatisticsSalesOrder salesOrder);

	/**
	 * 按年查询销售数量
	 * @return
	 */
	List<StatisticsSalesOrder> listYearNum(StatisticsSalesOrder salesOrder);


}
