From 6d2faa6e299bdfe545ee339269e64f2900229147 Mon Sep 17 00:00:00 2001
From: kazelee <1847801760@qq.com>
Date: 星期三, 16 七月 2025 17:29:26 +0800
Subject: [PATCH] 添加AGV实时状态反馈接口、看板获取AGV状态接口

---
 api/AgvController.cs |   56 +++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 43 insertions(+), 13 deletions(-)

diff --git a/api/AgvController.cs b/api/AgvController.cs
index 653838f..62bd5cd 100644
--- a/api/AgvController.cs
+++ b/api/AgvController.cs
@@ -1,18 +1,23 @@
-锘縰sing HH.WCS.Mobox3.AnGang.core;
-using HH.WCS.Mobox3.AnGang.dispatch;
-using HH.WCS.Mobox3.AnGang.process;
-using HH.WCS.Mobox3.AnGang.wms;
-using Newtonsoft.Json;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Web.Http;
-using static HH.WCS.Mobox3.AnGang.dispatch.NDC;
+锘縰sing System.Collections.Generic;
 using System.Linq;
-using HH.WCS.Mobox3.AnGang.util;
-
-using static HH.WCS.Mobox3.AnGang.api.ApiModel;
+using System.Net;
+using System.Reflection;
 using System.Text;
 using System.Web;
+using System.Web.Http;
+
+using HH.WCS.Mobox3.AnGang.core;
+using HH.WCS.Mobox3.AnGang.dispatch;
+using HH.WCS.Mobox3.AnGang.process;
+using HH.WCS.Mobox3.AnGang.util;
+using HH.WCS.Mobox3.AnGang.wms;
+
+using NetSDKCS;
+
+using Newtonsoft.Json;
+
+using static HH.WCS.Mobox3.AnGang.api.ApiModel;
+using static HH.WCS.Mobox3.AnGang.dispatch.NDC;
 
 namespace HH.WCS.Mobox3.AnGang.api
 {
@@ -33,7 +38,30 @@
             //LogRequestHeaders();
             return GZRobot.orderStatusReport(model);
         }
-        
+
+        [HttpPost]
+        [Route("agvRealtimeStateReport")]
+        public IHttpActionResult agvRealtimeStateReport(agvRealtimeStateReportInfo model) {
+            LogHelper.Info("agvRealtimeStateReport锛歊CS鍥借嚜AGV瀹炴椂鐘舵�鍥炴姤锛� + JsonConvert.SerializeObject(model), "HosttoagvTask");
+
+            var res = WCSCore.agvRealtimeStateReport(model);
+            //if (res == "offline") {
+            //    //return NotFound(new EmptyGzResult());
+            //    return NotFound();
+            //}
+            //else {
+            //    //return Ok(new EmptyGzResult());
+            //    return Ok();
+            //}
+            if (model == null) return NotFound();
+            if (string.IsNullOrEmpty(res)) {
+                return BadRequest();
+            }
+            else {
+                return Ok();
+            }
+        }
+
         /// <summary>
         /// AGV 涓庝骇绾胯繘琛屽畨鍏ㄤ氦浜�         /// </summary>
@@ -45,6 +73,8 @@
             return WCSCore.SafetyInteraction(model);
         }
 
+        // 鎼佺疆涓嶄娇鐢紝瀛樺湪bug锛欻ttpContext.Current.Request璧嬪�鍓嶅紩鐢紝搴旇鏄疌urrent涓簄ull瀵艰嚧鐨�+
         private void LogRequestHeaders() {
             var request = HttpContext.Current.Request;
             var logMessage = new StringBuilder();

--
Gitblit v1.9.1