package com.storlead.sales.service.customer;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.storlead.framework.auth.vo.LoginUser;
import com.storlead.framework.common.result.Result;
import com.storlead.framework.mybatis.service.MyBaseService;
import com.storlead.sales.pojo.dto.customer.CustomerSearchSearchDTO;
import com.storlead.sales.pojo.dto.customer.LiaisonAddDTO;
import com.storlead.sales.pojo.dto.customer.LiaisonSearchDTO;
import com.storlead.sales.pojo.entity.customer.LiaisonEntity;
import com.storlead.sales.pojo.vo.customer.LiaisonListVO;

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

/**
 * <p>
 * 联系人表 服务类
 * </p>
 *
 * @author YPZ
 * @since 2024-04-12
 */
public interface LiaisonService extends MyBaseService<LiaisonEntity> {

    /***
      * @Description: 查询联系人列表
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/4/18 16:30
      */
    Result<?> selectListVO(LiaisonSearchDTO liaisonSearchDTO);

    IPage<?> selectSimpleListVO(CustomerSearchSearchDTO customerSearchSearchDTO);

    /***
      * @Description: 通过liaisonList获取liaisonMap
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/4/28 14:15
      */
    Map<Long, LiaisonEntity> idListToLiaisonMap(List<Long> liaisonList);

    /***
      * @Description: 通过customerIdList获取liaisonMap
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/5/9 15:05
      */
    Map<Long, LiaisonEntity> customerIdListToLiaisonMap(List<Long> customerIdList);

    /***
      * @Description: 通过客户id获取首要联系人信息
      * @Param: customerId
      * @return:
      * @Author: YPZ
      * @Date: 2024/5/10 15:59
      */
    LiaisonEntity getByCustomerId(Long customerId);

    /**
     * 获取客户所有的联系人邮箱
     * @param customerId
     * @return
     */
    List<LiaisonEntity> getLiaisonByCustomerId(Long customerId);

    /***
      * @Description: 通过id查看联系人信息
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/5/13 11:57
      */
    LiaisonListVO getLiaisonById(Long id);

    /***
      * @Description: 通过客户id查看首要联系人
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/6/13 16:52
      */
    Result<?> getPrimaryLialison(LiaisonSearchDTO liaisonSearchDTO);

    Result<?> addOrEdit(LiaisonAddDTO locationAddDTO);

    /***
      * @Description: 资源关联联系人列表
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/9/23 11:14
      */
    Result<?> listByResource(LiaisonSearchDTO liaisonSearchDTO);


    Result<?> changePrimaryLialison(LiaisonSearchDTO liaisonSearchDTO);
}
