package cn.stylefeng.workflow.api.entity.task;

import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

@TableName("flow_oa_ru_task")
@Data
@EqualsAndHashCode(callSuper = true)
public class RuTask extends BaseEntity {

    @TableId(value = "task_id", type = IdType.ASSIGN_ID)
    @ChineseDescription("主键")
    private Long taskId;

    @TableField("model_id")
    @ChineseDescription("流程模型id")
    private Long modelId;

    @TableField("definition_id")
    @ChineseDescription("流程定义id")
    private Long definitionId;

    @TableField("instance_id")
    @ChineseDescription("流程实例id")
    private Long instanceId;

    @TableField("re_node_id")
    @ChineseDescription("流程节点id，对应flow_design_node表主键id")
    private Long reNodeId;

    @TableField("ru_node_id")
    @ChineseDescription("运行时流程节点id，对应flow_engine_runtime_node表主键id")
    private Long ruNodeId;

    @TableField("approver")
    @ChineseDescription("任务处理人id")
    private Long approver;

    @TableField("read_flag")
    @ChineseDescription("是否已读，Y-已读，N-未读")
    private String readFlag;

    @TableField(value = "suggest_content", updateStrategy = FieldStrategy.IGNORED)
    @ChineseDescription("审批意见内容")
    private String suggestContent;

    @TableField("begin_time")
    @ChineseDescription("开始办理时间，用在任务类型为“办理”时")
    private Date beginTime;

    @TableField("suggest_time")
    @ChineseDescription("审批时间，或完成办理的时间，或者已阅的事件")
    private Date suggestTime;

    @TableField("task_type")
    @ChineseDescription("任务类型：10-发起，20-审批，30-抄送，40-征询，50-办理")
    private Integer taskType;

    @TableField("task_status")
    @ChineseDescription("任务状态：10-发起，15-待开始，20-审批中，30-已审批，40-已拒绝，50-已退回，60-已撤回，70-已关闭，80-已转交")
    private Integer taskStatus;

    @TableField("remark")
    @ChineseDescription("备注")
    private String remark;

    @TableField(value = "version_flag", fill = FieldFill.INSERT)
    @ChineseDescription("乐观锁")
    @Version
    private Long versionFlag;

    @TableField("del_flag")
    @ChineseDescription("逻辑删除：Y-已删除，N-未删除")
    private String delFlag;

    @TableField(value = "tenant_id", fill = FieldFill.INSERT)
    @ChineseDescription("租户号")
    private Long tenantId;

}
