From 41a5531dc31a642623f0a7a766fbe9c256ba9247 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期二, 11 二月 2025 13:53:29 +0800
Subject: [PATCH] 优化WMS前端
---
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs | 115 +--------------------------------------------------------
1 files changed, 2 insertions(+), 113 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs"
index 3033440..b05ad95 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs"
@@ -75,77 +75,13 @@
#endregion
#region 鑾峰彇鍫嗗灈鏈虹Щ杞﹀畬鎴愪换鍔�
- Dt_Task dt_Task = GetTask((int)TaskCarStatusEnum.SC_CarFinish, (int)TaskOtherTypeEnum.RelocationCar);
- if (dt_Task != null)
- {
- var ShuttleCar = QueryCode(dt_Task.ShuttleCarCode);
- ShuttleCar.ShuttleCarPosition = dt_Task.TargetAddress;
- _shuttleCarService.UpdateData(ShuttleCar);
- if (string.IsNullOrEmpty(dt_Task.Remark))//瀹屾垚绉诲簱浠诲姟
- _taskService.AddTask_Hty(dt_Task, TaskOperateTypeEnum.AutoComplete.ToJson());
- else//涓嬪彂鍏呯數浠诲姟
- SendTask(dt_Task);
- }
+ GetSC_CarFinish();
#endregion
#region 鑾峰彇绉昏溅浠诲姟
- dt_Task = GetTask((int)TaskCarStatusEnum.CarNew, (int)TaskOtherTypeEnum.RelocationCar);//鑾峰彇鏂板缓绉昏溅浠诲姟
- if (dt_Task != null)
- {
- #region 鍒ゆ柇鏄惁瀛樺湪绌洪棽绌挎杞�,濡傞兘鍦ㄥ厖鐢�(閫夋嫨鐢甸噺楂樼殑骞惰秴杩�50%鐢甸噺鐨勭┛姊溅閫�鍑哄厖鐢�)
-
- #endregion
-
- if (string.IsNullOrEmpty(dt_Task.SourceAddress))
- {
- if (command.Status == (short)ShuttleCarStatus.Standby && command.TaskTypeComplete == (short)ShuttleCarTaskComplete.Standby && command.Err_Status == (short)ShuttleCarErr.Normal)
- {
- dt_Task.SourceAddress = QueryCode(shuttleCar._deviceCode).ShuttleCarPosition;
- dt_Task.CurrentAddress = dt_Task.SourceAddress;
- dt_Task.ShuttleCarCode = shuttleCar._deviceCode;
- _taskService.UpdateData(dt_Task);
- }
- }
- else if (string.IsNullOrEmpty(dt_Task.TargetAddress))
- {
- #region 鍚慦MS鐢宠
- WebResponseContent content = new WebResponseContent();
- var ResultData = HttpHelper.PostAsync(WMSInterfaceAddress.GetPosition + $"?position={dt_Task.SourceAddress}", "", headers: new Dictionary<string, string>());
- if (ResultData.Result != null)
- {
- content = JsonConvert.DeserializeObject<WebResponseContent>(ResultData.Result);
- if (content != null && content.Status)
- {
- dt_Task.TargetAddress = content.Message;
- dt_Task.NextAddress = dt_Task.TargetAddress;
- _taskService.UpdateData(dt_Task);
- }
- }
- #endregion
- }
- //绌挎杞︾Щ搴撲换鍔′笅鍙�
- if (!string.IsNullOrEmpty(dt_Task.SourceAddress) && !string.IsNullOrEmpty(dt_Task.TargetAddress) && !string.IsNullOrEmpty(dt_Task.ShuttleCarCode))
- {
- SendTask(dt_Task);
- }
- }
+ Get_CarTask(shuttleCar,command);
#endregion
- #region 绌挎杞﹀嚭鍏ュ簱浠诲姟
- else
- {
- var task = _taskService.QueryShuttleCarTask(shuttleCar.DeviceCode);
- if (task != null)
- {
- if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && !task.IsPickPlace)
- {
- var ShuttleCar = _shuttleCarService.QueryShuttleCar(task.SourceAddress);//鍑哄簱浠诲姟鍒ゆ柇鏄惁瀛樺湪绌挎杞�
- if (ShuttleCar != null) SendTask(task);
- else _taskService.AddRelocationCarTask("", task.SourceAddress);
- }
- }
- }
- #endregion
}
}
}
@@ -159,52 +95,5 @@
}
return Task.CompletedTask;
}
- private void SendTask(Dt_Task task)
- {
- ShuttleCar shuttleCar = Storage.Devices.FirstOrDefault(x => x.DeviceCode == task.ShuttleCarCode) as ShuttleCar;
- if (shuttleCar != null)
- {
- ShuttleCarTaskCommandR command = ReadCustomer<ShuttleCarTaskCommandR>(shuttleCar, shuttleCar.DeviceCode);//璇诲彇绌挎杞︿俊鎭�
- if (command != null && command.Status == (short)ShuttleCarStatus.Standby && command.TaskTypeComplete == (short)ShuttleCarTaskComplete.Standby && command.Err_Status == (short)ShuttleCarErr.Normal)
- {
- //浠诲姟杞崲
- ShuttleCarTaskCommandW shuttleCarTaskCommand = new ShuttleCarTaskCommandW();
- shuttleCarTaskCommand.Direction = command.Position;
- shuttleCarTaskCommand.TaskNum = task.TaskNum;
- if (task.TaskType == (int)TaskOtherTypeEnum.RelocationCar)//绉昏溅
- {
- if (task.TaskState == (int)TaskCarStatusEnum.CarNew)
- {
- if (task.Remark == ShuttleCarTaskType.ExitCharge.ToString()) shuttleCarTaskCommand.TaskType = (short)GetCarTaskType(task.Remark);
- else shuttleCarTaskCommand.TaskType = (short)GetCarTaskType(task.TaskType, shuttleCarTaskCommand.Direction);
- }
- else if (task.TaskState == (int)TaskCarStatusEnum.SC_CarFinish)
- {
- if (task.Remark == ShuttleCarTaskType.Charging.ToString()) shuttleCarTaskCommand.TaskType = (short)GetCarTaskType(task.Remark);
- else shuttleCarTaskCommand.TaskType = (short)GetCarTaskType(task.TaskType, shuttleCarTaskCommand.Direction);
- }
- }
- else
- shuttleCarTaskCommand.TaskType = (short)GetCarTaskType(task.TaskType, shuttleCarTaskCommand.Direction);
- //shuttleCarTaskCommand.TaskType = string.IsNullOrEmpty(task.Remark) ? (short)GetCarTaskType(task.TaskType, shuttleCarTaskCommand.Direction) : (short)GetCarTaskType(task.Remark);
- //浠诲姟涓嬪彂
- if (shuttleCarTaskCommand.TaskType != null)//0
- {
- if (shuttleCar.SendCommand(shuttleCarTaskCommand, shuttleCar.DeviceCode))
- {
- if (!string.IsNullOrEmpty(task.Remark)) task.Remark = task.Remark + "宸蹭笅鍙�";
- task.TaskState = GetTaskState(task.TaskType);
- _taskService.UpdateData(task);
- }
- }
- }
- }
- }
-
- ///涓嬪彂閫�鍑哄厖鐢典换鍔″苟鐢熸垚绉诲簱浠诲姟
- //if (command.ElectricQuantity > 50)
- //{
-
- //}
}
}
--
Gitblit v1.9.3