package com.tofly.gpsboot.common.system;

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

/**
 * 材质
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum MaterialEnum {
    /**
     *
     */
    T("1","铜"),
    L("2","吕"),
    GQ("3","光纤"),
    TGQ("4","铜/光纤"),
    ZT("5","铸铁"),
    QMZT("6","球墨铸铁"),
    DXG("7","镀锌管"),
    G("8","钢"),
    S("9","砼"),
    TT("10","陶土"),
    TC("11","陶瓷"),
    ST("12","石"),
    ZH("13","砖混"),
    Z("14","砖"),
    BLG("15","玻璃钢"),
    PE("16","PE"),
    PVC("17","PVC"),
    PRR("18","PPR"),
    FH("19","复合"),
    QT("20","其他"),

    ;
    /**
     * 编码
     */
    private String code;
    /**
     * 内容
     */
    private String value;

    public static String getCodeForValue(String code) {
        String path = "";
        if (StringUtils.isEmpty(code)) {
            return path;
        }

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