package com.qmth.teachcloud.common.enums;

import java.util.Objects;

/**
 * @Description: 流程类型 enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/8/2
 */
public enum FlowStatusEnum {

    START("已开始"),

    AUDITING("审核中"),

    REJECT("已驳回"),

    END("已终止"),

    FINISH("已结束");

    private String title;

    private FlowStatusEnum(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    /**
     * 状态转换 toName
     *
     * @param title
     * @return
     */
    public static String convertToName(String title) {
        for (FlowStatusEnum e : FlowStatusEnum.values()) {
            if (Objects.equals(title, e.getTitle())) {
                return e.name();
            }
        }
        return null;
    }
}
