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.distributed.print.business.enums.CustomFlowMultipleUserApproveTypeEnum;
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 = "实体表")
    private String objectTable;

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

    @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：终止，EXCHANGE：转他人审批")
    private FlowApproveOperationEnum approveOperation;

    @ApiModelProperty(value = "待审核人id")
    private String pendApproveId;

    @ApiModelProperty(value = "试卷附件")
    @TableField(value = "paper_attachment_id", updateStrategy = FieldStrategy.IGNORED)
    private String paperAttachmentId;

    @ApiModelProperty(value = "审批步骤")
    @TableField(value = "approve_multi_setup", updateStrategy = FieldStrategy.IGNORED)
    private Integer approveMultiSetup;

    @ApiModelProperty(value = "审批用户类别")
    @TableField(value = "approve_user_approve_type", updateStrategy = FieldStrategy.IGNORED)
    private CustomFlowMultipleUserApproveTypeEnum approveUserApproveType;

    public TFFlowLog() {

    }

    public TFFlowLog(Long schoolId, Long orgId, Long flowId, Long objectId, Long approveId, Long userId, String approveRemark, String objectTable) {
        this.schoolId = schoolId;
        this.orgId = orgId;
        this.flowId = flowId;
        this.approveId = approveId;
        this.objectId = objectId;
        this.approveRemark = approveRemark;
        this.objectTable = objectTable;
        insertInfo(userId);
    }

    public TFFlowLog(Long schoolId, Long orgId, Long flowId, Long objectId, Long approveId, Long userId, String approveRemark, String pendApproveId, FlowApproveOperationEnum approveOperation, String objectTable) {
        this.schoolId = schoolId;
        this.orgId = orgId;
        this.flowId = flowId;
        this.approveId = approveId;
        this.objectId = objectId;
        this.approveRemark = approveRemark;
        this.pendApproveId = pendApproveId;
        this.approveOperation = approveOperation;
        this.objectTable = objectTable;
        insertInfo(userId);
    }

    public TFFlowLog(Long schoolId, Long orgId, Long flowId, Long objectId, Long userId, String approveRemark, FlowApproveOperationEnum approveOperation, Long approveId, String pendApproveId, String objectTable) {
        setId(SystemConstant.getDbUuid());
        this.schoolId = schoolId;
        this.orgId = orgId;
        this.flowId = flowId;
        this.objectId = objectId;
        this.approveRemark = approveRemark;
        this.approveOperation = approveOperation;
        this.approveId = approveId;
        this.pendApproveId = pendApproveId;
        this.objectTable = objectTable;
        insertInfo(userId);
    }

    public CustomFlowMultipleUserApproveTypeEnum getApproveUserApproveType() {
        return approveUserApproveType;
    }

    public void setApproveUserApproveType(CustomFlowMultipleUserApproveTypeEnum approveUserApproveType) {
        this.approveUserApproveType = approveUserApproveType;
    }

    public Integer getApproveMultiSetup() {
        return approveMultiSetup;
    }

    public void setApproveMultiSetup(Integer approveMultiSetup) {
        this.approveMultiSetup = approveMultiSetup;
    }

    public String getPaperAttachmentId() {
        return paperAttachmentId;
    }

    public void setPaperAttachmentId(String paperAttachmentId) {
        this.paperAttachmentId = paperAttachmentId;
    }

    public String getPendApproveId() {
        return pendApproveId;
    }

    public void setPendApproveId(String pendApproveId) {
        this.pendApproveId = pendApproveId;
    }

    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 String getObjectTable() {
        return objectTable;
    }

    public void setObjectTable(String objectTable) {
        this.objectTable = objectTable;
    }

    public Long getObjectId() {
        return objectId;
    }

    public void setObjectId(Long objectId) {
        this.objectId = objectId;
    }

    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;
    }
}
