From 257d09aff7ec7b858b037607869d23ec61ac75bc Mon Sep 17 00:00:00 2001
From: helongyang <647556386@qq.com>
Date: 星期二, 19 八月 2025 09:03:49 +0800
Subject: [PATCH] 1
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs | 68 +++++++++++++++++++---------------
1 files changed, 38 insertions(+), 30 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs"
index bb8941d..dc24b96 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs"
@@ -46,22 +46,22 @@
{
var task = _taskRepository.QueryFirst(x => secureApplyModel.TaskCode == x.AgvTaskNum);
if (task == null) throw new Exception("鏈壘鍒颁换鍔�");
- if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
- {
- var content = TakeRequest(task.CurrentAddress);
- //if (!content.Status)
- //{
- // throw new Exception(content.Message);
- //}
- }
- else
- {
- var content = PutRequest(task.NextAddress, task.PalletType);
- //if (!content.Status)
- //{
- // throw new Exception(content.Message);
- //}
- }
+ //if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
+ //{
+ // var content = TakeRequest(task.CurrentAddress);
+ // //if (!content.Status)
+ // //{
+ // // throw new Exception(content.Message);
+ // //}
+ //}
+ //else
+ //{
+ // var content = PutRequest(task.NextAddress, task.PalletType);
+ // //if (!content.Status)
+ // //{
+ // // throw new Exception(content.Message);
+ // //}
+ //}
task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt();
var up = _taskRepository.UpdateData(task);
agvResponseContent.Code = up ? "0" : "1";
@@ -98,7 +98,12 @@
if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
{
var content = TakeFinish(task.CurrentAddress);
- if (!content.Status) throw new Exception(content.Message);
+ if (!content.Status)
+ {
+ task.TaskState = TaskStatusEnum.AGV_TakeError.ObjToInt();
+ _taskRepository.UpdateData(task);
+ throw new Exception(content.Message);
+ }
task.TaskState = TaskStatusEnum.AGV_Finish.ObjToInt();
var up = _taskRepository.DeleteAndMoveIntoHty(task, OperateTypeEnum.鑷姩瀹屾垚);
_taskService.TaskCompleted(task.TaskNum);
@@ -109,16 +114,16 @@
break;
case "getSafetySignal"://瀹夊叏淇″彿鐢宠
{
- if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
- {
- var content = TakeRequest(task.CurrentAddress);
- //if (!content.Status) throw new Exception(content.Message);
- }
- else
- {
- var content = PutRequest(task.NextAddress, task.PalletType);
- //if (!content.Status) throw new Exception(content.Message);
- }
+ //if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
+ //{
+ // var content = TakeRequest(task.CurrentAddress);
+ // //if (!content.Status) throw new Exception(content.Message);
+ //}
+ //else
+ //{
+ // var content = PutRequest(task.NextAddress, task.PalletType);
+ // //if (!content.Status) throw new Exception(content.Message);
+ //}
task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt();
var up = _taskRepository.UpdateData(task);
agvResponseContent.Code = up ? "0" : "1";
@@ -129,7 +134,12 @@
if (task.TaskType != TaskTypeEnum.Outbound.ObjToInt())
{
var content = PutFinish(task.NextAddress);
- if (!content.Status) throw new Exception(content.Message);
+ if (!content.Status)
+ {
+ task.TaskState = TaskStatusEnum.AGV_PutError.ObjToInt();
+ _taskRepository.UpdateData(task);
+ throw new Exception(content.Message);
+ }
Dt_StationManger dt_Station = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == task.NextAddress);
if (dt_Station == null)
{
@@ -239,8 +249,6 @@
OtherDevice otherDevice = (OtherDevice)device;
otherDevice.SetValue(GroundStationDBName.W_PutFinish, true, stationManger.StationCode);
- Thread.Sleep(1000);
- otherDevice.SetValue(GroundStationDBName.W_PutFinish, false, stationManger.StationCode);
return WebResponseContent.Instance.OK();
}
catch (Exception ex)
--
Gitblit v1.9.3