package org.wcs.constant.enums.plc;

import lombok.Getter;

/**
 * 堆垛机任务类型枚举
 */
@Getter
public enum StackerTaskTypeEnum {

    ERROR(-1, "异常搬出"),
    IN(1, "入库"),
    OUT(2, "出库"),
    MOVE(3, "移库");

    private final Integer code;
    private final String desc;

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

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