package com.qmth.distributed.print.business.bean.result;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.distributed.print.business.entity.TFFlowApproveLog;
import com.qmth.teachcloud.common.enums.FlowStatusEnum;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Objects;

/**
 * @Description: 流程审批列表result
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/8/5
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class FlowApproveResult extends TFFlowApproveLog implements Serializable {

    @ApiModelProperty(value = "发起人名称")
    private String startName;

    @ApiModelProperty(value = "一级审核人名称")
    private String primaryApproveName;

    @ApiModelProperty(value = "二级审核人名称")
    private String secondApproveName;

    @ApiModelProperty(value = "流程状态")
    private FlowStatusEnum status;

    @ApiModelProperty(value = "流程状态")
    private String statusStr;

    public FlowStatusEnum getStatus() {
        return status;
    }

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

    public String getStartName() {
        return startName;
    }

    public void setStartName(String startName) {
        this.startName = startName;
    }

    public String getPrimaryApproveName() {
        return primaryApproveName;
    }

    public void setPrimaryApproveName(String primaryApproveName) {
        this.primaryApproveName = primaryApproveName;
    }

    public String getSecondApproveName() {
        return secondApproveName;
    }

    public void setSecondApproveName(String secondApproveName) {
        this.secondApproveName = secondApproveName;
    }

    public String getStatusStr() {
        if (Objects.nonNull(status)) {
            return status.getTitle();
        } else {
            return statusStr;
        }
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }
}
