爆款 和 违规 逻辑调整

This commit is contained in:
wule committed 2026-09-09 16:10:11 +08:00
1 parent dc977c45d8
commit 8855361e36
2 files changed
+35 -16

No files matched your search

+31 -16
View File
@@ -9,6 +9,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection.Emit;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -23,6 +24,9 @@ namespace TemuKJD.BLL.Wx
public static int getInterval { get; set; } = 3; public static int getInterval { get; set; } = 3;
public static bool isGetOnce { get; set; } = true; public static bool isGetOnce { get; set; } = true;
/// <summary>
/// 从选品广场获取商品流量信息,已作废
/// </summary>
public void GetPlatformRecommendProduct() public void GetPlatformRecommendProduct()
{ {
@@ -175,9 +179,13 @@ namespace TemuKJD.BLL.Wx
// dbProdLst = JsonHelper.DeserializeJsonToList<KJDDBProduct>(JsonHelper.SerializeObject(prodObjs)); // 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"); // url = BaseClass.BuildPDDObjString("product/get_product_list");
// data = UserLogin.GetSignaturex() + // data = UserLogin.GetSignaturex() +
// "&search_spu=" + spuCode + // "&search_spu=" + spuCode +
@@ -501,23 +509,30 @@ namespace TemuKJD.BLL.Wx
dbProdLst = JsonHelper.DeserializeJsonToList<KJDDBProduct>(JsonHelper.SerializeObject(prodObjs)); 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); if((spuCode.StartsWith("EC1") && spuCode.EndsWith("A")) || spuCode.StartsWith("P1-"))
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 = "读取失败,库存商品查询失败"; if (spuCode.StartsWith("EC1") && spuCode.EndsWith("A"))
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wxPlatformRecommendUpdate\\" + shop.ShopId, info); spuCode = spuCode.Substring(3, spuCode.Length - 4);
continue; 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) if (dbProdLst.Count == 0 && spuCode.Length > 10)
@@ -110,6 +110,10 @@ namespace TemuKJD.PDDForms.ProductForms
{ {
spu_id = spuCode.Substring(3, spuCode.Length - 4); spu_id = spuCode.Substring(3, spuCode.Length - 4);
} }
else if (spuCode.StartsWith("P1-"))
{
spu_id = spuCode.Substring(3);
}
else else
{ {
secrec_spu_id = spuCode; secrec_spu_id = spuCode;