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


import com.yc.ship.framework.common.pojo.CommonResult;
import com.yc.ship.framework.common.pojo.PageResult;
import com.yc.ship.module.trade.api.dto.TradeBindOrderReqDTO;
import com.yc.ship.module.trade.api.dto.TradeModifyVisitorReqDTO;
import com.yc.ship.module.trade.api.dto.TradeOrderCreateReqDTO;
import com.yc.ship.module.trade.api.dto.TradeOrderRespDTO;
import com.yc.ship.module.trade.controller.admin.order.vo.order.*;
import com.yc.ship.module.trade.controller.app.otc.vo.*;
import com.yc.ship.module.trade.dal.dataobject.order.TradeOrderDO;

import java.io.File;
import java.util.List;
import java.util.Map;

/**
 * &#064;Description 订单交易service接口
 * @author qsl
 * &#064;Date 2025/6/4 15:03
 */
public interface TradeOrderService {

    /**
     * 更新订单锁
     */
    String UPDATE_ORDER_LOCK = "order:update:lock:%d";
    /**
     * 核销订单锁
     */
    String CHECK_ORDER_LOCK = "order:check:lock:%d";
    /**
     * 改签订单锁
     */
    String CHANGE_ORDER_BIZ_LOCK = "order:change:biz:lock:%d";

    /**
     * 获取管理端订单分页列表
     *
     */
    PageResult<TradeOrderRespVO> getPlatOrderPage(TradeOrderPageReqVO reqVO);

    List<TradeOrderRespExcelVO> getExportVisitorList(TradeOrderPageReqVO reqVO);

    /**
     * 订单创建
     *
     */
    CommonResult<TradeOrderRespDTO> createOrder(TradeOrderCreateReqDTO orderCreateReqDTO);

    CommonResult<TradeOrderRespDTO> createShipOrder(ShipTradeOrderCreateReqVO orderCreateReqDTO);

    CommonResult<TradeOrderRespDTO> modifyShipOrder(ShipTradeOrderCreateReqVO orderCreateReqDTO);


    /**
     * 订单关联
     *
     */
    CommonResult<Long> bindOrder(TradeBindOrderReqDTO tradeBindOrderReqDTO);

    /**
     * 修改游客信息
     *
     */
    CommonResult<?> modifyVisitor(TradeModifyVisitorReqDTO tradeModifyVisitorReqDTO);


    void bindChangeOrder(List<Long> originDetailIdList, Long orderId, Long originOrderId);

    int getMaxOrderNo(Long voyageId,String code);


    List<TradeOrderDO> getTradeOrderByExpire(String expiretime);

    List<Map<String, Object>> getTradeJz();

    TradeOrderDO getLastOrderByOrderNo(String orderNo);

    String getOrderCount(TradeOrderPageReqVO pageReqVO);

    /**
     * 获取小程序订单分页列表
     * @param pageReqVO
     * @return
     */
    PageResult<AppTradeOrderRespNewVO> getAppOrderPage(AppTradeOrderPageReqNewVO pageReqVO);

    /**
     * 获取小程序我的行程
     * @param loginUserId
     * @param status
     * @return
     */
    List<AppMyItineraryVO> getMyItinerary(Long loginUserId, Integer status, String keyword);
    /**
     * 获取小程序行程详情
     * @param orderId
     * @return
     */
    AppItineraryDetailVO getItineraryDetail(Long orderId, String keyword);

    /**
     *
     * 获取可以购买保险的订单ID
     * @return
     */
    List<Long> getCanBuyInsuranceOrder();

    TradeOrderDO getByOrderNo(String orderNo);

    List<TradeOrderDO> getListByIds(List<Long> orderIds);
}
