|
@@ -314,11 +314,11 @@ namespace MySystem
|
|
|
merchant.QueryCount = 2;
|
|
|
info.AlipayRemark = "";
|
|
|
LogHelper.Instance.WriteLog("start2end", "查询支付宝商户意愿申请状态");
|
|
|
- // if (merchant.Latitude == 0)
|
|
|
- // {
|
|
|
- // //签约成功调用腾讯地图接口获取地址
|
|
|
- // RedisDbconn.Instance.AddList("GetTencentAddressInfoQueue", "{\"Address\":\"" + merchant.Areas + merchant.Address + "\"}");
|
|
|
- // }
|
|
|
+ if (merchant.Latitude == 0)
|
|
|
+ {
|
|
|
+ //签约成功调用腾讯地图接口获取地址
|
|
|
+ RedisDbconn.Instance.AddList("GetTencentAddressInfoQueue", "{\"MerChantId\":\"" + merchant.Id + "\",\"Address\":\"" + merchant.Areas + merchant.Address + "\"}");
|
|
|
+ }
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
// else
|
|
@@ -596,15 +596,28 @@ namespace MySystem
|
|
|
}
|
|
|
|
|
|
//获取商户经纬坐标
|
|
|
- public void GetTencentAddressInfo(int MerchantId)
|
|
|
+ public void GetTencentAddressInfo(int Id)
|
|
|
{
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
- MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == MerchantId);
|
|
|
+ MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == Id);
|
|
|
string Address = merchant.Areas + merchant.Address;
|
|
|
string Key = Library.ConfigurationManager.AppSettings["TencentKey"].ToString();
|
|
|
- LogHelper.Instance.WriteLog("商户Id\n" + MerchantId + "\n\n", "获取商户经纬坐标");
|
|
|
+ LogHelper.Instance.WriteLog("商户Id\n" + Id + "\n\n", "获取商户经纬坐标");
|
|
|
LogHelper.Instance.WriteLog("请求参数\n" + Address + "\n\n", "获取商户经纬坐标");
|
|
|
var info = function.GetWebRequest("https://apis.map.qq.com/ws/geocoder/v1/?address=" + Address + "&key=" + Key);
|
|
|
+ JsonData result = JsonMapper.ToObject(info);
|
|
|
+ //创建成功
|
|
|
+ if (result["status"].ToString() == "0")
|
|
|
+ {
|
|
|
+ var merInfo = db.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantInfo();
|
|
|
+ if (merInfo.Id > 0)
|
|
|
+ {
|
|
|
+ merInfo.Longitude = decimal.Parse(result["result"]["location"]["lng"].ToString());
|
|
|
+ merInfo.Latitude = decimal.Parse(result["result"]["location"]["lat"].ToString());
|
|
|
+ db.SaveChanges();
|
|
|
+ db.Dispose();
|
|
|
+ }
|
|
|
+ }
|
|
|
LogHelper.Instance.WriteLog("返回\n" + info + "\n\n", "获取商户经纬坐标");
|
|
|
db.Dispose();
|
|
|
}
|
|
@@ -615,7 +628,6 @@ namespace MySystem
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
public void refund()
|
|
|
{
|
|
|
Thread th = new Thread(refunddo);
|