|
|
@ -89,6 +89,19 @@ namespace BBWY.Server.Business.Sync |
|
|
|
}); |
|
|
|
if (skuList == null || skuList.Count() == 0) |
|
|
|
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) |
|
|
|
{ |
|
|
|
var categoryId = sku.Source.Value<int>("categoryId"); |
|
|
@ -206,11 +219,11 @@ namespace BBWY.Server.Business.Sync |
|
|
|
public void SyncAllShopProduct() |
|
|
|
{ |
|
|
|
var shopList = venderBusiness.GetShopList(platform: Enums.Platform.京东); |
|
|
|
SyncProduct(shopList.FirstOrDefault(s => s.ShopId == "12657364"), true); //布莱特玩具专营店
|
|
|
|
//foreach (var shop in shopList)
|
|
|
|
//{
|
|
|
|
// Task.Factory.StartNew(() => SyncProduct(shop), System.Threading.CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.ProductSyncTaskScheduler);
|
|
|
|
//}
|
|
|
|
//SyncProduct(shopList.FirstOrDefault(s => s.ShopId == "12657364"), true); //布莱特玩具专营店
|
|
|
|
foreach (var shop in shopList) |
|
|
|
{ |
|
|
|
Task.Factory.StartNew(() => SyncProduct(shop), System.Threading.CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.ProductSyncTaskScheduler); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
@ -219,7 +232,7 @@ namespace BBWY.Server.Business.Sync |
|
|
|
public void SyncAllShopAllProduct() |
|
|
|
{ |
|
|
|
var shopList = venderBusiness.GetShopList(); |
|
|
|
//SyncProduct(shopList.FirstOrDefault(s => s.ShopName == "奥德汽车用品专营店"), true);
|
|
|
|
//SyncProduct(shopList.FirstOrDefault(s => s.ShopName == "趣弈手机配件专营店"), true);
|
|
|
|
foreach (var shop in shopList) |
|
|
|
{ |
|
|
|
Task.Factory.StartNew(() => SyncProduct(shop, true), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.ProductSyncTaskScheduler); |
|
|
|