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;
|
}
|
|
}
|
|
|
}
|
}
|