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.PurchContractElectronicInfo;
import com.sunxung.factoring.entity.purchcontractmanagement.PurchContractManagement;
import com.sunxung.factoring.entity.purchcontractmanagement.PurchContractSignConclusion;
import org.springframework.http.ResponseEntity;
import org.springframework.ui.Model;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List;

/**
 * @Description : 采购合同电子合同信息service
 * @Author : JiaYf
 * @Date: 2021-09-22 18:04
 */
public interface PurchContractElectronicInfoService extends IService<PurchContractElectronicInfo> {

    /**
     * 根据采购合同签署确认表Id获取
     * @param id
     * @return
     */
    List<PurchContractElectronicInfo> findByPurchContApprId(Long id);

    PurchContractElectronicInfo getLatestPurchContractSignConfirm(Long id);

    PurchContractElectronicInfo getView(Long id);


    /**
     * 签署回调
     * @param contractId
     */
    void doSignCallBack(String contractId);

    void doSignCallBackByQuery(String contractId,Boolean downloadContract);
    /**
     * 制作合同：模板填充数据生成docx
     * @param purchContractManagement
     * @param purch
     * @return File 生成的docx
     */
    File makePurchContractDocx(PurchContractManagement purchContractManagement, PurchContractBasicInfo purch);


    void updateShortUrl(Date date);

    /**
     * 出证下载
     * @param managementId
     * @param res
     * @return
     */
    ResponseEntity<Object> downloadReportUrl(Long managementId, HttpServletResponse res) throws IOException;

    void checkCallBack(Long businessKey);

    /**
     * 删除电子签信息  以刷新url
     * @param businessKey
     */
    void flushUrl(Long businessKey);

}
