package com.qmth.sop.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.sop.common.base.BaseEntity;
import com.qmth.sop.common.enums.FlowApproveSetupEnum;
import com.qmth.sop.common.enums.FlowStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 流程审核表
 * </p>
 *
 * @author wangliang
 * @since 2023-07-17
 */
@ApiModel(value = "TFFlowApprove对象", description = "流程审核表")
public class TFFlowApprove extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "机构id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long orgId;

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

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

    @ApiModelProperty(value = "状态，START：已开始，AUDITING：审核中，REJECT：已驳回，END：已终止，FINISH：已结束")
    private FlowStatusEnum status;

    @ApiModelProperty(value = "计划步骤")
    private Integer setup;

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

    @ApiModelProperty(value = "最大审批步骤")
    @TableField(value = "approve_max_setup", updateStrategy = FieldStrategy.IGNORED)
    private Integer approveMaxSetup;

    @ApiModelProperty(value = "流程转办")
    private String transferAssignee;

    @ApiModelProperty(value = "会签审批人")
    @TableField(value = "all_assignee", updateStrategy = FieldStrategy.IGNORED)
    private String allAssignee;

    @ApiModelProperty(value = "驳回路线")
    @TableField(value = "reject_link", updateStrategy = FieldStrategy.IGNORED)
    private String rejectLink;

    public TFFlowApprove() {

    }

    public TFFlowApprove(Long orgId, Long approveId, FlowStatusEnum status, Long userId) {
        this.orgId = orgId;
        this.approveId = approveId;
        this.status = status;
        insertInfo(userId);
        this.setup = FlowApproveSetupEnum.START.getSetup();
    }

    public Long getOrgId() {
        return orgId;
    }

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

    public Long getFlowId() {
        return flowId;
    }

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

    public Long getApproveId() {
        return approveId;
    }

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

    public FlowStatusEnum getStatus() {
        return status;
    }

    public void setStatus(FlowStatusEnum status) {
        this.status = status;
    }

    public Integer getSetup() {
        return setup;
    }

    public void setSetup(Integer setup) {
        this.setup = setup;
    }

    public Integer getApproveSetup() {
        return approveSetup;
    }

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

    public Integer getApproveMaxSetup() {
        return approveMaxSetup;
    }

    public void setApproveMaxSetup(Integer approveMaxSetup) {
        this.approveMaxSetup = approveMaxSetup;
    }

    public String getTransferAssignee() {
        return transferAssignee;
    }

    public void setTransferAssignee(String transferAssignee) {
        this.transferAssignee = transferAssignee;
    }

    public String getAllAssignee() {
        return allAssignee;
    }

    public void setAllAssignee(String allAssignee) {
        this.allAssignee = allAssignee;
    }

    public String getRejectLink() {
        return rejectLink;
    }

    public void setRejectLink(String rejectLink) {
        this.rejectLink = rejectLink;
    }
}
