package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

/**
 * @description: 基金支付类型
 * @author: DingJie
 * @create: 2021/8/316:16
 */
public enum FundPayType {

    URBAN_EMPLOYEES_BASIC_MEDICAL_INSURANCE("310100", "城镇职工基本医疗保险统筹基金"), // 1

    URBAN_EMPLOYEES_BASIC_ACCT("310200", "城镇职工基本医疗保险个人账户基金"),

    OFFICIALS("320100", "公务员医疗补助基金"), // 4

    BIG_AMOUNT("330100", "大额医疗费用补助基金"), // 2

    RETIRED("340100", "离休人员医疗保障基金"),

    DISABLED_SOLDER("350100", "一至六级残疾军人医疗补助基金"),

    ENTERPRISE("370100", "企业补充医疗保险基金"), // 6

    COUNTY("390100", "城乡居民基本医疗保险基金"),

    BIG_DISEASE("390200", "城乡居民大病医疗保险基金"), // 3

    BIRTH("510100", "生育基金"),

    HELP("610100", "医疗救助基金"), // 5

    HOSP_PAY("999996", "医院垫付"),

    EX_GRATIA_COMPENSATION("620100", "特惠保补偿金"),

    OTHERS("999997", "其他基金");

    private final String code;
    private final String name;

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

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

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
