schangxiang@126.com
2025-03-10 bd66e0df64fb45ec648ddacff4518992ce52e98f
CC/iWareCC_ASRS/ThreadService/04_BZ21£¨°áÔËÕû¶â»úÆ÷ÈË£©/2¡¢DataProcess_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();
                        }