package org.wcs.constant.enums.database;

import lombok.Getter;

/**
 * 基础资料里面的设备类型枚举
 */
@Getter
public enum BaseErroorEquipmentTypeEnum {
    STACKER(0, "堆垛机"),
    TRAY_CONVEY(1, "托盘线"),
    CONVEY(2, "箱式线"),
    CAR(3, "小车");

    private final Integer code;
    private final String name;

    BaseErroorEquipmentTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(Integer code) {
        for (BaseErroorEquipmentTypeEnum value : BaseErroorEquipmentTypeEnum.values()) {
            if (value.code.equals(code)) {
                return value.name;
            }
        }
        return null;
    }
}
