using JSMachine.WMS.App.Dto.Enum; using JSMachine.WMS.App.Dto; using JSMachine.WMS.Business.StockIn.IService; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using JSMachine.WMS.Common; using JSMachine.WMS.Infrastructure; using JSMachine.WMS.App.IService; namespace JSMachine.WMS.Business.StockIn.ServiceImpl.Strategy { /// /// 根据楼层和配置的混放模式选择入库库位计算策略。 /// public class StrategyFactory { /// /// 0-完全不混放 1-混合模式,优先同批次放一列,没有空库位再混放 2-完全混放模式,不用批次货物放一起 /// /// 入库起始区域。 /// 目标楼层。 /// 物料批次。 /// 与当前入库条件匹配的库位计算策略。 public static IStockInStrategy CreateStockInStrategy(TransportEnum startArea, FloorEnum floor, string materiaBatch) { switch (floor == FloorEnum.FirstFloor ? 0 : Global.AppSettings.PlcaementMod) { case 0: return new NoMixingStrategy(startArea, floor, materiaBatch); case 1: return new MixedModeStrategy(startArea, floor, materiaBatch); case 2: return new CompleteMixingStrategy(startArea, floor, materiaBatch); default: return new NoMixingStrategy(startArea, floor, materiaBatch); } } } }