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 com.storlead.sales.pojo.entity.customer.CustomerCompanyEntity;
import com.storlead.sales.pojo.entity.customer.LiaisonEntity;
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.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

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

    @ApiModelProperty(value = "客户主键")
    private Long id;

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

    @ApiModelProperty(value = "客户种类（1客户、2线索）")
    private Integer customerForm;

    @ApiModelProperty(value = "是否从线索过来（0否，1是）")
    private Boolean hasFromClue;

    @ApiModelProperty(value = "是否是公共线索/公海客户（0不是，1是）")
    private Boolean hasPublicCustomer;
    @ApiModelProperty(value = "是否是垃圾客户（0不是，1是）")
    private Boolean hasGarbageCustomer;

    @ApiModelProperty(value = "是否是重点关注（0不是，1是）")
    private Boolean hasFollowCustomer;

    @ApiModelProperty(value = "客户代码")
    private String customerCode;

    @ApiModelProperty(value = "所属大洲")
    private String continent;

    @ApiModelProperty(value = "所属国家")
    private String country;

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

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

    @ApiModelProperty(value = "意向产品id，逗号隔开（产品来源：官网后台）")
    private String intendedProductsIds;

    @ApiModelProperty(value = "意向产品名称，逗号隔开（产品来源：官网后台）")
    private String intendedProductsNames;

    @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 = "客户来源value（对应字典客户来源value）")
    @Dict(dictCode = "customer_source",valueField = "customerSourceName")
    private String customerSourceDictValue;

    @ApiModelProperty(value = "客户来源名称")
    private String customerSourceName;

    @ApiModelProperty(value = "客户类型value（对应字典客户类型value）")
    @Dict(dictCode = "customer_type",valueField = "customerTypeName")
    private String customerTypeDictValue;

    @ApiModelProperty(value = "客户类型名称")
    private String customerTypeName;

    @ApiModelProperty(value = "代理合作客户id")
    private Long cooperativeCustomerId;

    @ApiModelProperty(value = "代理合作客户名称")
    private String cooperativeCustomerName;

    @ApiModelProperty(value = "客户等级value（对应字典客户等级value）")
    @Dict(dictCode = "customer_level",valueField = "customerLevelName")
    private String customerLevelDictValue;

    @ApiModelProperty(value = "客户等级名称")
    private String customerLevelName;

    @ApiModelProperty(value = "客户信用等级value（对应字典客户信用等级value）")
    @Dict(dictCode = "credit_level",valueField = "customerCreditLevelDictValue")
    private String customerCreditLevelDictValue;

    @ApiModelProperty(value = "客户信用等级名称")
    private String customerCreditLevelName;

    @ApiModelProperty(value = "客户经济性质value（对应字典客户经济性质value）")
    @Dict(dictCode = "economic_nature",valueField = "customerEconomicNatureName")
    private String customerEconomicNatureDictValue;

    @ApiModelProperty(value = "客户经济性质名称")
    private String customerEconomicNatureName;

    @ApiModelProperty(value = "助记名称")
    private String mnemonicName;

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

    @ApiModelProperty(value = "开户行")
    private String openingBank;

    @ApiModelProperty(value = "税号")
    private String taxNumber;

    @ApiModelProperty(value = "银行账号")
    private String bankAccount;

    @ApiModelProperty(value = "置公原因value（对应字典置公原因value）")
    @Dict(dictCode = "reason_public_customer",valueField = "reasonPublicCustomerName")
    private String reasonPublicCustomerDictValue;

    @ApiModelProperty(value = "置公原因name（对应字典置公原因name）")
    private String reasonPublicCustomerName;

    @ApiModelProperty(value = "首页联系人")
    private LiaisonEntity liaison;

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

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

    @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 = "客户归属时间（1、领取或分配 - 领取时间或者被分配时间。2、创建或转客户-创建时间或转客户时间）")
    @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 ownerTime;

    @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 CustomerCompanyEntity customerCompany;

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

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

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

    @ApiModelProperty(value = "是否是重点关注，true/false")
    private boolean hasFollow = false;

    @ApiModelProperty(value = "协作人员id,逗号分割")
    private String collaborator;

    @ApiModelProperty(value = "协作人员姓名")
    private String collaboratorName;

    @ApiModelProperty(value = "协作人员idList")
    private List<Long> collaboratorList;

    @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 giveUpTime;

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

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

    @ApiModelProperty(value = "当前保护天数")
    private Integer nowProtectionDays;

    @ApiModelProperty(value = "最大保护天数")
    private Integer maxProtectionDays;

    @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 protectionDate;

}
