add
zongzhibin
2024-11-24 76e7b9c3a020470253801d7e2f513b473e2d27b5
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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;
        }
 
        /// <summary>
        /// 根据实际情况转换长和宽
        /// </summary>
        /// <param name="UpiInfo"></param>
        /// <param name="PhysicalLength">物理长度</param>
        /// <param name="PhysicalWidth">物理宽度</param>
        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;
            }
        }
 
 
    }
}