yanjinhui
3 天以前 39531cf0ea52494fe56b8734afa552db32b7a164
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs
@@ -1,6 +1,7 @@
using Autofac.Core;
using Magicodes.IE.Core;
using NetTaste;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -84,7 +85,7 @@
                                task.TaskState = (int)TaskStatusEnum.HktransportIng;
                                BaseDal.UpdateData(task);
                            }
                            else
                            else if (task.TaskState == (int)TaskStatusEnum.Execut)
                            {
                                task.TaskState = (int)TaskStatusEnum.Takeing;
                                TaskFeedback(task, 1);
@@ -293,7 +294,7 @@
                            break;
                        case "leavelift": //离开电梯
                            {
                                if (task.TaskType == (int)TaskTypeEnum.Q3RK || task.TaskType == (int)TaskTypeEnum.MOVE || task.TaskType == (int)TaskTypeEnum.F01|| task.TaskType == (int)TaskTypeEnum.Q3CK)
                                if (task.TaskType == (int)TaskTypeEnum.Q3RK || task.TaskType == (int)TaskTypeEnum.MOVE || task.TaskType == (int)TaskTypeEnum.F01 || task.TaskType == (int)TaskTypeEnum.Q3CK)
                                {
                                    task.TaskState = TaskStatusEnum.HKleavelift.ObjToInt();
                                    BaseDal.UpdateData(task);
@@ -396,16 +397,24 @@
                            {
                                task.ExceptionMessage = Rgv.content.errorReason;
                                var Error = _taskErrorMessageService.Repository.QueryFirst(x => x.ErrorCode == Rgv.content.errorCode && x.DeviceType == (int)deviceTypeEnum);
                                if (Error != null)
                                if (task.TaskType == (int)TaskTypeEnum.CPOutbound && task.TaskState == (int)TaskStatusEnum.Execut && Rgv.content.errorCode == 1330003)//成品出库任务下发后反馈有阻碍托,修改任务状态为新建重新查询阻碍托关系
                                {
                                    task.ExceptionMessage = Error.ExceptionMessage;
                                    MatchCollection matches = Regex.Matches(Rgv.content.errorReason, @"\(([^)]+)\)");
                                    if (matches.Count > 0)
                                        task.ExceptionMessage = ReplacePlaceholders(Rgv.content.errorReason, Error.ExceptionMessage);
                                    ErrorTaskFeedback(task, true, Error.ErrorCode.ToString());
                                    task.TaskState = (int)TaskStatusEnum.New;
                                    BaseDal.UpdateData(task);
                                }
                                else
                                    ErrorTaskFeedback(task, true);
                                {
                                    if (Error != null)
                                    {
                                        task.ExceptionMessage = Error.ExceptionMessage;
                                        MatchCollection matches = Regex.Matches(Rgv.content.errorReason, @"\(([^)]+)\)");
                                        if (matches.Count > 0)
                                            task.ExceptionMessage = ReplacePlaceholders(Rgv.content.errorReason, Error.ExceptionMessage);
                                        ErrorTaskFeedback(task, true, Error.ErrorCode.ToString());
                                    }
                                    else
                                        ErrorTaskFeedback(task, true);
                                }
                            }
                        }
                    }
@@ -637,38 +646,22 @@
                        dt_RGVLocationInfo.LocationStatus = locationStatusEnum.ObjToInt();
                        _rGVLocationInfoService.Repository.UpdateData(dt_RGVLocationInfo);
                    }
                }
                else//平库库位
                {
                }
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        #endregion
        #region æ›´æ–°ä¸€æ¥¼ç«™å°çŠ¶æ€
        public WebResponseContent UpdateStandStatus(Dt_Task task, string stationCode, LocationStatusEnum locationStatusEnum)
        {
            try
            {
                Dt_StationManger? stationManger = _stationMangerService.Repository.QueryFirst(x => x.StationCode == task.TargetAddress);
                //stationManger.IsOccupied = LocationStatusEnum.Lock.ObjToInt();
                if (stationManger != null)
                {
                    if (locationStatusEnum == LocationStatusEnum.Free) //如果起点完成就给货位赋值托盘号
                    Dt_StationManger stationManger = _stationMangerService.Repository.QueryFirst(x => x.StationCode == locationCode);
                    if (stationManger != null)
                    {
                        stationManger.IsOccupied = LocationStatusEnum.Lock.ObjToInt();
                        if (locationStatusEnum == LocationStatusEnum.Free) //如果起点完成就给货位赋值托盘号
                        {
                            stationManger.Remark = "";
                            stationManger.IsOccupied = LocationStatusEnum.Free.ObjToInt();
                        }
                        else
                        {
                            stationManger.Remark = palletCode;
                            stationManger.IsOccupied = LocationStatusEnum.Lock.ObjToInt();
                        }
                        _stationMangerService.UpdateData(stationManger);
                    }
                    else
                    {
                        stationManger.IsOccupied = LocationStatusEnum.Free.ObjToInt();
                    }
                    _stationMangerService.UpdateData(stationManger);
                }
                return WebResponseContent.Instance.OK();
            }