using Newtonsoft.Json;
|
using System;
|
using System.Collections.Generic;
|
using System.Configuration;
|
using System.Linq;
|
using System.Security.Policy;
|
using System.Threading.Tasks;
|
using System.Web;
|
using System.Web.Services;
|
using WebService.Log;
|
|
namespace WebService
|
{
|
/// <summary>
|
/// WebService1 的摘要说明
|
/// </summary>
|
[WebService(Namespace = "http://tempuri.org/")]
|
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
|
[System.ComponentModel.ToolboxItem(false)]
|
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
|
// [System.Web.Script.Services.ScriptService]
|
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冻结/解冻信息
|
// {
|
// var response = HttpHelper.Post<freezeByCustomerResponse>(url + "api/StockInfo/freezeByCustomer", data, "立库WMS冻结/解冻信息");
|
// 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冻结/解冻信息
|
/// </summary>
|
/// <returns></returns>
|
[WebMethod]
|
public string freezeByCustomer(string data)
|
{
|
string funcName = "freezeByCustomer";
|
new LogFactory().GetLog("接口").InfoFormat(true, funcName, "请求", $"{data}");
|
string url = ConfigurationManager.AppSettings["WMS"];
|
var response = HttpHelper.Post<freezeByCustomerResponse>(url + "api/StockInfo/freezeByCustomer", data, "立库WMS冻结/解冻信息");
|
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;
|
|
}
|
|
|
}
|
}
|