IPC-610
2024-10-21 f040136ab8029cc207a8111d21c78bbf315a6dbd
Admin.NET/WCS.Application/PLC/PLCCommon.cs
@@ -1,4 +1,5 @@
using Elastic.Clients.Elasticsearch.Tasks;
using Furion.Logging;
using Microsoft.AspNetCore.SignalR;
using RazorEngine.Compilation.ImpromptuInterface.Dynamic;
using System;
@@ -328,8 +329,8 @@
    public static PLCUtil GetPlcIp(string startStation) 
    {
        string strIp = "";
        var conveyList1 = new List<string>() { "147", "145", "139", "137", "129", "127", "121", "119", "111", "109", "103", "101", "093", "091", "085", "083", "075", "073", "067", "065","033" };
        var conveyList2 = new List<string>() { "252", "254", "260", "262", "270", "272", "278", "280", "288", "290", "294", "301", "307", "309", "315", "317", "325", "327", "331", "337" };
        var conveyList1 = new List<string>() { "147", "145", "139", "137", "129", "127", "121", "119", "111", "109", "103", "101", "093", "091", "085", "083", "075", "073", "067", "065","033","039","044" ,"051","059"};
        var conveyList2 = new List<string>() { "205", "234", "252", "254", "260", "262", "270", "272", "278", "280", "288", "290", "294", "301", "307", "309", "315", "317", "325", "327", "331", "337" };
        var conveyList3 = new List<string>() { "401", "402", "405", "406", "409", "410", "413", "414", "417", "418", "421", "422", "425", "426", "429", "430", "433", "434", "437", "438" };
        if (conveyList1.Contains(startStation))
        {
@@ -432,7 +433,10 @@
        taskInfo.EndPai = paiVal.ToString();
        taskInfo.EndCeng = cengNum.ToString();
        taskInfo.EndLie = lieNum.ToString() ;
        if (taskInfo.EndPai == "0" || taskInfo.EndCeng == "0" || taskInfo.EndLie == "0")
        {
            throw new Exception("排列层转换失败");
        }
        return taskInfo;
    }
    
@@ -809,11 +813,11 @@
    /// <summary>
    /// 根据储位排获取跺机对应的地址排
    /// 根据储位排获取跺机对应的地址排03010302
    /// </summary>
    /// <param name="road">排</param>
    /// <param name="pai">排</param>
    /// <param name="dept">深度</param>
    /// <param name="road">排02</param>
    /// <param name="pai">排03</param>
    /// <param name="dept">深度02</param>
    /// <returns></returns>
    public static int GetDjAdress(string road, string pai, string dept)
    {
@@ -841,11 +845,11 @@
            {
                if (deptNum == 1)
                {
                    paiVal = 1;
                    paiVal = 2;
                }
                else
                {
                    paiVal = 2;
                    paiVal = 1;
                }
            }
@@ -878,7 +882,11 @@
                }
            }
        }
        if (paiVal == 0)
        {
            Log.Error("排转换失败!");
            throw new Exception("排转换失败");
        }
        return paiVal;
    }