From 695571c6009ecbc12e7d4a4fb147df7967a1260e Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 07 七月 2025 20:21:19 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/InvokeAGVService.cs | 134 ++++++++++++++++++++++++++++++++++++++++----
1 files changed, 122 insertions(+), 12 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/InvokeAGVService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/InvokeAGVService.cs"
index fa13d12..a8e082b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/InvokeAGVService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/InvokeAGVService.cs"
@@ -6,8 +6,10 @@
using System.Threading.Tasks;
using WIDESEA_DTO.Agv;
using WIDESEAWCS_Common.APIEnum;
+using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_DTO.Agv;
namespace WIDESEAWCS_TaskInfoService
{
@@ -18,17 +20,19 @@
/// </summary>
/// <param name="taskModel"></param>
/// <returns></returns>
- public WebResponseContent AgvSendTask(AgvTaskDTO taskModel)
+ public WebResponseContent AgvSendTask(AgvTaskDTO taskModel, APIEnum SendTask = APIEnum.Agv_CSJSendTask)
{
WebResponseContent content = new WebResponseContent();
try
{
- string apiAddress = AppSettings.Get(APIEnum.AgvSendTask.ToString());
+ string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == SendTask.ToString())?.ApiAddress;
+ if (string.IsNullOrEmpty(apiAddress))
+ return WebResponseContent.Instance.Error($"鏈壘鍒板彂閫丄GV浠诲姟鎺ュ彛,璇锋鏌ユ帴鍙i厤缃�");
string response = HttpHelper.Post(apiAddress, taskModel.Serialize());
- AgvResponseContent agvContent= response.DeserializeObject<AgvResponseContent>();
- if (agvContent.Code=="200")
+ AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
+ if (agvContent.Code == "0")
{
- content.OK(agvContent.Message);
+ content.OK(data: agvContent.Data);
}
else
{
@@ -46,23 +50,24 @@
/// </summary>
public AgvResponseContent AgvSecureApply(AgvSecureApplyDTO secureApplyModel)
{
-
return new AgvResponseContent();
}
/// <summary>
- /// 瀹夊叏淇″彿鍥炲 WCS-AGV
+ /// 瀹夊叏淇″彿鍥炲 WCS-AGV //AGV浠诲姟缁х画鎵ц
/// </summary>
/// <param name="secureModel"></param>
/// <returns></returns>
- public WebResponseContent AgvSecureReply(AgvSecureReplyDTO secureReplyModel)
+ public WebResponseContent AgvSecureReply(AgvSecureReplyDTO secureReplyModel, APIEnum SecureReply = APIEnum.Agv_CSJSecureReply)
{
WebResponseContent content = new WebResponseContent();
try
{
- string apiAddress = AppSettings.Get(APIEnum.AgvSecureReply.ToString());
+ string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == SecureReply.ToString())?.ApiAddress;
+ if (string.IsNullOrEmpty(apiAddress))
+ return WebResponseContent.Instance.Error($"鏈壘鍒板彂閫丄GV浠诲姟鎺ュ彛,璇锋鏌ユ帴鍙i厤缃�");
string response = HttpHelper.Post(apiAddress, secureReplyModel.Serialize());
AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
- if (agvContent.Code == "200")
+ if (agvContent.Code == "0")
{
content.OK(agvContent.Message);
}
@@ -78,14 +83,119 @@
return content;
}
/// <summary>
- /// AGV浠诲姟鐘舵�佸埛鏂�
+ /// CTU鍙栨秷浠诲姟
+ /// </summary>
+ public WebResponseContent AgvBoxApplyPass(AgvCTUCancelDTO applyPassDTO, APIEnum SecureReply = APIEnum.AGV_CTUCancelTask)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == SecureReply.ToString())?.ApiAddress;
+ if (string.IsNullOrEmpty(apiAddress))
+ return WebResponseContent.Instance.Error($"鏈壘鍒癆GV鍙栨秷浠诲姟鎺ュ彛,璇锋鏌ユ帴鍙i厤缃�");
+ string response = HttpHelper.Post(apiAddress, applyPassDTO.Serialize());
+ AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
+ if (agvContent.Code == "0")
+ {
+ content.OK(agvContent.Message);
+ }
+ else
+ {
+ content.Error(agvContent.Message);
+ }
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
+ }
+ /// <summary>
+ /// AGV鎴愬搧鍙栨斁璐ч�氱煡
+ /// </summary>
+ public WebResponseContent AgvBoxApplyPass(AGVBoxApplyPassDTO applyPassDTO, APIEnum SecureReply = APIEnum.AGV_CPBoxApplyPass)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == SecureReply.ToString())?.ApiAddress;
+ if (string.IsNullOrEmpty(apiAddress))
+ return WebResponseContent.Instance.Error($"鏈壘鍒板彂閫丄GV浠诲姟鎺ュ彛,璇锋鏌ユ帴鍙i厤缃�");
+ string response = HttpHelper.Post(apiAddress, applyPassDTO.Serialize());
+ AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
+ if (agvContent.Code == "0")
+ {
+ content.OK(agvContent.Message);
+ }
+ else
+ {
+ content.Error(agvContent.Message);
+ }
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
+ }
+ public WebResponseContent AgvPreScheduleTask(AgvScheduleTaskDTO scheduleTaskDTO, APIEnum ScheduleTask = APIEnum.AGV_CTUScheduleTaskTask)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == ScheduleTask.ToString())?.ApiAddress;
+ if (string.IsNullOrEmpty(apiAddress))
+ return WebResponseContent.Instance.Error($"鏈壘鍒板彂閫丄GV浠诲姟鎺ュ彛,璇锋鏌ユ帴鍙i厤缃�");
+ string response = HttpHelper.Post(apiAddress, scheduleTaskDTO.Serialize());
+ AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
+ if (agvContent.Code == "0")
+ {
+ content.OK(agvContent.Message);
+ }
+ else
+ {
+ content.Error(agvContent.Message);
+ }
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
+ }
+ /// <summary>
+ /// AGV浠诲姟鐘舵�佸埛鏂�/AGV浠诲姟瀹屾垚
/// </summary>
/// <param name="agvUpdateModel"></param>
/// <returns></returns>
public AgvResponseContent AgvUpdateTask(AgvUpdateDTO agvUpdateModel)
{
-
return new AgvResponseContent();
}
+ public WebResponseContent AgvPodBerthAndMat(AgvPodBerthAndMatDTO agvPodModel, APIEnum PodBerthAndMat = APIEnum.Agv_CSJPodBerthAndMat)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == PodBerthAndMat.ToString())?.ApiAddress;
+ if (string.IsNullOrEmpty(apiAddress))
+ return WebResponseContent.Instance.Error($"鏈壘鍒板彂閫丄GV浠诲姟鎺ュ彛,璇锋鏌ユ帴鍙i厤缃�");
+ string response = HttpHelper.Post(apiAddress, agvPodModel.Serialize());
+ AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
+ if (agvContent.Code == "1")
+ {
+ content.OK(agvContent.Message);
+ }
+ else
+ {
+ content.Error(agvContent.Message);
+ }
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
+ }
}
}
--
Gitblit v1.9.3