From 9ca7e0307c853871aa984c25eacee18eee01e02d Mon Sep 17 00:00:00 2001 From: czw <selecti@yeah.net> Date: 星期二, 08 七月 2025 09:10:03 +0800 Subject: [PATCH] 1 --- 2025年6月12日/AuxAllWCS/Build/Project/AuxAllWCS.sln | 25 ++++++++++++ 2025年6月12日/AuxAllWCS/Build/Project/代码/VS自定义类/AutoThread.cs | 42 ++++++++++++++++---- 2025年6月12日/AuxAllWCS/Build/Project/packages.config | 4 ++ 3 files changed, 62 insertions(+), 9 deletions(-) diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/AuxAllWCS.sln" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/AuxAllWCS.sln" new file mode 100644 index 0000000..a7eb4b3 --- /dev/null +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/AuxAllWCS.sln" @@ -0,0 +1,25 @@ +锘�+Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.13.35913.81 d17.13 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuxAllWCS", "AuxAllWCS.csproj", "{D55A8F58-C2AA-442E-93D3-7537992A4993}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D55A8F58-C2AA-442E-93D3-7537992A4993}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D55A8F58-C2AA-442E-93D3-7537992A4993}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D55A8F58-C2AA-442E-93D3-7537992A4993}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D55A8F58-C2AA-442E-93D3-7537992A4993}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B1974573-F7AF-4DDA-B185-F5DE6AE43F7B} + EndGlobalSection +EndGlobal diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/packages.config" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/packages.config" new file mode 100644 index 0000000..6b76efe --- /dev/null +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/packages.config" @@ -0,0 +1,4 @@ +锘�?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="Microsoft.Web.WebView2" version="1.0.3351.48" targetFramework="net462" /> +</packages> \ No newline at end of file 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 7f33c68..8fc49a1 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" @@ -26,6 +26,7 @@ using System.Net; using System.Threading; using System.IO; +using GZ.Device.Agv; namespace GZ.Projects.AuxAllWCS { @@ -77,8 +78,8 @@ } // 鎵ц濮旀墭 - //if (methodName != "TaskEverythingRun") - // return null; + if (methodName != "TaskEverythingRun") + return null; return methodDelegate.DynamicInvoke(args); } @@ -647,11 +648,18 @@ } if (tag.RGV.taskend == 125) { - LogHelper.Info($"RGV 鏈�25鍛戒护鏈墽琛屻�"); + LogHelper.Info($"RGV 鏈�25鍛戒护鏈墽琛屻� "); + LogHelper.Info($"RGV125鍛戒护鏈墽琛�浠诲姟鏁版嵁 workmode:{tag.RGV.workMod}\n taskmod{tag.RGV.taskmod} \n t1No:{tag.RGV.taskno1}\n t1do:{tag.RGV.task1do} \n t2No:{tag.RGV.taskno2}\n t2do:{tag.RGV.task2do}\n taskend:{tag.RGV.taskend} "); + + if (tag.RGV.workMod == 0 && tag.RGV.taskmod == 0 && tag.RGV.taskno1 == tag.RGV.ReadTask1No && tag.RGV.taskno2 == tag.RGV.ReadTask2No) + { + LogHelper.Info($"RGV125鍛戒护鏈墽琛�tag.RGV.workMod == 0 && tag.RGV.taskmod == 0 && tag.RGV.taskno1 == tag.RGV.ReadTask1No && tag.RGV.taskno2 == tag.RGV.ReadTask2No 鑷姩娓呴櫎125"); + Conn.榛樿Redis.SetValue("RGV.taskend", "0", "RGVQueue", false); + } System.Threading.Thread.Sleep(3000); return; } - LogHelper.Info($"浠诲姟涓嬪彂 Rgv 浠诲姟 杩涘叆 Rgv淇℃伅 W1鐘舵�{tag.RGV.w1status} ReadTask1No>{tag.RGV.ReadTask1No} bit1taskOver>{tag.RGV.bit1taskOver} W2鐘舵�{tag.RGV.w2status} ReadTask2No>{tag.RGV.ReadTask2No} bit2taskOver>{tag.RGV.bit2taskOver}"); + LogHelper.Info($"浠诲姟涓嬪彂 Rgv 浠诲姟 杩涘叆 Rgv淇℃伅 W1鐘舵�{tag.RGV.w1status} ReadTask1No>{tag.RGV.ReadTask1No} 1宸ヤ綅鏉$爜:{tag.RGV.bit1Code} bit1taskOver>{tag.RGV.bit1taskOver} W2鐘舵�{tag.RGV.w2status} ReadTask2No>{tag.RGV.ReadTask2No} 2宸ヤ綅鏉$爜:{tag.RGV.bit2Code} bit2taskOver>{tag.RGV.bit2taskOver}"); TaskEntity task1 = null; TaskEntity task2 = null; var task1Isrun = false; @@ -713,7 +721,7 @@ task1.S_B_STATE = "鍙栬揣瀹屾垚"; } //tag.RGV.bit1taskOver = 0; - LogHelper.Info($"RGV 1宸ヤ綅浠诲姟{task1.S_TASK_NO} 鐘舵�鍒囨崲涓簕task1.S_B_STATE}"); + LogHelper.Info($"RGV 1宸ヤ綅浠诲姟{task1.S_TASK_NO} 鏉$爜锛歿tag.RGV.bit1Code} 鐘舵�鍒囨崲涓簕task1.S_B_STATE}"); //tag.RGV.bit1taskOver_LAST = 1; RedisHelper.Add($"RGV.bit1taskOver_LAST", "1", out string msg); LogHelper.Info($"RGV 1宸ヤ綅浠诲姟鍐欏鐞�); @@ -755,7 +763,7 @@ task2.S_B_STATE = "鍙栬揣瀹屾垚"; } //tag.RGV.bit2taskOver = 0; - LogHelper.Info($"RGV 2宸ヤ綅浠诲姟{task2.S_TASK_NO} 鐘舵�鍒囨崲涓簕task2.S_B_STATE}"); + LogHelper.Info($"RGV 2宸ヤ綅浠诲姟{task2.S_TASK_NO} 鏉$爜锛歿tag.RGV.bit2Code} 鐘舵�鍒囨崲涓簕task2.S_B_STATE}"); RedisHelper.Add($"RGV.bit2taskOver_LAST", "1", out string msg); LogHelper.Info($"RGV 2宸ヤ綅浠诲姟鍐欏鐞�); taskservice.Update(task2); @@ -996,7 +1004,18 @@ var taskCOdes = new List<string> { "Sarrive", "Srelease", "Earrive", "Erelease" }; TaskActRepository taskActRepository = new TaskActRepository(); TaskRepository taskRepository = new TaskRepository(); - var requires = taskActRepository.FindList(x => DateTime.Now.Subtract(x.T_CREATE).TotalHours < 1 && taskCOdes.Contains(x.S_ACTION_CODE) && x.N_CREATEMETHOD == 0).OrderBy(x => x.T_CREATE); + var requires = taskActRepository.FindList(x => taskCOdes.Contains(x.S_ACTION_CODE) && x.N_CREATEMETHOD == 0).OrderBy(x => x.T_CREATE).ToList(); + var timeMorhours = requires.FindAll(x => DateTime.Now.Subtract(x.T_CREATE).TotalHours > 1); + if (timeMorhours.Any()) + { + foreach (var mor in timeMorhours) + { + mor.N_CREATEMETHOD = 2; + mor.S_REVIEW_COMMENT = "瓒呮椂涓嶅鐞�; + taskActRepository.Update(mor); + } + requires = requires.Except(timeMorhours).ToList(); + } foreach (var item in requires) { LogHelper.Info($"ThreadGrats {item.S_TASK_NO} >{item.S_ACTION_CODE}鍏夋爡澶勭悊 =================> "); @@ -1004,6 +1023,7 @@ if (tin == -1) { item.N_CREATEMETHOD = -1; + item.S_REVIEW_COMMENT = $"淇″彿鏈煡{item.S_ACTION_CODE}涓嶅鐞�; taskActRepository.Update(item); continue; } @@ -1011,6 +1031,7 @@ if (task == null) { item.N_CREATEMETHOD = -1; + item.S_REVIEW_COMMENT = $"浠诲姟涓㈠け涓嶅鐞�; taskActRepository.Update(item); continue; } @@ -1051,6 +1072,7 @@ LogHelper.Info($"ThreadGrats {item.S_TASK_NO} >{item.S_ACTION_CODE} 璁惧鏄瘂dev.deviceName} 寮�惎鍏夋爡澶勭悊瀹屾垚 =================> "); item.N_CREATEMETHOD = 1; + item.S_REVIEW_COMMENT = $"鍏夋爡寮�惎瀹屾垚"; taskActRepository.Update(item); } //杞﹁杩涘叆浜や簰銆�@@ -1108,6 +1130,7 @@ taskCode = item.S_TASK_NO }); item.N_CREATEMETHOD = 1; + item.S_REVIEW_COMMENT = $"杞﹀瓙缁х画浠诲姟OK"; taskActRepository.Update(item); } } @@ -1171,7 +1194,7 @@ var listtep = new List<string>(); if (Bssx == "1020") { - if (tag.SF涓嬫枡浣�RArrive1003 == 1) + if (!string.IsNullOrEmpty(tag.SFT涓嬫枡鍙f墭鐩�R1003Barcode) && string.IsNullOrEmpty(tag.SFT涓嬫枡鍙f墭鐩�R1011Barcode)) { listtep = new List<string> { "1012", "1004" }; } @@ -1182,7 +1205,8 @@ } else { - if (tag.SF涓嬫枡浣�RArrive1005 == 1) + //if (tag.SF涓嬫枡浣�RArrive1005 == 1) + if (!string.IsNullOrEmpty(tag.SFT涓嬫枡鍙f墭鐩�R1005Barcode) && string.IsNullOrEmpty(tag.SFT涓嬫枡鍙f墭鐩�R1013Barcode)) { listtep = new List<string> { "1014", "1006" }; } -- Gitblit v1.9.1