package com.qmth.distributed.print.business.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.teachcloud.common.base.BaseEntity;
import com.qmth.teachcloud.common.contant.SystemConstant;
import com.qmth.teachcloud.common.enums.FlowApproveOperationEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 流程流水表
 * </p>
 *
 * @author wangliang
 * @since 2021-08-02
 */
@ApiModel(value = "TFFlowLog对象", description = "流程流水表")
public class TFFlowLog extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "学校id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long schoolId;

    @ApiModelProperty(value = "机构id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "org_id", updateStrategy = FieldStrategy.IGNORED)
    private Long orgId;

    @ApiModelProperty(value = "流程id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long flowId;

    @ApiModelProperty(value = "任务id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long taskId;

    @ApiModelProperty(value = "审核人id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long approveId;

    @ApiModelProperty(value = "审核步骤")
    private Integer approveSetup;

    @ApiModelProperty(value = "审核意见")
    private String approveRemark;

    @ApiModelProperty(value = "是否启用，0：停用，1：启用")
    private Boolean enable;

    @ApiModelProperty(value = "审批操作，SUBMIT：提交，APPROVE：审批，REJECT：驳回，END：终止")
    private FlowApproveOperationEnum approveOperation;

    public TFFlowLog() {

    }

    public TFFlowLog(Long schoolId, Long orgId, Long flowId, Long taskId, Long approveId, Long userId, String approveRemark) {
        setId(SystemConstant.getDbUuid());
        this.schoolId = schoolId;
        this.orgId = orgId;
        this.flowId = flowId;
        this.approveId = approveId;
        this.taskId = taskId;
        this.approveRemark = approveRemark;
        insertInfo(userId);
    }

    public Long getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(Long schoolId) {
        this.schoolId = schoolId;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    public FlowApproveOperationEnum getApproveOperation() {
        return approveOperation;
    }

    public void setApproveOperation(FlowApproveOperationEnum approveOperation) {
        this.approveOperation = approveOperation;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getFlowId() {
        return flowId;
    }

    public void setFlowId(Long flowId) {
        this.flowId = flowId;
    }

    public Long getTaskId() {
        return taskId;
    }

    public void setTaskId(Long taskId) {
        this.taskId = taskId;
    }

    public Long getApproveId() {
        return approveId;
    }

    public void setApproveId(Long approveId) {
        this.approveId = approveId;
    }

    public Integer getApproveSetup() {
        return approveSetup;
    }

    public void setApproveSetup(Integer approveSetup) {
        this.approveSetup = approveSetup;
    }

    public String getApproveRemark() {
        return approveRemark;
    }

    public void setApproveRemark(String approveRemark) {
        this.approveRemark = approveRemark;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }
}
