|
|
@ -54,22 +54,53 @@ namespace BBWY.Server.Business |
|
|
|
|
|
|
|
public string AcceptJDShopToken(JDShopToken jDShopToken) |
|
|
|
{ |
|
|
|
string appKey, appSecret; |
|
|
|
Enums.AppKeyType appKeyType; |
|
|
|
if (jDShopToken.State == "merp_1034059314253266944") |
|
|
|
{ |
|
|
|
//订单Key
|
|
|
|
appKey = "120EA9EC65AB017567D78CC1139EEEA5"; |
|
|
|
appSecret = "8a42bc2301e8439b896e99f5475e0a9b"; |
|
|
|
appKeyType = Enums.AppKeyType.订单管理; |
|
|
|
} |
|
|
|
else if (jDShopToken.State == "merp_1058051655896924160") |
|
|
|
{ |
|
|
|
//商品Key
|
|
|
|
appKey = "E1AA9247D5583A6D87449CE6AB290185"; |
|
|
|
appSecret = "e479558ddd9e40f8929cfc00c6cbbc9c"; |
|
|
|
appKeyType = Enums.AppKeyType.商品管理; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
throw new BusinessException($"不识别的state {jDShopToken.State}"); |
|
|
|
} |
|
|
|
|
|
|
|
var venderResponse = GetVenderInfo(new PlatformRequest() |
|
|
|
{ |
|
|
|
AppKey = "120EA9EC65AB017567D78CC1139EEEA5", |
|
|
|
AppSecret = "8a42bc2301e8439b896e99f5475e0a9b", |
|
|
|
AppKey = appKey, |
|
|
|
AppSecret = appSecret, |
|
|
|
AppToken = jDShopToken.AccessToken, |
|
|
|
Platform = Enums.Platform.京东 |
|
|
|
}); |
|
|
|
|
|
|
|
_ = restApiService.SendRequest(globalConfig.MdsApi, "/TaskList/Shop/UpdateShop", new |
|
|
|
//_ = restApiService.SendRequest(globalConfig.MdsApi, "/TaskList/Shop/UpdateShop", new
|
|
|
|
//{
|
|
|
|
// venderResponse.ShopName,
|
|
|
|
// venderResponse.ShopId,
|
|
|
|
// ShopType = venderResponse.ColType,
|
|
|
|
// AppToken = jDShopToken.AccessToken,
|
|
|
|
// venderResponse.VenderId
|
|
|
|
//}, new Dictionary<string, string>() { { "qy", "qy" } }, HttpMethod.Post);
|
|
|
|
|
|
|
|
var shop = freeSqlMultiDBManager.MDSfsql.Select<Shops>().Where(s => s.ShopName == venderResponse.ShopName).ToOne(); |
|
|
|
if (shop == null) |
|
|
|
throw new BusinessException($"未找到店铺 {venderResponse.ShopName}"); |
|
|
|
|
|
|
|
if (appKeyType == Enums.AppKeyType.订单管理) |
|
|
|
{ |
|
|
|
venderResponse.ShopName, |
|
|
|
venderResponse.ShopId, |
|
|
|
ShopType = venderResponse.ColType, |
|
|
|
AppToken = jDShopToken.AccessToken, |
|
|
|
venderResponse.VenderId |
|
|
|
}, new Dictionary<string, string>() { { "qy", "qy" } }, HttpMethod.Post); |
|
|
|
//freeSqlMultiDBManager.MDSfsql.Update<Shops>(shop.Id)
|
|
|
|
} |
|
|
|
|
|
|
|
return JsonConvert.SerializeObject(jDShopToken); |
|
|
|
} |
|
|
|
|
|
|
@ -180,6 +211,9 @@ namespace BBWY.Server.Business |
|
|
|
s.AppKey, |
|
|
|
s.AppSecret, |
|
|
|
s.AppToken, |
|
|
|
s.AppKey2, |
|
|
|
s.AppSecret2, |
|
|
|
s.AppToken2, |
|
|
|
s.ManagePwd, |
|
|
|
s.PlatformCommissionRatio, |
|
|
|
s.PlatformId, |
|
|
@ -207,6 +241,9 @@ namespace BBWY.Server.Business |
|
|
|
AppKey = string.IsNullOrEmpty(x.AppKey) ? "120EA9EC65AB017567D78CC1139EEEA5" : x.AppKey, |
|
|
|
AppSecret = string.IsNullOrEmpty(x.AppSecret) ? "8a42bc2301e8439b896e99f5475e0a9b" : x.AppSecret, |
|
|
|
AppToken = x.AppToken, |
|
|
|
AppKey2 = x.AppKey2, |
|
|
|
AppSecret2 = x.AppSecret2, |
|
|
|
AppToken2 = x.AppToken2, |
|
|
|
ManagePwd = x.ManagePwd, |
|
|
|
PlatformId = (Enums.Platform)x.PlatformId, |
|
|
|
PlatformCommissionRatio = x.PlatformCommissionRatio, |
|
|
@ -236,6 +273,7 @@ namespace BBWY.Server.Business |
|
|
|
ShopId = pa.ShopId, |
|
|
|
PurchasePlatformId = (Enums.Platform)int.Parse(pa.PurchasePlatformId) |
|
|
|
}); |
|
|
|
|
|
|
|
foreach (var d in departmentList) |
|
|
|
{ |
|
|
|
foreach (var s in d.ShopList) |
|
|
|