package com.trade.admin.trade.purchaseorder.service;

import cn.hutool.core.util.StrUtil;
import com.trade.common.constant.HttpStatus;
import com.trade.common.core.page.GridPage;

import com.trade.common.exception.ServiceException;
import com.trade.service.trade.purchaseorder.dto.*;
import com.trade.service.trade.purchaseorder.vo.*;

import java.util.List;

/**
 * @description: 采购订单服务
 * @Author: wanglang
 * @Date: 2024/9/12
 * @Version: 1.0
 */
public interface BPurchaseOrderService {

    /**
     * 分页查询采购订单列表
     * 
     * @param purchaseSearch
     * @return GridPage<PurchaseOrderVo>
     */
    GridPage<PurchaseOrderVo> queryListByPage(PurchaseSearchDto purchaseSearch);

    /**
     * 根据id查询订单详情
     *
     * @param id 主键
     * @return 订单详情
     */
    PurchaseOrderDetailsVo getDetailsById(Long id);

    /**
     * 分页查询订单物流信息
     * 
     * @param orderLogisticsSearch
     * @return GridPage<PurchaseOrderLogisticsPageVo>
     */
    GridPage<PurchaseOrderLogisticsPageVo> queryOrderLogisticsByPage(
            PurchaseOrderLogisticsSearchDto orderLogisticsSearch);

    /**
     * 拉取采购发票
     * 
     * @param orderIds
     * @return
     */
    Boolean pullPurchaseInvoice(List<Long> orderIds);

    /**
     * 分页查询采购订单发票列表
     *
     * @param purchaseOrderInvoiceSearchDto
     * @return GridPage<PurchaseOrderInvoiceVo>
     */
    GridPage<PurchaseOrderInvoiceVo> queryInvoiceListByPage(
            PurchaseOrderInvoiceSearchDto purchaseOrderInvoiceSearchDto);

    /**
     * 根据id获取发票详情
     *
     * @param InvoiceId 发票id
     * @return 发票详情
     */
    PurchaseOrderInvoiceDetailsVo getInvoiceDetails(Long InvoiceId);

    /**
     * 分页查询采购订单发票列表
     *
     * @param documentSearchDto
     * @return GridPage<PurchaseOrderInvoiceVo>
     */
    GridPage<PurchaseOrderInvoiceDocumentVo> queryInvoiceDocumentListByPage(
            PurchaseOrderInvoiceDocumentSearchDto documentSearchDto);

    /**
     * 查询物流单据
     *
     * @param documentSearchDto 物流单据查询条件
     * @return 物流单据列表
     */
    GridPage<PurchaseOrderLogisticsDocumentVo> queryPurchaseOrderLogisticsDocument(
            PurchaseOrderLogisticsDocumentSearchDto documentSearchDto);

    /**
     * 查询物流公司名称
     * 
     * @param purchaseContractNo 采购合同编号
     * @return 物流公司名称列表
     */
    List<String> queryLogisticsCompanyName(String purchaseContractNo);

    /**
     * 获取小图采购发票下载url
     * 
     * @param xtUserId
     * @param xtEid
     * @return
     */
    String getDownloadPurchaseInvoiceUrl(String xtUserId, String xtEid);
}
