From 32a9985c4a3a326d4c30432374247cca5e172c93 Mon Sep 17 00:00:00 2001 From: zxx <Zxx@HanInfo> Date: 星期五, 04 七月 2025 16:55:49 +0800 Subject: [PATCH] 1 --- HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/XMWcsHelper.cs | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 85 insertions(+), 0 deletions(-) diff --git a/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/XMWcsHelper.cs b/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/XMWcsHelper.cs new file mode 100644 index 0000000..29834e0 --- /dev/null +++ b/HH.WCS.Mobox3/HH.WCS.Mobox3.XiaoMi/dispatch/XMWcsHelper.cs @@ -0,0 +1,85 @@ +锘縰sing HH.WCS.XiaoMi.util; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static HH.WCS.XiaoMi.dispatch.HanAo; + +namespace HH.WCS.XiaoMi.LISTA.dispatch +{ + public class XMWcsHelper + { + private static readonly HttpHelper apiHelper = new HttpHelper(); + private static readonly string baseUrl = Settings.WcsSeverUrl; + + + //https://wcs2-dev.ev.mioffice.cn/api/Interface/AMR/positionApply + + /// <summary> + /// 鐩爣浣嶇疆鐢宠鎺ュ彛 + /// </summary> + /// <param name="model"></param> + /// <returns></returns> + public static ApplyResult GetPositionApply(ApplyModel model) + { + var msg = ""; + var dataResult = new ApplyResult() { body = new body { },header = new header { } }; + var request = JsonConvert.SerializeObject(model); + var response = apiHelper.Post(baseUrl + "/api/Interface/AMR/positionApply", request); + msg = $"[xiaomi-GetPositionApply] request={request} response={response}"; + Console.WriteLine(msg); + if (response != "") + { + try + { + dataResult = JsonConvert.DeserializeObject<ApplyResult>(response); + LogHelper.Info($"GetPositionApply杩斿洖鍙傛暟{JsonConvert.SerializeObject(dataResult)}", "灏忕背"); + return dataResult; + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } + } + else + { + msg = "[xiaomi-GetPositionApply]鐩爣浣嶇疆鐢宠澶辫触"; + Console.WriteLine(msg); + } + LogHelper.Info(msg, "灏忕背"); + return dataResult; + } + + + + /// <summary> + /// 鐩爣浣嶇疆鐢宠鍙傛暟 + /// </summary> + public class ApplyModel + { + public string wcsTaskCode { get; set; } + } + + /// <summary> + /// 鐩爣浣嶇疆鐢宠杩斿洖缁撴灉 + /// </summary> + public class ApplyResult + { + public header header { get; set; } + public body body { get; set; } + } + public class header + { + public string code { get; set; } + public string desc { get; set; } + } + public class body + { + public string pointCode { get; set; } + public string targetType { get; set; } + } + + } +} -- Gitblit v1.9.1