package com.mortals.xhx.common.code;

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

/**
 * 接收业务方法类
 *
 * @author:
 * @date: 2022/12/26 11:11
 */
public enum BusizTypeEnum {
    BUSIZ_ASSESSMENT("1", "评价"),
    BUSIZ_IDCARD_RECOGNITION("2", "身份证读取"),
    BUSIZ_PRINT("71", "打印"),
    BUSIZ_PRINTLIST("73", "打印机列表"),
    BUSIZ_CAPTURE("3", "高拍仪"),
    BUSIZ_PRINT_QUEUE("74", "查看指定打印机打印队列"),
    BUSIZ_SIGN("61", "签名板"),
    BUSIZ_CAMERA("51", "双目摄像头"),
    BUSIZ_FINGER("41", "指纹"),
    BUSIZ_SOCIAL("31", "社保卡"),
    ;
    private String value;
    private String desc;

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

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

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

    public static BusizTypeEnum getByValue(String value) {
        for (BusizTypeEnum BusizTypeEnum : BusizTypeEnum.values()) {
            if (BusizTypeEnum.getValue().equals(value)) {
                return BusizTypeEnum;
            }
        }
        return null;
    }

    /**
     * 获取Map集合
     *
     * @param eItem 不包含项
     * @return
     */
    public static Map<String, String> getEnumMap(String... eItem) {
        Map<String, String> resultMap = new LinkedHashMap<>();
        for (BusizTypeEnum item : BusizTypeEnum.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;
    }
}