package com.huiju.estateagents.service;

import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.huiju.estateagents.base.ResponseBean;
import com.huiju.estateagents.center.taUser.entity.TaUser;
import com.huiju.estateagents.entity.TaCustomerFrom;
import com.huiju.estateagents.entity.TaPerson;
import com.baomidou.mybatisplus.extension.service.IService;
import com.huiju.estateagents.entity.TaPersonBuilding;
import com.huiju.estateagents.entity.TaPersonPositon;

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

/**
 * <p>
 * 人员表 服务类
 * </p>
 *
 * @author jobob
 * @since 2019-05-10
 */
public interface ITaPersonService extends IService<TaPerson> {
    TaPerson mergePersonWxInfo(WxMaUserInfo userInfo);

    TaPerson updatePersonPhone(String miniOpenid, String phone, String buildingId, Integer orgId);

    IPage<Map<String, Object>> getCardList(int pageNumber, int pageSize, String buildingId, Integer orgId, TaPerson person);

    ResponseBean checkPhoneAndPass(String phone, String pass);

    ResponseBean resetPassword(String phone, String pass, String plat);

    ResponseBean getCardDetail(String openid, String id, String personId);

    ResponseBean resgiteAgent(String name, String phone, Integer sex, String explain, String openid);

    ResponseBean getWxUser(String openid);

    ResponseBean getWxUserSign(String openid, Integer orgId);

    TaPerson getPersonByTel(String userPhone);

    IPage<TaPerson> getPersonList(int pageNumber, int pageSize, String personType, String name, String phone, Integer status, String buildingId, String personTags);

    IPage<TaUser> getBuildingConsultantList(int pageNumber, int pageSize, String buildingId);

    TaPerson newPersonByOpenid(String openid, Integer orgId);

    ResponseBean bindCard(String phone, String pass, String openid);

    ResponseBean newConsultant(String paramStr);

    ResponseBean editConsultant(String id, String paramStr);

    Map<String, Object> getExtraInfo(String personId);

    List<TaPerson> getPersonsByOpenId(String openid);

    IPage<TaPerson> getDriftCustomerList(int pageNumber, int pageSize, String building, Integer orgId, String sceneType);

    String getPersonIdByCustomerId(String customerId);

    IPage<Map<String, Object>> getSavedConsaultants(int pageNumber, int pageSize, String personId);


    List<TaPersonBuilding> getPersonBuildings(String personId);

    String agentCodeGenerator();

    Integer sumPointsByOrgId(Integer orgId);

    /**
     * 渠道管理下的经纪人
     *
     * @param name
     * @param phone
     * @return
     */
    ResponseBean channelBrokerList(String name, String phone, Integer pageNum, Integer pageSize, Integer orgid, Integer channelId);

    /**
     * 渠道下邀请经纪人
     *
     * @param id
     * @param phone
     * @param pageNum
     * @param pageSize
     * @return
     */
    ResponseBean InviteClientsList(String id, String phone, Integer pageNum, Integer pageSize);

    //更新city拼音为cityId
    void upDatePersonCityToId(String personId);

    Integer judgeBindStatusByCondition(Integer userId, Integer orgId, String phone);

    /**
     * 第三方获取人员信息接口
     *
     * @param personId
     * @return
     */
    ResponseBean ThirdUserInfo(String personId);

    /**
     * 保存用户位置信息
     *
     * @param record
     * @return
     */
    Integer savePersonPosition(TaPersonPositon record);

    void authPhone(Integer orgId,
                   String openid,
                   String phone,
                   String buildingId,
                   String promoter,
                   String consultantPersonId,
                   TaCustomerFrom customerFrom) throws Exception;

    ResponseBean updateUserPhoto(String photoUrl, String openId);
}
