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.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.storlead.framework.annotate.Dict;
import com.storlead.framework.common.constant.LongToStringSerializer;
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.time.LocalDateTime;
import java.util.Set;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "客户跟进邮件VO")
public class CustomerFollowUpEmailsListVO extends SysBaseField {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "id")
    private Long id;

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

//    @ApiModelProperty(value = "关联客户id,逗号隔开")
//    private String customerIds;

    @TableField("mail_id")
    private Long mailId;

    @ApiModelProperty(value = "类型（跟进90，邮件110）")
    private String type;

    @ApiModelProperty(value = "联系人")
    private String liaisonIds;

    @ApiModelProperty(value = "联系人")
    private Set<String> liaisonNames;

    @ApiModelProperty(value = "主题")
    private String subject;

    @ApiModelProperty(value = "跟进详情")
    private String content;

    @ApiModelProperty(value = "跟进id")
    @JsonSerialize(using = LongToStringSerializer.class)
    private Long followUpId;

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

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

    @ApiModelProperty(value = "跟进目的value(对应字典跟进目的value)")
    @Dict(dictCode = "objective_value",valueField = "objectiveName")
    private String objectiveValue;

    @ApiModelProperty(value = "跟进目的")
    private String objectiveName;

    @ApiModelProperty(value = "收件为进，发件为出，不可调整（出入类型）")
    @Dict(dictCode = "in_out_mark",valueField = "inOutMarkName")
    private Integer inOutMark;

    @ApiModelProperty(value = "跟进方向")
    private String inOutMarkName;

    @ApiModelProperty(value = "跟进方式（邮箱默认E-mail(及5)，不可调整）")
    @Dict(dictCode = "follow_up_type",valueField = "followUpTypeName")
    private String followUpTypeValue;

    @ApiModelProperty(value = "客户跟进种类名称（对应字典客户跟进种类名称）")
    private String followUpTypeName;

    @ApiModelProperty(value = "关联类型")
    private String resourceType;

    @ApiModelProperty(value = "关联业务名称")
    private String resourceTypeName;

    @ApiModelProperty(value = "关联业务id")
    private Long resourceTypeId;

    @ApiModelProperty(value = "关联业务数据名称")
    private String resourceName;

    @ApiModelProperty(value = "状态（0未跟进，1已跟进。根据邮件是否关联跟进判定）")
    private Integer followStatus;

    @ApiModelProperty(value = "是否被阅读（0未读，1已读）")
    private Long recipientRead;

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

    @ApiModelProperty(value = "收件人邮箱")
    private Set<String> recipientls;

    @ApiModelProperty(value = "附件数")
    @TableField(exist = false)
    private Integer attachmentNum = 0;
}
