package com.sunxung.factoring.service.project;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sunxung.factoring.entity.GridPage;
import com.sunxung.factoring.entity.project.CProjectCoreEnterpriseHistory;
import com.sunxung.factoring.entity.project.ProjectCoreEnterprise;
import com.sunxung.factoring.entity.project.ProjectCoreEnterpriseScore;
import com.sunxung.factoring.entity.project.ProjectInformation;
import com.sunxung.factoring.entity.project.vo.SearchBusinessProcessingTask;

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

/**
 * <p>
 * 项目核心企业 服务类
 * </p>
 *
 * @author liutao
 * @since 2023-11-25
 */
public interface IProjectCoreEnterpriseService extends IService<ProjectCoreEnterprise> {

    /**
     * 开启核心企业流程
     *
     * @param projectInformation
     */
    void startProjectProcess(ProjectInformation projectInformation);

    /**
     * 根据id查询
     *
     * @param id
     * @return
     */
    ProjectCoreEnterprise get(Long id);

    /**
     * 查看表单详情
     *
     * @param id
     * @return
     */
    CProjectCoreEnterpriseHistory getView(Long id);

    /**
     * 查询所有核心企业授信
     *
     * @param search
     * @return
     */
    GridPage<ProjectCoreEnterprise> findAll(SearchBusinessProcessingTask search);

    /**
     * 获取核心企业准入报告
     *
     * @param id
     * @return
     */
    ProjectCoreEnterpriseScore getEnterpriseReport(Long id);

    /**
     * 根据项目id获取项目核心企业
     *
     * @param cProjectInformationId
     * @return
     */
    ProjectCoreEnterprise getByProjectInfoId(Long cProjectInformationId);

    /**
     * 下载准入报告
     *
     * @param id
     * @param res
     */
    void download(Long id, HttpServletResponse res) throws IOException;

    /**
     * 根据企业信息Id查询
     *
     * @param enterpriseId
     * @return
     */
    List<ProjectCoreEnterprise> getByEnterpriseId(Long enterpriseId);
}
