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

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.storlead.framework.annotate.Dict;
import com.storlead.sales.pojo.entity.customer.LiaisonEntity;
import com.storlead.sales.pojo.vo.customer.SimilarityErrorVO;
import com.storlead.sales.pojo.entity.task.TaskEntity;
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.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "CustomerAddDTO", description = "客户管理添加DTO")
public class CustomerAddDTO implements Serializable {

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

    private String dataCode;

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

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

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

    @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")
    private String clueStatusDictValue;

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

    @ApiModelProperty(value = "客户来源value（对应字典客户来源value）")
    @Dict(dictCode = "customer_source")
    private String customerSourceDictValue;

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

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

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

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

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

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

    @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")
    private String reasonPublicCustomerDictValue;

    @ApiModelProperty(value = "客户企业信息")
    private CustomerCompanyAddDTO customerCompany;

    @ApiModelProperty(value = "联系人")
    private LiaisonAddDTO liaison;

    @ApiModelProperty(value = "归属人员")
    private Long ownerBy;

    @ApiModelProperty(value = "任务")
    private TaskEntity task;

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

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

    @ApiModelProperty(value = "附件idList")
    private List<Long> resourceIdList;

    private Long customerId;

    private Integer hasOrderForm;

    @ApiModelProperty(value = "相似客户错误信息列表")
    private List<SimilarityErrorVO>  errorCanSaveVOList;

    public void setCustomerName(String customerName) {
        this.customerName = customerName == null ? null : customerName.trim();
    }


}
