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

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.storlead.framework.annotate.Dict;
import com.storlead.framework.mybatis.entity.SysBaseField;
import com.storlead.sales.enums.ResourceTypeEnum;
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.Date;

/**
 * <p>
 * 客户跟进记录表
 * </p>
 *
 * @author YPZ
 * @since 2024-04-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("customer_follow_up")
@ApiModel(value="CustomerFollowUpEntity对象", description="客户跟进记录表")
public class CustomerFollowUpEntity extends SysBaseField {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "客户跟进记录id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "客户跟进种类value（对应字典客户跟进种类value）")
    @TableField("follow_up_type_value")
    private String followUpTypeValue;

    @ApiModelProperty(value = "跟进人员id")
    @TableField("follow_up_member_id")
    private Long followUpMemberId;

    @ApiModelProperty(value = "跟进时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("follow_up_time")
    private LocalDateTime followUpTime;

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

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

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

    @ApiModelProperty(value = "关联任务id")
    @TableField("task_id")
    private Long taskId;

    @ApiModelProperty(value = "关联邮件id")
    @TableField("mail_id")
    private Long mailId;

    @ApiModelProperty(value = "关联联系人id,逗号隔开")
    @TableField("liaison_ids")
    private String liaisonIds;

    @ApiModelProperty(value = "业务类型10:客户(包含线索)、20:联系人、30:商机、40:订单")
    @TableField("resource_type")
    private String resourceType;

    @ApiModelProperty(value = "业务类型关联ID")
    @TableField("resource_type_id")
    private Long resourceTypeId;

    @ApiModelProperty(value = "业务名称")
    @TableField("resource_name")
    private String resourceName;

    @ApiModelProperty(value = "业务阶段对应的字典value")
    @TableField("dict_code")
    private String dictCode;

    @ApiModelProperty(value = "业务阶段")
    @TableField("resource_stage_dict_value")
    private String resourceStageDictValue;

    @ApiModelProperty(value = "业务阶段名称")
    @TableField("resource_stage_name")
    private String resourceStageName;

//    @ApiModelProperty(value = "提醒用户id，逗号隔开")
    @TableField("remind_user_ids")
    private String remindUserIds;

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


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


}
