package com.ho.flow.entity.process;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntityImpl;

import java.util.Date;

public class ProcessDefinitionDTO  {


    @ApiModelProperty(value = "id")
    private String id;

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

    @ApiModelProperty(value = "流程key")
    private String key;

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

    @ApiModelProperty(value = "部署id")
    private String deploymentId;

    @ApiModelProperty(value = "资源名称")
    private String resourceName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "部署时间")
    private Date deploymentTime;

    @ApiModelProperty(value = "流程实例状态 1 激活 2 挂起 ")
    private Integer suspendState;

    @ApiModelProperty(value = "第几页")
    private Integer pageNum=1;

    @ApiModelProperty(value = "分页数量")
    private Integer pageSize=10;

    @ApiModelProperty(value = "租户id")
    private String tenantId;

    public ProcessDefinitionDTO() {
    }

    public ProcessDefinitionDTO(ProcessDefinitionEntityImpl processDefinition, ActReDeploymentVO actReDeploymentVO) {
        this.tenantId = processDefinition.getTenantId();
        this.id = processDefinition.getId();
        this.name = processDefinition.getName();
        this.key = processDefinition.getKey();
        this.version = processDefinition.getVersion();
        this.deploymentId = processDefinition.getDeploymentId();
        this.resourceName = processDefinition.getResourceName();
        this.deploymentTime = actReDeploymentVO.getDeployTime();
        this.suspendState = processDefinition.getSuspensionState();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

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

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public int getVersion() {
        return version;
    }

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

    public String getDeploymentId() {
        return deploymentId;
    }

    public void setDeploymentId(String deploymentId) {
        this.deploymentId = deploymentId;
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public Date getDeploymentTime() {
        return deploymentTime;
    }

    public void setDeploymentTime(Date deploymentTime) {
        this.deploymentTime = deploymentTime;
    }

    public Integer getSuspendState() {
        return suspendState;
    }

    public void setSuspendState(Integer suspendState) {
        this.suspendState = suspendState;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }
}
