add
zongzhibin
2024-11-30 752fd1d6f70afc3f58eca4ab2e6b9359ba2a5578
CC/iWareCC_ASRS/ThreadService/02_BZ39¹¤Î»£¨²¹°åºó¹¤Î»£©/Inbound/2¡¢DataProcess_RobotBuffer_FinishTask.cs
@@ -34,7 +34,7 @@
                SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTask = string.Empty;
                try
                {
                    if (SystemValue.isAllowRuning_DataProcess_RobotBuffer_FinishTask && SystemValue.isStartedModel)
                    if ( SystemValue.isStartedModel)//SystemValue.isAllowRuning_DataProcess_RobotBuffer_FinishTask &&
                    {
                        var rgvLocation = StationLocationEnum.BZ39.ToString();
                        var obj = FormCC.stationView.R_StationForReadCommList.Where(x => x.StationCode == rgvLocation.ToString()).FirstOrDefault();
@@ -62,11 +62,23 @@
                                var task = wmsDB.wms_rbline_task.Where(x =>
                                 x.TaskNo == obj.R_Inbound_TaskID.ToString()
                                && x.RbTaskType == (int)RbTaskTypeEnum.入库任务
                                && x.TaskStatus == (int)TaskStatusEnum.已下发).FirstOrDefault();
                                ).OrderByDescending(x=>x.Id).FirstOrDefault();
                                if (task == null)
                                {
                                    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTask = $"{rgvLocation.ToString()},根据 R_InboundNumber:{obj.R_InboundNumber}没有找到已下发的任务 ";
                                    continue;
                                }
                                else
                                {
                                    if (task.TaskStatus == (int)TaskStatusEnum.已完成)
                                    {
                                        using (StationServiceClient client = new StationServiceClient())
                                        {
                                            var res = await client.InboundFinishConfirmAsync((int)EDevice.Station, true, rgvLocation);
                                        }
                                        continue;
                                    }
                                }
                                var upiCode = task.UPI;
@@ -89,6 +101,7 @@
                                    InTime = DateTime.Now,
                                    OperReason = "入库",
                                    PackageCode = task.PackageCode,
                                    Length = task.Length,
                                    Width = task.Width,
                                    Thk = task.Thk,
                                    PlaceCode = task.PlaceCode,
@@ -124,6 +137,18 @@
                                wmsDB.SaveChanges();
                            }
                        }
                        else
                        {
                            //不再拦截
                            //首先先清理
                            using (StationServiceClient client = new StationServiceClient())
                            {
                                var res = await client.InboundFinishConfirmAsync((int)EDevice.Station, false, rgvLocation);
                            }
                        }
                    }
                }
                catch (Exception ex)