package org.wcs.constant.enums.database;

import lombok.Getter;
import org.wcs.constant.enums.business.LocationTypeEnum;

/**
 * 订单执行设备枚举
 */
@Getter
public enum StockExecuteEquipmentEnum {
    UNKNOWN(0, "未知"),
    STACKER(1, "堆垛机"),
    CONVEYOR(2, "输送线"),
    SHUTTLE(3, "穿梭车"),
    STOCK_BOX(4, "货柜"),
    RGV(5, "RGV"),
    AGV(6, "AGV"),
    TRAY(7, "托盘");

    private final Integer code;
    private final String name;

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


    public static StockExecuteEquipmentEnum getExecuteEquipment(LocationTypeEnum locationType) {
        return switch (locationType) {
            case STACKER -> STACKER;
            case CONVEY -> CONVEYOR;
            case AGV -> AGV;
            case SHUTTLE -> SHUTTLE;
            case TRAY_CONVEY -> TRAY;
            default -> UNKNOWN;
        };
    }
}
