using JSMachine.WMS.App.Dto;
using JSMachine.WMS.App.Dto.Enum;
using JSMachine.WMS.Business.RcsCallBack.IService.StaePattern;
using JSMachine.WMS.Business.RcsCallBack.ServiceImpl.StatePattern.PutdownCompleted;
using JSMachine.WMS.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JSMachine.WMS.Business.RcsCallBack.ServiceImpl.StatePattern
{
///
/// rcs回调处理器工厂类
///
public class RcsCallbackHandlerFactory
{
///
/// 根据 RCS 返回状态和目标库位运输区域选择状态处理器。
///
/// RCS 任务状态码。
/// 任务目标库位。
/// 负责当前状态后续处理的处理器。
public IAgvTaskStateHandler CreateHandler(int status, StorageRackDto destWarehouse)
{
return status switch
{
21 => GlobalServericeProvidor.GetService(),
23 => destWarehouse.Transport switch
{
TransportEnum.NorthArea or TransportEnum.SouthArea or TransportEnum.MiddleOutArea or TransportEnum.ReturnStockArea
=> GlobalServericeProvidor.GetService(),
TransportEnum.NormalArea => GlobalServericeProvidor.GetService(),
TransportEnum.TransitArea => GlobalServericeProvidor.GetService(),
TransportEnum.Elevator => GlobalServericeProvidor.GetService(),
}
};
}
}
}