package com.diagbot.enums;

import lombok.Getter;
import lombok.Setter;

/**
 * @Description: 工作流节点
 * @author: gaodm
 * @time: 2018/9/3 16:01
 */
public enum WorkFlowNodeEnum {

    APPEAL("1", "申诉"),
    APPEAL_BACK("2", "撤销申诉"),
    DEPT_CHECK("3", "科室审核");

    @Getter
    @Setter
    private String key;

    @Getter
    @Setter
    private String name;

    WorkFlowNodeEnum(String key, String name) {
        this.key = key;
        this.name = name;
    }

    public static WorkFlowNodeEnum getEnum(String key) {
        for (WorkFlowNodeEnum item : WorkFlowNodeEnum.values()) {
            if (item.key.equals(key)) {
                return item;
            }
        }
        return null;
    }

    public static String getName(String key) {
        WorkFlowNodeEnum item = getEnum(key);
        return item != null ? item.name : null;
    }
}
