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; /// ///获取单例的方法 /// ///角色服务的单例实体 public static ExpresService GetInstance() { if (Instance == null) { lock (Lock) { if (Instance == null) { Instance = new ExpresService(); } } } return Instance; } public Dictionary SendSubByJson(string requestData) { try { var resStr = HttpHelper.GetHttpResponse(_expresBaseAddress + "/Expres/SendSubByJson", new { requestData = requestData } , 5000); Dictionary jsonDict = JsonConvert.DeserializeObject>(resStr); return jsonDict; } catch (Exception ex) { LogTextHelper.WriteLog(_logPath, this.ToString(), "SendSubByJson", ex.Message); return null; } } } }