libo
2025-03-31 7e50638f14d0df6d151bda986c8519565bfc09cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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;
 
        }
 
 
    }
}