package com.diagbot.enums;

import com.diagbot.core.KeyedNamed;
import lombok.Setter;

/**
 * @author wangfeng
 * @Description: 核查任务类型
 * @date 2018年11月21日 下午2:31:42
 */
public enum CheckJobTypeEnum implements KeyedNamed {
    DEPT_SUPERVISOR(0, "科室任务"),
    QUAT_SUPERVISOR(1, "质控科任务"),
    HOSP_SUPERVISOR(2, "院级任务");

    @Setter
    private int key;

    @Setter
    private String name;

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

    public static CheckJobTypeEnum getEnum(int key) {
        for (CheckJobTypeEnum item : CheckJobTypeEnum.values()) {
            if (item.key == key) {
                return item;
            }
        }
        return null;
    }

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

    @Override
    public int getKey() {
        return key;
    }

    @Override
    public String getName() {
        return name;
    }
}

