From ca91751dfa17e8d1f708bb2e8bec7bdbb3df0c22 Mon Sep 17 00:00:00 2001 From: sanji Date: Wed, 3 Jan 2024 15:27:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsku=E7=BC=BA=E5=B0=91?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=BC=95=E8=B5=B7=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlatformSDK/JDBusiness.cs | 23 +------------------ .../Sync/ProductSyncBusiness.cs | 10 ++++---- .../Dto/Response/Product/ProductResponse.cs | 3 ++- 3 files changed, 8 insertions(+), 28 deletions(-) diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index e179ae9d..00c2323e 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs @@ -126,7 +126,7 @@ namespace BBWY.Server.Business private string GetSkuTitle(JToken s) { if (s["saleAttrs"] == null) - throw new BusinessException($"{s["skuId"]}没有名字"); + return string.Empty;//throw new BusinessException($"{s["skuId"]}没有名字"); StringBuilder titleBuilder = new StringBuilder(); List attrValueAliasList = new List(); @@ -147,27 +147,6 @@ namespace BBWY.Server.Business } } return titleBuilder.ToString(); - - //var title = s["saleAttrs"] != null ? string.Join("-", s["saleAttrs"].Select(a => a["attrValueAlias"][0].ToString())) : string.Empty; - //if (!string.IsNullOrEmpty(title) && title.Contains("id") && title.Contains("value")) - //{ - // if (title.Contains("]-[")) - // { - // title = title.Replace("]-[", "]^["); - // var titleArray = title.Split(new char[] { '^' }, StringSplitOptions.RemoveEmptyEntries); - // StringBuilder sb = new StringBuilder(); - // foreach (var titleStr in titleArray) - // { - // sb.Append(string.Join("", JArray.Parse(titleStr).Select(j => $"{j.Value("value")}{j.Value("unit")}"))); - // } - // title = sb.ToString(); - // } - // else - // { - // title = string.Join("", JArray.Parse(title).Select(j => $"{j.Value("value")}{j.Value("unit")}")); - // } - //} - //return title; } public override IList GetProductSkuList(SearchProductSkuRequest searchProductSkuRequest) diff --git a/BBWY.Server.Business/Sync/ProductSyncBusiness.cs b/BBWY.Server.Business/Sync/ProductSyncBusiness.cs index d6e51b58..6be23395 100644 --- a/BBWY.Server.Business/Sync/ProductSyncBusiness.cs +++ b/BBWY.Server.Business/Sync/ProductSyncBusiness.cs @@ -246,11 +246,11 @@ namespace BBWY.Server.Business.Sync public void SyncAllShopAllProduct() { var shopList = venderBusiness.GetShopList(platform: Enums.Platform.京东); - //SyncProduct(shopList.FirstOrDefault(s => s.ShopName == "披风熊玩具专营店"), true); - foreach (var shop in shopList) - { - Task.Factory.StartNew(() => SyncProduct(shop, true), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.ProductSyncTaskScheduler); - } + SyncProduct(shopList.FirstOrDefault(s => s.ShopId == "12309755"), true); + //foreach (var shop in shopList) + //{ + // Task.Factory.StartNew(() => SyncProduct(shop, true), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.ProductSyncTaskScheduler); + //} } private string GetCategoryName(ShopResponse shop, string categoryId) diff --git a/BBWY.Server.Model/Dto/Response/Product/ProductResponse.cs b/BBWY.Server.Model/Dto/Response/Product/ProductResponse.cs index 610b60d5..5e0287d4 100644 --- a/BBWY.Server.Model/Dto/Response/Product/ProductResponse.cs +++ b/BBWY.Server.Model/Dto/Response/Product/ProductResponse.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json.Linq; +using FreeSql.DataAnnotations; +using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Text;