From ceb8c334e8ca10d569b4c7f72b74126ce1877e48 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期二, 07 一月 2025 21:51:51 +0800 Subject: [PATCH] 添加辅料仓功能,优化测试架仓代码 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/InvokeAGVService.cs | 25 ++++++++++++++----------- 1 files changed, 14 insertions(+), 11 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 18b5cc0..5fa9778 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,6 +6,7 @@ using System.Threading.Tasks; using WIDESEA_DTO.Agv; using WIDESEAWCS_Common.APIEnum; +using WIDESEAWCS_Common.TaskEnum; using WIDESEAWCS_Core; using WIDESEAWCS_Core.Helper; @@ -18,17 +19,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") + if (agvContent.Code == "0") { - content.OK(agvContent.Message); + content.OK(data: agvContent.Data); } else { @@ -46,23 +49,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,13 +82,12 @@ return content; } /// <summary> - /// AGV浠诲姟鐘舵�佸埛鏂� + /// AGV浠诲姟鐘舵�佸埛鏂�/AGV浠诲姟瀹屾垚 /// </summary> /// <param name="agvUpdateModel"></param> /// <returns></returns> public AgvResponseContent AgvUpdateTask(AgvUpdateDTO agvUpdateModel) { - return new AgvResponseContent(); } } -- Gitblit v1.9.3