package com.mortals.xhx.common.code;

import java.util.LinkedHashMap;
import java.util.Map;


public enum ProductToAppNameEnum {
    数字化样表系统("ybj", "sample-form-manager"),
    数字化填单系统("tdj", "fill-manager"),
    窗口评价交互升级服务系统("ckp", "log_pjdevice"),
    自助存取件系统("qjg", "log_pickup"),
    导视机("dsj", "log_guide"),
    智能排队叫号系统("pdj", "智能排队叫号系统");
    private String value;
    private String desc;

    ProductToAppNameEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }

    public static ProductToAppNameEnum getByValue(String value) {
        for (ProductToAppNameEnum goveServiceCenterShowEnum : ProductToAppNameEnum.values()) {
            if (goveServiceCenterShowEnum.getValue() == value) {
                return goveServiceCenterShowEnum;
            }
        }
        return null;
    }

    /**
     * 获取Map集合
     *
     * @param eItem 不包含项
     * @return
     */
    public static Map<String, String> getEnumMap(String... eItem) {
        Map<String, String> resultMap = new LinkedHashMap<>();
        for (ProductToAppNameEnum item : ProductToAppNameEnum.values()) {
            try {
                boolean hasE = false;
                for (String e : eItem) {
                    if (item.getValue() == e) {
                        hasE = true;
                        break;
                    }
                }
                if (!hasE) {
                    resultMap.put(item.getValue() + "", item.getDesc());
                }
            } catch (Exception ex) {

            }
        }
        return resultMap;
    }
}