From a47e45d04ca5beadcf815d852cae52ef56f669e5 Mon Sep 17 00:00:00 2001
From: czw <selecti@yeah.net>
Date: 星期三, 23 七月 2025 16:39:33 +0800
Subject: [PATCH] 1

---
 2025年6月12日/AuxAllWCS/Build/Project/代码/界面事件.cs |   61 +++++++++++++++++++++++++-----
 1 files changed, 50 insertions(+), 11 deletions(-)

diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\347\225\214\351\235\242\344\272\213\344\273\266.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\347\225\214\351\235\242\344\272\213\344\273\266.cs"
index c49a6e7..b14d39f 100644
--- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\347\225\214\351\235\242\344\272\213\344\273\266.cs"
+++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\347\225\214\351\235\242\344\272\213\344\273\266.cs"
@@ -28,6 +28,8 @@
 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>
@@ -63,6 +65,14 @@
             }
             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>
             /// 绋嬪簭鐗囨:鍒濆鍖栭厤缃�             /// 鎻忚堪:
@@ -810,16 +820,8 @@
                     {
                         #region    [鑴氭湰][20250323151832119][涓氬姟閫昏緫.Ipping]
 
-                        //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!");
+                        //var hkr = AutoThread.InvokeMethod(AutoThread.Instance, "IsMachineOnline", new object[] { "192.168.1.103", 1000 });
+                        //Console.WriteLine("192.168.1.103 > " + hkr.ToString());
                         #endregion [鑴氭湰][20250323151832119][涓氬姟閫昏緫.Ipping]
                     }
                     catch (Exception ex)
@@ -848,7 +850,7 @@
                     try
                     {
                         #region    [鑴氭湰][20250708095248653][涓氬姟閫昏緫.鏂扮嚎绋嬫�绾縘
-                        AutoThread.InvokeMethod(AutoThread.Instance, "ThreaTotal", new object[] { tag });
+                        AutoThread.InvokeMethod(AutoThread.Instance, "ThreaTotal", new object[] { tag, Device });
                         #endregion [鑴氭湰][20250708095248653][涓氬姟閫昏緫.鏂扮嚎绋嬫�绾縘
                     }
                     catch (Exception ex)
@@ -1226,6 +1228,43 @@
                                         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;
                         }

--
Gitblit v1.9.1