新增爆款商品查询
This commit is contained in:
1 parent
8c2cd6b83d
commit
c60e6d1be0
2 files changed
+115
-17
No files matched your search
+13
-13
@@ -1087,7 +1087,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
"",
|
||||
"修改时间",
|
||||
"入库时间"});
|
||||
this.cmbTime.Location = new System.Drawing.Point(402, 80);
|
||||
this.cmbTime.Location = new System.Drawing.Point(402, 82);
|
||||
this.cmbTime.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbTime.Name = "cmbTime";
|
||||
this.cmbTime.Size = new System.Drawing.Size(56, 25);
|
||||
@@ -1101,7 +1101,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
"",
|
||||
"是",
|
||||
"否"});
|
||||
this.cmbHasFission.Location = new System.Drawing.Point(800, 43);
|
||||
this.cmbHasFission.Location = new System.Drawing.Point(800, 45);
|
||||
this.cmbHasFission.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbHasFission.Name = "cmbHasFission";
|
||||
this.cmbHasFission.Size = new System.Drawing.Size(51, 25);
|
||||
@@ -1136,7 +1136,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
"",
|
||||
"是",
|
||||
"否"});
|
||||
this.cmbPddRelation.Location = new System.Drawing.Point(687, 6);
|
||||
this.cmbPddRelation.Location = new System.Drawing.Point(687, 8);
|
||||
this.cmbPddRelation.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbPddRelation.Name = "cmbPddRelation";
|
||||
this.cmbPddRelation.Size = new System.Drawing.Size(51, 25);
|
||||
@@ -1181,7 +1181,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
this.cmbCat2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cmbCat2.FormattingEnabled = true;
|
||||
this.cmbCat2.Location = new System.Drawing.Point(252, 80);
|
||||
this.cmbCat2.Location = new System.Drawing.Point(252, 82);
|
||||
this.cmbCat2.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbCat2.Name = "cmbCat2";
|
||||
this.cmbCat2.Size = new System.Drawing.Size(51, 25);
|
||||
@@ -1267,7 +1267,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
"机会商品",
|
||||
"以图搜品",
|
||||
"多多外部数据"});
|
||||
this.cmbSourceType.Location = new System.Drawing.Point(252, 43);
|
||||
this.cmbSourceType.Location = new System.Drawing.Point(252, 45);
|
||||
this.cmbSourceType.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbSourceType.Name = "cmbSourceType";
|
||||
this.cmbSourceType.Size = new System.Drawing.Size(51, 25);
|
||||
@@ -1313,7 +1313,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
"",
|
||||
"是",
|
||||
"否"});
|
||||
this.cmbWxCat.Location = new System.Drawing.Point(574, 6);
|
||||
this.cmbWxCat.Location = new System.Drawing.Point(574, 8);
|
||||
this.cmbWxCat.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbWxCat.Name = "cmbWxCat";
|
||||
this.cmbWxCat.Size = new System.Drawing.Size(51, 25);
|
||||
@@ -1335,7 +1335,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.cmbSort.Items.AddRange(new object[] {
|
||||
"入库时间",
|
||||
"曝光量"});
|
||||
this.cmbSort.Location = new System.Drawing.Point(348, 43);
|
||||
this.cmbSort.Location = new System.Drawing.Point(348, 45);
|
||||
this.cmbSort.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbSort.Name = "cmbSort";
|
||||
this.cmbSort.Size = new System.Drawing.Size(51, 25);
|
||||
@@ -1399,7 +1399,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
this.cmbGroupFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cmbGroupFilter.FormattingEnabled = true;
|
||||
this.cmbGroupFilter.Location = new System.Drawing.Point(156, 43);
|
||||
this.cmbGroupFilter.Location = new System.Drawing.Point(156, 45);
|
||||
this.cmbGroupFilter.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbGroupFilter.Name = "cmbGroupFilter";
|
||||
this.cmbGroupFilter.Size = new System.Drawing.Size(51, 25);
|
||||
@@ -1414,7 +1414,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
"是",
|
||||
"否",
|
||||
"导出未拉回"});
|
||||
this.cmbExportToOutServer.Location = new System.Drawing.Point(574, 43);
|
||||
this.cmbExportToOutServer.Location = new System.Drawing.Point(574, 45);
|
||||
this.cmbExportToOutServer.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbExportToOutServer.Name = "cmbExportToOutServer";
|
||||
this.cmbExportToOutServer.Size = new System.Drawing.Size(51, 25);
|
||||
@@ -1450,7 +1450,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
"安全商品",
|
||||
"违规商品",
|
||||
"未校验"});
|
||||
this.cmbWxSafe.Location = new System.Drawing.Point(461, 43);
|
||||
this.cmbWxSafe.Location = new System.Drawing.Point(461, 45);
|
||||
this.cmbWxSafe.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbWxSafe.Name = "cmbWxSafe";
|
||||
this.cmbWxSafe.Size = new System.Drawing.Size(51, 25);
|
||||
@@ -1492,7 +1492,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
this.cmbCat1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cmbCat1.FormattingEnabled = true;
|
||||
this.cmbCat1.Location = new System.Drawing.Point(156, 80);
|
||||
this.cmbCat1.Location = new System.Drawing.Point(156, 82);
|
||||
this.cmbCat1.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbCat1.Name = "cmbCat1";
|
||||
this.cmbCat1.Size = new System.Drawing.Size(51, 25);
|
||||
@@ -1514,7 +1514,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
this.cmbCat3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cmbCat3.FormattingEnabled = true;
|
||||
this.cmbCat3.Location = new System.Drawing.Point(348, 80);
|
||||
this.cmbCat3.Location = new System.Drawing.Point(348, 82);
|
||||
this.cmbCat3.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbCat3.Name = "cmbCat3";
|
||||
this.cmbCat3.Size = new System.Drawing.Size(51, 25);
|
||||
@@ -1610,7 +1610,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
"",
|
||||
"普通商品",
|
||||
"爆款数据"});
|
||||
this.cmbSpProdType.Location = new System.Drawing.Point(800, 6);
|
||||
this.cmbSpProdType.Location = new System.Drawing.Point(800, 8);
|
||||
this.cmbSpProdType.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbSpProdType.Name = "cmbSpProdType";
|
||||
this.cmbSpProdType.Size = new System.Drawing.Size(51, 25);
|
||||
|
||||
@@ -179,6 +179,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
decimal seconds;
|
||||
Invoke(new Action(() => { pageSize = this.ucSplitPage1.PageSize; }));
|
||||
var list = GetProductList(out pageCount, out seconds, page, pageSize);
|
||||
//var list = GetHotProductList(out pageCount, out seconds, page, pageSize);
|
||||
lstTemuDbProduct.AddRange(list);
|
||||
this.ucSplitPage1.TotalPage = pageCount;
|
||||
|
||||
@@ -344,6 +345,103 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
});
|
||||
}
|
||||
|
||||
public List<KJDDBProduct> GetHotProductList(out int pageCount, out decimal seconds, int page = 1, int pageSize = 200)
|
||||
{
|
||||
List<KJDDBProduct> list = new List<KJDDBProduct>();
|
||||
pageCount = 1;
|
||||
seconds = 0;
|
||||
|
||||
var url = BaseClass.BuildWXObjString("product/get_hot_product_list");
|
||||
if (shop != null && shop.DbId.ParseToInt() != 0)
|
||||
url = BaseClass.BuildWXObjString("product/get_hot_product_list");
|
||||
var data = "";
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
data = //UserLogin.GetSignaturex() +
|
||||
"&page=" + page +
|
||||
"&page_size=" + pageSize +
|
||||
"&search_spu=" + txtSPU.Text.Trim() +
|
||||
"&search_prod_name=" + GetHtml.UrlEncodeUtf8(txtProdName.Text.Trim());
|
||||
|
||||
if (chkViewUvMin.Checked)
|
||||
{
|
||||
data += "&min_view_uv=" + numFilterViewUv.Value.ParseToInt();
|
||||
}
|
||||
if (chkFilterSaleCountNum.Checked)
|
||||
{
|
||||
data += "&min_sale_count_num=" + numFilterSaleCountNum.Value.ParseToInt();
|
||||
}
|
||||
|
||||
if (cmbTime.Text == "修改时间")
|
||||
{
|
||||
data += "&mdy_time_begin=" + dtpStart.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
data += "&mdy_time_end=" + dtpEnd.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
if (cmbTime.Text == "入库时间")
|
||||
{
|
||||
data += "&add_time_begin=" + dtpStart.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
data += "&add_time_end=" + dtpEnd.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
{
|
||||
var cate1 = GlobalConfig.WxCatList.FirstOrDefault(c => c.level == 1 && c.name == cmbCat1.Text.Trim());
|
||||
var cates2 = GlobalConfig.WxCatList.Where(c => c.f_cat_id == cate1?.cat_id).ToList();
|
||||
var cate2 = cates2.FirstOrDefault(c => c.level == 2 && c.name == cmbCat2.Text.Trim());
|
||||
var cates3 = GlobalConfig.WxCatList.Where(c => c.f_cat_id == cate2?.cat_id).ToList();
|
||||
var cate3 = cates3.FirstOrDefault(c => c.level == 3 && c.name == cmbCat3.Text.Trim());
|
||||
if (!string.IsNullOrEmpty(cmbCat1.Text) && cate1 != null)
|
||||
data += "&wx_cat_1=" + cate1.cat_id;
|
||||
if (!string.IsNullOrEmpty(cmbCat2.Text) && cate2 != null)
|
||||
data += "&wx_cat_2=" + cate2.cat_id;
|
||||
if (!string.IsNullOrEmpty(cmbCat3.Text) && cate3 != null)
|
||||
data += "&wx_cat_3=" + cate3.cat_id;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(txtSecretStyleCode.Text.Trim()))
|
||||
{
|
||||
data += "&search_secret_spu_ids=" + string.Join(",", txtSecretStyleCode.Text.Trim().Split(new string[] { " ", ",", "," }, StringSplitOptions.RemoveEmptyEntries));
|
||||
}
|
||||
|
||||
if (this.cmbSort.Text == "曝光量")
|
||||
{
|
||||
data += "&sort_field=view_uv";
|
||||
}
|
||||
}));
|
||||
data += "&sign=" + BaseClass.GetMd5(DateTime.Now.ToString("yyyyMMddHHmm") + "wxxd").ToLower();
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgForm.ShowError("获取商品列表失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg"));
|
||||
}));
|
||||
return list;
|
||||
}
|
||||
|
||||
seconds = BaseRegex.GetDecimalJson(ref html, "seconds");
|
||||
int count = BaseRegex.GetIntJson(ref html, "count");
|
||||
pageCount = Math.Ceiling(1.0 * count / pageSize).ParseToInt();
|
||||
pageCount = Math.Max(pageCount, 1);
|
||||
|
||||
var jArr = JObject.Parse(html)["data"];
|
||||
if (jArr.Count() == 0)
|
||||
return list;
|
||||
var sProd = JsonHelper.SerializeObject(jArr);
|
||||
|
||||
try
|
||||
{
|
||||
list = JsonHelper.DeserializeJsonToList<KJDDBProduct>(sProd);
|
||||
return list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new List<KJDDBProduct>();
|
||||
}
|
||||
}
|
||||
|
||||
public List<KJDDBProduct> GetProductList(out int pageCount, out decimal seconds, int page = 1, int pageSize = 200)
|
||||
{
|
||||
List<KJDDBProduct> list = new List<KJDDBProduct>();
|
||||
@@ -381,13 +479,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
}
|
||||
if (chkFilterSaleCountNum.Checked)
|
||||
{
|
||||
data += "&sale_count_num_more=" + numFilterSaleCountNum.Value.ParseToInt();
|
||||
data += "&min_sale_count_num=" + numFilterSaleCountNum.Value.ParseToInt();
|
||||
}
|
||||
|
||||
if (cmbTime.Text == "修改时间")
|
||||
{
|
||||
data += "&start_time=" + dtpStart.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
data += "&end_time=" + dtpEnd.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
data += "&mdy_time_begin=" + dtpStart.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
data += "&mdy_time_end=" + dtpEnd.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
if (cmbTime.Text == "入库时间")
|
||||
{
|
||||
@@ -494,7 +592,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
data += "&is_relation=1";
|
||||
|
||||
if (chkGetSaleCountLess0.Checked)
|
||||
data += "&sale_count_num_less=-1";
|
||||
data += "&max_sale_count_num=-1";
|
||||
if (chkShowDelProd.Checked)
|
||||
data += "&is_del=1";
|
||||
}));
|
||||
|
||||
Reference in new issue
Block a user