package com.ruoyi.project.business.domain.vo.lead;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.project.business.domain.TbFile;
import com.ruoyi.project.business.domain.TcLeadHistory;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 线索管理对象 tc_lead
 *
 * @author ruoyi
 * @date 2024-04-10
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode
public class LeadRes {

    /**
     * 线索ID
     */
    private Long leadId;

    /**
     * 线索编号
     */
    @Excel(name = "线索编号", i18nCode = "lead.no")
    private String leadNo;

    /**
     * 来源（关联字典表）
     */
    @Excel(name = "来源", dictType = "lead_source", i18nCode = "lead.source")
    private String origin;

    /**
     * 状态（关联字典表）
     */
    @Excel(name = "状态", dictType = "lead_status", i18nCode = "lead.status")
    private String status;

    /**
     * 区域名称
     */
    @Excel(name = "区域", i18nCode = "lead.area")
    private String areaName;

    private Long areaId;

    @Excel(name = "城市", i18nCode = "project.city")
    private String city;


    /**
     * 国家
     */
    @Excel(name = "国家", i18nCode = "lead.country")
    private String countryName;

    private Long countryId;

    /**
     * 分配对象name
     */
    @Excel(name = "分配对象", i18nCode = "lead.owner")
    private String ownerName;
    private Long owner;


    /**
     * 所属代理商
     */
    @Excel(name = "所属代理商", i18nCode = "lead.onwerAgent")
    private String ownerAgentName;
    private Long ownerAgent;

    /**
     * 客户名称
     */
    // @Excel(name = "客户名称", i18nCode = "lead.customer")
    private String accountName;

    /**
     * 公司名称
     */
    @Excel(name = "公司名称", i18nCode = "lead.company")
    private String company;


    /**
     * 公司类型
     */
    @Excel(name = "公司类型", dictType = "lead_company_type", i18nCode = "lead.companyType")
    private String companyType;


    /**
     * 需求类型
     */
    @Excel(name = "需求类型", dictType = "lead_requirements", i18nCode = "lead.requirementType")
    private String requirementType;

    /**
     * 优先级（关联字典表）
     */
    @Excel(name = "优先级", dictType = "lead_priority", i18nCode = "lead.priority")
    private String priority;

    /**
     * 最新跟进结果
     */
    @Excel(name = "最新跟进结果", i18nCode = "lead.lastFollowResult")
    private String lastFollowResult;

    /**
     * 最新跟进时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最新跟进时间", width = 30, dateFormat = "yyyy-MM-dd", i18nCode = "lead.lastFollowTime")
    private LocalDate lastFollowTime;

    /**
     * 跟进人
     */
    @Excel(name = "跟进人", i18nCode = "lead.follower")
    private String follower;

    /**
     * 产品意向
     */
    @Excel(name = "产品意向", dictType = "intentional_product", i18nCode = "lead.productIntention")
    private String intentionalProduct;

    /**
     * 项目类型
     */
    @Excel(name = "项目类型", dictType = "project_type", i18nCode = "lead.projectType")
    private String segment;

    /**
     * 创建人
     */
    @Excel(name = "创建人", i18nCode = "lead.createBy")
    private String createByNickName;

    /**
     * 创建日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd", i18nCode = "lead.createTime")
    private LocalDate createTime;

    /**
     * 最新跟进记录
     */
    // private TcFollow lastFollow;


    private Long createBy;

    //============================

    /**
     * 归属集团
     */
    private String group;

    /**
     * 公司背景
     */
    private String background;

    /**
     * 询盘信息
     */
    // @Excel(name = "询盘信息", i18nCode = "lead.desc")
    private String requirement;


    /**
     * 丢失原因备注
     */
    private String lostRemark;

    /**
     * 联系人
     */
    private String contactPerson;

    /**
     * 职位
     */
    private String jobTitle;


    /**
     * 联系电话
     */
    private String contact;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 失效原因
     */
    private String invalidReason;

    /**
    * 线索类型（0：终端客户 1 代理商）
    */
    // @Excel(name = "线索类型", dictType = "lead_type", i18nCode = "lead.type")
    private String type;

    /**
    * 地址
    */
    // @Excel(name = "地址", i18nCode = "lead.address")
    private String address;
    
    /**
     * 备注
     */
    private String remark;


    //============================
    
    // 关联客户no
    private String relationAccountNo;

    // 关联客户名称
    private String relationAccountName;

    // 关联客户区域Id
    private Long relationAccountAreaId;

    // 关联客户国家Id
    private Long relationAccountCountryId;
    
    // 关联客户 代理商id
    private Long relationAccountAgentId;
    
    // 排他
    private Date updateTime;


    /**
    * 转化后客户id
    */
    private Long relativeAccount;
    ///**
    // * 线索时间
    // */
    //@JsonFormat(pattern = "yyyy-MM-dd")
    // @Excel(name = "线索时间", width = 30, dateFormat = "yyyy-MM-dd", i18nCode = "lead.time")
    private Date leadTime;
    /**
     * 附件，多个附件用逗号隔开
     */
    private String annex;

    /**
     * 附件文件列表
     */
    private List<TbFile> tbFiles;

    // 是否可分配的
    private boolean assignable;

    // 是否可回收
    private boolean recyclable;

    // 是否可跟进、可转化客户
    private boolean followable;

    // 是否可删除
    private boolean deletable;

    // 是否可转化客户
    private boolean convertable;

    // 是否可转化项目
    private boolean convertProjectable;
    
    // 是否显示 静默/无效
    private boolean silentOrInvalidAble;


    private List<TcLeadHistory> tcLeadHistories;
    
    // 最新跟进记录
    private TcLeadHistory lastHistory;
}
