From 251e0a3deb75c529fa35408be4ce5bb6e46a01f0 Mon Sep 17 00:00:00 2001
From: cjs <2216046164@qq.com>
Date: 星期五, 30 五月 2025 17:23:38 +0800
Subject: [PATCH] 111

---
 ams/Hanhe.iWCS.JingmenGEMTwoProtocol/PLCControl.cs       |   36 +++++++--
 ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ApiController.cs    |    2 
 .vs/VSWorkspaceState.json                                |    7 +
 ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ProcessHelper.cs    |  106 +++++++++++++-------------
 .vs/荆门格林美南区/v17/DocumentLayout.json                      |   65 ++++++++++++++++
 ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ProtocolAnalysis.cs |    4 
 .vs/荆门格林美南区/v17/.wsuo                                    |    0 
 7 files changed, 155 insertions(+), 65 deletions(-)

diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json
new file mode 100644
index 0000000..65d226f
--- /dev/null
+++ b/.vs/VSWorkspaceState.json
@@ -0,0 +1,7 @@
+{
+  "ExpandedNodes": [
+    ""
+  ],
+  "SelectedNode": "\\C:\\software\\A-\u5DE5\u4F5C\\\u6E90\u7801\\GIT\\\u8346\u95E8\u683C\u6797\u7F8E\u5357\u533A",
+  "PreviewInSolutionExplorer": false
+}
\ No newline at end of file
diff --git "a/.vs/\350\215\206\351\227\250\346\240\274\346\236\227\347\276\216\345\215\227\345\214\272/v17/.wsuo" "b/.vs/\350\215\206\351\227\250\346\240\274\346\236\227\347\276\216\345\215\227\345\214\272/v17/.wsuo"
new file mode 100644
index 0000000..51134c6
--- /dev/null
+++ "b/.vs/\350\215\206\351\227\250\346\240\274\346\236\227\347\276\216\345\215\227\345\214\272/v17/.wsuo"
Binary files differ
diff --git "a/.vs/\350\215\206\351\227\250\346\240\274\346\236\227\347\276\216\345\215\227\345\214\272/v17/DocumentLayout.json" "b/.vs/\350\215\206\351\227\250\346\240\274\346\236\227\347\276\216\345\215\227\345\214\272/v17/DocumentLayout.json"
new file mode 100644
index 0000000..e1adfe1
--- /dev/null
+++ "b/.vs/\350\215\206\351\227\250\346\240\274\346\236\227\347\276\216\345\215\227\345\214\272/v17/DocumentLayout.json"
@@ -0,0 +1,65 @@
+{
+  "Version": 1,
+  "WorkspaceRootPath": "C:\\software\\A-\u5DE5\u4F5C\\\u6E90\u7801\\GIT\\\u8346\u95E8\u683C\u6797\u7F8E\u5357\u533A\\",
+  "Documents": [],
+  "DocumentGroupContainers": [
+    {
+      "Orientation": 0,
+      "VerticalTabListWidth": 256,
+      "DocumentGroups": [
+        {
+          "DockedWidth": 16,
+          "SelectedChildIndex": -1,
+          "Children": [
+            {
+              "$type": "Bookmark",
+              "Name": "ST:0:0:{eefa5220-e298-11d0-8f78-00a0c9110057}"
+            },
+            {
+              "$type": "Bookmark",
+              "Name": "ST:0:0:{3ae79031-e1bc-11d0-8f78-00a0c9110057}"
+            },
+            {
+              "$type": "Bookmark",
+              "Name": "ST:130:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
+            },
+            {
+              "$type": "Bookmark",
+              "Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
+            },
+            {
+              "$type": "Bookmark",
+              "Name": "ST:0:0:{b1e99781-ab81-11d0-b683-00aa00a3ee26}"
+            },
+            {
+              "$type": "Bookmark",
+              "Name": "ST:129:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
+            },
+            {
+              "$type": "Bookmark",
+              "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
+            }
+          ]
+        },
+        {
+          "DockedWidth": 18,
+          "SelectedChildIndex": -1,
+          "Children": [
+            {
+              "$type": "Bookmark",
+              "Name": "ST:0:0:{d78612c7-9962-4b83-95d9-268046dad23a}"
+            },
+            {
+              "$type": "Bookmark",
+              "Name": "ST:0:0:{34e76e81-ee4a-11d0-ae2e-00a0c90fffc3}"
+            },
+            {
+              "$type": "Bookmark",
+              "Name": "ST:1:0:{e8034f19-ab72-4f06-83fd-f6832b41aa63}"
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}
\ No newline at end of file
diff --git a/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ApiController.cs b/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ApiController.cs
index f3fa3bf..1e615e8 100644
--- a/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ApiController.cs
+++ b/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ApiController.cs
@@ -146,7 +146,7 @@
         public ZZTPWNumResult ZZTPWNum(string factory)
         {
             ZZTPWNumResult result = new ZZTPWNumResult();
-            result = ApiHelper.ZZTPWNum();
+            result = ApiHelper.ZZTPWNum(factory);
             return result;
         }
     }
diff --git a/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/PLCControl.cs b/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/PLCControl.cs
index d79d552..b6de37b 100644
--- a/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/PLCControl.cs
+++ b/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/PLCControl.cs
@@ -981,7 +981,7 @@
 
                         if (req)
                         {
-                            ProcessHelper.deleteInfo(plc.location + "-澶嶇О鍏ョ紦瀛樻灦");
+                            ProcessHelper.deleteInfo(plc.location + "-澶嶇О涓嬬嚎");
                             var queryList = MongoDBSingleton.Instance.Find<packageInfoModel>(Query.And(Query.EQ("machineNo", model.machince), Query.EQ("trayCode", model.ext2), Query.EQ("weight2", "")), "packageInfoModel");
                             if (queryList.Count > 0)
                             {
@@ -1027,6 +1027,10 @@
                                 MongoDBSingleton.Instance.Update<ProductList>(Query.And(Query.EQ("Date", DateTime.Now.ToString("yyyy-MM-dd")), Query.EQ("machine", model.machince)), Update.Set("percentOfPass", proInfo.percentOfPass).Set("qualifiedQuantity", proInfo.qualifiedQuantity), UpdateFlags.None);
                             }
                         }
+                        else
+                        {
+                            ProcessHelper.recordInfo(plc.location + "-澶嶇О涓嬬嚎", "褰撳墠鍗婃垚鍝佸簱鍖烘湭鑾峰彇鍒板彲鐢ㄨ揣浣嶏紝妫�煡鏄惁宸叉弧");
+                        }
 
                     }
                     if (result.result[2] == 2)
@@ -1037,7 +1041,7 @@
                         req = WMSHelper.WMSIn(plc.location, model.ext2, ref wmstaskno, ref traycode, timeStamp);
                         if (req)
                         {
-                            ProcessHelper.deleteInfo(plc.location + "-澶嶇О鍏ョ紦瀛樻灦");
+                            ProcessHelper.deleteInfo(plc.location + "-澶嶇О涓嬬嚎");
                             var wirte = OITcpHelper.RegisterWriteOutPut(new OITcpHelper.RegisterWriteOutPutModel
                             {
                                 addr = plc.writeAddr + 3,
@@ -1083,7 +1087,11 @@
                                 else CMMLog.Debug($"packageInfoModel鏈壘鍒版暟鎹紝machineNo:{model.machince},trayCode:{model.ext2}");
                             }
                         }
-                        else CMMLog.Debug($"澶嶇О鍏ョ紦瀛樻灦NG娴佺▼锛歐MS鐢熸垚浠诲姟澶辫触锛�);
+                        else
+                        {
+                            ProcessHelper.recordInfo("澶嶇О涓嬬嚎", "褰撳墠NG搴撳尯鏈幏鍙栧埌鍙敤璐т綅锛屾鏌ユ槸鍚﹀凡婊�);
+                            CMMLog.Debug($"澶嶇О鍏ョ紦瀛樻灦NG娴佺▼锛歐MS鐢熸垚浠诲姟澶辫触锛�);
+                        }
                     }
                     string PlcBit02 = Settings.GetPlcInfo().Where(a => a.deviceType == "2").FirstOrDefault().location;
                     UpdateBuilder update = Update.Set("ng", result.result[2]);
@@ -1501,6 +1509,7 @@
                             string ChangeBit = WMSHelper.WmsUpdateWay(taskInfo.CN_S_SOURCE_NO, plc.Extend);
                             if (!string.IsNullOrEmpty(ChangeBit))
                             {
+                                ProcessHelper.deleteInfo("鍙犲寘NG");
                                 CMMLog.Info($"璧风偣锛歿taskInfo.CN_S_END_BIT}");
                                 CMMLog.Info($"缁堢偣锛歿ChangeBit}");
                                 int[] parms = { StockInstance.Instance.GetAGVCodeForBitCode(taskInfo.CN_S_END_BIT), StockInstance.Instance.GetAGVCodeForBitCode(ChangeBit) };
@@ -1511,12 +1520,15 @@
                                 TSHelper.GoToAGV(taskNo, 10, 8);
 
                                 MongoDBSingleton.Instance.Update<TN_I_TASK_MST>(Query.EQ("CN_S_TASK_NO", taskNo), Update.Set("CN_S_END_BIT", ChangeBit).Set("CN_S_START_BIT", taskInfo.CN_S_END_BIT), "TN_I_TASK_MST", UpdateFlags.None);
-                                
+
                                 MongoDBSingleton.Instance.Remove<WMSInfo>(Query.EQ("trayCode", taskInfo.CN_S_BATCH_NO), RemoveFlags.Single);
 
                             }
-                            else CMMLog.Debug($"璋冪敤WMS鏀归亾鎺ュ彛锛屾湭鑾峰彇鍒板彲鐢ㄧ偣浣嶃�");
-                            //Console.WriteLine($"璇荤爜淇℃伅姣斿缁撴灉锛氭潯鐮佷笌浼犻�鐨勬暟鎹笉涓�嚧");
+                            else
+                            {
+                                CMMLog.Debug($"璋冪敤WMS鏀归亾鎺ュ彛锛屾湭鑾峰彇鍒板彲鐢ㄧ偣浣嶃�");
+                                ProcessHelper.recordInfo("鍙犲寘NG","NG搴撳尯鏈幏鍙栧埌鍙敤璐т綅锛屾鏌G搴撳尯鏄惁宸叉弧");
+                            }
                         }
                         
                     }
@@ -1863,8 +1875,16 @@
                             string wmstaskno = "";
                             string traycode = "";
                             bool req = WMSHelper.WMSIn(plc.location, "", ref wmstaskno, ref traycode);
-                            if (req) CMMLog.Debug($"璋冪敤WMS鑾峰彇涓夋ゼ鍙犵洏鏈虹敓鎴愪换鍔℃垚鍔燂紒");
-                            else CMMLog.Debug($"璋冪敤WMS鑾峰彇涓夋ゼ鍙犵洏鏈虹敓鎴愪换鍔″け璐ワ紒");
+                            if (req)
+                            {
+                                CMMLog.Debug($"璋冪敤WMS鑾峰彇涓夋ゼ鍙犵洏鏈虹敓鎴愪换鍔℃垚鍔燂紒");
+                                ProcessHelper.deleteInfo("鍙犵洏涓嬬嚎");
+                            }
+                            else
+                            {
+                                ProcessHelper.recordInfo("鍙犵洏涓嬬嚎", "鍙犵洏鏈轰笅绾垮簱鍖烘湭鏌ヨ鍒板彲鐢ㄨ揣浣嶏紝妫�煡鍙犵洏鏈轰笅绾垮簱鍖烘槸鍚﹀凡婊�);
+                                CMMLog.Debug($"璋冪敤WMS鑾峰彇涓夋ゼ鍙犵洏鏈虹敓鎴愪换鍔″け璐ワ紒");
+                            }
                         }
                     }
                 }
diff --git a/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ProcessHelper.cs b/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ProcessHelper.cs
index 391cc92..598fb2b 100644
--- a/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ProcessHelper.cs
+++ b/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ProcessHelper.cs
@@ -692,51 +692,51 @@
                 if (plc.Count > 0)
                 {
                     #region 鍒ゆ柇杈撻�绾挎ā寮�鍙樻洿娉ㄩ噴
-                    bool action = true;
-                    foreach(var a in plc)
-                    {
-                        var modeResult = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel
-                        {
-                            dataNum = 1,
-                            addr = a.readAddr + 3,
-                            host = a.ip,
-                            port = a.port
-                        });
-                        if (modeResult != null && modeResult.errCode == 0)
-                        {
-                            CMMLog.Debug($"OutWareTask锛氳鍙栨粴绛掓満{a.ip}閫氶亾鍙蜂负锛歿a.readAddr + 3}鐨勫�涓猴細{modeResult.result[0]}");
-                            if (modeResult.result[0] == 2)
-                            {
-                                action = false;
-                                CMMLog.Debug($"OutWareTask:杈撻�绾夸负 鍏ュ簱妯″紡锛岃緭閫佺嚎鐐逛綅锛歿a.location}");
-                                break;
-                            }
-                            else
-                            {
-                                //璇诲彇涓棿琛ㄦā寮�-                                var modelInfo = MongoDBSingleton.Instance.FindOne<ModeList>("ModeList");
-                                if (modelInfo != null)
-                                {
-                                    if (modelInfo.Mode == "鍏ュ簱妯″紡")
-                                    {
-                                        action = false;
-                                        CMMLog.Debug($"OutWareTask:涓棿琛�ModeList涓�鍏ュ簱妯″紡");
-                                        break;
-                                    }
-                                }
-                                else
-                                {
-                                    action = false;
-                                    CMMLog.Debug("OutWareTask:涓棿琛�ModeList 涓虹┖");
-                                    break;
-                                }
-                            }
-                        }
-                    };
-                    if (!action)
-                    {
-                        return false;
-                    }
+                    //bool action = true;
+                    //foreach(var a in plc)
+                    //{
+                    //    var modeResult = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel
+                    //    {
+                    //        dataNum = 1,
+                    //        addr = a.readAddr + 3,
+                    //        host = a.ip,
+                    //        port = a.port
+                    //    });
+                    //    if (modeResult != null && modeResult.errCode == 0)
+                    //    {
+                    //        CMMLog.Debug($"OutWareTask锛氳鍙栨粴绛掓満{a.ip}閫氶亾鍙蜂负锛歿a.readAddr + 3}鐨勫�涓猴細{modeResult.result[0]}");
+                    //        if (modeResult.result[0] == 2)
+                    //        {
+                    //            action = false;
+                    //            CMMLog.Debug($"OutWareTask:杈撻�绾夸负 鍏ュ簱妯″紡锛岃緭閫佺嚎鐐逛綅锛歿a.location}");
+                    //            break;
+                    //        }
+                    //        else
+                    //        {
+                    //            //璇诲彇涓棿琛ㄦā寮�+                    //            var modelInfo = MongoDBSingleton.Instance.FindOne<ModeList>("ModeList");
+                    //            if (modelInfo != null)
+                    //            {
+                    //                if (modelInfo.Mode == "鍏ュ簱妯″紡")
+                    //                {
+                    //                    action = false;
+                    //                    CMMLog.Debug($"OutWareTask:涓棿琛�ModeList涓�鍏ュ簱妯″紡");
+                    //                    break;
+                    //                }
+                    //            }
+                    //            else
+                    //            {
+                    //                action = false;
+                    //                CMMLog.Debug("OutWareTask:涓棿琛�ModeList 涓虹┖");
+                    //                break;
+                    //            }
+                    //        }
+                    //    }
+                    //};
+                    //if (!action)
+                    //{
+                    //    return false;
+                    //}
                     #endregion
 
 
@@ -793,14 +793,14 @@
                         new SqlHelper<object>().ExecuteSql($"update dbo.tn_am_task_mst set CN_S_END_BIT='{endMachLoc}',CN_S_END_AGVBIT = '{StockInstance.Instance.GetAGVCodeForBitCode(endMachLoc)}' where CN_S_TASK_NO = '{mst.CN_S_TASK_NO}'");
 
                         var plcTwo = Settings.GetPlcInfo().Where(a => a.location == endMachLoc && a.enable == 1).First();
-                        int[] num = new int[1] { 1 };
-                        var wirte = OITcpHelper.RegisterWriteOutPutMulti(new OITcpHelper.RegisterWriteOutPutModelMulti
-                        {
-                            addr = plcTwo.writeAddr + 1,
-                            host = plcTwo.ip,
-                            data = num,
-                            port = plcTwo.port
-                        });
+                        //int[] num = new int[1] { 1 };
+                        //var wirte = OITcpHelper.RegisterWriteOutPutMulti(new OITcpHelper.RegisterWriteOutPutModelMulti
+                        //{
+                        //    addr = plcTwo.writeAddr + 1,
+                        //    host = plcTwo.ip,
+                        //    data = num,
+                        //    port = plcTwo.port
+                        //});
 
                         result = true;
                     }
diff --git a/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ProtocolAnalysis.cs b/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ProtocolAnalysis.cs
index bdd88ea..e299bc8 100644
--- a/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ProtocolAnalysis.cs
+++ b/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ProtocolAnalysis.cs
@@ -668,8 +668,7 @@
 
                     if (result != null && result.errCode == 0)
                     {
-                        CMMLog.Info($"鐢靛姩闂ㄥ紑闂ㄦ祦绋嬶細璇诲彇鐢靛姩闂ㄩ�閬撳彿涓猴細{doorInfo.readAddr}閲岄潰鐨勫�涓簕result.result[0]},{doorInfo.readAddr + 1}閲岄潰鐨勫�涓簕result.result[1]}");
-                        Console.WriteLine($"鐢靛姩闂ㄥ紑闂ㄦ祦绋嬶細璇诲彇鐢靛姩闂ㄩ�閬撳彿涓猴細{doorInfo.readAddr}閲岄潰鐨勫�涓簕result.result[0]},{doorInfo.readAddr + 1}閲岄潰鐨勫�涓簕result.result[1]}");
+                        CMMLog.Info($"鐢靛姩闂ㄥ紑闂ㄦ祦绋嬶細璇诲彇鐢靛姩闂ㄩ�閬撳彿涓猴細{doorInfo.readAddr}閲岄潰鐨勫�涓簕result.result[0]},{doorInfo.readAddr + 1}閲岄潰鐨勫�涓簕result.result[1]},闂ㄥ彿锛歿action.Ext2}");
                         if(action.Ext2 == "4")
                         {
                             if (result.result[0] == 1)
@@ -681,7 +680,6 @@
                             }
                         }
                         else if(result.result[0] == 1 && result.result[1] == 1)
-                        //if(result.result[0] == 1 && result.result[1] == 1)
                         {
                             //鎺ㄩ�灏忚溅杩涘幓
                             CMMLog.Info($"鐢靛姩闂ㄥ凡缁忔墦寮�紝闂ㄥ彿锛歿action.Ext2}");

--
Gitblit v1.9.1