package com.yonge.cooleshow.admin.service;

import com.yonge.cooleshow.admin.dto.*;
import com.yonge.cooleshow.admin.dto.search.OrderStatisticalSearch;
import com.yonge.cooleshow.admin.dto.search.UserStatisticalSearch;
import org.springframework.transaction.annotation.Transactional;

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

/**
 * 订单管理Service
 * Created by macro on 2018/10/11.
 */
public interface OmsOrderService {
    /**
     * 订单查询
     * @return
     */
    List<OrderVo> list(OmsOrderQueryParam queryParam, Integer pageSize, Integer pageNum);

    /**
     * 批量发货
     */
    @Transactional
    int delivery(List<OmsOrderDeliveryParam> deliveryParamList);

    /**
     * 批量关闭订单
     */
    @Transactional
    int close(List<Long> ids, String note);

    /**
     * 批量删除订单
     */
    @Transactional
    int delete(List<Long> ids);

    /**
     * 获取指定订单详情
     */
    OmsOrderDetail detail(Long id);

    /**
     * 修改订单收货人信息
     */
    @Transactional
    int updateReceiverInfo(OmsReceiverInfoParam receiverInfoParam);

    /**
     * 修改订单费用信息
     */
    @Transactional
    int updateMoneyInfo(OmsMoneyInfoParam moneyInfoParam);

    /**
     * 修改订单备注
     */
    @Transactional
    int updateNote(Long id, String note, Integer status);

    /**
     * 商城用户统计
     *
     * @param search 参数
     */
    void userStatistical(UserStatisticalSearch search);

    /**
     * 远程查询订单成功的用户和时间信息
     *
     * @param param
     *            -- startTime   订单完成开始时间
     *            -- endTime 订单完成结束时间
     *            -- userIdList 用户id集合
     * @return
     */
    List<Map<String,Object>> userOrderInfoList(Map<String, Object> param);

    /**
     * 首页统计
     */
    HomeStatistical countStatistical();

    /**
     * 订单统计
     *
     * @param search 条件
     * @return
     */
    HomeOrderStatistical orderStatistical(OrderStatisticalSearch search);
}
