From 7e50638f14d0df6d151bda986c8519565bfc09cc Mon Sep 17 00:00:00 2001 From: libo <Administrator@DESKTOP-1A6QMNS> Date: 星期一, 31 三月 2025 10:08:12 +0800 Subject: [PATCH] 将原先的一个webservice,改为三个对应功能 --- 项目代码/WebService/WMS_WebService/WebService/LiKu.asmx.cs | 110 ++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 81 insertions(+), 29 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WebService/WMS_WebService/WebService/LiKu.asmx.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WebService/WMS_WebService/WebService/LiKu.asmx.cs" index e6b795d..d1dcfbf 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WebService/WMS_WebService/WebService/LiKu.asmx.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WebService/WMS_WebService/WebService/LiKu.asmx.cs" @@ -22,45 +22,97 @@ public class LiKu : System.Web.Services.WebService { - + /// <summary> /// 涓婃父WMS绯荤粺璋冪敤绔嬪簱WMS鎺ュ彛 /// </summary> /// <returns></returns> + //[WebMethod] + //public string AcceptWMSRequest(string funcName, string data) + //{ + // new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "璇锋眰", $"{data}"); + // string url = ConfigurationManager.AppSettings["WMS"]; + // if (funcName == "freezeByCustomer")// 绔嬪簱WMS鍐荤粨/瑙e喕淇℃伅 + // { + // var response = HttpHelper.Post<freezeByCustomerResponse>(url + "api/StockInfo/freezeByCustomer", data, "绔嬪簱WMS鍐荤粨/瑙e喕淇℃伅"); + // string res = JsonConvert.SerializeObject(response); + // new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "鍝嶅簲", $"{res}"); + // return res; + // } + // else if (funcName == "InventoryQuery")//搴撳瓨淇℃伅 + // { + // var response = HttpHelper.Post<InventoryQueryResponse>(url + "api/StockInfo/inventoryQuery", data, "搴撳瓨淇℃伅"); + // string res = JsonConvert.SerializeObject(response); + // new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "鍝嶅簲", $"{res}"); + // return res; + // } + // else if (funcName == "returnInventory")//浣欐枡鍥炲簱淇℃伅 + // { + // var response = HttpHelper.Post<ReturnInventoryResponse>(url + "api/InboundOrder/returnInventory", data, "浣欐枡鍥炲簱淇℃伅"); + // string res = JsonConvert.SerializeObject(response); + // new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "鍝嶅簲", $"{res}"); + // return res; + // } + // else + // { + + // new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "鍝嶅簲", $"涓嶆敮鎸佽璇锋眰"); + // return "涓嶆敮鎸佽璇锋眰"; + // } + + //} + + /// <summary> + /// 绔嬪簱WMS鍐荤粨/瑙e喕淇℃伅 + /// </summary> + /// <returns></returns> [WebMethod] - public string AcceptWMSRequest(string funcName,string data) + public string freezeByCustomer(string data) { + string funcName = "freezeByCustomer"; new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "璇锋眰", $"{data}"); string url = ConfigurationManager.AppSettings["WMS"]; - if (funcName == "freezeByCustomer")// 绔嬪簱WMS鍐荤粨/瑙e喕淇℃伅 - { - var response = HttpHelper.Post<freezeByCustomerResponse>(url + "api/StockInfo/freezeByCustomer", data, "绔嬪簱WMS鍐荤粨/瑙e喕淇℃伅"); - string res = JsonConvert.SerializeObject(response); - new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "鍝嶅簲", $"{res}"); - return res; - } - else if(funcName == "InventoryQuery")//搴撳瓨淇℃伅 - { - var response = HttpHelper.Post<InventoryQueryResponse>(url + "api/StockInfo/inventoryQuery", data, "搴撳瓨淇℃伅"); - string res = JsonConvert.SerializeObject(response); - new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "鍝嶅簲", $"{res}"); - return res; - } - else if(funcName == "returnInventory")//浣欐枡鍥炲簱淇℃伅 - { - var response = HttpHelper.Post<ReturnInventoryResponse>(url + "api/InboundOrder/returnInventory", data, "浣欐枡鍥炲簱淇℃伅"); - string res = JsonConvert.SerializeObject(response); - new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "鍝嶅簲", $"{res}"); - return res; - } - else - { - - new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "鍝嶅簲", $"涓嶆敮鎸佽璇锋眰"); - return "涓嶆敮鎸佽璇锋眰"; - } + var response = HttpHelper.Post<freezeByCustomerResponse>(url + "api/StockInfo/freezeByCustomer", data, "绔嬪簱WMS鍐荤粨/瑙e喕淇℃伅"); + string res = JsonConvert.SerializeObject(response); + new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "鍝嶅簲", $"{res}"); + return res; } + /// <summary> + /// 浣欐枡鍥炲簱淇℃伅 + /// </summary> + /// <returns></returns> + [WebMethod] + public string returnInventory(string data) + { + string funcName = "returnInventory"; + new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "璇锋眰", $"{data}"); + string url = ConfigurationManager.AppSettings["WMS"]; + var response = HttpHelper.Post<ReturnInventoryResponse>(url + "api/InboundOrder/returnInventory", data, "浣欐枡鍥炲簱淇℃伅"); + string res = JsonConvert.SerializeObject(response); + new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "鍝嶅簲", $"{res}"); + return res; + + } + + /// <summary> + /// 搴撳瓨淇℃伅 + /// </summary> + /// <returns></returns> + [WebMethod] + public string InventoryQuery(string data) + { + string funcName = "InventoryQuery"; + new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "璇锋眰", $"{data}"); + string url = ConfigurationManager.AppSettings["WMS"]; + var response = HttpHelper.Post<InventoryQueryResponse>(url + "api/StockInfo/inventoryQuery", data, "搴撳瓨淇℃伅"); + string res = JsonConvert.SerializeObject(response); + new LogFactory().GetLog("鎺ュ彛").InfoFormat(true, funcName, "鍝嶅簲", $"{res}"); + return res; + + } + + } } -- Gitblit v1.9.3