package com.hai.service;

import com.alibaba.fastjson.JSONObject;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder;
import com.hai.entity.HighUserCard;
import com.hai.entity.OutRechargeOrder;
import com.hai.model.*;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @Auther: 胡锐
 * @Description:
 * @Date: 2021/3/26 23:04
 */
public interface HighOrderService {

    /**
     * @Author 胡锐
     * @Description 增加订单
     * @Date 2021/3/26 23:05
     **/
    void insertOrder(HighOrder highOrder) throws Exception;

    /**
     * 修子订单信息
     * @param highChildOrder
     */
    void updateChildOrder(HighChildOrder highChildOrder);

    /**
     * @Author 胡锐
     * @Description 金币支付订单
     * @Date 2021/3/27 11:20
     **/
    void goldPayOrder(Long userId, Long orderId) throws Exception;

    /**
     * 油卡支付订单
     * @param userCardId 用户与卡号关系
     * @param orderId    订单id
     * @throws Exception
     */
    void oilCardPayOrder(Long userCardId, Long orderId) throws Exception;

    /**
     * 汇联通工会卡支付
     * @param userCardId
     * @param orderId
     * @throws Exception
     */
    void hltUnionCardPay(Long userCardId, Long orderId) throws Exception;

    /**
     * @Author 胡锐
     * @Description 修改订单
     * @Date 2021/3/26 23:06
     **/
    void updateOrder(HighOrder highOrder);

    /**
     * 修改订单详情
     * @param highOrder
     */
    void updateOrderDetail(HighOrder highOrder);

    /**
     * 订单业务交易处理
     * 注意：支付完成后可以调用此方法
     * @param order
     */
    void orderBusinessTransaction(HighOrder order) throws Exception;

    /**
     * @Author 胡锐
     * @Description 获取未完成的子订单数量
     * @Date 2021/3/27 13:35
     **/
    Integer getUndoneChildOrder(Long orderId);

    /**
     * @Author 胡锐
     * @Description 查询子商品
     * @Date 2021/4/5 13:23
     **/
    HighChildOrder getChildOrderById(Long childOrderId);

    /**
     * @Author 胡锐
     * @Description 根据用户和商品id 查询
     * @Date 2021/4/15 21:38
     **/
    HighChildOrder getChildOrderByUserGoods(Long userId,Integer goodsType,Long goodsId);

    /**
     * 根据订单id 查询子商品
     * @param orderId
     * @return
     */
    List<HighChildOrder> getChildOrderByOrder(Long orderId);

    /**
     * @Author Sum1Dream
     * @name getChildOrderByPresentation.java
     * @Description // 根据是否赠品查询子订单
     * @Date 16:20 2021/9/7
     * @Param [orderId, isGiveAway]
     * @return com.hai.entity.HighChildOrder
     **/
    HighChildOrder getChildOrderByPresentation(Long orderId);

    /**
     * @Author 胡锐
     * @Description 查询子商品列表
     * @Date 2021/4/2 21:51
     **/
    List<HighChildOrder> getChildOrderList(Map<String, Object> map);

    /**
     * @Author 胡锐
     * @Description 根据id查询
     * @Date 2021/3/26 23:06
     **/
    HighOrder getOrderById(Long id);

    /**
     * @Author 胡锐
     * @Description 根据订单号查询
     * @Date 2021/3/27 0:38
     **/
    HighOrder getOrderByOrderNo(String orderNo);

    /**
     * @Author 袁野
     * @Description 查询订单列表
     * @Date 2021/3/26 23:06
     **/
    List<HighOrderData> getOrderBList(Map<String,Object> map);

    /**
     * @Author 胡锐
     * @Description 查询订单列表
     * @Date 2021/3/26 23:06
     **/
    List<HighOrder> getOrderList(Map<String,Object> map);

    /**
     * 查询订单列表
     * @param map
     * @return
     */
    List<HighOrderModel> getGoodsOrderModelList(Map<String,Object> map) throws Exception;

    /**
     * 查询加油订单
     * @param map
     * @return
     * @throws Exception
     */
    List<HighOrderModel> getGasOrderModelList(Map<String,Object> map) throws Exception;

    /**
     * 查询肯德基订单
     * @param map
     * @return
     * @throws Exception
     */
    List<HighOrderModel> getKfcOrderModelList(Map<String,Object> map) throws Exception;

    /**
     * 查询电影订单
     * @param map
     * @return
     * @throws Exception
     */
    List<HighOrderModel> getCinemaOrderList(Map<String,Object> map) throws Exception;

    /**
     * 查询话费充值订单
     * @param map
     * @return
     * @throws Exception
     */
    List<HighOrderModel> getMobileOrderList(Map<String,Object> map) throws Exception;

    /**
     * 根据标识码 查询订单
     * @param identificationCode
     * @return
     * @throws Exception
     */
    List<HighOrderModel> getOrderListByIdCode(String identificationCode, Map<String,Object> map) throws Exception;

    /**
     * @Author 胡锐
     * @Description 查询需要关闭的订单列表
     * @Date 2021/3/27 15:43
     **/
    List<HighOrder> getCloseOrder();

    /**
     * 根据优惠券代理商id 查询已消费的订单
     * @param discountCodeId
     * @return
     */
    HighOrder getConsumeOrderByDiscountCode(Long discountCodeId);

    /**
     * @Author 胡锐
     * @Description 子订单完成
     * @Date 2021/3/27 13:28
     **/
    void childOrderComplete(Long childOrderId);

    /**
     * @Author 胡锐
     * @Description 取消订单
     * @Date 2021/3/27 15:50
     **/
    void cancelOrder(Long orderId);

    /**
     * @Author 袁野
     * @Description 根据用户查询订单统计
     * @Date 2021/3/27 15:50
     **/
    Integer countOrderByUserId(Long memId , Integer status);

    /**
     * @Author 袁野
     * @Description 根据用户查询订单统计
     * @Date 2021/3/27 15:50
     **/
    Long whetherCheck(Long memId , Integer status);

    /**
    * @Author Sum1Dream
    * @name orderCheck.java
    * @Description // 订单查看
    * @Date 14:46 2022/7/19
    * @Param [java.lang.Long]
    * @return void
    */
    void orderCheck(Long orderId);

    /**
     * @Author 袁野
     * @Description 未使用优惠券数量
     * @Date 2021/3/27 15:50
     **/
    Integer countUnusedDiscountByUserId(Long userId , Integer status);

    /**
     * 查询处于已经支付和待支付的话费订单
     * @return
     */
    List<HighOrder> getAlreadyPaidMobileOrder();

    /**
     * 查询处于已经支付和待支付的KFC订单
     * @return
     */
    List<HighOrder> getAlreadyPaidKfcOrder();

    /**
     * 查询处于已经支付和待支付的话费订单
     * @return
     */
    List<HighOrder> getAlreadyPaidCinemaOrder();


    List<HighOrder> getTest();

    /**
     * 查询团油超过支付时间24小时订单
     * @return
     */
    List<Map<String,Object>> getFinishGasOrder();

    /**
     * 查询订单列表
     * @param map
     * @return
     */
    List<HighOrderModel> selectDiscountPackageOrderList(Map<String,Object> map) throws Exception;

    /**
    * @Author Sum1Dream
    * @name orderByIndex.java
    * @Description // 查询卡券统计
    * @Date 3:57 下午 2022/1/10
    * @Param [java.lang.Integer]
    * @return com.hai.model.OrderCountModel
    */
    OrderCountModel orderByIndex(Integer code);

    /**
     * @Author Sum1Dream
     * @name orderByIndex.java
     * @Description // 查询汇联通统计
     * @Date 3:57 下午 2022/1/10
     * @Param [java.lang.Integer]
     * @return com.hai.model.OrderCountModel
     */
    OrderCountModel HLTOrderByIndex(Integer code);

    /**
    * @Author Sum1Dream
    * @name HLTOrderByList.java
    * @Description // 工会卡预支付查询列表
    * @Date 5:28 下午 2022/1/10
    * @Param [Integer]
    * @return java.util.List<com.hai.model.HighOrderModel>
    */
    List<HighOrderModel> HLTOrderByList(Integer code) throws Exception;

    /**
    * @Author Sum1Dream
    * @name orderPriceTotal.java
    * @Description // 获取支付订单总金额
    * @Date 2:09 下午 2022/1/12
    * @Param []
    * @return java.math.BigDecimal
    */
    BigDecimal orderPriceTotal(Map<String , Object> map);

    /**
    * @Author Sum1Dream
    * @name rechargePriceTotal.java
    * @Description // 获取话费订单总金额
    * @Date 2:09 下午 2022/1/12
    * @Param []
    * @return java.math.BigDecimal
    */
    BigDecimal rechargePriceTotal(Map<String , Object> map);

    /**
    * @Author Sum1Dream
    * @name orderPriceCount.java
    * @Description // 获取支付订单数量
    * @Date 2:09 下午 2022/1/12
    * @Param []
    * @return java.lang.Long
    */
    Long orderPriceCount(Map<String , Object> map);

    /**
    * @Author Sum1Dream
    * @name rechargePriceCount.java
    * @Description // 获取话费订单数量
    * @Date 2:10 下午 2022/1/12
    * @Param []
    * @return java.lang.Long
    */
    Long rechargePriceCount(Map<String , Object> map);

    /**
    * @Author Sum1Dream
    * @name getOrderSumOrderByDate.java
    * @Description // 查询订单最近七天订单金额
    * @Date 11:48 上午 2022/1/13
    * @Param []
    * @return java.util.List<com.hai.model.OrderSumModel>
    */
    List<OrderSumModel> getOrderSumOrderByDate();

    /**
    * @Author Sum1Dream
    * @name getOrderSumRechargeByDate.java
    * @Description // 查询话费订单最近七天订单金额
    * @Date 11:49 上午 2022/1/13
    * @Param []
    * @return java.util.List<com.hai.model.OrderSumModel>
    */
    List<OrderSumModel> getOrderSumRechargeByDate();

    /**
    * @Author Sum1Dream
    * @name getDateCountByUser.java
    * @Description // 查询最近七天注册用户数量
    * @Date 11:49 上午 2022/1/13
    * @Param []
    * @return java.util.List<com.hai.model.DateCountModel>
    */
    List<DateCountModel> getDateCountByUser();

    /**
    * @Author Sum1Dream
    * @name getDateCountByOrder.java
    * @Description // 查询最近七天订单数量
    * @Date 11:50 上午 2022/1/13
    * @Param []
    * @return java.util.List<com.hai.model.DateCountModel>
    */
    List<DateCountModel> getDateCountByOrder();

    /**
    * @Author Sum1Dream
    * @name getDateCountByRecharge.java
    * @Description //查询最近七天话费订单数量
    * @Date 11:51 上午 2022/1/13
    * @Param []
    * @return java.util.List<com.hai.model.DateCountModel>
    */
    List<DateCountModel> getDateCountByRecharge();

    /**
     * 查询用户当天加油订单数据量
     * @param userId
     * @return
     */
    int getGasTheDayOrderNum(Long userId);

    /**
    * @Author Sum1Dream
    * @name TyOrderStatistics.java
    * @Description // 团游订单统计
    * @Date 15:01 2022/3/31
    * @Param [java.util.Map<java.lang.String,java.lang.Object>]
    * @return com.hai.model.TyOrderCountModel
    */
    TyOrderCountModel TyOrderStatistics(Map<String , Object> map) throws Exception;

    /**
     * 查询加油站当天统计
     * @param storeId
     * @param status
     * @return
     */
    Map<String, Object> getGasTheDayOrderCount(Long storeId, String status);

    /**
     * 查询加油站工作人员当天统计
     * @param gasStaffId
     * @param status
     * @return
     */
    Map<String, Object> getGasStaffTheDayOrderCount(Long gasStaffId, String status);

    /**
     * 查询加油站历史统计
     * @param storeId
     * @param status
     * @return
     */
    Map<String, Object> getGasHistoryOrderCount(Long storeId, String status);

    /**
     * 查询加油站加油员历史统计
     * @param gasStaffId
     * @param status
     * @return
     */
    Map<String, Object> getGasStaffHistoryOrderCount(Long gasStaffId, String status);

    /**
     * 查询加油站订单列表
     * @param param
     * @return
     */
    List<GasOrderModel> getGasOrderList(Map<String, Object> param) throws Exception;

    /**
     * 统计加油站订单
     * @param param
     * @return
     * @throws Exception
     */
    Map<String, Object> countGasOrder(Map<String, Object> param) throws Exception;

    /**
     * 查询加油站订单列表
     * @param orderNo
     * @return
     */
    GasOrderModel getGasOrderDetail(String orderNo);

    /**
     * 打印加油订单
     * @param gasId
     */
    void printGasOrder(Long gasId, HighOrder order, boolean makeUp);

    /**
    * @Author Sum1Dream
    * @name insertThirdProduct.java
    * @Description // 第三方产品下单
    * @Date 09:45 2022/7/4
    * @Param [com.alibaba.fastjson.JSONObject]
    * @return void
    */
    HighOrder insertThirdProduct(JSONObject object) throws Exception;


    /**
     * @Author Sum1Dream
     * @name hltUnionCardPay.java
     * @Description // 汇联通支付
     * @Date 17:21 2022/5/25
     * @Param [java.lang.Long, com.hai.entity.OutRechargeOrder]
     * @return void
     */
    void hltUnionCardPayByThirdProduct(HighUserCard userCard, Long orderId) throws Exception;

    /**
    * @Author Sum1Dream
    * @name getThirdOrder.java
    * @Description // 查询第三方为支付已支付订单
    * @Date 11:26 2022/7/8
    * @Param []
    * @return java.util.List<com.hai.entity.HighOrder>
    */
    List<HighOrder> getThirdOrder();

    /**
     * @Author Sum1Dream
     * @name orderToRefund.java
     * @Description // 第三方订单退款
     * @Date 4:44 下午 2022/1/24
     * @Param [java.lang.Long]
     * @return void
     */
    void thirdOrderToRefund(Long orderId) throws Exception;

    /**
     * @Author Sum1Dream
     * @Description //取消订单 Administrator
     * @Date 18:37 2021/6/12
     * @Param [orderId]
     * @return void
     **/
    void thirdCancelOrder(Long orderId);

    /**
     * 查询自建站列表
     * @param goodsId
     * @return
     */
    List<SelfOilStationModel> getSelfOilStationOrderList(String goodsId);

    /**
    * @Author Sum1Dream
    * @name integralRebateOrder.java
    * @Description // 查询可积分返利订单
    * @Date 10:13 2022/8/4
    * @Param []
    * @return java.util.List<com.hai.entity.HighOrder>
    */
    List<HighOrder> integralRebateOrder();

    /**
    * @Author Sum1Dream
    * @name orderSource.java
    * @Description // 查询订单来源
    * @Date 14:11 2022/8/4
    * @Param [java.lang.Integer, java.lang.Long]
    * @return com.alibaba.fastjson.JSONObject
    */
    JSONObject orderSource(Integer goodsType , Long goodsId , String orderNo , Long companyId);

    /**
    * @Author Sum1Dream
    * @name promoteOrderList.java
    * @Description // 根据渠道商编码查询订单
    * @Date 16:10 2022/8/19
    * @Param [java.lang.Long]
    * @return java.util.List<com.hai.entity.HighOrder>
    */
    List<HighOrder> promoteOrderList(Long identificationCode) throws Exception;

    /**
    * @Author Sum1Dream
    * @name orderListByAgentId.java
    * @Description // B端查询代理商订单
    * @Date 16:11 2022/8/19
    * @Param [java.util.Map<java.lang.String,java.lang.Object>]
    * @return java.util.List<com.hai.entity.HighOrder>
    */
    List<HighOrder> orderListByAgentId(Map<String , Object> map) throws Exception;
}

