From 04d10bce51a6272d02a4a0f1b05a4f64bf73f273 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周二, 05 8月 2025 16:48:03 +0800 Subject: [PATCH] 休眠10秒 ,2秒改为10秒 【Editby shaocx,2025-08-05】 --- CC/iWareCC_ASRS/ThreadService/01_BZ01工位(清灰,洗板后工位)/DataProcess_BZ01.cs | 55 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 49 insertions(+), 6 deletions(-) diff --git "a/CC/iWareCC_ASRS/ThreadService/01_BZ01\345\267\245\344\275\215\357\274\210\346\270\205\347\201\260\357\274\214\346\264\227\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/DataProcess_BZ01.cs" "b/CC/iWareCC_ASRS/ThreadService/01_BZ01\345\267\245\344\275\215\357\274\210\346\270\205\347\201\260\357\274\214\346\264\227\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/DataProcess_BZ01.cs" index ab98464..16a4eb3 100644 --- "a/CC/iWareCC_ASRS/ThreadService/01_BZ01\345\267\245\344\275\215\357\274\210\346\270\205\347\201\260\357\274\214\346\264\227\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/DataProcess_BZ01.cs" +++ "b/CC/iWareCC_ASRS/ThreadService/01_BZ01\345\267\245\344\275\215\357\274\210\346\270\205\347\201\260\357\274\214\346\264\227\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/DataProcess_BZ01.cs" @@ -70,13 +70,48 @@ SystemWarningMsg._lbl_alert_DataProcess_BZ01 = $"{rgvLocation.ToString()}-璇锋眰浜嗚В鐮侊紝浣嗘槸缁撴灉鏄┖鐨�,姝ゆ寰幆缁撴潫"; continue; } + if (lastUpi == result) { - SystemWarningMsg._lbl_alert_DataProcess_BZ01 = $"{rgvLocation.ToString()}-閲嶅鐨刄PI{result}"; - continue; + //瀵绘壘涓婃鐨凚Z01楠岃瘉璁板綍 + using (WmsDBModel wmsDB = new WmsDBModel()) + { + var lastRecord = wmsDB.wms_record_upi_process.Where(x => x.Upi == lastUpi && x.Location == "BZ01").OrderByDescending(x => x.Id).FirstOrDefault(); + if (lastRecord != null) + { + //鍙栨槸鍚� 榻愬寘 + bool my_qitaoReault = false; + if (lastRecord.UpiStatus == (int)UpiStatusEnum.宸查綈鍖�) + { + my_qitaoReault = true; + } + //鎺ㄩ�丳LC + using (StationServiceClient client = new StationServiceClient()) + { + var res = await client.WriteQiTaoInfoAsync((int)EDevice.Station, rgvLocation, my_qitaoReault); + if (!res.result) + { + SystemWarningMsg._lbl_alert_DataProcess_BZ01 = $"{rgvLocation.ToString()}-銆愬崟鐙帹閫丳LC銆戞帹閫侀綈濂楃粨鏋滃け璐�,WriteQiTaoInfoAsync杩斿洖:{res.resMsg}"; + continue; + } + else + { + Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-銆愬崟鐙帹閫丳LC銆戞帹閫侀綈濂楃粨鏋滄垚鍔�,WriteQiTaoInfoAsync锛屽弬鏁�: 绔欑偣{rgvLocation},榻愬缁撴灉:{my_qitaoReault}"); + SystemWarningMsg._lbl_alert_DataProcess_BZ01 = $"{rgvLocation.ToString()}-銆愬崟鐙帹閫丳LC銆戞帹閫侀綈濂楃粨鏋滄垚鍔�"; + continue; + } + } + } + else + { + SystemWarningMsg._lbl_alert_DataProcess_BZ01 = $"{rgvLocation.ToString()}-閲嶅鐨刄PI{result}"; + continue; + } + } } + //*/ var upiCode = result; - lastUpi = upiCode; + var qitaoReault = false;//榻愬寘缁撴灉 using (WmsDBModel wmsDB = new WmsDBModel()) @@ -145,6 +180,12 @@ #region 璁$畻鏄惁榻愬寘 qitaoReault = ValidateQiBao(wmsDB, upiObj); #endregion + } + //鍖呬腑鍙湁涓�鍧楁澘鏃讹紝璁ゅ畾涓� 涓嶉綈鍖� 銆怑ditby shaocx,2025-04-01銆� + var isOnlyOne = MyExtendHelper.IsOnlyOneInPackage(wmsDB, upiObj.UPI); + if (isOnlyOne) + { + qitaoReault = false; } //澧炲姞浼樺寲楠岃瘉 銆怑ditby shaocx,2024-12-16銆� @@ -312,6 +353,8 @@ // continue; //} + + lastUpi = upiCode; using (StationServiceClient client = new StationServiceClient()) { var res = await client.WriteQiTaoInfoAsync((int)EDevice.Station, rgvLocation, qitaoReault); @@ -409,14 +452,14 @@ var bz30Config = wmsDB.SysConfig.Where(x => x.Code == "Wait_269").FirstOrDefault(); if (bz30Config == null) { - SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"娌℃湁閰嶇疆 Wait_269 鍊�"; + SystemWarningMsg._lbl_alert_DataProcess_BZ01 = $"娌℃湁閰嶇疆 Wait_269 鍊�"; return false; } int i = 0; bool right = int.TryParse(bz30Config.Value, out i); if (right == false) { - SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"閰嶇疆 Wait_269 鍊间笉鏄暣鏁�"; + SystemWarningMsg._lbl_alert_DataProcess_BZ01 = $"閰嶇疆 Wait_269 鍊间笉鏄暣鏁�"; return false; } @@ -435,7 +478,7 @@ //瓒呮椂 return true; } - SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"閰嶇疆 Wait_269 鍊兼槸{i},褰撳墠闂撮殧鏄瘂sec}绉�,鏈秴鏃躲�傚紑濮嬬瓑寰呮椂闂磠timingForWait}"; + SystemWarningMsg._lbl_alert_DataProcess_BZ01 = $"閰嶇疆 Wait_269 鍊兼槸{i},褰撳墠闂撮殧鏄瘂sec}绉�,鏈秴鏃躲�傚紑濮嬬瓑寰呮椂闂磠timingForWait}"; return false; } -- Gitblit v1.9.3