package com.sunxung.factoring.service.purchcontractmanagement;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sunxung.factoring.entity.purchcontractmanagement.PurchContractBasicInfo;
import com.sunxung.factoring.entity.purchcontractmanagement.vo.PurchContractApprovalVo;
import com.sunxung.factoring.entity.purchcontractmanagement.vo.PurchContractVo;

/**
 * @Description : 采购合同基础信息service
 * @Author : JiaYf
 * @Date: 2021-09-15 10:11
 */
public interface PurchContractBasicInfoService extends IService<PurchContractBasicInfo> {

    /**
     * 获取最新的采购合同信息
     *
     * @param purchContractManageId 采购合同管理的Id
     * @return
     */
    PurchContractBasicInfo getLatestBasicInfo(Long purchContractManageId, String conclusion);

    /**
     * 获取合同详情信息
     * JiaYf
     *
     * @param id
     * @return
     */
    PurchContractApprovalVo getDetail(Long id);

    /**
     * 删除附件中间表
     *
     * @param purchContractId 采购合同ID
     * @return int 受影响的记录数
     */
    void deleteFileByPurchContractId(Long purchContractId);

    /**
     * 新增合同附件中间表
     *
     * @param purchContractId 合同信息的ID
     * @param fileId          附件的ID
     */
    void addFileRef(Long purchContractId, Long fileId);

    /**
     * 查询信息、用于历史列表展示
     *
     * @param id
     * @return
     */
    PurchContractVo getView(Long id);

    /**
     * 根据业务编号和供应商Id获取采购合同信息
     *
     * @param businessNumber
     * @param supplierId
     * @return
     */
    PurchContractBasicInfo findByBusinessNumberAndSupplierId(String businessNumber, Long supplierId);
}
