From 71e1322fa3f5879b9d71930b783ed1a393477451 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周四, 27 3月 2025 17:24:07 +0800 Subject: [PATCH] 下发 条件限制 --- CC/iWareCC_ASRS/ThreadService/04_BZ21(搬运整垛机器人)/2、DataProcess_BZ21_IssueTask.cs | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-) diff --git "a/CC/iWareCC_ASRS/ThreadService/04_BZ21\357\274\210\346\220\254\350\277\220\346\225\264\345\236\233\346\234\272\345\231\250\344\272\272\357\274\211/2\343\200\201DataProcess_BZ21_IssueTask.cs" "b/CC/iWareCC_ASRS/ThreadService/04_BZ21\357\274\210\346\220\254\350\277\220\346\225\264\345\236\233\346\234\272\345\231\250\344\272\272\357\274\211/2\343\200\201DataProcess_BZ21_IssueTask.cs" index 97ab8d2..4b5c50e 100644 --- "a/CC/iWareCC_ASRS/ThreadService/04_BZ21\357\274\210\346\220\254\350\277\220\346\225\264\345\236\233\346\234\272\345\231\250\344\272\272\357\274\211/2\343\200\201DataProcess_BZ21_IssueTask.cs" +++ "b/CC/iWareCC_ASRS/ThreadService/04_BZ21\357\274\210\346\220\254\350\277\220\346\225\264\345\236\233\346\234\272\345\231\250\344\272\272\357\274\211/2\343\200\201DataProcess_BZ21_IssueTask.cs" @@ -70,20 +70,35 @@ continue; } + var package = wmsDB.mes_package_gather.Where(x => x.PackageCode == upiObj.PackageCode).FirstOrDefault(); + if (package == null) + { + SystemWarningMsg._lbl_Alert_DataProcess_BZ21_IssueTask = $"{rgvLocation.ToString()},鏍规嵁鍖呭彿:{upiObj.PackageCode}娌℃湁鎵惧埌瀵硅薄 "; + continue; + } + short cartonwidth = 0;//绾哥瀹� short cartonhigh = 0;//绾哥楂� var upilist = wmsDB.mes_batchOrderUPI_new.Where(x => x.PackageCode == upiObj.PackageCode).ToList(); var upilength = upilist.Max(x => x.Length); var upiwidth = upilist.Max(x => x.Width); - cartonhigh = (short)upiObj.Info3; - cartonwidth = (short)upiObj.Info2; + cartonhigh = (short)package.Info3; + cartonwidth = (short)package.Info2; + + var ngFlag = false; + var queryFlag = (int)UpiFlagEnum.NG; + var ngCount = upilist.Count(x => x.UpiFlag == queryFlag); + if (ngCount > 0) + { + ngFlag = true; + } //杩欓噷涓嬪彂 浠诲姟 using (StationServiceClient client = new StationServiceClient()) { var plcres = client.WriteSurroundTaskInfo((int)EDevice.Station, rgvLocation, short.Parse(task.TaskNo), - (short)upilength, (short)upiwidth, cartonhigh, cartonwidth, 0, 0); + (short)upilength, (short)upiwidth, cartonhigh, cartonwidth, 0, 0, ngFlag); if (!plcres.result) { SystemWarningMsg._lbl_Alert_DataProcess_BZ21_IssueTask = $"{rgvLocation.ToString()}-涓嬪彂鍏ュ簱浠诲姟 澶辫触,WriteInStoreTaskInfoAsync 杩斿洖:{plcres.resMsg}"; @@ -96,6 +111,7 @@ } task.TaskStatus = (int)TaskStatusEnum.宸蹭笅鍙�; + task.IssueTime = DateTime.Now; wmsDB.SaveChanges(); } -- Gitblit v1.9.3