11
schangxiang@126.com
2024-12-03 e8734db76fbbb3149ba663beff3b4f7451012b03
CC/iWareCC_ASRS/ThreadService/02_BZ39¹¤Î»£¨²¹°åºó¹¤Î»£©/Outbound/3¡¢DataProcess_RobotBuffer_FinishTaskForOutbound.cs
@@ -25,8 +25,8 @@
                Thread.Sleep(500);//休眠2秒,将休眠写到前面,是为了下面的continue方法执行后不显示错误信息的提示!!!【EditBy shaocx,2022-05-24】
                SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound = string.Empty;
                try
                {
                    if (SystemValue.isAllowRuning_DataProcess_RobotBuffer_FinishTaskForOutbound && SystemValue.isStartedModel)
                {//SystemValue.isAllowRuning_DataProcess_RobotBuffer_FinishTaskForOutbound &&
                    if (SystemValue.isStartedModel)
                    {
                        var rgvLocation = StationLocationEnum.BZ39.ToString();
                        var obj = FormCC.stationView.R_StationForReadCommList.Where(x => x.StationCode == rgvLocation.ToString()).FirstOrDefault();
@@ -53,11 +53,23 @@
                                var task = wmsDB.wms_rbline_task.Where(x =>
                                 x.TaskNo == obj.R_Outbound_TaskID.ToString()
                                && x.RbTaskType == (int)RbTaskTypeEnum.出库任务
                                && x.TaskStatus == (int)TaskStatusEnum.已下发).FirstOrDefault();
                                ).OrderByDescending(x => x.Id).FirstOrDefault();
                                if (task == null)
                                {
                                    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound = $"{rgvLocation.ToString()},根据 R_OutboundNumber:{obj.R_OutboundNumber}没有找到已下发的任务 ";
                                    continue;
                                }
                                else
                                {
                                    if (task.TaskStatus == (int)TaskStatusEnum.已完成)
                                    {
                                        using (StationServiceClient client = new StationServiceClient())
                                        {
                                            var res = await client.OutboundFinishConfirmAsync((int)EDevice.Station, true, rgvLocation, false);
                                        }
                                        continue;
                                    }
                                }
                                var upiCode = task.UPI;
@@ -81,7 +93,7 @@
                                //给PLC推送任务完成确认信号
                                using (StationServiceClient client = new StationServiceClient())
                                {
                                    var res = await client.OutboundFinishConfirmAsync((int)EDevice.Station, true, rgvLocation);
                                    var res = await client.OutboundFinishConfirmAsync((int)EDevice.Station, true, rgvLocation, true);
                                    if (!res.result)
                                    {
                                        SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound = $"{rgvLocation.ToString()}-下发出库任务 å¤±è´¥,OutboundFinishConfirmAsync è¿”回:{res.resMsg}";
@@ -93,9 +105,18 @@
                                    }
                                }
                                WmsRecordUpiProcessHandler.SaveWmsRecordUpiProcess(wmsDB, upiObj, task.PlaceCode, $"出缓存库:{task.PlaceCode},"+task.TaskMsg);
                                wmsDB.SaveChanges();
                            }
                        }
                        else
                        {
                            using (StationServiceClient client = new StationServiceClient())
                            {
                                var res = await client.OutboundFinishConfirmAsync((int)EDevice.Station, false, rgvLocation, false);
                            }
                        }
                    }
                }
                catch (Exception ex)