package cn.cslg.report.entity;

import cn.cslg.report.common.model.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 任务表
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@TableName(value = "TASK")
public class Task extends BaseEntity<Task> {
    /**
     * 创建任务时间
     */
    @Schema(description = "创建任务时间")
    @TableField(value = "CREATE_TIME")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 任务名称
     */
    @Schema(description = "任务名称",required = true)
    @TableField(value = "TASK_NAME")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private String taskName;

    /**
     * 完成进度
     */
    @Schema(description = "完成进度")
    @TableField(value = "PROGRESS")
    private Double progress;

    /**
     * 完成状态
     */
    @Schema(description = "完成状态")
    @TableField(value = "TASK_STATUS")
    private Integer taskStatus;

    /**
     * 任务创建人ID
     */
    @Schema(description = "任务创建人ID")
    @TableField(value = "CREATE_ID")
    private Integer createID;

    /**
     * 任务创建人姓名
     */
    @Schema(description = "任务创建人姓名")
    @TableField(value = "CREATE_NAME")
    private String createName;
    /**
     * 任务开始时间
     */
    @Schema(description = "任务开始时间")
    @TableField(value = "BEGIN_TIME")
    private Date beginTime;

    /**
     * 完成时间
     */
    @Schema(description = "完成时间")
    @TableField(value = "FINISH_TIME")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date finishTime;

    /**
     * 结束时间
     */
    @Schema(description = "任务截止时间",required = true)
    @TableField(value = "END_TIME")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    /**
     * 任务类型
     */
    @Schema(description = "任务类型",required = true)
    @TableField(value = "TYPE")
    private Integer type;

    /**
     * 报告ID
     */
    @Schema(description = "报告ID",required = true)
    @TableField(value = "REPORT_ID")
    private Integer reportId;

    /**
     * 处理人ID
     */
    @Schema(description = "处理人ID",required = true)
    @TableField(value = "HANDLE_PERSON_ID")
    private Integer handlePersonId;

    /**
     * 处理人姓名
     */
    @Schema(description = "处理人姓名",required = true)
    @TableField(value = "HANDLE_PERSON_NAME")
    private String handlePersonName;

    /**
     * 备注
     */
    @Schema(description = "备注")
    @TableField(value = "REMARK")
    private String remark;

    /**
     * 结果
     */
    @Schema(description = "结果")
    @TableField(value = "RESULT")
    private Integer result;

    /**
     * 标的专利/产品号
     */
    @Schema(description="标的专利号",required = true)
    @TableField(value = "SIGN_PATENT_NO")
    private String signPatentNo;
}
