package com.gxwebsoft.cms.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.cms.entity.CustomerLeadEntity;
import com.gxwebsoft.cms.param.CustomerLeadParam;
import com.gxwebsoft.cms.param.LeadDispatchParam;
import com.gxwebsoft.cms.param.LeadFollowParam;

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

/**
 * 客资管理服务接口
 *
 * @author 科技小王子
 * @since 2026-04-14
 */
public interface CustomerLeadService extends IService<CustomerLeadEntity> {

    /**
     * 分页查询客资列表
     */
    Map<String, Object> getLeadPage(CustomerLeadParam param);

    /**
     * 获取客资详情
     */
    CustomerLeadEntity getLeadDetail(Integer leadId);

    /**
     * 创建客资（管理员录入）
     */
    CustomerLeadEntity createLead(CustomerLeadParam param);

    /**
     * 更新客资信息
     */
    boolean updateLead(CustomerLeadParam param);

    /**
     * 更新客资状态
     */
    boolean updateLeadStatus(Integer leadId, Integer status, String remarks);

    /**
     * 派单给业务员
     */
    boolean dispatchLead(LeadDispatchParam param);

    /**
     * 批量派单
     */
    Map<String, Object> batchDispatchLeads(LeadDispatchParam param);

    /**
     * 添加跟进记录
     */
    boolean addFollowLog(LeadFollowParam param);

    /**
     * 获取客资跟进历史
     */
    List<Map<String, Object>> getFollowHistory(Integer leadId);

    /**
     * 获取统计数据
     */
    Map<String, Object> getStatistics(CustomerLeadParam param);

    /**
     * 导出客资数据
     */
    List<Map<String, Object>> exportLeads(CustomerLeadParam param);

    /**
     * 获取未分配客资列表
     */
    List<CustomerLeadEntity> getUnassignedLeads();

    /**
     * 获取业务员的客资统计
     */
    Map<String, Object> getSalesmanLeadStats(Integer salesmanId);
}
