|
@@ -1,6 +1,7 @@ |
|
|
using HandyControl.Controls; |
|
|
using HandyControl.Controls; |
|
|
using HKCardIN.Helper; |
|
|
using HKCardIN.Helper; |
|
|
using HKCardIN.Logic.Model; |
|
|
using HKCardIN.Logic.Model; |
|
|
|
|
|
using HKLog; |
|
|
using Newtonsoft.Json.Linq; |
|
|
using Newtonsoft.Json.Linq; |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
@@ -22,12 +23,20 @@ namespace HKCardIN.Logic |
|
|
/// <returns></returns> |
|
|
/// <returns></returns> |
|
|
public UserAndCardInfo PullUserAndCardInfo(string CardNo) |
|
|
public UserAndCardInfo PullUserAndCardInfo(string CardNo) |
|
|
{ |
|
|
{ |
|
|
return IHttpMultiClient.HttpMulti.AddNode(t => |
|
|
|
|
|
{ |
|
|
|
|
|
t.NodePath = ApiRoute.PullUserAndCardInfo; |
|
|
|
|
|
t.ReqType = MultiType.POST; |
|
|
|
|
|
t.JsonParam = (new { cardNum = CardNo }).ToJson(); |
|
|
|
|
|
}).Build().RunStringFirst().ToModel<JObject>()["data"].ToJson().ToModel<UserAndCardInfo>(); |
|
|
|
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
return IHttpMultiClient.HttpMulti.AddNode(t => |
|
|
|
|
|
{ |
|
|
|
|
|
t.NodePath = ApiRoute.PullUserAndCardInfo; |
|
|
|
|
|
t.ReqType = MultiType.POST; |
|
|
|
|
|
t.JsonParam = (new { cardNum = CardNo }).ToJson(); |
|
|
|
|
|
}).Build().RunStringFirst().ToModel<JObject>()["data"].ToJson().ToModel<UserAndCardInfo>(); |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
HKLogImport.WriteError(ex); |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
/// <summary> |
|
|
/// <summary> |
|
|
/// 同步充值记录 |
|
|
/// 同步充值记录 |
|
@@ -36,13 +45,22 @@ namespace HKCardIN.Logic |
|
|
/// <returns></returns> |
|
|
/// <returns></returns> |
|
|
public bool PushMoneyToServer(string CardNo, decimal Money) |
|
|
public bool PushMoneyToServer(string CardNo, decimal Money) |
|
|
{ |
|
|
{ |
|
|
var data = IHttpMultiClient.HttpMulti.AddNode(t => |
|
|
|
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
var data = IHttpMultiClient.HttpMulti.AddNode(t => |
|
|
|
|
|
{ |
|
|
|
|
|
t.NodePath = ApiRoute.PushMoneyToServer; |
|
|
|
|
|
t.ReqType = MultiType.POST; |
|
|
|
|
|
t.JsonParam = (new { Money, Type = 1, CardNum = CardNo }).ToJson(); |
|
|
|
|
|
}).Build().RunStringFirst(); |
|
|
|
|
|
return bool.Parse(data.ToModel<JObject>()["data"].ToString()); |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
{ |
|
|
{ |
|
|
t.NodePath = ApiRoute.PushMoneyToServer; |
|
|
|
|
|
t.ReqType = MultiType.POST; |
|
|
|
|
|
t.JsonParam = (new { Money, Type = 1, CardNum = CardNo }).ToJson(); |
|
|
|
|
|
}).Build().RunStringFirst(); |
|
|
|
|
|
return bool.Parse(data.ToModel<JObject>()["data"].ToString()); |
|
|
|
|
|
|
|
|
HKLogImport.WriteError(ex); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
/// <summary> |
|
|
/// <summary> |
|
|
/// 根据会员手机获取卡号 |
|
|
/// 根据会员手机获取卡号 |
|
@@ -51,12 +69,20 @@ namespace HKCardIN.Logic |
|
|
/// <returns></returns> |
|
|
/// <returns></returns> |
|
|
public UserAndCardInfo GetCardNoByPhone(string Phone) |
|
|
public UserAndCardInfo GetCardNoByPhone(string Phone) |
|
|
{ |
|
|
{ |
|
|
var data = IHttpMultiClient.HttpMulti.AddNode(t => { |
|
|
|
|
|
t.NodePath = ApiRoute.GetCardNoByPhone; |
|
|
|
|
|
t.ReqType = MultiType.POST; |
|
|
|
|
|
t.JsonParam = (new { phone = Phone }).ToJson(); |
|
|
|
|
|
}).Build().RunStringFirst().ToModel<JObject>()["data"].ToJson().ToModel<UserAndCardInfo>(); |
|
|
|
|
|
return data; |
|
|
|
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
var data = IHttpMultiClient.HttpMulti.AddNode(t => { |
|
|
|
|
|
t.NodePath = ApiRoute.GetCardNoByPhone; |
|
|
|
|
|
t.ReqType = MultiType.POST; |
|
|
|
|
|
t.JsonParam = (new { phone = Phone }).ToJson(); |
|
|
|
|
|
}).Build().RunStringFirst(); |
|
|
|
|
|
return data.ToModel<JObject>()["data"].ToJson().ToModel<UserAndCardInfo>(); |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
HKLogImport.WriteError(ex); |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |