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/ZH_AGVController.cs | 93 ++++++++++++++++++++++++++++++++--------------
1 files changed, 65 insertions(+), 28 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs"
index a6305aa..b31fc0e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_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";
@@ -101,7 +101,12 @@
if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
{
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);
@@ -112,16 +117,16 @@
break;
case "getSafetySignal"://瀹夊叏淇″彿鐢宠
{
- if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
- {
- 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.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
+ //{
+ // 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";
@@ -132,7 +137,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)
{
@@ -334,5 +344,32 @@
return WebResponseContent.Instance.Error(ex.Message);
}
}
+
+ //闃荤剨浠撳嚭搴撲换鍔$┖鍌ㄤ綅寮傚父鎵嬪姩閲嶅彂AGV浠诲姟
+ [HttpPost, HttpGet,Route("AgvZHTaskResend"),AllowAnonymous]
+ public WebResponseContent AgvZHTaskResend(int taskNum)
+ {
+ try
+ {
+ Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == taskNum);
+ if (task == null)
+ {
+ return WebResponseContent.Instance.Error("鏈壘鍒扮浉鍏充换鍔′俊鎭�");
+ }
+ if (task.TaskState == TaskStatusEnum.Exception.ObjToInt() && task.DeviceCode == "AGV_ZH")
+ {
+ _taskService.UpdateTask(task, TaskStatusEnum.AGV_Execute);
+ }
+ else
+ {
+ return WebResponseContent.Instance.Error("浠诲姟璁惧缂栧彿涓嶆纭垨浠诲姟鐘舵�侀潪绌哄偍浣嶅紓甯�");
+ }
+ return WebResponseContent.Instance.OK();
+ }
+ catch(Exception ex)
+ {
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
+ }
}
}
--
Gitblit v1.9.3