package com.kmall.admin.service;

import com.kmall.admin.entity.OfflineCartEntity;
import com.kmall.admin.entity.OrderEntity;
import com.kmall.admin.entity.OrderRefundEntity;
import com.kmall.common.entity.SysUserEntity;
import com.kmall.common.utils.print.ticket.item.Ticket;
import com.kmall.common.utils.wechat.WechatRefundApiResult;
import com.kmall.common.utils.wechat.wxglobal.dto.WechatGlobalRefundApiResult;
import net.sf.json.JSONObject;

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

/**
 * @author Scott
 * @email
 * @date 2017-08-13 10:41:09
 */
public interface OrderService {

    OrderEntity queryObject(Long id);

    OrderEntity queryObjectBySysUser(Long id);

    List<OrderEntity> queryList(Map<String, Object> map);

    int queryTotal(Map<String, Object> map);

    List<OrderEntity> queryOffilineOrderList(Map<String, Object> map);

    int save(OrderEntity order);

    int update(OrderEntity order);

    int delete(Long id);

    int deleteBatch(Long[] ids);

    /**
     * 确定收货
     *
     * @param id
     * @return
     */
    int confirm(Long id);

    int sendGoods(OrderEntity order);

    /**
     * 打印订单
     *
     * @param id 订单ID
     * @return
     */
    Ticket printMsg(Long id);

    /**
     * 退款
     */
    void refund(OrderEntity orderInfo, WechatRefundApiResult result);

    /**
     * 微信国际退款逻辑处理
     * @param order
     * @param result
     */
    void globalRefund(OrderEntity order, WechatGlobalRefundApiResult result);

    void pinganRefund(OrderEntity order, JSONObject result, String refundId);

    List<OrderRefundEntity> queryRefundList(Map<String, Object> map);

    int queryRefundTotal(Map<String, Object> map);

    OrderRefundEntity queryRefundObject(Long refundId);

    void applyRefundDeal(OrderEntity orderInfo, OrderRefundEntity refundEntity);

    void cancelOrder(OrderEntity orderInfo);

    /**
     * 获取首页展示信息--会员购买率相关
     *
     * @param params
     * @return
     */
    int getUserOrderInfo(Map<String, Object> params);

    Map getLogistics(Long id);

    OrderEntity queryInfos(Long id);

    Double getTotalActualPrice(String merchOrderSn);

    Map orderSubmit(List<OfflineCartEntity> offlineCartEntityList,SysUserEntity user);

    int confirmPay(Long id, String payFlag,String orderSnWx);
}
