优化机会商品采集
This commit is contained in:
1 parent
d70b2eb6a7
commit
88675637ab
4 files changed
+123
-34
No files matched your search
@@ -27,7 +27,7 @@ namespace AllBase
|
||||
/// <summary>
|
||||
/// 版本ID
|
||||
/// </summary>
|
||||
public static int VersionCount = 775;
|
||||
public static int VersionCount = 776;
|
||||
//public static int VersionCount = 613;
|
||||
|
||||
/// <summary>
|
||||
|
||||
+3
-2
@@ -49,6 +49,7 @@ namespace TemuKJD
|
||||
public partial class MainForm : BaseForm
|
||||
{
|
||||
public static string sCurrentModule = string.Empty;
|
||||
public static int ProcessCount = 0;
|
||||
public static MainForm instance;
|
||||
|
||||
public string LoginType;
|
||||
@@ -191,9 +192,9 @@ namespace TemuKJD
|
||||
settings.LogSeverity = LogSeverity.Disable;
|
||||
|
||||
var pName = Process.GetCurrentProcess().ProcessName;
|
||||
var pCount = Process.GetProcesses().Count(p => p.ProcessName == pName);
|
||||
ProcessCount = Process.GetProcesses().Count(p => p.ProcessName == pName);
|
||||
//138版cef自己不会分缓存,会因占用导致报错,手动分缓存
|
||||
settings.CachePath = Path.Combine(Environment.CurrentDirectory, "Cache\\" + pCount);
|
||||
settings.CachePath = Path.Combine(Environment.CurrentDirectory, "Cache\\" + ProcessCount);
|
||||
//settings.CachePath = null; //禁止缓存
|
||||
//settings.CefCommandLineArgs.Add("enable-javascript", "1");
|
||||
//settings.CefCommandLineArgs.Add("disable-features", "NetworkService,NetworkServiceInProcess");
|
||||
|
||||
@@ -39,6 +39,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.txtMinPrice = new System.Windows.Forms.TextBox();
|
||||
this.btnStopStop = new DevComponents.DotNetBar.PanelEx();
|
||||
this.btnSelectSuccess = new DevComponents.DotNetBar.PanelEx();
|
||||
this.btnStop = new DevComponents.DotNetBar.PanelEx();
|
||||
@@ -90,9 +93,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.chk = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
|
||||
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
|
||||
this.txtMinPrice = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.btnClear = new DevComponents.DotNetBar.PanelEx();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
@@ -139,6 +140,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.ucGroupBoxEx1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.ucGroupBoxEx1.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
|
||||
this.ucGroupBoxEx1.Controls.Add(this.btnClear);
|
||||
this.ucGroupBoxEx1.Controls.Add(this.label7);
|
||||
this.ucGroupBoxEx1.Controls.Add(this.label6);
|
||||
this.ucGroupBoxEx1.Controls.Add(this.txtMinPrice);
|
||||
@@ -171,6 +173,35 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.ucGroupBoxEx1.TabStop = false;
|
||||
this.ucGroupBoxEx1.Text = "操作";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(1004, 79);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(44, 17);
|
||||
this.label7.TabIndex = 844;
|
||||
this.label7.Text = "元SKU";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(849, 79);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(116, 17);
|
||||
this.label6.TabIndex = 843;
|
||||
this.label6.Text = "入库时移除价格低于";
|
||||
//
|
||||
// txtMinPrice
|
||||
//
|
||||
this.txtMinPrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtMinPrice.Location = new System.Drawing.Point(965, 76);
|
||||
this.txtMinPrice.Name = "txtMinPrice";
|
||||
this.txtMinPrice.Size = new System.Drawing.Size(39, 23);
|
||||
this.txtMinPrice.TabIndex = 842;
|
||||
this.txtMinPrice.Text = "10";
|
||||
//
|
||||
// btnStopStop
|
||||
//
|
||||
this.btnStopStop.CanvasColor = System.Drawing.SystemColors.Control;
|
||||
@@ -853,34 +884,29 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.ucSplitPage1.TotalPage = 1;
|
||||
this.ucSplitPage1.PageChange += new System.Action<object>(this.ucSplitPage1_PageChange);
|
||||
//
|
||||
// txtMinPrice
|
||||
// btnClear
|
||||
//
|
||||
this.txtMinPrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtMinPrice.Location = new System.Drawing.Point(965, 76);
|
||||
this.txtMinPrice.Name = "txtMinPrice";
|
||||
this.txtMinPrice.Size = new System.Drawing.Size(39, 23);
|
||||
this.txtMinPrice.TabIndex = 842;
|
||||
this.txtMinPrice.Text = "10";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(849, 79);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(116, 17);
|
||||
this.label6.TabIndex = 843;
|
||||
this.label6.Text = "入库时移除价格低于";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(1004, 79);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(44, 17);
|
||||
this.label7.TabIndex = 844;
|
||||
this.label7.Text = "元SKU";
|
||||
this.btnClear.CanvasColor = System.Drawing.SystemColors.Control;
|
||||
this.btnClear.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnClear.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.btnClear.Location = new System.Drawing.Point(588, 75);
|
||||
this.btnClear.Name = "btnClear";
|
||||
this.btnClear.Size = new System.Drawing.Size(100, 25);
|
||||
this.btnClear.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.btnClear.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
|
||||
this.btnClear.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
|
||||
this.btnClear.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
|
||||
this.btnClear.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.btnClear.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
|
||||
this.btnClear.Style.GradientAngle = 90;
|
||||
this.btnClear.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.btnClear.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.btnClear.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.btnClear.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.btnClear.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
|
||||
this.btnClear.TabIndex = 875;
|
||||
this.btnClear.Text = "清除列表";
|
||||
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
|
||||
//
|
||||
// PDDGetChanceProdForm
|
||||
//
|
||||
@@ -973,5 +999,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.TextBox txtMinPrice;
|
||||
private DevComponents.DotNetBar.PanelEx btnClear;
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -44,6 +45,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.panel2.Location = new Point(45, 55);
|
||||
this.panel2.Width = Math.Max(10, this.panel2.Parent.Width - 90);
|
||||
this.panel2.Height = Math.Max(10, this.panel2.Parent.Height - 90);
|
||||
this.panel2.SendToBack();
|
||||
|
||||
chkSelectAll = dgvShop.Columns["colSelect"].AddHeaderCheckBox(HorizontalAlignment.Center, 0, 0, null, null, false, null, true);
|
||||
chkSelectAll.CheckedChanged += chkSelectAll_CheckedChanged;
|
||||
@@ -60,6 +62,51 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.txtNotes.TextChanged += Txt_TextChanged;
|
||||
this.txtShopId.TextChanged += Txt_TextChanged;
|
||||
this.txtShopName.TextChanged += Txt_TextChanged;
|
||||
|
||||
var tmpChanceProductLst = NaiBa.Util.Helper.ConfigHelper.LoadConfig<List<ChanceProductResult>>("pdd_chance_product_list_" + MainForm.ProcessCount);
|
||||
if (tmpChanceProductLst == null)
|
||||
tmpChanceProductLst = new List<ChanceProductResult>();
|
||||
lstChanceProductResult.AddRange(tmpChanceProductLst);
|
||||
pbLoading.Visible = true;
|
||||
Task.Run(() =>
|
||||
{
|
||||
int id = 0;
|
||||
foreach (var chanceProductResult in lstChanceProductResult)
|
||||
{
|
||||
id++;
|
||||
if (id % 50 == 0)
|
||||
Thread.Sleep(1);
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var rowId = this.dgvChanceProduct.Rows.Add(
|
||||
true,
|
||||
chanceProductResult.chance_id,
|
||||
chanceProductResult.pic_url.Replace("https://", "http://"),
|
||||
DataGridViewExtension.defaultBitmap,
|
||||
chanceProductResult.keywords,
|
||||
chanceProductResult.hot_index,
|
||||
chanceProductResult.cat_id_3.ParseToLong() == 0 ? new long?() : chanceProductResult.cat_id_3.ParseToLong(),
|
||||
"采集详情后显示",
|
||||
"删除",
|
||||
chanceProductResult.getProductMsg
|
||||
);
|
||||
dgvChanceProduct.Rows[rowId].Height = 60;
|
||||
|
||||
if (chanceProductResult.dbProduct != null)
|
||||
{
|
||||
var dbProd = chanceProductResult.dbProduct;
|
||||
var row = dgvChanceProduct.Rows[rowId];
|
||||
row.Cells["colGoodsName"].Value = dbProd.product_name;
|
||||
row.Cells["colCate"].Value = dbProd.cat_name;
|
||||
row.Cells["colPrice"].Value = dbProd.price_text;
|
||||
}
|
||||
}));
|
||||
}
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
pbLoading.Visible = false;
|
||||
}));
|
||||
});
|
||||
}
|
||||
private void Txt_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
@@ -449,6 +496,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//DeleteProduct(dbId);
|
||||
dgvChanceProduct.Rows.Remove(row);
|
||||
lstChanceProductResult.Remove(chanceProd);
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_chance_product_list_" + MainForm.ProcessCount, lstChanceProductResult);
|
||||
break;
|
||||
case "图片":
|
||||
var imgUrl = dgvChanceProduct.Rows[e.RowIndex].Cells["colImgUrl"].Value.ParseToString().Replace("?imageView2/2/w/90/h/90", "");
|
||||
@@ -616,8 +664,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
row.Cells["colMsg"].Value = chanceProd.getProductMsg;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
if (rowLst.IndexOf(row) % 20 == 0)
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_chance_product_list_" + MainForm.ProcessCount, lstChanceProductResult);
|
||||
}
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_chance_product_list_" + MainForm.ProcessCount, lstChanceProductResult);
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
@@ -849,6 +900,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnClear_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(BaseMsgForm.ShowConfirm("确定清除列表数据?").DialogResult == DialogResult.OK)
|
||||
{
|
||||
dgvChanceProduct.Rows.Clear();
|
||||
lstChanceProductResult.Clear();
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_chance_product_list_" + MainForm.ProcessCount, lstChanceProductResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ChanceProductConfig
|
||||
|
||||
Reference in new issue
Block a user