lss
2025-07-03 791be053ea908ab986dffeb2f4aef7b87b450d2d
HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/process/DeviceProcess.cs
@@ -48,7 +48,7 @@
        /// <summary>
        /// 叠盘机空托返回
        /// </summary>    
        internal static void Traystacker(string loc, int qty, int type)
        internal static void Traystacker(string loc, int qty, int type,string cntrcode="")
        {
            try
            {
@@ -91,8 +91,9 @@
        /// </summary>
        internal static void Traffic()
        {
            Console.WriteLine("开始原材料叠盘位置判断");
            var db = new SqlHelper<object>().GetInstance();
            List<string> locs = new List<string>() { "LCDP-001" };
            List<string> locs = new List<string>() { "LCDP-001", "BADPW-01" };
            var location = db.Queryable<Location>().Where(a => locs.Contains(a.S_CODE)).ToList();
            if (location.Count > 0)
            {
@@ -126,9 +127,9 @@
        internal static void KjTraffic()
        {
            Console.WriteLine("开始井松agv叠盘回库位置判断");
            var db = new SqlHelper<object>().GetInstance();
            List<string> locs = new List<string>() { "PMDDW-001" };
            List<string> locs = new List<string>() { "AGV12DP-001", "AGV01DP-001", "AGV05DP-001" };
            var location = db.Queryable<Location>().Where(a => locs.Contains(a.S_CODE)).ToList();
            if (location.Count > 0)
            {
@@ -144,12 +145,19 @@
                        //    var cntrcodes = cntr.Select(a => a.S_CNTR_CODE).ToArray();
                        //    cntrcode = string.Join(",", cntrcodes);
                        //}
                        string cntrcode = "";
                        var cntr = db.Queryable<LocCntrRel>().Where(a => a.S_LOC_CODE.Trim() == item.S_CODE).ToList();
                        if (cntr.Count > 0)
                        {
                            cntrcode = cntr.OrderBy(a => a.T_CREATE).First().S_CNTR_CODE;
                            // cntrcode = string.Join(",", cntrcodes);
                        }
                        LogHelper.Info($"货位{item}叠满6个开始回调接口");
                        //创建过未完成的任务不发起请求
                        var mst = WCSHelper.GetTaskByStartloc(item.S_CODE);
                        if (mst == null)
                        {
                            Traystacker(item.S_CODE, item.N_CURRENT_NUM, 1);
                            Traystacker(item.S_CODE, item.N_CURRENT_NUM, 2, cntrcode);
                        }
                    }
                }
@@ -206,30 +214,30 @@
                            //}
                            //创建过未完成的任务不发起请求
                            //var mst = WCSHelper.GetTaskByStartloc(device.TN_Location);
                            //if (mst == null)
                            //{
                            //    Traystacker(device.TN_Location, value, 2);
                            //}
                            //else
                            //{
                            //    LogHelper.Info($"有执行中的叠盘回库任务{mst.S_CODE},不触发叠盘任务");
                            //}
                            var loc = LocationHelper.GetLocByLoc(device.TN_Location);
                            if (loc != null)
                            var mst = WCSHelper.GetTaskByStartloc(device.TN_Location);
                            if (mst == null)
                            {
                                if (loc.N_LOCK_STATE == 0) {
                                    Traystacker(device.TN_Location, value, 2);
                                }
                                else
                                {
                                    LogHelper.Info($"设备起点:{device.TN_Location}有锁,不生成任务");
                                }
                                Traystacker(device.TN_Location, value, 2);
                            }
                            else
                            {
                                LogHelper.Info($"根据设备:{device.deviceName},起点:{device.TN_Location},未找到货位");
                                LogHelper.Info($"有执行中的叠盘回库任务{mst.S_CODE},不触发叠盘任务");
                            }
                            //var loc = LocationHelper.GetLocByLoc(device.TN_Location);
                            //if (loc != null)
                            //{
                            //    if (loc.N_LOCK_STATE == 0) {
                            //        Traystacker(device.TN_Location, value, 2);
                            //    }
                            //    else
                            //    {
                            //        LogHelper.Info($"设备起点:{device.TN_Location}有锁,不生成任务");
                            //    }
                            //}
                            //else
                            //{
                            //    LogHelper.Info($"根据设备:{device.deviceName},起点:{device.TN_Location},未找到货位");
                            //}
                        }
                        else
                        {