Browse Source

排除无效店铺

qianyi
shanji 2 years ago
parent
commit
9e8cbd83f8
  1. 19
      BBWY.Client/APIServices/MdsApiService.cs
  2. 2
      BBWY.Client/App.xaml.cs
  3. 2
      BBWY.Client/Views/MainWindow.xaml
  4. 4
      BBWY.Server.Business/PlatformSDK/LogisticsCompanyConverter.cs

19
BBWY.Client/APIServices/MdsApiService.cs

@ -4,6 +4,7 @@ using BBWY.Common.Models;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
namespace BBWY.Client.APIServices
@ -58,13 +59,19 @@ namespace BBWY.Client.APIServices
response.Data.Add(d);
foreach (var jShop in jayShops)
{
if (jShop.Value<long?>("ShopId") == null || string.IsNullOrEmpty(jShop.Value<string>("AppToken")))
var shopId = jShop.Value<long?>("ShopId");
if (shopId == null || string.IsNullOrEmpty(jShop.Value<string>("AppToken")))
continue; //排除未授权
try
{
var jayAccounts = jShop.Value<JArray>("AccountList");
if ((jayAccounts == null || !jayAccounts.HasValues) && d.ShopList.Count(s => s.ShopId == shopId) > 0)
{
continue;
}
var shop = new Shop()
{
ShopId = jShop.Value<long>("ShopId"),
ShopId = shopId.Value,
AppKey = jShop.Value<string>("AppKey"),
AppSecret = jShop.Value<string>("AppSecret"),
AppToken = jShop.Value<string>("AppToken"),
@ -76,9 +83,7 @@ namespace BBWY.Client.APIServices
TeamId = jShop.Value<string>("TeamId")
};
d.ShopList.Add(shop);
var jayAccounts = jShop.Value<JArray>("AccountList");
if (jayAccounts == null || !jayAccounts.HasValues)
continue;
shop.PurchaseAccountList = new List<PurchaseAccount>();
foreach (var jPurchaseAccount in jayAccounts)
{
@ -89,8 +94,8 @@ namespace BBWY.Client.APIServices
AppKey = jPurchaseAccount.Value<string>("AppKey"),
AppSecret = jPurchaseAccount.Value<string>("AppSecret"),
AppToken = jPurchaseAccount.Value<string>("AppToken"),
ShopId = shop.ShopId
//PurchasePlatformId = jPurchaseAccount.Value<long>()
ShopId = shop.ShopId,
PurchasePlatformId = (Platform)jPurchaseAccount.Value<int>("AppPlatformId")
});
}
}

2
BBWY.Client/App.xaml.cs

@ -48,6 +48,8 @@ namespace BBWY.Client
//齐越山鸡
userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTM1MzMwMzI4ODkyMTQ5NzYwIiwidGVhbUlkIjoiMTUxNjk3NDI1MDU0MjUwMTg4OCIsInNvblRlYW1JZHMiOiIxNDM2Mjg4NTAwMjM1MjQzNTIwIiwiZXhwIjoxNjk0NjY5NjkxfQ.cSwro-7bGwOu92YejH9JhMenTai7Mvf99i2paQCmxIw";
//userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTIwOTc1NzQ0MTY2MDA2Nzg0IiwidGVhbUlkIjoiMTQzNjI4ODUwMDIzNTI0MzUyMCIsInNvblRlYW1JZHMiOiIiLCJleHAiOjE3MDkyNzQ3NzZ9.2aAkMNeDPHUZ3q0K83Usp7QNhPMkBNW8uWxknJZ49oE";
//刷单组测试
//userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTcxODUyODE0OTAzMTUyNjQwIiwidGVhbUlkIjoiMTU3MTg1MjQ1MDI5NjUwMDIyNCIsInNvblRlYW1JZHMiOiIiLCJleHAiOjE2OTUxNDc2ODh9.hVupdHnhgHHGo3QrMSDqhINqtq6Q5_RovWyXjiMkkEs";
//齐越愉辰

2
BBWY.Client/Views/MainWindow.xaml

@ -26,7 +26,7 @@
<!--<TextBlock Text="{Binding GlobalContext.User.TeamName}" Margin="5,0,0,0"/>
<TextBlock Text="{Binding GlobalContext.User.Shop.Platform}" Margin="5,0,0,0"/>-->
<TextBlock Text="{Binding GlobalContext.User.Shop.ShopName}" Margin="5,0,0,0"/>
<TextBlock Text="v10081" Margin="5,0,0,0"/>
<TextBlock Text="v10082" Margin="5,0,0,0"/>
</StackPanel>
</Border>
<Grid Grid.Row="1">

4
BBWY.Server.Business/PlatformSDK/LogisticsCompanyConverter.cs

@ -44,6 +44,10 @@ namespace BBWY.Server.Business
new LogisticsCompanyRelationship(){SourceName="极兔快递(原百世快递)",TargetName="京旗联盟-极兔",SecondTargetName ="厂家自送"},
new LogisticsCompanyRelationship(){SourceName="极兔速递-原百世快递",TargetName="京旗联盟-极兔",SecondTargetName ="厂家自送"}
});
converterDictionary.Add($"{Enums.Platform.拳探}_{Enums.Platform.京东}", new List<LogisticsCompanyRelationship>()
{
});
}
/// <summary>

Loading…
Cancel
Save