From a93b0e99036c24b9bd58c79bf5e7364b1ba28bae Mon Sep 17 00:00:00 2001
From: 杨前锦 <1010338399@qq.com>
Date: 星期二, 01 七月 2025 16:02:33 +0800
Subject: [PATCH] 福建佳通-流程优化

---
 HH.WCS.Mobox3/HH.WCS.Mobox3.FJJT/api/WmsController.cs |   67 +++++++++++++++++++++++++--------
 1 files changed, 51 insertions(+), 16 deletions(-)

diff --git a/HH.WCS.Mobox3/HH.WCS.Mobox3.FJJT/api/WmsController.cs b/HH.WCS.Mobox3/HH.WCS.Mobox3.FJJT/api/WmsController.cs
index 6f1ff5e..0ef3414 100644
--- a/HH.WCS.Mobox3/HH.WCS.Mobox3.FJJT/api/WmsController.cs
+++ b/HH.WCS.Mobox3/HH.WCS.Mobox3.FJJT/api/WmsController.cs
@@ -18,9 +18,7 @@
     {
         /// <summary>
         /// 1.绌哄伐瑁呭嚭搴�-        /// 涓氬姟鍦烘櫙锛�-        /// 1.鐩磋繛娴佺▼鍒濆鍖栵紝琛ュ厖绌哄伐瑁�-        /// 2.闈炵洿杩炴祦绋嬶紝鍥哄畾绔欏彴鑷姩琛ュ厖绌哄伐瑁�+        /// 涓氬姟鍦烘櫙锛氱洿杩炴祦绋嬪垵濮嬪寲锛岃ˉ鍏呯紦瀛樹綅鐨勭┖宸ヨ
         /// </summary>
         /// <param name="model"></param>
         /// <returns></returns>
@@ -36,7 +34,7 @@
             }
             catch (BusinessException be)
             {
-                responseResult.code = 501;
+                responseResult.code = 201;
                 responseResult.msg = be.Message;
             }
             catch (Exception ex) 
@@ -45,7 +43,6 @@
                 responseResult.msg = $"WMS鍐呴儴閿欒锛岃鑱旂郴寮�彂浜哄憳澶勭悊";
                 WMSHelper.addAlarmRecord("绯荤粺閿欒", "楂�, $"WMS鍐呴儴閿欒: 绌哄伐瑁呭嚭搴撻敊璇紝閿欒鍘熷洜锛歿ex.Message}");
             }
-            
             LogHelper.Info("emptyPalletOutStock 鍑哄弬锛� + JsonConvert.SerializeObject(responseResult), "WMS");
             return responseResult;
         }
@@ -65,25 +62,25 @@
             ResponseResult responseResult = new ResponseResult();
             try
             {
-                if (model.signalType == 1)  // 鐗╂枡涓嬬嚎鍏ュ簱璇锋眰
+                if (model.signalType == 1)  // 姝e父鐗╂枡涓嬬嚎鍏ュ簱璇锋眰
                 {
-                    OffLineRequest request = new OffLineRequest() { loc = model.loc, cntrNo = model.cntrNo, jtNo = model.deviceNo };
+                    OffLineRequest request = new OffLineRequest() { loc = model.loc, cntrNo = model.cntrNo, jtNo = model.deviceNo, isNormal = true};
                     responseResult = ApiHelper.offLineProcess(request);
                 }
                 else if (model.signalType == 3)  // 璇荤爜鍏ュ簱璇锋眰
                 {
-                    ReadCodeRequest request = new ReadCodeRequest() { loc = model.loc, cntrNo = model.cntrNo };
+                    ReadCodeRequest request = new ReadCodeRequest() { loc = model.loc, cntrNo = model.cntrNo ,taskNo = model.taskNo };
                     responseResult = ApiHelper.readCodeProcess(request);
                 }
                 else if (model.signalType == 5)  // 寮傚父宸ヨ鍏ュ簱璇锋眰
                 {
-                    OffLineRequest request = new OffLineRequest() { loc = model.loc, cntrNo = model.cntrNo, jtNo = model.deviceNo };
+                    OffLineRequest request = new OffLineRequest() { loc = model.loc, cntrNo = model.cntrNo, jtNo = model.deviceNo , isNormal = false};
                     responseResult = ApiHelper.offLineProcess(request);
                 }
             }
             catch (BusinessException be)
             {
-                responseResult.code = 501;
+                responseResult.code = 201;
                 responseResult.msg = be.Message;
             }
             catch (Exception ex)
@@ -162,7 +159,7 @@
         /// <param name="model"></param>
         /// <returns></returns>
         [HttpPost]
-      /*  [Route("notifyAlarm")]*/
+        /*  [Route("notifyAlarm")]  */
         public ResponseResult unBindingLoc(LocModel model)
         {
             LogHelper.Info("UnBindingLoc 鍏ュ弬锛� + JsonConvert.SerializeObject(model), "WMS");
@@ -199,11 +196,7 @@
         {
             LogHelper.Info("switchStationAttribute 鍏ュ弬锛� + JsonConvert.SerializeObject(model), "WMS");
             ResponseResult result = new ResponseResult();
-            var bo = ApiHelper.switchStationAttribute(model);
-            if (!bo) 
-            {
-                result.code = 201;
-            }
+            result = ApiHelper.switchStationAttribute(model);
             LogHelper.Info("switchStationAttribute 鍑哄弬锛� + JsonConvert.SerializeObject(result), "WMS");
             return result;
         }
@@ -228,8 +221,46 @@
             return result;
         }
 
+
+        //--------------------------------- 鎻愪緵缁欐枩瑁佺殑鎺ュ彛 --------------------------------
+
+        /// <summary>
+        /// 9.鏂滆鍑哄簱浠诲姟
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        /* [Route("notifyAlarm")]*/
+        public ResponseResult createXcItemOutStockTask(XcItemOutStockModel model)
+        {
+            LogHelper.Info("XcItemOutStock 鍏ュ弬锛� + JsonConvert.SerializeObject(model), "WMS");
+            ResponseResult result = new ResponseResult();
+            result = ApiHelper.createXcItemOutStockTask(model);
+            LogHelper.Info("XcItemOutStock 鍑哄弬锛� + JsonConvert.SerializeObject(result), "WMS");
+            return result;
+        }
+
+        public class XcItemOutStockModel 
+        {
+            public string reqId { get; set; }
+            public string reqTime { get; set; }
+            public string startLoc { get; set; }
+            public string eqNo { get; set; }  // 璁惧鍙�+            public string palletId { get; set; }  // 鎵樼洏鍙�+            /*public string lotName { get; set; }  // 鎵规鏉$爜
+            public string yclBatch { get; set; }  // 鍘熸潗鏂欐壒娆″彿
+            public string materialCode { get; set; }  // 鐗╂枡缂栫爜
+            public float qty { get; set; }  // 鐗╂枡鏁伴噺
+            public string productionDate { get; set; }  // 鐢熶骇鏃ユ湡锛坹yyy-MM-dd HH:mm:ss锛�+            public string qcStatus { get; set; }  // 妫�獙鐘舵� 0锛氭湭妫�獙 1锛氬悎鏍硷紝2锛氫笉鍚堟牸
+            public string shelfLifeDate { get; set; }  // 鏈�暱鍋滄斁鏃ユ湡
+            public string minShelfLife_Date { get; set; }  // 鏈�皬鍋滄斁鏃ユ湡*/
+        }
+
         public class LocStateFeedBackModel 
         {
+            public string reqId { get; set; }
+            public string reqTime { get; set; }
             public string loc_code { get; set; } // 绔欏彴缂栫爜
             public string type { get; set; } // 璇锋眰绫诲瀷 1 鍏佽鍙栬揣 2 鍏佽鏀捐揣
             public string req_no { get; set; } // 绔欏彴缂栫爜
@@ -237,6 +268,8 @@
 
         public class SwitchStationAttributeModel
         {
+            public string reqId { get; set; }
+            public string reqTime { get; set; }
             public string locCode { get; set; } // 绔欏彴缂栫爜
             public string signalType { get; set; } // 1.agv涓婃枡妯″紡 2.浜哄伐妯″紡
         }
@@ -249,6 +282,8 @@
 
         public class OutStockModel
         {
+            public string reqId { get; set; }
+            public string reqTime { get; set; }
             public string endLocCode { get; set; }
         }
     }

--
Gitblit v1.9.1