package com.hai.order.service;

import com.alibaba.fastjson.JSONObject;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder;
import com.hai.order.model.CreateOrderModel;
import com.hai.order.model.combine.CombineOrderModel;
import com.hai.order.type.OrderRefundOpUserType;

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

/**
 * @className: OrderService
 * @author: HuRui
 * @date: 2022/8/18
 **/
public interface OrderService {

    /**
     * 增加订单数据
     * @param order
     * @return
     */
    HighOrder insertOrderData(HighOrder order);

    /**
     * 修改订单数据
     * @param order
     * @return
     */
    HighOrder updateOrderData(HighOrder order);

    /**
     * 创建订单
     * @param createOrderModel 创建订单参数
     * @return
     */
    HighOrder createOrder(CreateOrderModel createOrderModel) throws Exception;

    JSONObject  createOrderCombine(CombineOrderModel combineOrderModel) throws Exception;


    /**
     * 订单取消
     * @param order  订单
     * @param remarks  备注
     * @return
     */
    HighOrder cancelOrder(HighOrder order,String remarks);

    /**
     * 订单退款
     * @param order
     * @param remarks
     * @return
     */
    HighOrder refundOrder(HighOrder order, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception;

    /**
     * 子订单退款
     * @param order
     * @param childOrderNo
     * @param refundGoodsNum
     * @param remarks
     * @return
     */
    HighOrder refundChildOrder(HighOrder order, String childOrderNo, Integer refundGoodsNum, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception;

    /**
     * 根据订单号查询交易订单号详情
     * @param orderNo  订单号
     * @return
     */
    HighOrder getOrderDetailByNo(String orderNo);


    /**
     * @Author Sum1Dream
     * @Name getOrderDetail
     * @Description // 查询线上
     * @Date 18:29 2023/5/18
     * @Param [orderNo]
     * @Return com.hai.entity.HighOrder
     */
    HighOrder getOrderDetail(String orderNo);

    /**
     * 根据子订单号查询子订单信息
     * @param childOrderNo
     * @return
     */
    HighChildOrder getChildOrderByNo(String childOrderNo);

    /**
     * 查询订单列表
     * @param param  参数
     * @return
     */
    List<HighOrder> getOrderList(Map<String,Object> param);

    /**
     * @Author Sum1Dream
     * @Name orderCheck
     * @Description // 查看订单
     * @Date 13:55 2022/10/25
     * @Param [orderNo]
     * @Return void
     */
    void orderCheck(String orderNo);

    /**
     * @Author Sum1Dream
     * @Name phoneErrorOrder
     * @Description // 查询话费错误订单
     * @Date 10:13 2023/2/10
     * @Param []
     * @Return java.util.List<com.hai.entity.HighOrder>
     */
    List<HighOrder> phoneErrorOrder();


    /**
     * @Author Sum1Dream
     * @Name getChildOrderList
     * @Description // 查询子订单数量
     * @Date 15:54 2023/5/16
     * @Param [param]
     * @Return java.util.List<com.hai.entity.HighChildOrder>
     */
    List<HighChildOrder> getChildOrderList(Map<String,Object> param);
}
