package com.tofly.gpsboot.common.system;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.StringUtils;

/**
 * 隐患状态
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum TroubleSateEnum {
    /**
     *
     */
    TROUBLE_SATE_NO_DISPOSE("0","无需处理"),
    TROUBLE_SATE_PATROL("1","巡查"),
    TROUBLE_SATE_YES_ELIMINATE("2","已消除"),
    TROUBLE_SATE_APPLY_ELIMINATE("3","消除申请"),

    TROUBLE_SATE_REPORT("4","已上报")
    ;
    ;
    /**
     * 编码
     */
    private String code;
    /**
     * 内容
     */
    private String value;
    public static String getCodeForValue(String code) {
        String path = "";
        if (StringUtils.isEmpty(code)) {
            return path;
        }

        for (TroubleSateEnum e : TroubleSateEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                path = e.value;
                break;
            }
        }
        return path;
    }
}
