爆款 和 违规 逻辑调整
This commit is contained in:
1 parent
dc977c45d8
commit
8855361e36
2 files changed
+35
-16
No files matched your search
@@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 从选品广场获取商品流量信息,已作废
|
||||
/// </summary>
|
||||
public void GetPlatformRecommendProduct()
|
||||
{
|
||||
|
||||
@@ -175,9 +179,13 @@ namespace TemuKJD.BLL.Wx
|
||||
// dbProdLst = JsonHelper.DeserializeJsonToList<KJDDBProduct>(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<KJDDBProduct>(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<KJDDBProduct>(JsonHelper.SerializeObject(prodObjs));
|
||||
}
|
||||
prodObjs = JsonHelper.JObjectParse(html)["data"];
|
||||
dbProdLst = JsonHelper.DeserializeJsonToList<KJDDBProduct>(JsonHelper.SerializeObject(prodObjs));
|
||||
}
|
||||
|
||||
if (dbProdLst.Count == 0 && spuCode.Length > 10)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user