From c9e3a7f0c154892f2327e300e28af53f81e40ad0 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周四, 20 2月 2025 11:03:24 +0800
Subject: [PATCH] 软件加密+ 修复 不断给plc报警的问题

---
 CC/iWareCC_ASRS/ThreadService/03_BZ12(机器人码包工位)/1、DataProcess_BZ12.cs |   35 +++++++++++++++++++++++++----------
 1 files changed, 25 insertions(+), 10 deletions(-)

diff --git "a/CC/iWareCC_ASRS/ThreadService/03_BZ12\050\346\234\272\345\231\250\344\272\272\347\240\201\345\214\205\345\267\245\344\275\215\051/1\343\200\201DataProcess_BZ12.cs" "b/CC/iWareCC_ASRS/ThreadService/03_BZ12\050\346\234\272\345\231\250\344\272\272\347\240\201\345\214\205\345\267\245\344\275\215\051/1\343\200\201DataProcess_BZ12.cs"
index 159e325..deb05cc 100644
--- "a/CC/iWareCC_ASRS/ThreadService/03_BZ12\050\346\234\272\345\231\250\344\272\272\347\240\201\345\214\205\345\267\245\344\275\215\051/1\343\200\201DataProcess_BZ12.cs"
+++ "b/CC/iWareCC_ASRS/ThreadService/03_BZ12\050\346\234\272\345\231\250\344\272\272\347\240\201\345\214\205\345\267\245\344\275\215\051/1\343\200\201DataProcess_BZ12.cs"
@@ -69,15 +69,12 @@
                             }
                             var upiCode = result.Replace("/r", ""); ;
                             short lastnum = 0;//鏄惁鏈澘
-                            //short isrotate = 0;//鏄惁鏃嬭浆
-                            //short placeX = 0;
-                            //short placeY = 0;
-                            //short placeZ = 0;
+
                             string place = "";
                             using (WmsDBModel wmsDB = new WmsDBModel())
                             {
                                 //瑕佹槸鏈夊凡涓嬪彂鐨勪换鍔★紝灏变笉瑕佹墽琛�
-                                var isValidate = TaskHandler.ValidateIssueTaskForNoFinishTaskByUpi(wmsDB, result);
+                                var isValidate = TaskHandler.ValidateIssueTaskForNoFinishTaskByUpi(wmsDB, result, false);
                                 if (!isValidate)
                                 {
                                     SystemWarningMsg._lbl_alert_DataProcess_BZ12 = $"{rgvLocation.ToString()}-upi锛歿result}鏈夆�樺凡涓嬪彂鈥欑殑浠诲姟锛屼笉鑳藉鐞�,姝ゆ寰幆缁撴潫";
@@ -108,12 +105,23 @@
                                 //placeZ = (short)upiObj.MachineZCenter;
                                 if (upiObj.UpiStatus == (int)UpiStatusEnum.宸茬爜鍨� || upiObj.UpiStatus == (int)UpiStatusEnum.鐮佸灈涓�)
                                 {
-                                    //鍐欏叆鎶ヨ淇℃伅
-                                    await MyExtendHelper.WriteBoolPlcDataForWarning(PlcWarningAddressGloble.Num_BZ12_3);
-
                                     SystemWarningMsg._lbl_alert_DataProcess_BZ12 = $"{rgvLocation.ToString()},鏍规嵁UPI:{upiCode}鐘舵�佸凡鏄�'宸茬爜鍨�'鎴�'鐮佸灈涓�' ";
+                                    MyExtendHelper.SetValueControlRequestDicts(PlcWarningAddressGloble.Num_BZ12_3, false, SystemWarningMsg._lbl_alert_DataProcess_BZ12);
+
+                                    var isAllow = MyExtendHelper.ValidateIsAllowRequest(PlcWarningAddressGloble.Num_BZ12_3, LogType.DataProcess_BZ12);
+                                    if (isAllow == false)
+                                    {
+                                        continue;
+                                    }
+                                    else
+                                    {
+                                        //鍐欏叆鎶ヨ淇℃伅
+                                        await MyExtendHelper.WriteBoolPlcDataForWarning(PlcWarningAddressGloble.Num_BZ12_3);
+                                    }
+
                                     continue;
                                 }
+                                MyExtendHelper.SetValueControlRequestDicts(PlcWarningAddressGloble.Num_BZ12_3, true, "");
                                 upiObj.UpiStatus = (int)UpiStatusEnum.鐮佸灈涓�;
                                 upiObj.AreaCode = (int)AreaCodeEnum.鐮佸灈鍖哄煙;
                                 //鏌ュ杩欏寘鎵�鏈夌殑鏁伴噺
@@ -159,7 +167,6 @@
                                 }
                                 else
                                 {//琛ㄧず杩欐槸 鍖呯殑绗竴鍧楁澘
-                                    lastnum = 1;
                                     palletizingUPI = upiObj.PackageCode;
                                     if (obj.R_PalletizingStation1 == 1)
                                     {
@@ -188,10 +195,18 @@
                                 //濡傛灉娆″簭绛変簬褰撻挶鍖呮�绘暟閲忥紝鏄惁鏈澘缃负true
                                 if (upiObj.Shelf == upiList.Count())
                                 {
-                                    lastnum = 2;
+                                    lastnum = 2;//锛�1棣栦欢锛�2鏈欢锛�0涓轰腑闂存澘锛�
                                     palletizingUPI = null;
                                     palletizingStation = 0;
                                 }
+                                else if (upiObj.Shelf == 1)
+                                {
+                                    lastnum = 1;//锛�1棣栦欢锛�2鏈欢锛�0涓轰腑闂存澘锛�
+                                }
+                                else
+                                {
+                                    lastnum = 0;//锛�1棣栦欢锛�2鏈欢锛�0涓轰腑闂存澘锛�
+                                }
 
 
                                 //鏌ヨ鏈夋病鏈夋搴忓皬浜庡綋鍓嶆搴忓苟涓旀病鏈夌爜鍨涚殑

--
Gitblit v1.9.3