22
schangxiang@126.com
2024-12-06 9aa1ccbaf232340bcc1196eddb85258e2b16f4e2
CC/iWareCC_ASRS/ThreadService/02_BZ39¹¤Î»£¨²¹°åºó¹¤Î»£©/Outbound/3¡¢DataProcess_RobotBuffer_FinishTaskForOutbound.cs
@@ -29,6 +29,11 @@
                    if (SystemValue.isStartedModel)
                    {
                        var rgvLocation = StationLocationEnum.BZ39.ToString();
                        if (FormCC.stationView == null)
                        {
                            SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound = $"{rgvLocation.ToString()}-获取PLC对象为null";
                            continue;
                        }
                        var obj = FormCC.stationView.R_StationForReadCommList.Where(x => x.StationCode == rgvLocation.ToString()).FirstOrDefault();
                        if (obj.R_OutboundFinish)
                        {
@@ -52,7 +57,7 @@
                            {
                                var task = wmsDB.wms_rbline_task.Where(x =>
                                 x.TaskNo == obj.R_Outbound_TaskID.ToString()
                                && x.RbTaskType == (int)RbTaskTypeEnum.出库任务
                                && (x.RbTaskType == (int)RbTaskTypeEnum.齐包出库任务 || x.RbTaskType == (int)RbTaskTypeEnum.强制出库任务)
                                ).OrderByDescending(x => x.Id).FirstOrDefault();
                                if (task == null)
                                {
@@ -79,6 +84,18 @@
                                    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound = $"{rgvLocation.ToString()},根据UPI:{upiCode}没有找到对象 ";
                                    continue;
                                }
                                //更新板件的状态和区域
                                if (task.RbTaskType == (int)RbTaskTypeEnum.齐包出库任务)
                                {
                                    upiObj.UpiStatus = (int)UpiStatusEnum.已齐包;
                                    upiObj.AreaCode = (int)AreaCodeEnum.码垛区域;
                                }
                                else if (task.RbTaskType == (int)RbTaskTypeEnum.强制出库任务)
                                {
                                    upiObj.UpiStatus = (int)UpiStatusEnum.已下线;
                                    upiObj.AreaCode = (int)AreaCodeEnum.下线区域;
                                }
                                //库存减少
                                wms_stock_quan qun = wmsDB.wms_stock_quan.Where(x => x.PlaceCode == task.PlaceCode).FirstOrDefault();
                                wmsDB.wms_stock_quan.Remove(qun);
@@ -105,7 +122,7 @@
                                    }
                                }
                                WmsRecordUpiProcessHandler.SaveWmsRecordUpiProcess(wmsDB, upiObj, task.PlaceCode, "出缓存库:"+task.TaskMsg);
                                WmsRecordUpiProcessHandler.SaveWmsRecordUpiProcess(wmsDB, upiObj, task.PlaceCode, $"出缓存库:{task.PlaceCode}," + task.TaskMsg);
                                wmsDB.SaveChanges();
                            }