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

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.storlead.framework.annotate.Dict;
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.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 = "BusinessAddDTO", description = "商机添加DTO")
public class BusinessAddDTO {
    private static final long serialVersionUID = 1L;

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

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

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

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

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

    @ApiModelProperty(value = "币种：1-人民币,2-美元")
    private Integer currency;

    @ApiModelProperty(value = "汇率")
    private BigDecimal exchangeRate;

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

    @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 Date expectedSigningDate;

    @ApiModelProperty(value = "销售阶段value（对应字典销售阶段value）")
    @Dict(dictCode = "sales_phase")
    private String salesPhaseDictValue;

    @ApiModelProperty(value = "商机类型value（对应字典商机类型value）")
    @Dict(dictCode = "business_type")
    private String businessTypeDictValue;

    @ApiModelProperty(value = "成交机率value（对应字典成交机率value）")
    @Dict(dictCode = "transaction_probability")
    private String transactionProbabilityDictValue;

    @ApiModelProperty(value = "商机来源value（对应字典商机来源value）")
    @Dict(dictCode = "sources_of_business")
    private String sourcesOfBusinessDictValue;

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

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

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

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

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

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

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