package com.qmth.sop.business.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonInclude;
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.contant.SystemConstant;
import com.qmth.sop.common.enums.TFCustomModelTypeEnum;
import com.qmth.sop.common.enums.TFCustomTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 自定义流程表
 * </p>
 *
 * @author wangliang
 * @since 2023-07-17
 */
@ApiModel(value = "TFCustomFlow对象", description = "自定义流程表")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TFCustomFlow extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty(value = "流程名称")
    private String name;

    @ApiModelProperty(value = "模式类型")
    private TFCustomModelTypeEnum modelType;

    @ApiModelProperty(value = "流程类型，OFFICE_SOP_FLOW：教务处SOP，CLOUD_MARK_SOP_FLOW：研究生SOP，DING_EXCEPTION_FLOW：考勤异常审核流程，PROJECT_EXCHANGE_FLOW：项目计划变更流程，QUALITY_PROBLEM_FLOW：质量问题反馈流程")
    private TFCustomTypeEnum type;

    @ApiModelProperty(value = "是否启用，0：停用，1：启用")
    @TableField(value = "enable", updateStrategy = FieldStrategy.IGNORED)
    private Boolean enable;

    @ApiModelProperty(value = "是否发布，0：否，1：是")
    @TableField(value = "publish", updateStrategy = FieldStrategy.IGNORED)
    private Boolean publish;

    @ApiModelProperty(value = "自定义流程源数据")
    private String objectData;

    @ApiModelProperty(value = "版本号")
    private Integer version;

    @ApiModelProperty(value = "流程定义id")
    private String flowDefinitionId;

    @ApiModelProperty(value = "流程部署id")
    @TableField(value = "flow_deployment_id", updateStrategy = FieldStrategy.IGNORED)
    private String flowDeploymentId;

    @ApiModelProperty(value = "流程过程变量数据")
    private String flowProcessVar;

    public TFCustomFlow() {

    }

    public TFCustomFlow(Long orgId, String name, TFCustomTypeEnum type, String flowDeploymentId, TFCustomModelTypeEnum modelType) {
        setId(SystemConstant.getDbUuid());
        this.orgId = orgId;
        this.name = name;
        this.type = type;
        this.flowDeploymentId = flowDeploymentId;
        this.modelType = modelType;
    }

    public Long getOrgId() {
        return orgId;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public TFCustomModelTypeEnum getModelType() {
        return modelType;
    }

    public void setModelType(TFCustomModelTypeEnum modelType) {
        this.modelType = modelType;
    }

    public TFCustomTypeEnum getType() {
        return type;
    }

    public void setType(TFCustomTypeEnum type) {
        this.type = type;
    }

    public Boolean getEnable() {
        return enable;
    }

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

    public Boolean getPublish() {
        return publish;
    }

    public void setPublish(Boolean publish) {
        this.publish = publish;
    }

    public String getObjectData() {
        return objectData;
    }

    public void setObjectData(String objectData) {
        this.objectData = objectData;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public String getFlowDefinitionId() {
        return flowDefinitionId;
    }

    public void setFlowDefinitionId(String flowDefinitionId) {
        this.flowDefinitionId = flowDefinitionId;
    }

    public String getFlowDeploymentId() {
        return flowDeploymentId;
    }

    public void setFlowDeploymentId(String flowDeploymentId) {
        this.flowDeploymentId = flowDeploymentId;
    }

    public String getFlowProcessVar() {
        return flowProcessVar;
    }

    public void setFlowProcessVar(String flowProcessVar) {
        this.flowProcessVar = flowProcessVar;
    }
}
