package com.qmth.teachcloud.common.enums;

import java.util.Objects;

/**
 * @Description: 流程审批操作 enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/8/2
 */
public enum FlowApproveOperationEnum {

    SUBMIT("提交"),

    APPROVE("审批"),

    REJECT("驳回"),

    END("终止");

    private String title;

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

    public String getTitle() {
        return title;
    }

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