schangxiang@126.com
2025-03-27 5b5429a616f4d6637c3ddd4b2476f4d563f19585
CC/iWareCC_ASRS/ThreadService/04_BZ21£¨°áÔËÕû¶â»úÆ÷ÈË£©/2¡¢DataProcess_BZ21_IssueTask.cs
@@ -63,10 +63,17 @@
                                continue;
                            }
                            var upiObj = wmsDB.mes_batchOrderUPI_new.Where(x => x.UPI == task.UPI).FirstOrDefault();
                            var upiObj = wmsDB.mes_batchOrderUPI_new.Where(x => x.UPI == task.Upi).FirstOrDefault();
                            if (upiObj == null)
                            {
                                SystemWarningMsg._lbl_Alert_DataProcess_BZ21_IssueTask = $"{rgvLocation.ToString()},根据UPI:{task.UPI}没有找到对象 ";
                                SystemWarningMsg._lbl_Alert_DataProcess_BZ21_IssueTask = $"{rgvLocation.ToString()},根据UPI:{task.Upi}没有找到对象 ";
                                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;
                            }
@@ -75,15 +82,23 @@
                            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,7 +111,7 @@
                            }
                            task.TaskStatus = (int)TaskStatusEnum.已下发;
                            task.TaskStatusName = TaskStatusEnum.已下发.ToString();
                            task.IssueTime = DateTime.Now;
                            wmsDB.SaveChanges();
                        }