22
schangxiang@126.com
2025-08-23 c3984d64e9727d60a2a61682271bd52cc82712b9
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
using iWareCommon.Common.Entity;
using iWareCommon.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
 
namespace FineUIPro.iWareWms.Expres.Service
{
    public class ExpresService
    {
        private readonly string _logPath = ConfigurationManager.AppSettings["LogDir"].ToString();
        private readonly string _expresBaseAddress = ConfigurationManager.AppSettings["ExpresServerBaseAddress"].ToString();
 
        public static object Lock = new object();
 
 
 
        public static ExpresService Instance = null;
 
        ///<summary>
        ///获取单例的方法
        ///</summary>
        ///<returns>角色服务的单例实体</returns>
        public static ExpresService GetInstance()
        {
 
            if (Instance == null)
            {
                lock (Lock)
                {
                    if (Instance == null)
                    {
                        Instance = new ExpresService();
                    }
                }
            }
            return Instance;
        }
 
        public Dictionary<string, object> SendSubByJson(string requestData)
        {
            try
            {
 
                var resStr = HttpHelper.GetHttpResponse(_expresBaseAddress + "/Expres/SendSubByJson", new { requestData = requestData } , 5000);
                Dictionary<string, object> jsonDict = JsonConvert.DeserializeObject<Dictionary<string, object>>(resStr);
                return jsonDict;
            }
            catch (Exception ex)
            {
                LogTextHelper.WriteLog(_logPath, this.ToString(), "SendSubByJson", ex.Message);
                return null;
            }
 
        }
 
 
    }
}