using Admin.NET.Application;
using iWareSql.WmsDBModel;
using System;
using System.Collections.Generic;
namespace iWareSql
{
public class TCSCommon
{
///
/// 根据物料长和宽获取机器人入库的库位类型
///
/// 物理宽度
/// 物理长度
/// 库位类型
public static int GetPlaceTypeByWidthLength(mes_batchOrderUPI_new UpiInfo, double PhysicalLength, double PhysicalWidth, ref List usePlaceTypeList)
{
//不需要转换长宽,跟李耀武确认了 【Editby shaocx,2024-11-20】
// GetPhysicalWidthLength(UpiInfo, ref PhysicalLength, ref PhysicalWidth);
var PlaceType = 0;
if (PhysicalLength < 700)
{
PlaceType = (int)PlaceTypeEnum.小货位;
usePlaceTypeList.Add(PlaceType);
usePlaceTypeList.Add((int)PlaceTypeEnum.中货位);
usePlaceTypeList.Add((int)PlaceTypeEnum.大货位);
}
else if (PhysicalLength >= 700 && PhysicalLength <= 1000)
{
PlaceType = (int)PlaceTypeEnum.中货位;
usePlaceTypeList.Add(PlaceType);
usePlaceTypeList.Add((int)PlaceTypeEnum.大货位);
}
else if (PhysicalLength > 1000)
{
PlaceType = (int)PlaceTypeEnum.大货位;
usePlaceTypeList.Add(PlaceType);
}
if (PlaceType == 0)
{
throw new Exception("按照UPI:" + UpiInfo.UPI + "的物理长度" + PhysicalLength + ",物料宽度:" + PhysicalWidth + "没有匹配到库位类型!");
}
return PlaceType;
}
///
/// 根据实际情况转换长和宽
///
///
/// 物理长度
/// 物理宽度
private static void GetPhysicalWidthLength(mes_batchOrderUPI_new UpiInfo, ref double PhysicalLength, ref double PhysicalWidth)
{
if (UpiInfo.Rotation > 0)
{//如果是四面钻,物理长和宽对调
PhysicalWidth = UpiInfo.Length;
PhysicalLength = UpiInfo.Width;
}
else
{
PhysicalLength = UpiInfo.Length;
PhysicalWidth = UpiInfo.Width;
}
}
}
}