package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

/**
 * @description: 收费项目等级
 * @author: DingJie
 * @create: 2021/7/1010:51
 */
public enum ChrgitmLv {

    FIRST_CLASS("01", "甲类"),

    SECOND_CLASS("02", "乙类"),

    SELF_PAY("03", "丙类");

    private final String code;
    private final String name;

    ChrgitmLv(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static ChrgitmLv get(String code) {
        if (StringUtil.isBlank(code)) {
            return null;
        }
        for (ChrgitmLv chrgitmLv : ChrgitmLv.values()) {
            if (code.trim().equals(chrgitmLv.getCode())) {
                return chrgitmLv;
            }
        }
        return null;
    }
}
