package com.storlead.sales.pojo.vo.customer;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.storlead.framework.annotate.AnnotateEnumType;
import com.storlead.framework.annotate.Dict;
import com.storlead.framework.annotate.OrgAutoMateAnnotate;
import com.storlead.framework.mybatis.entity.SysBaseField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "LiaisonListVO", description = "客户联系人列表VO")
public class LiaisonListVO extends SysBaseField {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "联系人id")
    private Long id;

    @ApiModelProperty(value = "编码")
    private String dataCode;

    @ApiModelProperty(value = "关联客户id")
    private Long customerId;

    @ApiModelProperty(value = "关联客户名称")
    private String customerName;

    //返回时客户还是线索
    @ApiModelProperty(value = "客户种类（1客户、2线索）")
    private Integer customerForm;

    @ApiModelProperty(value = "线索状态value（对应字典线索状态value）")
    @Dict(dictCode = "clue_status",valueField = "clueStatusName")
    private String clueStatusDictValue;

    @ApiModelProperty(value = "线索状态名称")
    private String clueStatusName;

    @ApiModelProperty(value = "客户状态value（对应字典客户状态value）")
    @Dict(dictCode = "customer_status",valueField = "customerStatusName")
    private String customerStatusDictValue;

    @ApiModelProperty(value = "客户状态名称")
    private String customerStatusName;

    @ApiModelProperty(value = "是否是首要联系人（0不是，1是）")
    private Boolean hasPrimaryLialison;

    @ApiModelProperty(value = "联系人姓名")
    private String name;

    @ApiModelProperty(value = "尊称（0未知，1先生，2女士）")
    @Dict(dictCode = "call_dict_value",valueField = "callName")
    private Integer call;

    @ApiModelProperty(value = "尊称")
    private String callName;

    @ApiModelProperty(value = "联系人角色value（对应字典联系人角色value）")
    @Dict(dictCode = "liaison_role",valueField = "liaisonRoleName")
    private String liaisonRoleDictValue;

    @ApiModelProperty(value = "联系人角色name（对应字典联系人角色name）")
    //数据库不存在该字段
    private String liaisonRoleName;

    @ApiModelProperty(value = "生日")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format ="yyyy-MM-dd")
    private Date birthday;

    @ApiModelProperty(value = "部门职务")
    private String departmentPosition;

    @ApiModelProperty(value = "手机号码")
    private String telephone;

    @ApiModelProperty(value = "电子邮箱")
    private String email;

    @ApiModelProperty(value = "备用邮箱1")
    private String email1;
    @ApiModelProperty(value = "备用邮箱2")
    private String email2;
    @ApiModelProperty(value = "备用邮箱3")
    private String email3;

//    @ApiModelProperty(value = "商机/订单（1商机，2订单）")
//    private Integer nicheOrOrders;

    @ApiModelProperty(value = "资源类型(10:客户、11线索、20:联系人、30:商机、40:订单、50:回款、60:退款、70:费用、80:任务、90:跟进、100:工单)")
    @TableField("resource_type")
    private String resourceType;

    @ApiModelProperty(value = "资源类型关联ID")
    @TableField("resource_type_id")
    private Long resourceTypeId;

    @ApiModelProperty(value = "传真号码")
    private String faxNumber;

    @ApiModelProperty(value = "邮政编码")
    private String postcode;

    @ApiModelProperty(value = "联系方式")
    private String contactInformation;

    @ApiModelProperty(value = "备注信息")
    private String remark;

    @ApiModelProperty(value = "qq")
    private String qq;

    @ApiModelProperty(value = "skype")
    private String skype;

    @ApiModelProperty(value = "旺旺")
    private String wangwang;

    @ApiModelProperty(value = "微信")
    private String wechat;

    @ApiModelProperty(value = "Twitter")
    private String twitter;

    @ApiModelProperty(value = "Linkedin")
    private String linkedin;

    @ApiModelProperty(value = "Facebook")
    private String facebook;

    @ApiModelProperty(value = "Whatsapp")
    private String whatsapp;

    @ApiModelProperty(value = "区域")
    private String internationalArea;

    @ApiModelProperty(value = "详细地址")
    private String address;

    @ApiModelProperty(value = "归属人员")
    @OrgAutoMateAnnotate(valueField = "ownerByName",annotateType = AnnotateEnumType.USER)
    private Long ownerBy;

    @ApiModelProperty(value = "归属人员姓名")
    private String ownerByName;

    @ApiModelProperty(value = "创建人姓名")
    private String createByName;

    @ApiModelProperty(value = "固定电话")
    private String fixedLineTelephone;

    @ApiModelProperty(value = "宅电")
    private String homeElectricity;

    @ApiModelProperty(value = "下一个id")
    private Long nextId;

    @ApiModelProperty(value = "上一个id")
    private Long previousId;

    @ApiModelProperty(value = "最后跟进时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastFollowUpTime;

    @ApiModelProperty(value = "未跟进天数")
    private Integer noFollowUpDate;

    @ApiModelProperty(value = "未跟进天数")
    private Integer notFollowUpDate;

    @ApiModelProperty(value = "下次跟进时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime nextFollowUpTime;

    @ApiModelProperty(value = "重复类型")
    private String reason;

    @ApiModelProperty(value = "业务类型名称")
    private String resourceTypeName;


    @ApiModelProperty(value = "业务名称")
    private String resourceName;

}
