| | |
| | | private Dictionary<string, OrderByType> _taskOrderBy = new() |
| | | { |
| | | {nameof(Dt_Task.Grade),OrderByType.Desc }, |
| | | {nameof(Dt_Task.CreateDate),OrderByType.Asc}, |
| | | {nameof(Dt_Task.TaskNum),OrderByType.Asc}, |
| | | }; |
| | | |
| | | public Dictionary<string, OrderByType> TaskOrderBy { get { return _taskOrderBy; } set { _taskOrderBy = value; } } |
| | |
| | | task.CurrentAddress = item.SourceAddress; |
| | | task.NextAddress = routers.FirstOrDefault().ChildPosi; |
| | | } |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | { |
| | | task.TaskState = item.SourceIsPickPlace ? TaskRelocationStatusEnum.CarSource_Finish.ObjToInt() : TaskRelocationStatusEnum.RelocationNew.ObjToInt(); |
| | | } |
| | | tasks.Add(task); |
| | | } |
| | |
| | | return BaseDal.QueryFirst(x => x.Roadway == deviceNo && TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.Line_InFinish && !string.IsNullOrEmpty(x.NextAddress) && x.CurrentAddress == currentAddress, TaskOrderBy); |
| | | } |
| | | |
| | | public Dt_Task QueryCarOutFinish() |
| | | { |
| | | Dt_Task? _Task = BaseDal.QueryFirst(x => TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.Car_OutFinish, TaskOrderBy); |
| | | return _Task; |
| | | } |
| | | /// <summary> |
| | | /// æ ¹æ®è®¾å¤ç¼å·ãå½åå°åæç
§ä¼å
级以åå建æ¶é´æåºæ¥è¯¢ä»»å¡æ± åºåºç±»åçæ°å¢çä»»å¡ |
| | | /// </summary> |
| | |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ä»»å¡ä¿¡æ¯,ä»»å¡å·:ã{taskNum}ã"); |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | task.TaskState = (int)TaskOutStatusEnum.OutPending; |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) |
| | | { |
| | | task.TaskState = (int)TaskInStatusEnum.InPending; |
| | | } |
| | | //if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | //{ |
| | | // task.TaskState = (int)TaskOutStatusEnum.OutPending; |
| | | //} |
| | | //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) |
| | | //{ |
| | | // task.TaskState = (int)TaskInStatusEnum.InPending; |
| | | //} |
| | | task.ExceptionMessage = message; |
| | | task.ModifyDate = DateTime.Now; |
| | | BaseDal.UpdateData(task); |
| | |
| | | } |
| | | else if (task.TaskType == TaskOtherTypeEnum.RelocationCarCharging.ObjToInt()) |
| | | { |
| | | if (task.TaskState >= (int)CarChargingTaskEnum.RelocationCarFinish) |
| | | if (task.TaskState >= (int)CarChargingTaskEnum.CarChargingFinish) |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"该任å¡ç¶æä¸å¯è·³è½¬å°ä¸ä¸æ¥,ä»»å¡å·:ã{task.TaskNum}ã,ä»»å¡ç¶æ:ã{task.TaskState}ã"); |
| | | } |
| | |
| | | /// <param name="TaskState"></param> |
| | | /// <param name="TaskType"></param> |
| | | /// <returns></returns> |
| | | public Dt_Task GetTaskState(int TaskState, int TaskType) |
| | | public Dt_Task? GetTaskState(int TaskState, int TaskType) |
| | | { |
| | | Dt_Task task = null; |
| | | Dt_Task? task = null; |
| | | if (TaskState > 0 && TaskType > 0) |
| | | task = BaseDal.QueryFirst(x => x.TaskState == TaskState && x.TaskType == TaskType); |
| | | else if (TaskState > 0) |
| | |
| | | { |
| | | if (!string.IsNullOrEmpty(SourceAddress) && SourceAddress != "") |
| | | { |
| | | Dt_Task? task = BaseDal.QueryFirst(x => x.SourceAddress == SourceAddress && x.TaskType == TaskOtherTypeEnum.RelocationCar.ObjToInt()); |
| | | Dt_Task? task = BaseDal.QueryFirst(x => x.SourceAddress == SourceAddress && |
| | | x.ShuttleCarCode == ShuttleCarCode && |
| | | (x.TaskType == TaskOtherTypeEnum.RelocationCar.ObjToInt() || |
| | | x.TaskType == TaskOtherTypeEnum.RelocationCarCharging.ObjToInt())); |
| | | if (task != null) return; |
| | | } |
| | | if (!string.IsNullOrEmpty(TargetAddress) && TargetAddress != "") |
| | | { |
| | | Dt_Task? task = BaseDal.QueryFirst(x => x.TargetAddress == TargetAddress && x.TaskType == TaskOtherTypeEnum.RelocationCar.ObjToInt()); |
| | | Dt_Task? task = BaseDal.QueryFirst(x => x.TargetAddress == TargetAddress && |
| | | (x.TaskType == TaskOtherTypeEnum.RelocationCar.ObjToInt() || |
| | | x.TaskType == TaskOtherTypeEnum.RelocationCarCharging.ObjToInt())); |
| | | if (task != null) return; |
| | | } |
| | | #region å建å åæºç§»è½¦ä»»å¡ |
| | |
| | | NextAddress = TargetAddress, |
| | | CreateDate = DateTime.Now, |
| | | Creater = "WCS", |
| | | TaskState = string.IsNullOrEmpty(remark) ? (int)TaskCarStatusEnum.CarNew : (int)CarChargingTaskEnum.CarNew, |
| | | TaskState = string.IsNullOrEmpty(remark) ? (int)TaskCarStatusEnum.CarNew : (int)CarChargingTaskEnum.CarChargingNew, |
| | | ShuttleCarCode = ShuttleCarCode, |
| | | WMSId = 0, |
| | | Remark = remark |
| | | }; |
| | | if (SourceAddress == TargetAddress) dt_Task.TaskState = (int)CarChargingTaskEnum.SC_CarFinish; |
| | | if (SourceAddress == TargetAddress) dt_Task.TaskState = (int)CarChargingTaskEnum.CarChargingSC_CarFinish; |
| | | AddData(dt_Task); |
| | | #endregion |
| | | } |