package com.yc.ship.module.trade.service.otc;


import com.yc.ship.framework.common.pojo.CommonResult;
import com.yc.ship.framework.common.pojo.PageResult;
import com.yc.ship.framework.security.core.LoginUser;
import com.yc.ship.module.product.api.dto.CategoryRespDTO;
import com.yc.ship.module.product.api.dto.ProductSpuRespDTO;
import com.yc.ship.module.trade.controller.admin.order.vo.order.*;
import com.yc.ship.module.trade.controller.admin.order.vo.otc.PrintRespVO;
import com.yc.ship.module.trade.controller.admin.order.vo.refund.RefundDetailRespVO;
import com.yc.ship.module.trade.controller.admin.order.vo.refund.RefundPageReqVO;
import com.yc.ship.module.trade.controller.admin.order.vo.refund.RefundRecordPageReqVO;
import com.yc.ship.module.trade.controller.admin.order.vo.refund.RefundRecordRespVO;
import com.yc.ship.module.trade.controller.admin.order.vo.refund.RefundRespVO;
import com.yc.ship.module.trade.controller.app.otc.vo.AppTradeOrderDetailRespVO;
import com.yc.ship.module.trade.controller.admin.order.vo.order.PublicOrderVoyageRespVO;
import com.yc.ship.module.trade.dal.dataobject.contract.ContractDO;
import com.yc.ship.module.trade.dal.dataobject.insurance.InsuranceDO;
import com.yc.ship.module.trade.dal.dataobject.order.TradeDetailBaseDO;

import javax.validation.Valid;
import java.io.File;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author qsl
 */
public interface OtcTradeOrderService {


    /**
     * 窗口支付订单
     */
    CommonResult<PayOrderRespVO> windowPayOrder(LoginUser loginUser, PayOrderReqVO payOrderReqVO);

    /**
     * 定金支付
     */
    CommonResult<PayOrderRespVO> payDeposiOrder(LoginUser loginUser, PayOrderReqVO payOrderReqVO);
    CommonResult<PayOrderRespVO> payBcOrder(LoginUser loginUser, PayOrderReqVO payOrderReqVO);

    /**
     * 查询订单状态
     */
    CommonResult<?> queryOrderStatus(Long orderId);

    CommonResult<?> queryDeposiOrderStatus(Long orderId);
    CommonResult<?> queryBcOrderStatus(Long orderId);

    CommonResult<?> queryOrderAudit(Long orderId);

    CommonResult<?> queryCancelAudit(Long orderId);

    CommonResult<?> orderAudit(Long orderId, Integer auditStatus,String auditAdvice);

    /**
     * 撤回审核
     */
    CommonResult<?> cancelAuto(Long orderId);

    PageResult<TradeOrderRespVO> getMiniTradeOrderPage(TradeOrderPageReqVO pageReqVO);

    PageResult<TradeOrderRespVO> getPaidOrderPage(TradeOrderPageReqVO pageReqVO);


    /**
     * 获取订单详情
     */
    TradeOrderRespVO getOrderInfo(Long id);

    TradeOrderPdaRespVO getPdaOrderInfo(Long id);

    /**
     * 通过门票ID获取门票详情
     */
    List<TradeDetailBaseDO> getDetailInfo(Long detailId);

    List<CategoryRespDTO> getCategoryOrSpuList(String type, String travelDate);

    List<CategoryRespDTO> getCategoryAndSpuAll(String type, String travelDate);

    ProductSpuRespDTO getProductSpuDTO(Long id, String date, String planId);

    ProductSpuRespDTO getProductSpuDTO(Long id, String date, String planId, Long distributorId);

    ProductSpuRespDTO getProductSpuDtoWithoutStock(Long id);

    List<ContractDO> getContract(Long orderId);

    List<InsuranceDO> getInsurance(Long orderId);

    //获取订单模板
    List<PrintRespVO> getOrderPrintData(Long orderId);

    TradeOrderRespVO getRefundOrderInfo(Long id);


    PageResult<TradeDetailRespVO> getRefundDetailPage(TradeDetailPageReqVO pageReqVO);

    PageResult<RefundRespVO> getRefundRecordPage(RefundPageReqVO pageReqVO);

    List<RefundDetailRespVO> getRefundBatchDetails(Long refundId);

    /**
     * 获取退款记录列表
     */
    PageResult<RefundRecordRespVO> getPageRefundRecord(RefundRecordPageReqVO pageReqVO);

    PageResult<TradeOrderRespVO> queryCanInvoicedOrderPage(TradeOrderPageReqVO pageReqVO);

    PageResult<TradeOrderRespVO> queryPlatCanInvoicedOrder(TradeOrderPageReqVO pageReqVO);

    TradeOrderRespVO orderRuleOrUserDetails(Long id);


    OrderPayAmountRespVO getPayAmount(Long orderId);


    /**
     * 创建旅行社订单
     */
    CommonResult<?> createOtcOrder(LoginUser agencyLoginUser, TradeOrderOtcCreateVO createVO);

    CommonResult<?> motifyOtcOrder(LoginUser agencyLoginUser, TradeOrderOtcCreateVO createVO);

    /**
     * 获取订单详情 新
     */
    TradeOrderRespNewVO getOrderInfoNew(Long id);

    CommonResult<?> regionStatic(TradeStaticReqVO reqVO);

    CommonResult<?> getOrderById(Long orderId);

    /**
     * 获取订单确认单信息
     */
    TradeOrderConfirmationVO getOrderConfirmation(Long id);


    /**
     * 生成确认单
     */
    File createConfirmaction(Long id, Double totalMoney);

    CommonResult<?> orderRead(Long orderId);

    CommonResult<?> cancelAudit(Long orderId, Integer auditStatus, BigDecimal damaged);

    CommonResult<?> updateStatus(Long orderId, Integer  status);

    /**
     * 获取订单统计信息
     */
    OrderTotalRespVO getOrderTotal(OrderTotalQueryVO queryVO);

    /**
     * 导出游客名单-计调
     */
    File exportTouristList(TradeOrderPageReqVO pageReqVO);

    /**
     * 导出游客名单-代理商
     */
    File exportTouristListToAgent(@Valid TradeOrderPageReqVO pageReqVO);

    AppTradeOrderDetailRespVO getAppOrderInfoNew(Long id);

    /**
     * 获取订单航次信息（免登录）
     *
     * @param orderId 订单ID
     * @return 订单航次信息
     */
    CommonResult<PublicOrderVoyageRespVO> getOrderVoyage(Long orderId);
}
