From fe16b1af4bbfabda8726eca582b04f00d1b1de6f Mon Sep 17 00:00:00 2001 From: liuying <1427574514@qq.com> Date: 周二, 10 12月 2024 11:13:13 +0800 Subject: [PATCH] pda --- CC/iWareCC_ASRS/ThreadService/01_BZ01工位(清灰,洗板后工位)/DataProcess_BZ01.cs | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 40 insertions(+), 7 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 e2c6727..f5e455d 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" @@ -37,7 +37,7 @@ SystemWarningMsg._lbl_alert_DataProcess_BZ01 = string.Empty; try { - if (SystemValue.isAllowRuning_DataProcess_BZ01 && SystemValue.isStartedModel) + if (SystemValue.isStartedModel)//SystemValue.isAllowRuning_DataProcess_BZ01 && { if (FormCC.IsAllowRunOutMode == true) { @@ -50,6 +50,11 @@ * 1銆佷粠鏁版嵁搴撲腑鍒ゆ柇鏄惁榻愬 * 2銆佹牴鎹綈濂楃粨鏋滐紝鎺ㄩ�佺粰PLC */ + if (FormCC.stationView == null) + { + SystemWarningMsg._lbl_alert_DataProcess_BZ01 = $"{rgvLocation.ToString()}-鑾峰彇PLC瀵硅薄涓簄ull"; + continue; + } var obj = FormCC.stationView.R_StationForReadCommList.Where(x => x.StationCode == rgvLocation.ToString()).FirstOrDefault(); if (obj.R_ReqParseData) { @@ -60,12 +65,15 @@ continue; } var upiCode = result; - var qitaoReault = false; + var qitaoReault = false;//榻愬寘缁撴灉 using (WmsDBModel wmsDB = new WmsDBModel()) { var upiObj = wmsDB.mes_batchOrderUPI_new.Where(x => x.UPI == upiCode).FirstOrDefault(); if (upiObj == null) { + //鍐欏叆鎶ヨ淇℃伅 + await MyExtendHelper.WriteBoolPlcDataForWarning(PlcWarningAddressGloble.Num_BZ01_1); + SystemWarningMsg._lbl_alert_DataProcess_BZ01 = $"{rgvLocation.ToString()},鏍规嵁UPI:{upiCode}娌℃湁鎵惧埌瀵硅薄 "; continue; } @@ -84,8 +92,6 @@ x.AreaCode == (int)AreaCodeEnum.缂撳瓨鍒嗘嫞鍖� || x.AreaCode == (int)AreaCodeEnum.鐮佸灈鍖哄煙 - || - x.AreaCode == (int)AreaCodeEnum.鏈哄櫒浜哄矝缂撳瓨鍖哄煙 ).ToList(); if (isQiTaoList.Count() != allList.Count()) {//涓嶉綈鍖� @@ -94,8 +100,32 @@ } else {//榻愬寘 - qitaoReault = true; - upiObj.AreaCode = (int)AreaCodeEnum.鐮佸灈鍖哄煙; + //杩欓噷鍐嶅鍔犱釜閫昏緫锛屽繀椤绘槸鎸夌収娆″簭杩涘叆鐨勬墠鐪熸鐨勭畻榻愬寘 [Editby shaocx,2024-12-06] + //瀵绘壘鏈寘鍐呯殑鍓嶄竴鍧楁澘鐨勪綅缃� + int queryAreaCode = (int)AreaCodeEnum.寰呯紦瀛樺垎鎷e尯; + var lastUpiLineQueue = wmsDB.mes_upi_linequeue.Where(x => x.PackageCode == upiObj.PackageCode && x.AreaCode == queryAreaCode) + .OrderBy(x => x.Id).FirstOrDefault();//鏌ヨ璇ュ寘闃熷垪鐨勭涓�鍧楁澘 + if (lastUpiLineQueue == null) + {//璇存槑 闃熷垪涓病鏈夎鍖呯殑鏁版嵁 + qitaoReault = false; + upiObj.AreaCode = (int)AreaCodeEnum.缂撳瓨鍒嗘嫞鍖�; + } + else + { + if (lastUpiLineQueue.Shelf != upiObj.Shelf) + { + qitaoReault = false; + upiObj.AreaCode = (int)AreaCodeEnum.缂撳瓨鍒嗘嫞鍖�; + } + else + { + qitaoReault = true; + upiObj.AreaCode = (int)AreaCodeEnum.鐮佸灈鍖哄煙; + } + + //娉ㄦ剰锛氳鍒犻櫎璇ラ槦鍒楁暟鎹摝 + wmsDB.mes_upi_linequeue.Remove(lastUpiLineQueue); + } } using (StationServiceClient client = new StationServiceClient()) @@ -131,6 +161,8 @@ rbRunMode.OrderId = upiObj.OrderId; rbRunMode.PackageCode = upiObj.PackageCode; + WmsRecordUpiProcessHandler.SaveWmsRecordUpiProcess(wmsDB, upiObj, "BZ01", "榻愬寘楠岃瘉:" + (qitaoReault ? "榻愬寘" : "涓嶉綈鍖�")); + wmsDB.SaveChanges(); } } @@ -161,7 +193,8 @@ private static bool IsAllloRunOutTaskMode(WmsDBModel wmsDB, mes_batchOrderUPI_new curUpiObj) { //棣栧厛鏌ヨ鏁版嵁搴撲腑鏄惁鏈� 瑕佸嚭搴撶殑鏁版嵁 - var isExistOutTaskForNewCreated = wmsDB.wms_rbline_task.Where(x => x.RbTaskType == (int)RbTaskTypeEnum.鍑哄簱浠诲姟 + var isExistOutTaskForNewCreated = wmsDB.wms_rbline_task.Where(x => + (x.RbTaskType == (int)RbTaskTypeEnum.榻愬寘鍑哄簱浠诲姟 || x.RbTaskType == (int)RbTaskTypeEnum.寮哄埗鍑哄簱浠诲姟) && x.TaskStatus == (int)TaskStatusEnum.鏂板缓 ).Count(); if (isExistOutTaskForNewCreated == 0) -- Gitblit v1.9.3