1
czw
2025-06-27 e52744716da77be232ac6ecc7573a2ef2294e65c
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Build/Project/´úÂë/ViewModel.cs
@@ -142,6 +142,7 @@
                    List<string> cntrs = wcsTask.S_CNTRS.Split(',').ToList();
                    bool bobe = false;
                    //model.method = model.method?.ToLower();
                    switch (model.method)
                    {
                        case "start":
@@ -154,7 +155,9 @@
                                bobe = true;
                            }
                            break;
                        case "outBin":
                        case "outbin":
                            model.method = model.method?.ToLower();
                            LogHelper.Info($"海康车任务状态变更为取货完成,任务号为:{model.taskCode}", "agv杭叉交互日志");
                            wcsTask.S_B_STATE = "取货完成";
@@ -184,9 +187,12 @@
                                }
                                else if (device.deviceType == 2)
                                {
                                    var inde = device.location.ToList().FindIndex(x => x == wcsTask.S_START_LOC) == 0;
                                    string V = inde ? "D1224" : "D1225";
                                    Conn.默认Redis.SetValue(device.deviceName + "." + V, "0", device.deviceName + "Queue");
                                    //Task.Run(() =>
                                    //{
                                    //    var inde = device.location.ToList().FindIndex(x => x == wcsTask.S_START_LOC) == 0;
                                    //    string V = inde ? "D1224" : "D1225";
                                    //    Conn.默认Redis.SetValue(device.deviceName + "." + V, "0", device.deviceName + "Queue");
                                    //});
                                }
                            }
                            //LocationHelper.UnLockLoc(wcsTask.S_START_LOC);
@@ -244,11 +250,15 @@
                                    }
                                }
                                else if (device2.deviceType == 2)
                                {
                                    if (device2.deviceName.Contains("Js捷顺"))
                                    {
                                        var inde = device2.location.ToList().FindIndex(x => x == wcsTask.S_END_LOC) == 0;
                                        string V = inde ? "D1224" : "D1225";
                                        Conn.默认Redis.SetValue(device2.deviceName + "." + V, "1", device2.deviceName + "Queue");
                                        Task.Run(() =>
                                        {
                                            var inde = device2.location.ToList().FindIndex(x => x == wcsTask.S_END_LOC) == 0;
                                            string V = inde ? "D1224" : "D1225";
                                            Conn.默认Redis.SetValue(device2.deviceName + "." + V, "1", device2.deviceName + "Queue");
                                        });
                                        var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + "mom-basic/dataTransmission/json/service/202", JsonConvert.SerializeObject(new
                                        {
@@ -265,6 +275,19 @@
                                        //    else tag.Js2.D1225 = 1;
                                        //}
                                    }
                                    var ssloc = device2.deviceNo[1];
                                    var endloc = locrep.FindEntity(x => x.S_LOC_CODE == ssloc);
                                    LogHelper.Info($"捷顺卸货后, æŸ¥çœ‹ç¼“存位 {ssloc}-{endloc?.N_CURRENT_NUM}>0? åˆ™ç”³è¯·mes搬走。");
                                    if (endloc != null && endloc.N_CURRENT_NUM == 1)
                                    {
                                        var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + "mom-basic/dataTransmission/json/service/200", JsonConvert.SerializeObject(new
                                        {
                                            requestType = 3,
                                            startBit = ssloc
                                        }));
                                        LogHelper.Info($"{ssloc}申请mes任务结果{str}");
                                    }
                                }
                            }
                            //LocationMethod.JudgeLocation(wcsTask);
@@ -364,7 +387,7 @@
            }
            else
            {
                LogHelper.Info($"当前任务号任务不存在{model.taskCode}", "agv杭叉交互日志");
                LogHelper.Info($"当前任务号任务不存在{model.taskCode} agv杭叉交互日志");
            }
            #endregion [自定义指令][20250324165239206][OperateHKTaskStatus]
        }