package com.huiju.estateagents.eContract.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.huiju.estateagents.base.ResponseBean;
import com.huiju.estateagents.bo.request.ContractRecordRequestBO;
import com.huiju.estateagents.eContract.entity.TaContract;
import com.huiju.estateagents.entity.TaPerson;
import com.huiju.estateagents.entity.TaRaiseRecord;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 合同列表  服务类
 * </p>
 *
 * @author fxf
 * @since 2020-03-26
 */
public interface ITaContractService extends IService<TaContract> {

    /**
     * 条件查询合同列表
     *
     * @param pageNum
     * @param pageSize
     * @param contractName
     * @param archives
     * @param signatoryName
     * @param signatoryStatus
     * @param customerName
     * @param customerStatus
     * @param archivesStartDate
     * @param archivesEndDate
     * @param orgId
     * @return
     */
    ResponseBean listContractForAdmin(Integer pageNum, Integer pageSize, String contractName, Boolean archives, String signatoryName, Integer signatoryStatus,
                                      String customerName, Integer customerStatus, LocalDate archivesStartDate, LocalDate archivesEndDate, Integer orgId);

    /**
     * 条件查询合同列表
     *
     * @param requestBO
     * @return
     */
    ResponseBean listContractForChannel(ContractRecordRequestBO requestBO);

    /**
     * 企业自动签署合同
     * @param taRaiseRecord
     * @param person
     * @return
     */
    TaContract autoContract(TaRaiseRecord taRaiseRecord, TaPerson person) throws Exception;

    /**
     * 手动签署合同
     * @param taContract
     * @param person
     * @return
     */
    String manualContract(TaContract taContract, TaPerson person) throws Exception;

    /**
     * 检查签署合同状态
     * @param taRaiseRecord
     * @param person
     * @return
     */
    TaContract checkContract(TaRaiseRecord taRaiseRecord, TaPerson person) throws Exception;
}
