From b6d4961bb8f5d07ffeba341306b654bd71e2962a Mon Sep 17 00:00:00 2001
From: czw <selecti@yeah.net>
Date: 星期二, 22 七月 2025 14:37:06 +0800
Subject: [PATCH] 1

---
 2025年6月12日/AuxAllWCS/Build/Project/代码/界面事件.cs              |   38 ++++++++++++++++++++++++++++++++++++++
 2025年6月12日/AuxAllWCS/Build/Project/代码/VS自定义类/AutoThread.cs |   20 ++++++++++++++++++--
 2 files changed, 56 insertions(+), 2 deletions(-)

diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs"
index 9fc9023..00abfb2 100644
--- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs"
+++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs"
@@ -430,6 +430,10 @@
                 }
                 else
                 {
+                    if (tag.wxr1.R44_LAST && !tag.wxr1.R44)
+                    {
+                        RedisHelper.Add($"缁村笇灏旀姄鑷�.R44_LAST", "false", out string msg);
+                    }
                     //TaskRepository ts = new TaskRepository();
                     if (tag.wxr1.R10_LAST) //鎵樼洏鏀剧疆淇″彿銆傘�
                     {
@@ -458,7 +462,7 @@
                                 //tag.wxr1.R10 = true;
                                 Conn.榛樿Redis.SetValue(VERX.deviceName + ".R10", "true", VERX.deviceName + "Queue");
                                 //tag.wxr1.R44_LAST = false;
-                                RedisHelper.Add($"缁村笇灏旀姄鑷�.R44_LAST", "false", out string msg);
+                                //RedisHelper.Add($"缁村笇灏旀姄鑷�.R44_LAST", "false", out string msg);
                             }
                             else
                             {
@@ -514,6 +518,10 @@
                 }
                 else
                 {
+                    if (tag.wxr1.R46_LAST && !tag.wxr1.R46)
+                    {
+                        RedisHelper.Add($"缁村笇灏旀姄鑷�.R46_LAST", "false", out string msg);
+                    }
                     if (tag.wxr1.R11_LAST) //鎵樼洏鏀剧疆淇″彿銆傘�
                     {
                         if (tag.wxr1.R11)
@@ -540,7 +548,7 @@
                                 //tag.wxr1.R11 = true;
                                 Conn.榛樿Redis.SetValue(VERX.deviceName + ".R11", "true", VERX.deviceName + "Queue");
                                 //tag.wxr1.R46_LAST = false;
-                                RedisHelper.Add($"缁村笇灏旀姄鑷�.R46_LAST", "false", out string msg);
+                                //RedisHelper.Add($"缁村笇灏旀姄鑷�.R46_LAST", "false", out string msg);
                             }
                             else
                             {
@@ -596,6 +604,10 @@
                 }
                 else
                 {
+                    if (tag.wxr2.R44_LAST && !tag.wxr2.R44)
+                    {
+                        RedisHelper.Add($"缁村笇灏旀姄鑷�.R44_LAST", "false", out string msg);
+                    }
                     if (tag.wxr2.R10_LAST) //鎵樼洏鏀剧疆淇″彿銆傘�
                     {
                         if (tag.wxr2.R10)
@@ -679,6 +691,10 @@
                 }
                 else
                 {
+                    if (tag.wxr2.R46_LAST && !tag.wxr2.R46)
+                    {
+                        RedisHelper.Add($"缁村笇灏旀姄鑷�.R46_LAST", "false", out string msg);
+                    }
                     //LogHelper.Info($"Threadwxr2R 鎵樼洏鏀剧疆淇″彿1銆傘�  -{tag.wxr2.R11_LAST}");
                     if (tag.wxr2.R11_LAST) //鎵樼洏鏀剧疆淇″彿銆傘�
                     {
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 277fb05..1b10889 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,7 @@
 using GZ.DB.Repository.OIDATABASE;
 using GZ.DB.IRepository.OIDATABASE;
 using GZ.DB.Entity.OIDATABASE;
+using static GZ.Projects.AuxAllWCS.ToWMSMES.CreateTask;
 namespace GZ.Projects.AuxAllWCS
 {
     /// <summary>
@@ -1219,6 +1220,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