package com.storlead.sales.service.customer;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.storlead.framework.common.result.Result;
import com.storlead.framework.mybatis.service.MyBaseService;
import com.storlead.mail.pojo.vo.UserClickTitleVO;
import com.storlead.sales.pojo.dto.customer.CustomerFollowUpAddDTO;
import com.storlead.sales.pojo.dto.customer.CustomerFollowUpSearchDTO;
import com.storlead.sales.pojo.dto.customer.CustomerSearchSearchDTO;
import com.storlead.sales.pojo.entity.customer.CustomerFollowUpEntity;
import com.storlead.sales.pojo.vo.customer.CustomerFollowUpDetailVO;
import com.storlead.sales.pojo.vo.customer.CustomerFollowUpLastVO;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 客户跟进记录表 服务类
 * </p>
 *
 * @author YPZ
 * @since 2024-04-19
 */
public interface CustomerFollowUpService extends MyBaseService<CustomerFollowUpEntity> {

    /***
      * @Description: 查询客户跟进记录列表
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/4/22 16:56
      */
    Result<?> selectListVO(CustomerFollowUpSearchDTO customerFollowUpSearchDTO);


    List<UserClickTitleVO> selectUserClickTitle(Long ownerBy, String title);


    /***
      * @Description: 新增/修改客户跟进记录
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/6/4 17:25
      */
    Result<?> addCustomerFollowUp(CustomerFollowUpAddDTO customerFollowUpAddDTO);

    CustomerFollowUpDetailVO getVOById(Long id);

    /***
      * @Description: 查询对应业务类型最后一次跟进时间及未跟进天数
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/6/6 17:44
      */
    Map<Long, CustomerFollowUpLastVO> getFollowUpLastVOMap(List<Long> resourceTypeIdList, String type);

    Map<Long, CustomerFollowUpLastVO> getBussFollowUpLastVOMap(List<Long> resourceTypeIdList, String type);
    /***
      * @Description: 查询对应业务类型最后一次跟进时间
      * @Param:
      * @return:
      * @Author: YPZ
      * @Date: 2024/6/11 16:45
      */
    LocalDateTime getLastFollowUpTime(Long id, String type);

    String getResourceTyepName(String resourceType, String resourceTypeId);

    String getResourceStatusTyepId(String resourceType, Long resourceTypeId);

    IPage<?> selectSimpleListVO(CustomerSearchSearchDTO customerSearchSearchDTO);
}
