Browse Source

Merge branch 'master' of http://code.qiyue666.com/pengcong001/bbwy

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
3b45a8a72a
  1. 2
      BBWY.Server.Business/PlatformSDK/LogisticsCompanyConverter.cs
  2. 25
      BBWY.Server.Business/Sync/ProductSyncBusiness.cs

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

@ -30,7 +30,7 @@ namespace BBWY.Server.Business
new LogisticsCompanyRelationship(){SourceName="德邦快递",TargetName="德邦快递",SecondTargetName="德邦快运"}, new LogisticsCompanyRelationship(){SourceName="德邦快递",TargetName="德邦快递",SecondTargetName="德邦快运"},
new LogisticsCompanyRelationship(){SourceName="其它",TargetName="厂家自送"}, new LogisticsCompanyRelationship(){SourceName="其它",TargetName="厂家自送"},
new LogisticsCompanyRelationship(){SourceName="极兔速递",TargetName="厂家自送"}, new LogisticsCompanyRelationship(){SourceName="极兔速递",TargetName="厂家自送"},
new LogisticsCompanyRelationship(){SourceName="中通快运",TargetName="中通快运"}, //new LogisticsCompanyRelationship(){SourceName="中通快运",TargetName="中通快运"},
new LogisticsCompanyRelationship(){SourceName="龙邦速递",TargetName="龙邦快递"}, new LogisticsCompanyRelationship(){SourceName="龙邦速递",TargetName="龙邦快递"},
new LogisticsCompanyRelationship(){SourceName="安能物流",TargetName="安能物流"}, new LogisticsCompanyRelationship(){SourceName="安能物流",TargetName="安能物流"},
new LogisticsCompanyRelationship(){SourceName="德坤物流",TargetName="厂家自送"}, new LogisticsCompanyRelationship(){SourceName="德坤物流",TargetName="厂家自送"},

25
BBWY.Server.Business/Sync/ProductSyncBusiness.cs

@ -89,6 +89,19 @@ namespace BBWY.Server.Business.Sync
}); });
if (skuList == null || skuList.Count() == 0) if (skuList == null || skuList.Count() == 0)
continue; continue;
//排查已删除的sku
var currentDbSkus = dbProductSkus.Where(dbsku => dbsku.ProductId == product.Id).ToList();
var deletedSkuList = currentDbSkus.Where(dbsku => skuList.Count(s => s.Id == dbsku.Id) == 0).ToList();
if (deletedSkuList.Count() > 0)
{
foreach (var deletedSku in deletedSkuList)
{
var update = fsql.Update<ProductSku>(deletedSku.Id).Set(s => s.State, 4);
updateProductSkuList.Add(update);
}
}
foreach (var sku in skuList) foreach (var sku in skuList)
{ {
var categoryId = sku.Source.Value<int>("categoryId"); var categoryId = sku.Source.Value<int>("categoryId");
@ -206,11 +219,11 @@ namespace BBWY.Server.Business.Sync
public void SyncAllShopProduct() public void SyncAllShopProduct()
{ {
var shopList = venderBusiness.GetShopList(platform: Enums.Platform.); var shopList = venderBusiness.GetShopList(platform: Enums.Platform.);
SyncProduct(shopList.FirstOrDefault(s => s.ShopId == "12657364"), true); //布莱特玩具专营店 //SyncProduct(shopList.FirstOrDefault(s => s.ShopId == "12657364"), true); //布莱特玩具专营店
//foreach (var shop in shopList) foreach (var shop in shopList)
//{ {
// Task.Factory.StartNew(() => SyncProduct(shop), System.Threading.CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.ProductSyncTaskScheduler); Task.Factory.StartNew(() => SyncProduct(shop), System.Threading.CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.ProductSyncTaskScheduler);
//} }
} }
/// <summary> /// <summary>
@ -219,7 +232,7 @@ namespace BBWY.Server.Business.Sync
public void SyncAllShopAllProduct() public void SyncAllShopAllProduct()
{ {
var shopList = venderBusiness.GetShopList(); var shopList = venderBusiness.GetShopList();
//SyncProduct(shopList.FirstOrDefault(s => s.ShopName == "奥德汽车用品专营店"), true); //SyncProduct(shopList.FirstOrDefault(s => s.ShopName == "趣弈手机配件专营店"), true);
foreach (var shop in shopList) foreach (var shop in shopList)
{ {
Task.Factory.StartNew(() => SyncProduct(shop, true), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.ProductSyncTaskScheduler); Task.Factory.StartNew(() => SyncProduct(shop, true), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.ProductSyncTaskScheduler);

Loading…
Cancel
Save