|
|
@@ -46,9 +46,15 @@ namespace MySystem
|
|
|
ConsumerOrders order = db.ConsumerOrders.FirstOrDefault(m => m.Id == sub.Id);
|
|
|
if (order != null)
|
|
|
{
|
|
|
- string text = function.GetWebRequest(Library.ConfigurationManager.AppSettings["SpHost"].ToString() + "/Api/PublicMethod/GetSettleOrderAmount?orderNo=" + order.SeoTitle + "&date=" + order.CreateDate.Value.ToString("yyyy-M-d"));
|
|
|
- order.SettleAmount = int.Parse(function.CheckInt(text));
|
|
|
- db.SaveChanges();
|
|
|
+ MerchantAddInfo add = db.MerchantAddInfo.FirstOrDefault(m => m.Id == order.MerchantId) ?? new MerchantAddInfo();
|
|
|
+ // string text = function.GetWebRequest(Library.ConfigurationManager.AppSettings["SpHost"].ToString() + "/Api/PublicMethod/GetSettleOrderAmount?orderNo=" + order.SeoTitle + "&date=" + order.CreateDate.Value.ToString("yyyy-M-d"));
|
|
|
+ string result = HaoDaHelper.Instance.QueryOrderDivideDetail(add.OutMchtNo, order.SeoTitle, add.BrandId);
|
|
|
+ JsonData jsonObj = JsonMapper.ToObject(result);
|
|
|
+ if(jsonObj["resultCode"].ToString() == "1" && result.Contains("\"settleAmount\""))
|
|
|
+ {
|
|
|
+ order.SettleAmount = int.Parse(function.CheckInt(jsonObj["data"]["settleAmount"].ToString()));
|
|
|
+ db.SaveChanges();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
db.Dispose();
|