package org.wcs.constant.enums.etag;

import lombok.Getter;

/**
 * 电子标签数据提交的类型枚举
 */
@Getter
public enum EtagSubCommandEnum {

    CONFIRM_COMMAND(6, "确认键按下提交"),
    OUT_STOCK(7, "缺货"), // 注意：当用户修改数据低于发送的数据时，会返回此状态
    CONNECT_TIMEOUT(10, "通讯超时"),
    BUTTON_STUCK(13, "按键卡死"),
    ERR_INSTRUCTION(12, "指令错误");

    private final Integer code;
    private final String desc;

    EtagSubCommandEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static EtagSubCommandEnum getByCode(Integer code) {
        for (EtagSubCommandEnum value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }



}
