From 79e04c3c2125ab860670f05b0f73ca9cc4168c0f Mon Sep 17 00:00:00 2001 From: kazelee <1847801760@qq.com> Date: 星期一, 23 六月 2025 17:16:31 +0800 Subject: [PATCH] 优化产品入库逻辑,修复货位绑定和货品明细重复的问题 --- dispatch/GZRobot.cs | 36 ++++++++++++++++++++++++++++++------ 1 files changed, 30 insertions(+), 6 deletions(-) diff --git a/dispatch/GZRobot.cs b/dispatch/GZRobot.cs index 213e3d5..c4ee859 100644 --- a/dispatch/GZRobot.cs +++ b/dispatch/GZRobot.cs @@ -7,6 +7,7 @@ using HH.WCS.Mobox3.AnGang.models; using Newtonsoft.Json; using static HH.WCS.Mobox3.AnGang.api.ApiModel; +using static System.Net.WebRequestMethods; namespace HH.WCS.Mobox3.AnGang.dispatch { /// <summary> @@ -27,6 +28,7 @@ var dataResult = JsonConvert.DeserializeObject<gzResult<IOStatesInfoResult>>(result); } + // DOC 1. 鍒涘缓璁㈠崟 WMS->RCS public static int CreateOrder(string taskNo, int priority, string param, string ts = "churuku", string created_user = "hanhe") { LogHelper.Info($"CreateOrder鍙傛暟淇℃伅:taskNo:{taskNo},priority:{priority},param:{param},ts:{ts}锛宑reated_user锛歿created_user}", "API"); var msg = ""; @@ -40,7 +42,14 @@ if (response != "") { try { var dataResult = JsonConvert.DeserializeObject<gzResult<OrderInfoResult>>(response); - if (dataResult.code == 0) { + // 鍘熶唬鐮侀儴鍒�+ //if (dataResult.code == 0) { + // orderId = dataResult.data[0].in_order_id; + //} + // 灏婇噸鏂囨。鐨勭増鏈�+ // 杩斿洖鍙傛暟涓紝code鐩墠涓嶅啀浣跨敤锛屽彲閫氳繃msg瀛楁鍒ゆ柇鏄惁鎴愬姛锛屽鏋渕sg涓衡�success鈥濆垯琛ㄧず鎴愬姛锛屽惁鍒欎负鎶ラ敊淇℃伅鎴栦笉瀛樺湪銆俬ttp code涓�22鏃跺�鐨勬姤閿欎负绯荤粺鎶ラ敊锛屽叾涓殑msg鏃犳硶鍏ㄩ儴鑾峰彇銆�+ // SELFNOTE: 鐩存帴璋冪敤HttpHelper.Post鏂规硶锛屾棤娉曡幏鍙杊eader锛屾殏鏃朵笉鑰冭檻 + if (dataResult.msg == "success") { orderId = dataResult.data[0].in_order_id; } } @@ -76,6 +85,7 @@ return result; } + // DOC 2. 鍙栨秷璁㈠崟 WMS->RCS public static bool CancelGZOrder(int orderId) { bool result = false; string msg = ""; @@ -86,12 +96,21 @@ msg = $"[guozi-CancelOrder] request={requests};response={response}"; if (response != "") { var dataResult = JsonConvert.DeserializeObject<CancelGZOrderResult>(response); - if (dataResult.code == 0) { - msg = "[guozi-CancelOrder]鍙栨秷璁㈠崟鎴愬姛"; - Console.WriteLine(msg); + // 鍘熶唬鐮佺増鏈�+ //if (dataResult.code == 0) { + // msg = "[guozi-CancelOrder]鍙栨秷璁㈠崟鎴愬姛"; + // Console.WriteLine(msg); + // result = true; + // return result; + //} + + // 灏婇噸鏂囨。鐨勭増鏈�+ if (dataResult.msg == "success") { // 鐩墠鍙彇娑堜竴涓换鍔★紝鎴愬姛鏃犻渶鍐嶆鏌uccess_list鍜宔rror_list + Console.WriteLine("[guozi-CancelOrder]鍙栨秷璁㈠崟鎴愬姛"); result = true; return result; } + } else { msg = "[guozi-CancelOrder]鍙栨秷璁㈠崟澶辫触"; @@ -100,7 +119,7 @@ return result; } - + // DOC 3. 璁㈠崟鐘舵�鎺ㄩ� RCS->WMS /// <summary> /// 璁㈠崟鐘舵�鍙嶉 /// </summary> @@ -193,6 +212,7 @@ return result; } + // DOC 6. 浜や簰琛ㄦ煡璇� /// <summary> /// 鑾峰彇浜や簰淇℃伅 /// </summary> @@ -228,6 +248,7 @@ return list; } + // DOC 6. 浜や簰琛ㄦ煡璇紙鏇存柊缁堢偣璐т綅锛� public static bool UpdateInteractInfo(UpdateInteractInfo interactInfo) { string msg = ""; var result = false; @@ -245,6 +266,8 @@ return result; } + + // DOC 5. 绉伴噸淇℃伅鏌ヨ public static List<CustomData> CustomBuf() { var res = new List<CustomData>(); string msg = ""; @@ -406,8 +429,9 @@ public class UpdateInteractInfo { public int interaction_info_id { get; set; } + public string type_name { get; set; } = "GET_DST"; public string info_status { get; set; } - public string return_value { get; set; } + public string return_value { get; set; } = ""; } public class interaction_state { -- Gitblit v1.9.1