package com.qmth.sop.business.bean.result;

import com.qmth.sop.business.bean.dto.FlowRejectSequenceDto;
import io.swagger.annotations.ApiModelProperty;
import org.jetbrains.annotations.NotNull;

import java.io.Serializable;
import java.util.List;

/**
 * @Description: 流程节点result
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/8/6
 */
public class FlowTaskResult implements Serializable, Comparable<FlowTaskResult> {

    @ApiModelProperty(value = "流程节点名称")
    private String taskName;

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

    @ApiModelProperty(value = "流程节点步骤")
    private Integer setup;

    @ApiModelProperty(value = "表单key")
    private String formKey;

    @ApiModelProperty(value = "表单数据")
    private List<FlowFormWidgetResult> formProperty;

    @ApiModelProperty(value = "流程驳回集合")
    private List<FlowRejectSequenceDto> approveRejectList;

    public List<FlowRejectSequenceDto> getApproveRejectList() {
        return approveRejectList;
    }

    public void setApproveRejectList(List<FlowRejectSequenceDto> approveRejectList) {
        this.approveRejectList = approveRejectList;
    }

    public List<FlowFormWidgetResult> getFormProperty() {
        return formProperty;
    }

    public void setFormProperty(List<FlowFormWidgetResult> formProperty) {
        this.formProperty = formProperty;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getTaskKey() {
        return taskKey;
    }

    public void setTaskKey(String taskKey) {
        this.taskKey = taskKey;
    }

    public Integer getSetup() {
        return setup;
    }

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

    public String getFormKey() {
        return formKey;
    }

    public void setFormKey(String formKey) {
        this.formKey = formKey;
    }

    @Override
    public int compareTo(@NotNull FlowTaskResult o) {
        if (o.getSetup() < this.getSetup()) {
            return 1;
        } else if (o.getSetup() > this.getSetup()) {
            return -1;
        } else {
            return 0;
        }
    }
}
