package com.crunii.micro.domain.entity.main;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;


@Entity
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of = {"id"})
@GenericGenerator(name = "idGenerator", strategy = "com.crunii.micro.core.distributed.DistributedSnowFlakeId")
@ApiModel(description = "活动流程审核节点表")
@Table(name="YCQ_ACTIVE_FLOW_NODE")
public class YcqFlowNode implements Serializable{
    /** 主键 */
    @ApiModelProperty(value = "主键")
    @Id
    @GeneratedValue(generator = "idGenerator")
    private Long id ;

    @ApiModelProperty(value = "组织id")
    @Column(name = "org_id")
    private Long orgId ;

    @ApiModelProperty(value = "组织名字")
    @Column(name = "org_name")
    private String orgName ;

    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_time")
    private Date createTime ;

    @ApiModelProperty(value = "创建者")
    @Column(name = "create_by")
    private String createBy ;

    @ApiModelProperty(value = "创建者id")
    @Column(name = "create_id")
    private Long createId ;

    @ApiModelProperty(value = "业务id")
    @Column(name = "biz_id")
    private Long bizId ;

    @ApiModelProperty(value = "原因")
    @Column(name = "reason")
    private String reason ;

    @ApiModelProperty(value = "审核结果 0待审核 1审核通过 2审核通过并交上级审核  3审核不通过")
    @Column(name = "result_type")
    private Integer resultType ;

    @ApiModelProperty(value = "审核结果")
    @Column(name = "result_str")
    private String resultStr ;

    @ApiModelProperty(value = "审核人id")
    @Column(name = "login_id")
    private Integer loginId;

    @ApiModelProperty(value = "业务类型，枚举定义")
    @Column(name = "biz_type")
    private String bizType;

    @ApiModelProperty("审核类型 1 组织审核 2 人审核,3部门审核")
    @Column(name = "approve_type")
    private Integer approveType;


    @ApiModelProperty(value = "1是  2否")
    @Column(name = "is_initial")
    private Integer isInitial=2;

    @ApiModelProperty("是否重新启动(0否，1是)")
    @Column(name = "is_restart")
    private Integer isRestart;

    @ApiModelProperty("审核部门")
    @Column(name = "department")
    private String department;

    @ApiModelProperty("拒绝次数")
    @Column(name = "audit_times")
    private Integer auditTimes;

    @ApiModelProperty("审核状态")
    @Column(name = "audit_result")
    private Integer auditResult;

    @ApiModelProperty(value = "审核发起人")
    @Column(name = "launch_approve_worker")
    private Integer launchApproveWorker;

    @ApiModelProperty(value = "审核时间")
    @Column(name = "launch_approve_time")
    private Date launchApproveTime;
}
