package org.jeecg.modules.projectManagement.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.basedata.entity.*;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.projectManagement.entity.EmailEntity;
import org.jeecg.modules.projectManagement.entity.FdContract;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Description: 合同档案基本信息表
 * @author： jeecg-boot
 * @date： 2019-05-22
 * @version： V1.0
 */
public interface IFdContractService extends IService<FdContract> {

    IPage<FdContract> findByPage(Page<FdContract> page, QueryWrapper<FdContract> queryWrapper);

    void saveContract(FdContract fdContract);

    void updateContract(FdContract fdContract);

    void deleteContract(String ids);

    List<FdQuotationTemplate> findQuotationTemplate(String quotationId);

    void saveAll(FdContract fdContract);

    Map<String, Object> closeBatch(@Param("list") List<String> list);

    void deleteCompound(String id);

    void deleteContracts(String id);

    Map<String, Object> auditBatch(@Param("list") List<String> list);

    Map<String, Object> reviewBatch(@Param("list") List<String> list);

    List<FdContract> contractReport(String startDate,String endDate);

    FdContract exportJson(String contractId);

    void contractImport(FdContract fdContract);

    int updateStatusShared(List<String> list,String status);

    /***
     * @Title:双签通知
            * @Description:TODO 根据选择的Pm发送邮件通知
            * @param givePerson, contractId, receiverIds]
            * @return void
            * @exception
            * @author 陈创
            * @date 2020/3/11 15:31
            * @updatehistory:
     *   2020/3/11 15:31 新增
            */
    void notificationPm(String givePerson,String contractId,List<String> receiverIds);

    void peopleSendMsg(String givePerson,String personnel,String title,String msg);

    /***
     * @Title:
            * @Description:TODO 根据选择的Pm发送邮件通知(有发件人与附件)
            * @param [contractId, emailEntity]
            * @return void
            * @exception
            * @author 陈创
            * @date 2020/4/17 14:26
            * @updatehistory:
     *   2020/4/17 14:26 新增
            */
    void emailEnclosureNotificationPm(FdContract fdContract);

    /***
     * @Title:
            * @Description:TODO 根据合同id查询相关信息
            * @param [fdContract]
            * @return org.jeecg.modules.projectManagement.entity.FdContract
            * @exception
            * @author 陈创
            * @date 2020/4/2 15:11
            * @updatehistory:
     *   2020/4/2 15:11 新增
            */
    FdContract getFdContractInformationByCid(FdContract fdContract);

    List<FdContract> totalProportionContract(Date quotationDate,Date endDate,FdContract fdContract);

    IPage<FdContract> getReportPageContract(Page<FdContract> page, QueryWrapper<FdContract> queryWrapper);

    /**
    * @Author chenchuang
    * @Description //TODO 合同导出
    * @Date 2020/5/22 11:16
    * @Param [fdContract]
    * @return java.util.List<org.jeecg.modules.projectManagement.entity.FdContract>
    */
    List<FdContract> getContractExport(FdContract fdContract);

    /**
    * @Author chenchuang
    * @Description //TODO 关联项目档案分组查询合同号
    * @Date 2020/5/28 13:21
    * @Param []
    * @return java.util.List<org.jeecg.modules.projectManagement.entity.FdContract>
    */
    List<FdContract> getContractGroupById();

    void updateDelById(FdContract fdContract);
}
