/**
 * @filename:SalesContractService 2024-09-03
 * @project KJT v1.0.0 Copyright(c) 2024 wanglang Co. Ltd. All right reserved.
 */
package com.trade.service.trade.salescontract.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.trade.service.finance.paymentcollection.vo.EntrySalesContractVo;
import com.github.pagehelper.PageInfo;
import com.trade.service.trade.filingdoc.vo.Contract4FilingDocSearch;
import com.trade.service.trade.salescontract.domain.SalesContract;
import com.trade.service.trade.salescontract.dto.ContractSearchDto;
import com.trade.service.trade.salescontract.dto.SalesContractDto;
import com.trade.service.trade.filingdoc.vo.SalesContract4FilingDocVO;
import com.trade.service.trade.salescontract.vo.SalesContractInfoVo;
import com.trade.service.trade.salescontract.vo.SalesContractVo;

import java.util.List;

/**
 * @Description:销售合同基础信息服务层
 * @version: v1.0.0
 * @author: wanglang
 */
public interface SalesContractService extends IService<SalesContract> {

    /**
     * 根据合同id获取销售合同基本信息
     *
     * @param contractId 合同id
     * @return 销售合同基本信息
     */
    SalesContractInfoVo getSalesContractDetails(Long contractId);

    /**
     * 根据查询条件获取销售合同信息
     * 
     * @param contractSearch 查询条件
     * @return 销售合同信息
     */
    List<SalesContractVo> getSalesContractInfo(ContractSearchDto contractSearch);

    /**
     * 删除销售合同
     *
     * @param contractId 合同id
     * @return true:删除成功，false:删除失败
     */
    Boolean deleteSalesContract(Long contractId);

    /**
     * 根据合同id获取销售合同dto
     *
     * @param contractId 合同id
     * @return 销售合同dto
     */
    SalesContractDto getSalesContractById(Long contractId);

    /**
     * 根据客户id获取销售合同信息
     *
     * @param customerUserId 客户id
     * @param importerCertNo 进口商证件号
     * @return 销售合同信息
     */
    List<SalesContractVo> querySalesContractByCustomerUserId(Long customerUserId, String importerCertNo);

    List<String> getDestPortList(Long customerUserId);

    /**
     * @param contractNo
     * @param customerUserId
     * @return
     */
    SalesContract getByContractNo(String contractNo, Long customerUserId);

    boolean existSalesContractByImporterCertNo(String importerCertNo, Long customerUserId);

    /**
     * 查询所有销售合同
     *
     * @return
     */
    List<EntrySalesContractVo> selectEntrySalesContract();

    /**
     * 根据查询条件获取销售合同信息
     * 
     * @param search 查询条件
     * @return 销售合同信息
     */
    PageInfo<SalesContract4FilingDocVO> queryList4FilingDocBySearch(Contract4FilingDocSearch search);
}
