package com.qmth.teachcloud.common.enums;

import java.util.Objects;

/**
 * @Description: 流程审批名称 enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/8/2
 */
public enum FlowApproveNameEnum {

    TEACHER("命题老师", "Teacher"),

    DIRECTOR("主任审批", "Director"),

    PRESIDENT("院长审核", "President"),

    PRINT("印刷员审核", "Print");

    private String title;

    private String id;

    private FlowApproveNameEnum(String title, String id) {
        this.title = title;
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public String getId() {
        return id;
    }

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