diff --git a/TEMUKJD/BLL/Wx/WxPlatformRecommendProdManage.cs b/TEMUKJD/BLL/Wx/WxPlatformRecommendProdManage.cs index 19fa0f7..1d1697a 100644 --- a/TEMUKJD/BLL/Wx/WxPlatformRecommendProdManage.cs +++ b/TEMUKJD/BLL/Wx/WxPlatformRecommendProdManage.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Reflection.Emit; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -23,6 +24,9 @@ namespace TemuKJD.BLL.Wx public static int getInterval { get; set; } = 3; public static bool isGetOnce { get; set; } = true; + /// + /// 从选品广场获取商品流量信息,已作废 + /// public void GetPlatformRecommendProduct() { @@ -175,9 +179,13 @@ namespace TemuKJD.BLL.Wx // dbProdLst = JsonHelper.DeserializeJsonToList(JsonHelper.SerializeObject(prodObjs)); // } - // if (dbProdLst.Count == 0 && spuCode.StartsWith("EC1") && spuCode.EndsWith("A")) + // // 查询货号EC1开头商品换算成的spu是否存在 + // if (dbProdLst.Count == 0 && ((spuCode.StartsWith("EC1") && spuCode.EndsWith("A")) || spuCode.StartsWith("P1-"))) // { - // spuCode = spuCode.Substring(3, spuCode.Length - 4); + // if (spuCode.StartsWith("EC1") && spuCode.EndsWith("A")) + // spuCode = spuCode.Substring(3, spuCode.Length - 4); + // if (spuCode.StartsWith("P1-")) + // spuCode = spuCode.Substring(3); // url = BaseClass.BuildPDDObjString("product/get_product_list"); // data = UserLogin.GetSignaturex() + // "&search_spu=" + spuCode + @@ -501,23 +509,30 @@ namespace TemuKJD.BLL.Wx dbProdLst = JsonHelper.DeserializeJsonToList(JsonHelper.SerializeObject(prodObjs)); } - if (dbProdLst.Count == 0 && spuCode.StartsWith("EC1") && spuCode.EndsWith("A")) + // 查询货号EC1或P1-开头商品换算成的spu是否存在 + if (dbProdLst.Count == 0) { - spuCode = spuCode.Substring(3, spuCode.Length - 4); - url = BaseClass.BuildPDDObjString("product/get_product_list"); - data = UserLogin.GetSignaturex() + - "&search_spu=" + spuCode + - "&special_prod_type=普通商品,书籍" + - "&is_not_count=true"; - html = GetHtml.PostUtf8(url, data); - if (!html.Contains("\"code\":200")) + if((spuCode.StartsWith("EC1") && spuCode.EndsWith("A")) || spuCode.StartsWith("P1-")) { - info.failReason = "读取失败,库存商品查询失败"; - NaiBa.Util.Helper.ConfigHelper.SaveConfig("wxPlatformRecommendUpdate\\" + shop.ShopId, info); - continue; + if (spuCode.StartsWith("EC1") && spuCode.EndsWith("A")) + spuCode = spuCode.Substring(3, spuCode.Length - 4); + if (spuCode.StartsWith("P1-")) + spuCode = spuCode.Substring(3); + url = BaseClass.BuildPDDObjString("product/get_product_list"); + data = UserLogin.GetSignaturex() + + "&search_spu=" + spuCode + + "&special_prod_type=普通商品,书籍" + + "&is_not_count=true"; + html = GetHtml.PostUtf8(url, data); + if (!html.Contains("\"code\":200")) + { + info.failReason = "读取失败,库存商品查询失败"; + NaiBa.Util.Helper.ConfigHelper.SaveConfig("wxPlatformRecommendUpdate\\" + shop.ShopId, info); + continue; + } + prodObjs = JsonHelper.JObjectParse(html)["data"]; + dbProdLst = JsonHelper.DeserializeJsonToList(JsonHelper.SerializeObject(prodObjs)); } - prodObjs = JsonHelper.JObjectParse(html)["data"]; - dbProdLst = JsonHelper.DeserializeJsonToList(JsonHelper.SerializeObject(prodObjs)); } if (dbProdLst.Count == 0 && spuCode.Length > 10) diff --git a/TEMUKJD/PDDForms/ProductForms/WXProdViolationManage.cs b/TEMUKJD/PDDForms/ProductForms/WXProdViolationManage.cs index 2730e48..5e8cb41 100644 --- a/TEMUKJD/PDDForms/ProductForms/WXProdViolationManage.cs +++ b/TEMUKJD/PDDForms/ProductForms/WXProdViolationManage.cs @@ -110,6 +110,10 @@ namespace TemuKJD.PDDForms.ProductForms { spu_id = spuCode.Substring(3, spuCode.Length - 4); } + else if (spuCode.StartsWith("P1-")) + { + spu_id = spuCode.Substring(3); + } else { secrec_spu_id = spuCode;