1
czw
2 天以前 cd5a8566240658de52502a22f78b4c6652382357
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Build/Project/´úÂë/½çÃæÊ¼þ.cs
@@ -28,8 +28,6 @@
using GZ.DB.Repository.OIDATABASE;
using GZ.DB.IRepository.OIDATABASE;
using GZ.DB.Entity.OIDATABASE;
using static GZ.Projects.AuxAllWCS.ToWMSMES.CreateTask;
using GZ.Device.PLC;
namespace GZ.Projects.AuxAllWCS
{
    /// <summary>
@@ -65,14 +63,6 @@
            }
            View1_Init(sender, e);
            //var path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs");
            //string text = File.ReadAllText(configPath);
            //PlcConfig plcConfig = JsonConvert.DeserializeObject<PlcConfig>(text);
            //if (plcConfig != null && FactoryMap.ContainsKey((int)plcConfig.Brand) && FactoryMap[(int)plcConfig.Brand].Contains((int)plcConfig.Comm))
            //{
            //}
            Console.Write(path);
            /// <summary>
            /// ç¨‹åºç‰‡æ®µ:初始化配置
            /// æè¿°:
@@ -820,8 +810,16 @@
                    {
                        #region    [脚本][20250323151832119][业务逻辑.Ipping]
                        //var hkr = AutoThread.InvokeMethod(AutoThread.Instance, "IsMachineOnline", new object[] { "192.168.1.103", 1000 });
                        //Console.WriteLine("192.168.1.103 > " + hkr.ToString());
                        //LogHelper.Info($"<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>");
                        //LogHelper.Info($"<<<<<<<<<<<<<<<<<程序·启动>>>>>>>>>>>>>>");
                        //// ä½¿ç”¨æ‹¦æˆªå™¨
                        //var interceptor = new ConsoleInterceptor();
                        //Console.SetOut(interceptor);
                        //LogHelper.Info($"<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>");
                        //AnsiConsole.Markup("[underline red]Hello[/] World!");
                        // AnsiConsole.Markup("[underline red]Hello[/] World!");
                        #endregion [脚本][20250323151832119][业务逻辑.Ipping]
                    }
                    catch (Exception ex)
@@ -985,6 +983,9 @@
                    Device.A3005取货交互?.Stop();
                    Device.A3006放货交互?.Stop();
                    Device.A3010取货交互?.Stop();
                    Device.S2008Read?.Stop();
                    Device.Z转子1号机械手?.Stop();
                    Device.Z转子2号机械手?.Stop();
                }
                catch (Exception ex)
                {
@@ -1054,6 +1055,9 @@
                        || (Device.A3005取货交互 == null ? false : Device.A3005取货交互.State != GZ.Device.PLC.PlcRunState.Stoped)
                        || (Device.A3006放货交互 == null ? false : Device.A3006放货交互.State != GZ.Device.PLC.PlcRunState.Stoped)
                        || (Device.A3010取货交互 == null ? false : Device.A3010取货交互.State != GZ.Device.PLC.PlcRunState.Stoped)
                        || (Device.S2008Read == null ? false : Device.S2008Read.State != GZ.Device.PLC.PlcRunState.Stoped)
                        || (Device.Z转子1号机械手 == null ? false : Device.Z转子1号机械手.State != GZ.Device.PLC.PlcRunState.Stoped)
                        || (Device.Z转子2号机械手 == null ? false : Device.Z转子2号机械手.State != GZ.Device.PLC.PlcRunState.Stoped)
                    )
                    {
                        System.Threading.Thread.Sleep(1000);
@@ -1227,43 +1231,6 @@
                                        var model = JsonConvert.DeserializeObject<ToWMSMES.CreateTask>(requestJson);
                                        var res = ToWMSMES.CreateTask.CreatePointTask(model);
                                        return JsonConvert.SerializeObject(res);
                                    }
                                case "/api/Wcs/initZZCache":
                                    {
                                        statusCode = System.Net.HttpStatusCode.OK;
                                        var rturn = new ReturnMsg
                                        {
                                            resultCode = 0,
                                            resultMsg = ""
                                        };
                                        try
                                        {
                                            LocRepository locRepository = new LocRepository();
                                            foreach (var item in Settings.deviceInfos.FindAll(x => x.deviceType == 2))
                                            {
                                                foreach (var ssloc in item.deviceNo)
                                                {
                                                    var ssl = locRepository.FindEntity(x => x.S_LOC_CODE == ssloc);
                                                    if (ssl != null && (ssl.N_CURRENT_NUM > 0 || ssl.S_LOCK_STATE != "无"))
                                                    {
                                                        ssl.N_CURRENT_NUM = 0;
                                                        ssl.S_LOCK_STATE = "无";
                                                        locRepository.Update(ssl);
                                                    }
                                                }
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            LogHelper.Error("/api/Wcs/initZZCache" + requestJson + ex.Message, ex);
                                            return JsonConvert.SerializeObject(new ReturnMsg
                                            {
                                                resultCode = -1,
                                                resultMsg = ex.Message
                                            });
                                        }
                                        return JsonConvert.SerializeObject(rturn);
                                    }
                            }
                            break;