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

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.util.List;

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;

/**
 * <p>
 * 任务表
 * </p>
 *
 * @author chenkq
 * @since 2024-04-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("task")
@ApiModel(value="TaskEntity对象", description="任务表")
public class TaskEntity extends SysBaseField {

    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @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")
    @ApiModelProperty(value = "任务开始时间")
    private LocalDateTime taskBeginTime;

    @ApiModelProperty(value = "任务内容")
    private String taskContent;

    @ApiModelProperty(value = "业务数据类型")
    @Dict(dictCode = "work_data_group",valueField = "resourceTypeName")
    private String resourceType;

    @ApiModelProperty(value = "资源")
    private Long resourceTypeId;

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


    @ApiModelProperty(value = "抄送人")
    @OrgAutoMateAnnotate(valueField = "cooperateByName",annotateType = AnnotateEnumType.USER,multiple = true)
    private String cooperateBy;

    @ApiModelProperty(value = "紧急程度：1：重要，2：紧急 3：重要不紧急,4:重要且紧急")
    @Dict(dictCode = "task_priority_grade",valueField = "priorityGradeName",multiple = true)
    private Integer priorityGrade;

    @ApiModelProperty(value = "标记")
    private String markTag;

    @ApiModelProperty(value = "状态:0 :未开始,1:已完成,2:已取消 3:已超时,4:未完成")
    @Dict(dictCode = "task_status_type",valueField = "taskStatusName")
    private Integer taskStatus;

    @ApiModelProperty(value = "操作人")
    @OrgAutoMateAnnotate(valueField = "operatorByName",annotateType = AnnotateEnumType.USER)
    private Long operatorBy;

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

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

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

    @ApiModelProperty(value = "0：准时提醒，1:提前5分钟,30：提前半小时")
    @Dict(dictCode = "task_remind_type",valueField = "remindTypeName")
    private Integer remindType;

    @ApiModelProperty(value = "提醒类型：site：站内，mail：邮件,sms：短信 ： 多个逗号分割")
    @Dict(dictCode = "task_remind_mode",valueField = "remindModeName",multiple = true)
    private String remindMode;

    @ApiModelProperty(value = "提醒方式标记：[site，mail,sms]")
    @TableField(exist = false)
    private List<String> remindModels;

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

    @ApiModelProperty(value = "是否进行了超时提醒: 1:是,0:没有")
    private Integer outTimeRemind;

    @TableField(exist = false)
    private Boolean isCreateTask;

    @ApiModelProperty(value = "业务数据类型")
    @TableField(exist = false)
    private String resourceTypeName;

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

    @TableField(exist = false)
    private String taskData;
}
