package com.huiju.estateagents.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.huiju.estateagents.base.ResponseBean;
import com.huiju.estateagents.center.taUser.entity.TaUser;
import com.huiju.estateagents.entity.*;
import com.huiju.estateagents.excel.AgentsRecommendCustomer;
import com.huiju.estateagents.excel.ExcelRecommendCustomer;
import com.huiju.estateagents.excel.ReporRecommendCustomer;

import java.util.List;

/**
 * <p>
 * 推荐客户表 服务类
 * </p>
 *
 * @author jobob
 * @since 2019-05-10
 */
public interface ITaRecommendCustomerService extends IService<TaRecommendCustomer> {

    ResponseBean getMyCustList(String openid, String keywords, int pageNumber, int pageSize);

    ResponseBean getCustDetail(String id);

    ResponseBean updateCustByJSON(String paramStr);

    ResponseBean recommendCust(String paramStr, String openid, Integer orgId);

    ResponseBean reportCust(String paramStr, String openid, Integer orgId);

    IPage<TaRecommendCustomer> getUnSignedCustomerList(int pageNumber, int pageSize, String building, String personId);

    IPage getCustomerList(Integer status, int pageNumber, int pageSize, String building, String name, String tel, String consultName,
                          String consultTel, String entryType, String verifyStatus, Integer sex, String customerType, Integer orgId,
                          List<TaPersonBuilding> taPersonBuildingList, String sceneType, String startCreateDate, String endCreateDate,
                          String sharePersonName, Integer belongStatus);

    IPage<TaRecommendCustomer> getRecCustomerList(int pageNumber, int pageSize, String building, String name, String tel, String consultName, String consultTel, String entryType, String verifyStatus, Integer sex, Integer orgId, List<TaPersonBuilding> taPersonBuildingList);

    IPage<TaRecommendCustomer> getRepCustomerList(int pageNumber, int pageSize, String building, String name, String tel, String consultName, String consultTel, String entryType, String verifyStatus, Integer sex, Integer orgId, List<TaPersonBuilding> taPersonBuildingList);

    IPage<TaPerson> getIndependentAgents(int pageNumber, int pageSize, String name, String tel, String channelId, Integer orgId);


    TaRecommendCustomer getCustomerDetail(String customerId, int pageNumber, int pageSize, List<TaPersonBuilding> taPersonBuildingList, String buildingId);

    TaPerson getPublicCustomerDetail(String personId, int pageNumber, int pageSize, List<TaPersonBuilding> taPersonBuildingList, String buildingId);

    TaRecommendCustomer getCustomerById(String customerId);

    IPage<TaRecommendCustomer> getCustomersIRecommended(int pageNumber, int pageSize, String customerId, Integer orgId, List<TaPersonBuilding> taPersonBuildingList);

    TaRecommendCustomer newByPerson(TaPerson person);

    ResponseBean consultantAssist(TaUser taUser, String customerId, Integer orgId);

    ResponseBean batchConsultantAssist(TaUser taUser, Integer orgId);

    /**
     * 导出数据(推荐客户)
     *
     * @param orgId
     * @return
     */
    List<ExcelRecommendCustomer> getRecCustomerExport(Integer orgId, Integer pageCode, Integer pageSize, List<TaPersonBuilding> taPersonBuildingList);

    /**
     * 导出数据(推荐客户) 总数
     *
     * @param orgId
     * @return
     */
    Integer getRecCustomerExportCount(Integer orgId, List<TaPersonBuilding> taPersonBuildingList);

    /**
     * 导出数据(报备客户) 总数
     *
     * @param orgId
     * @return
     */
    Integer getRepCustomerReportCount(String building, String name, String tel, String consultName, String consultTel, String entryType, String verifyStatus, Integer sex, Integer orgId, List<TaPersonBuilding> taPersonBuildingList);

    /**
     * 导出数据(报备客户)
     *
     * @param orgId
     * @param pageCode
     * @param pageSize
     * @return
     */
    List<ReporRecommendCustomer> getRepCustomerReportExport(String building, String name, String tel, String consultName, String consultTel, String entryType, String verifyStatus, Integer sex, Integer orgId, Integer pageCode, Integer pageSize, List<TaPersonBuilding> taPersonBuildingList);

    /**
     * 导出数据(经纪人) 总数
     *
     * @param orgId
     * @return
     */
    Integer getIndependentAgentsCount(Integer orgId);

    /**
     * 导出数据(经纪人)
     *
     * @param orgId
     * @param pageCode
     * @param pageSize
     * @return
     */
    List<AgentsRecommendCustomer> getIndependentAgentsExport(String name, String tel, String channelId, Integer orgId, Integer pageCode, Integer pageSize);

    /**
     * 查询我的客户人数集合
     *
     * @param openid
     * @return
     */
    ResponseBean getMyCustStatistics(String openid);

    /**
     * 分页查询我的跟进客户集合
     *
     * @param pageNumber
     * @param pageSize
     * @param openid
     * @param name
     * @param phone
     * @param status
     * @param startReportDate
     * @param endReportDate
     * @param startArrivalDate
     * @param endArrivalDate
     * @return
     */
    ResponseBean getMyCustFollowOrClinch(Integer pageNumber, Integer pageSize, String openid, String type, String name, String phone, Integer status, String startReportDate, String endReportDate, String startArrivalDate, String endArrivalDate);

    /**
     * 获取盘客工具下我的客户详情
     *
     * @param customerId
     * @param openid
     * @return
     */
    ResponseBean getMyCustDetail(String customerId, String openid);

    /**
     * 更新我的客户基本信息
     *
     * @param taRecommendCustomer
     * @param openid
     * @return
     */
    ResponseBean updateMyCust(TaRecommendCustomer taRecommendCustomer, String openid);

    /**
     * 查询置业顾问的 归属客户
     *
     * @param openid
     * @param keywords
     * @param pageNumber
     * @param pageSize
     * @return
     */
    ResponseBean getAdminMyCustList(String openid, String keywords, int pageNumber, int pageSize);

    /**
     * 获取置业顾问下
     * @param userId
     * @param personId
     * @param buildingId
     * @param orgId
     * @param taPersonBuildingListByUserId
     * @return
     */
    List<TaRecommendCustomer> getConsultantCustomerList(Integer userId, String personId, String buildingId, Integer orgId, List<TaPersonBuilding> taPersonBuildingListByUserId);

    /**
     * 生成新客户信息
     * @param orgId
     * @param person
     * @param recommender
     * @param consultant
     * @param building
     * @param from
     * @return
     * @throws Exception
     */
    List<TaRecommendCustomer> newCustomer(Integer orgId, TaPerson person, TaPerson recommender, TaPerson consultant, TaBuilding building, TaCustomerFrom from) throws Exception;
}
