package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

/**
 * @description: 支付地点
 * @author: DingJie
 * @create: 2021/7/1010:56
 */
public enum PayLoc {

    SI_CENTRAL("1", "中心"),

    MEDICAL_INSTITUTION("2", "医疗机构"),

    REMOTE_IN_PROVINCE("3", "省内异地"),

    REMOTE_ACROSS_PROVINCE("4", "跨省异地"),

    ONLINE_HOSPITAL("5", "互联网医院");

    private final String code;
    private final String name;

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

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

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