From 7f078e66be9959d94fc78344f195b7b4656812be Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期日, 29 十二月 2024 11:22:10 +0800
Subject: [PATCH] 任务表添加AGV任务号(AGV-年月日+任务号),修改测试架仓AGV交互逻辑
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AgvUpdateDTO.cs | 4 ++--
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGVExtend.cs | 8 ++++----
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs | 22 ++++++++++++++++++++--
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 2 +-
4 files changed, 27 insertions(+), 9 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AgvUpdateDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AgvUpdateDTO.cs"
index 4c8f9d0..98307d4 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AgvUpdateDTO.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AgvUpdateDTO.cs"
@@ -19,11 +19,11 @@
/// <summary>
/// 浣嶇疆X鍧愭爣 浠诲姟瀹屾垚鏃舵湁鍊�
/// </summary>
- public int CooX { get; set; }
+ public double CooX { get; set; }
/// <summary>
/// 浣嶇疆Y鍧愭爣 浠诲姟瀹屾垚鏃舵湁鍊�
/// </summary>
- public int CooY { get; set; }
+ public double CooY { get; set; }
/// <summary>
/// 褰撳墠浣嶇疆缂栧彿<br/>
/// 浠诲姟寮�濮嬶細璇ヤ綅缃负浠诲姟璧风偣<br/>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs"
index 9b15909..b4abb72 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs"
@@ -85,8 +85,8 @@
{
if (agvUpdateModel == null) throw new Exception("鏈幏鍙栧埌璇锋眰鍙傛暟");
agvResponseContent.ReqCode = agvUpdateModel.ReqCode;
- var task = _taskRepository.QueryFirst(x => agvUpdateModel.TaskCode.ObjToInt() == x.TaskNum);
- if (task == null) throw new Exception("鏈壘鍒颁换鍔�");
+ var task = _taskRepository.QueryFirst(x => agvUpdateModel.TaskCode == x.AgvTaskNum);
+ if (task == null) throw new Exception($"鏈壘鍒颁换鍔�,浠诲姟鍙枫�恵agvUpdateModel.TaskCode}銆�");
switch (agvUpdateModel.Method)
{
case "start":
@@ -104,6 +104,24 @@
return agvResponseContent;
}
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);
+ }
+ task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt();
+ var up = _taskRepository.UpdateData(task);
+ agvResponseContent.Code = up ? "0" : "1";
+ agvResponseContent.Message = up ? "鎴愬姛" : "澶辫触";
+ return agvResponseContent;
+ }
case "end"://鍏ュ簱鏍规嵁杩欎釜淇″彿鍒ゆ柇鏀捐揣瀹屾垚
if (task.TaskType != TaskTypeEnum.Outbound.ObjToInt())
{
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index 8a359ad..f218473 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -161,7 +161,7 @@
if (string.IsNullOrEmpty(item.AGVArea))
{
- task.AgvTaskNum = "AGV-" + item.TaskNum;
+ task.AgvTaskNum = "AGV-" + DateTime.Now.ToString("YYMMDD") + item.TaskNum;
Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress || x.StackerCraneCode == item.RoadWay);
if (stationManger == null)
{
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGVExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGVExtend.cs"
index 5c19b97..42a710a 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGVExtend.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGVExtend.cs"
@@ -40,14 +40,14 @@
positionCode=agvTask.NextAddress
}
},
- TaskCode = agvTask.TaskNum.ToString(),
- PodTyp = agvTask.PalletType == 1 ? "XX" : "DD",
+ TaskCode = agvTask.AgvTaskNum,
+ PodTyp = agvTask.PalletType < 3 ? "XX" : "DD",
};
WebResponseContent content = _taskService.AgvSendTask(taskDTO);
if (content.Status)
{
agvTask.TaskState = TaskStatusEnum.AGV_Executing.ObjToInt();
- agvTask.Remark = content.Data.ObjToString();
+ //agvTask.Remark = content.Data.ObjToString();
}
else
{
@@ -76,7 +76,7 @@
AgvSecureReplyDTO replyDTO = new AgvSecureReplyDTO()
{
ReqCode = Guid.NewGuid().ToString().Replace("-", ""), //WaitToTask.TaskNum.ToString(),
- taskCode = WaitToTask.Remark,
+ taskCode = WaitToTask.AgvTaskNum,
};
WebResponseContent content = _taskService.AgvSecureReply(replyDTO);
if (content.Status)
--
Gitblit v1.9.3