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

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.storlead.framework.mybatis.query.QueryBaseEntity;
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.LocalDate;
import java.util.Date;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "BusinessSearchDTO", description = "商机查询DTO")
public class BusinessSearchDTO extends QueryBaseEntity {

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

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

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

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

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

    @ApiModelProperty(value = "国家区域")
    private String country;

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

    @ApiModelProperty(value = "是否需要查询未成交商机")
    private Boolean isNeedNotDeal = false;

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

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

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

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

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

    @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 = "归属人员")
    private Long ownerBy;

    @ApiModelProperty(value = "业务数据类型")
    private String resourceType;

    @ApiModelProperty(value = "ID")
    private Long resourceTypeId;

    @ApiModelProperty(value = "是否有已成交订单(1有，2没有)")
    private Integer hasOrderForm;

    @ApiModelProperty(value = "是否是流失商机")
    private Integer hasLoss ;

    @ApiModelProperty(value = "部门id")
    private Long deptId;

    @ApiModelProperty(value = "部门idList")
    private List<Long> deptIds;

    @ApiModelProperty(value = "归属人ids")
    private List<Long> ownerByIds;

    @ApiModelProperty(value = "搜索开始时间")
    private String startDate;

    @ApiModelProperty(value = "搜索结束时间")
    private String endDate;
}
