22
schangxiang@126.com
2024-12-13 1e4dd5165af23023c88281fa5ed20f13de0b4243
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using Admin.NET.Application;
using iWareSql.WmsDBModel;
using System;
using System.Collections.Generic;
 
namespace iWareSql
{
    public class TCSCommon
    {
        /// <summary>
        /// 根据物料长和宽获取机器人入库的库位类型
        /// </summary>
        /// <param name="PhysicalWidth">物理宽度</param>
        /// <param name="PhysicalLength">物理长度</param>
        /// <returns>库位类型</returns>
        public static int GetPlaceTypeByWidthLength(mes_batchOrderUPI_new UpiInfo, double PhysicalLength, double PhysicalWidth, ref List<int> 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;
        }
 
 
    }
}