package com.mortals.xhx.common.code;

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

/**
 * @author: finegirl
 * @date: 2021/7/16 11:50
 * @description: //TODO 请完善注释信息
 **/
public enum UserType {
    SYSTEM(0, "系统用户"),
    WORK(1, "后台管理"),
    WORK_PERSON(2, "工作人员"),
    INSPECT_PERSON(3, "巡查人员");;

    private int value;
    private String desc;

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

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

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

    public static UserType getByValue(int value) {
        UserType[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            UserType examStatus = var1[var3];
            if (examStatus.getValue() == value) {
                return examStatus;
            }
        }

        return null;
    }

    public static Map<String, String> getEnumMap(int... eItem) {
        Map<String, String> resultMap = new LinkedHashMap();
        UserType[] var2 = values();
        int var3 = var2.length;

        for(int var4 = 0; var4 < var3; ++var4) {
            UserType item = var2[var4];

            try {
                boolean hasE = false;
                int[] var7 = eItem;
                int var8 = eItem.length;

                for(int var9 = 0; var9 < var8; ++var9) {
                    int e = var7[var9];
                    if (item.getValue() == e) {
                        hasE = true;
                        break;
                    }
                }

                if (!hasE) {
                    resultMap.put(item.getValue() + "", item.getDesc());
                }
            } catch (Exception var11) {
            }
        }

        return resultMap;
    }
}