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.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "BusinessDetailVO", description = "商机详情VO")
public class BusinessDetailVO extends SysBaseField {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "商机主键")
    private Long id;

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

    @ApiModelProperty(value = "商机标题")
    private String title;

    @ApiModelProperty(value = "商机阶段（1初步洽谈、2深入沟通、3产品报价、4成交商机）对应字典business_stage")
    @Dict(dictCode = "business_stage",valueField = "stageName")
    private String stage;

    @ApiModelProperty(value = "商机阶段名称")
    private String stageName;

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

    @ApiModelProperty(value = "关联报价id")
    private Long quotationId;

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

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

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

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

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

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

    @ApiModelProperty(value = "预计销售金额")
    private BigDecimal estimatedSalesAmount;

    @ApiModelProperty(value = "预计签单日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format ="yyyy-MM-dd")
    private LocalDate expectedSigningDate;

    @ApiModelProperty(value = "销售阶段value（对应字典销售阶段value）")
    @Dict(dictCode = "sales_phase",valueField = "salesPhaseName",multiple = true)
    private String salesPhaseDictValue;
    @ApiModelProperty(value = "销售阶段名称")
    private String salesPhaseName;

    @ApiModelProperty(value = "商机类型value（对应字典商机类型value）")
    @Dict(dictCode = "business_type",valueField = "businessTypeName",multiple = true)
    private String businessTypeDictValue;
    @ApiModelProperty(value = "商机类型名称")
    private String businessTypeName;

    @ApiModelProperty(value = "成交机率value（对应字典成交机率value）")
    @Dict(dictCode = "transaction_probability",valueField = "stransactionProbabilityName",multiple = true)
    private String transactionProbabilityDictValue;
    @ApiModelProperty(value = "成交机率名称")
    private String stransactionProbabilityName;

    @ApiModelProperty(value = "商机来源value（对应字典商机来源value）")
    @Dict(dictCode = "sources_of_business",valueField = "sourcesOfBusinessName",multiple = true)
    private String sourcesOfBusinessDictValue;
    @ApiModelProperty(value = "商机来源名称")
    private String sourcesOfBusinessName;

    @ApiModelProperty(value = "获取日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format ="yyyy-MM-dd")
    private LocalDate getedDate;

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

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

    @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 = "下一个id")
    private Long nextId;

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

    @ApiModelProperty(value = "是否是流失商机（0不是，1是）")
    private Integer hasLoss;

    @ApiModelProperty(value = "流失原因value（对应字典流失原因value）")
    @Dict(dictCode = "loss_reason",valueField = "lossReasonName")
    private String lossReasonDictValue;

    @ApiModelProperty(value = "流失原因")
    private String lossReasonName;

    @ApiModelProperty(value = "流失备注")
    private String lossRemark;

    @ApiModelProperty(value = "唤醒原因value（对应字典唤醒原因value）")
    @Dict(dictCode = "awaken_reason",valueField = "awakenReasonName")
    private String awakenReasonDictValue;

    @ApiModelProperty(value = "唤醒原因")
    private String awakenReasonName;

    @ApiModelProperty(value = "唤醒备注")
    private String awakenRemark;
}
