package com.qmth.sop.common.enums;

import java.util.Objects;

/**
 * @Description: 自定义流程审核类型
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2022/1/21
 */
public enum CustomFlowMultipleUserApproveTypeEnum {

    ORDER("依次审批"),

    ALL("会签（所有人必须审批）"),

    SOME("或签（一名审批人同意或拒绝即可）");

    private String title;

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

    public String getTitle() {
        return title;
    }

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