调整备货逻辑不允许品质分过低的商品自动备货(完成但尚未测试) 注释无用的相关接口(原小奶狗,小奶兔)

This commit is contained in:
wule committed 2025-08-18 19:19:42 +08:00
1 parent fceead357f
commit 8445ec1828
19 files changed
+865 -540

No files matched your search

+5 -3
View File
@@ -26,15 +26,17 @@ namespace TemuKJD
{
Task.Run(() =>
{
while (!Work.Initialization.IsCheckFilesFinish || !Program.IsInit)
while (!Work.Initialization.IsCheckFilesFinish || !Program.IsInit || this.progressBarX1.Value < 50)
{
Thread.Sleep(10);
Thread.Sleep(new Random().Next(10, 50));
Invoke(new Action(() =>
{
this.progressBarX1.Value = Work.Initialization.InitPercent;
this.progressBarX1.Value = Work.Initialization.InitPercent++;
this.progressBarX1.Maximum = 50;
}));
if (this.progressBarX1.Value >= 50)
Thread.Sleep(300);
}
Invoke(new Action(() =>
{
+103 -93
View File
@@ -56,10 +56,15 @@ namespace TemuKJD.KJDForms.ProductForms
this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dgvAdjust = new TemuKJD.UserComponent.DataGridViewEx();
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.btnClear = new DevComponents.DotNetBar.PanelEx();
this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colSupplierId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSupplierName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colPriceOrderSn = new System.Windows.Forms.DataGridViewLinkColumn();
this.colImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colProductSkcPic = new System.Windows.Forms.DataGridViewImageColumn();
this.colProductId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colProdSkc = new System.Windows.Forms.DataGridViewLinkColumn();
@@ -72,10 +77,6 @@ namespace TemuKJD.KJDForms.ProductForms
this.colChangeType = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colChangeReason = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.btnClear = new DevComponents.DotNetBar.PanelEx();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -427,6 +428,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.colSupplierId,
this.colSupplierName,
this.colPriceOrderSn,
this.colImgUrl,
this.colProductSkcPic,
this.colProductId,
this.colProdSkc,
@@ -447,6 +449,87 @@ namespace TemuKJD.KJDForms.ProductForms
this.dgvAdjust.Size = new System.Drawing.Size(822, 443);
this.dgvAdjust.TabIndex = 187;
this.dgvAdjust.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvStock_CellContentClick);
this.dgvAdjust.Scroll += new System.Windows.Forms.ScrollEventHandler(this.dgvAdjust_Scroll);
//
// splitContainer4
//
this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer4.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer4.Location = new System.Drawing.Point(0, 0);
this.splitContainer4.Name = "splitContainer4";
//
// splitContainer4.Panel1
//
this.splitContainer4.Panel1.Controls.Add(this.statusBar);
//
// splitContainer4.Panel2
//
this.splitContainer4.Panel2.Controls.Add(this.panelEx1);
this.splitContainer4.Panel2.Controls.Add(this.btnClear);
this.splitContainer4.Size = new System.Drawing.Size(1110, 26);
this.splitContainer4.SplitterDistance = 832;
this.splitContainer4.TabIndex = 3;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 0);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(832, 26);
this.statusBar.TabIndex = 2;
//
// panelEx1
//
this.panelEx1.CanvasColor = System.Drawing.SystemColors.Control;
this.panelEx1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.panelEx1.DisabledBackColor = System.Drawing.Color.Empty;
this.panelEx1.Location = new System.Drawing.Point(155, 0);
this.panelEx1.Name = "panelEx1";
this.panelEx1.Size = new System.Drawing.Size(115, 21);
this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center;
this.panelEx1.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.panelEx1.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.panelEx1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.panelEx1.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.panelEx1.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.panelEx1.Style.GradientAngle = 90;
this.panelEx1.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.panelEx1.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.panelEx1.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.panelEx1.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.panelEx1.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.panelEx1.TabIndex = 668;
this.panelEx1.Text = "停止当前操作";
this.panelEx1.Click += new System.EventHandler(this.panelEx1_Click);
//
// btnClear
//
this.btnClear.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.btnClear.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnClear.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnClear.DisabledBackColor = System.Drawing.Color.Empty;
this.btnClear.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClear.Location = new System.Drawing.Point(47, 0);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(90, 21);
this.btnClear.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnClear.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClear.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClear.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnClear.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnClear.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnClear.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnClear.Style.GradientAngle = 90;
this.btnClear.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnClear.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnClear.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnClear.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnClear.TabIndex = 440;
this.btnClear.Text = "清空结果";
this.btnClear.Visible = false;
//
// colCheck
//
@@ -479,13 +562,19 @@ namespace TemuKJD.KJDForms.ProductForms
this.colPriceOrderSn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colPriceOrderSn.Width = 125;
//
// colImgUrl
//
this.colImgUrl.HeaderText = "图片路径";
this.colImgUrl.Name = "colImgUrl";
this.colImgUrl.ReadOnly = true;
this.colImgUrl.Visible = false;
//
// colProductSkcPic
//
this.colProductSkcPic.HeaderText = "Skc图片";
this.colProductSkcPic.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom;
this.colProductSkcPic.Name = "colProductSkcPic";
this.colProductSkcPic.ReadOnly = true;
this.colProductSkcPic.Visible = false;
this.colProductSkcPic.Width = 60;
//
// colProductId
@@ -570,86 +659,6 @@ namespace TemuKJD.KJDForms.ProductForms
this.colMsg.ReadOnly = true;
this.colMsg.Width = 400;
//
// splitContainer4
//
this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer4.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer4.Location = new System.Drawing.Point(0, 0);
this.splitContainer4.Name = "splitContainer4";
//
// splitContainer4.Panel1
//
this.splitContainer4.Panel1.Controls.Add(this.statusBar);
//
// splitContainer4.Panel2
//
this.splitContainer4.Panel2.Controls.Add(this.panelEx1);
this.splitContainer4.Panel2.Controls.Add(this.btnClear);
this.splitContainer4.Size = new System.Drawing.Size(1110, 26);
this.splitContainer4.SplitterDistance = 832;
this.splitContainer4.TabIndex = 3;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 0);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(832, 26);
this.statusBar.TabIndex = 2;
//
// panelEx1
//
this.panelEx1.CanvasColor = System.Drawing.SystemColors.Control;
this.panelEx1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.panelEx1.DisabledBackColor = System.Drawing.Color.Empty;
this.panelEx1.Location = new System.Drawing.Point(155, 0);
this.panelEx1.Name = "panelEx1";
this.panelEx1.Size = new System.Drawing.Size(115, 21);
this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center;
this.panelEx1.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.panelEx1.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.panelEx1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.panelEx1.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.panelEx1.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.panelEx1.Style.GradientAngle = 90;
this.panelEx1.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.panelEx1.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.panelEx1.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.panelEx1.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.panelEx1.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.panelEx1.TabIndex = 668;
this.panelEx1.Text = "停止当前操作";
this.panelEx1.Click += new System.EventHandler(this.panelEx1_Click);
//
// btnClear
//
this.btnClear.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.btnClear.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnClear.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnClear.DisabledBackColor = System.Drawing.Color.Empty;
this.btnClear.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClear.Location = new System.Drawing.Point(47, 0);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(90, 21);
this.btnClear.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnClear.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClear.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClear.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnClear.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnClear.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnClear.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnClear.Style.GradientAngle = 90;
this.btnClear.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnClear.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnClear.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnClear.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnClear.TabIndex = 440;
this.btnClear.Text = "清空结果";
this.btnClear.Visible = false;
//
// PriceManageForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -708,10 +717,19 @@ namespace TemuKJD.KJDForms.ProductForms
private System.Windows.Forms.TextBox txtScale1;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.CheckBox chkHasSuccess;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopLoginName;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopId;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopName;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopNotes;
private System.Windows.Forms.DataGridViewTextBoxColumn colLoginStatus;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCanUse;
private System.Windows.Forms.DataGridViewTextBoxColumn colMessage;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierName;
private System.Windows.Forms.DataGridViewLinkColumn colPriceOrderSn;
private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colProductSkcPic;
private System.Windows.Forms.DataGridViewLinkColumn colProductId;
private System.Windows.Forms.DataGridViewLinkColumn colProdSkc;
@@ -724,13 +742,5 @@ namespace TemuKJD.KJDForms.ProductForms
private System.Windows.Forms.DataGridViewTextBoxColumn colChangeType;
private System.Windows.Forms.DataGridViewTextBoxColumn colChangeReason;
private System.Windows.Forms.DataGridViewTextBoxColumn colMsg;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopLoginName;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopId;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopName;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopNotes;
private System.Windows.Forms.DataGridViewTextBoxColumn colLoginStatus;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCanUse;
private System.Windows.Forms.DataGridViewTextBoxColumn colMessage;
}
}
@@ -291,6 +291,7 @@ namespace TemuKJD.KJDForms.ProductForms
if (jsonStr.Contains("当前操作人数太多,请稍后重试") && tryCount < 5)
{
tryCount++;
Thread.Sleep(Randomx.GetId(500,1000));
goto tryAgain;
}
if (jsonStr.Contains("当前操作人数太多,请稍后重试"))
@@ -306,6 +307,7 @@ namespace TemuKJD.KJDForms.ProductForms
continue;
}
string snTag = BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now).ToString();
if (jsonStr.Contains("\"success\":true"))
{
var jArr = new JArray();
@@ -323,6 +325,7 @@ namespace TemuKJD.KJDForms.ProductForms
TemuPriceAdjustInfo pInfo = JsonHelper.DeserializeJsonToObject<TemuPriceAdjustInfo>(sItem); // 反序列化得到类
if (pInfo != null && !lstPriceAdjustInfo.Any(a=>a.priceOrderSn == pInfo.priceOrderSn))
{
pInfo.snTag = snTag;
lstPriceAdjustInfo.Add(pInfo);
//string url = pInfo.image.Replace("https", "http");
@@ -335,7 +338,8 @@ namespace TemuKJD.KJDForms.ProductForms
pInfo.supplierId,
shop.ShopAccount, // pInfo.supplierName, // 列表里取不到,这里取shop里的
pInfo.priceOrderSn,
null,//image, // skc图片
pInfo.image.Replace("https", "http"),
defaultBitmap,//image, // skc图片
pInfo.productId,
pInfo.skcId,
pInfo.productName + "\r\n" + pInfo.skuSpecs, // 商品标题+sku名称
@@ -353,6 +357,10 @@ namespace TemuKJD.KJDForms.ProductForms
}));
}
}
Invoke(new Action(() =>
{
ShowDgvImg();
}));
int total = BaseRegex.GetStringJson(ref jsonStr, "total").ParseToInt();
totalPage = Math.Ceiling(total / 10.0).ParseToInt();
@@ -513,8 +521,13 @@ namespace TemuKJD.KJDForms.ProductForms
Thread.Sleep(200 + Randomx.GetId(100));
//var adjustLst = lstPriceAdjustInfo.Where(a => a.skuIds == priceAdjust.skuIds && a.isRefuseAdjust == false).ToList();
var adjustLst = lstPriceAdjustInfo.Where(a =>
priceAdjust.skuInfoItemList.Any(sku => a.skuIds.Contains(sku.productSkuId.ToString())) && a.isRefuseAdjust == false).ToList();
//var adjustLst = lstPriceAdjustInfo.Where(a =>
// priceAdjust.skuInfoItemList.Any(sku => a.skuIds.Contains(sku.productSkuId.ToString())) && a.isRefuseAdjust == false).ToList();
// 同一页的一起提交
var adjustLst = lstPriceAdjustInfo.Where(a =>
a.snTag == priceAdjust.snTag && // 选中商品的同页商品
lstPriceAdjust.Any(s => s.skcId == a.skcId) && // 该商品也需要有同skc商品被选中
a.isRefuseAdjust == false).ToList(); // 没有被取消调价过
var adjustStrLst = adjustLst.Select(s => s.id.ParseToString()).ToList();
@@ -526,6 +539,13 @@ namespace TemuKJD.KJDForms.ProductForms
foreach(var adj in adjustLst)
{
adj.isRefuseAdjust = true;
var rs = this.dgvAdjust.Rows.Cast<DataGridViewRow>().Where(r =>
r.Cells["colPriceOrderSn"].Value.ToString() == adj.priceOrderSn.ParseToString());
Invoke(new Action(() =>
{
foreach(var r in rs)
r.Cells["colMsg"].Value = "已拒绝跟价";
}));
}
}
@@ -598,5 +618,57 @@ namespace TemuKJD.KJDForms.ProductForms
break;
}
}
Bitmap defaultBitmap = new Bitmap(80, 80);
void ShowDgvImg()
{
Task.Run(() =>
{
foreach (DataGridViewRow row in this.dgvAdjust.Rows)
{
if (row.Index > 0 && row.Cells["colProductSkcPic"].Displayed == false)
{
try
{
Invoke(new Action(() =>
{
row.Cells["colProductSkcPic"].Value = defaultBitmap;
}));
}
catch
{
}
continue;
}
if (row.Cells["colProductSkcPic"].Value != null && row.Cells["colProductSkcPic"].Value != defaultBitmap)
continue;
Image image = null;
string imgUrl = row.Cells["colImgUrl"]?.Value.ParseToString();
string getImgError = "";
if (!string.IsNullOrWhiteSpace(imgUrl))
image = GetHtml.GetUrlImg(imgUrl, out getImgError);
if (!string.IsNullOrEmpty(getImgError))
BaseMsgForm.ShowError(getImgError);
try
{
Invoke(new Action(() =>
{
row.Cells["colProductSkcPic"].Value = image;
}));
}
catch
{
}
}
});
}
private void dgvAdjust_Scroll(object sender, ScrollEventArgs e)
{
ShowDgvImg();
}
}
}
@@ -150,6 +150,9 @@
<metadata name="colPriceOrderSn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colImgUrl.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colProductSkcPic.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
+194 -176
View File
@@ -117,12 +117,17 @@ namespace TemuKJD.KJDForms.ProductForms
this.btnStopAdd = new DevComponents.DotNetBar.PanelEx();
this.chkLimited = new System.Windows.Forms.CheckBox();
this.dgvStock = new TemuKJD.UserComponent.DataGridViewEx();
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.btnClear = new DevComponents.DotNetBar.PanelEx();
this.colUpId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colSupplierId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSupplierName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colStockId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colParentStockId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colProductSkcPic = new System.Windows.Forms.DataGridViewImageColumn();
this.colProductId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colProdSkc = new System.Windows.Forms.DataGridViewLinkColumn();
@@ -134,12 +139,9 @@ namespace TemuKJD.KJDForms.ProductForms
this.colTodaySaleVolume = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSalesInventoryNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colWaitReceiveNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colQualityScore = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colNeedStockUp = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.btnClear = new DevComponents.DotNetBar.PanelEx();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -1334,6 +1336,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.colSupplierName,
this.colStockId,
this.colParentStockId,
this.colImgUrl,
this.colProductSkcPic,
this.colProductId,
this.colProdSkc,
@@ -1345,6 +1348,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.colTodaySaleVolume,
this.colSalesInventoryNum,
this.colWaitReceiveNum,
this.colQualityScore,
this.colNeedStockUp,
this.colMsg});
this.dgvStock.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -1355,159 +1359,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.dgvStock.Size = new System.Drawing.Size(860, 435);
this.dgvStock.TabIndex = 187;
this.dgvStock.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvStock_CellContentClick);
//
// colUpId
//
this.colUpId.HeaderText = "上家Id";
this.colUpId.Name = "colUpId";
this.colUpId.ReadOnly = true;
this.colUpId.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colUpId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colUpId.Visible = false;
this.colUpId.Width = 95;
//
// colCheck
//
this.colCheck.HeaderText = "选择";
this.colCheck.Name = "colCheck";
this.colCheck.ReadOnly = true;
this.colCheck.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colCheck.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colCheck.Width = 30;
//
// colSupplierId
//
this.colSupplierId.HeaderText = "店铺Id";
this.colSupplierId.Name = "colSupplierId";
this.colSupplierId.ReadOnly = true;
//
// colSupplierName
//
this.colSupplierName.HeaderText = "店铺名称";
this.colSupplierName.Name = "colSupplierName";
this.colSupplierName.ReadOnly = true;
this.colSupplierName.Width = 110;
//
// colStockId
//
this.colStockId.HeaderText = "备货单号";
this.colStockId.Name = "colStockId";
this.colStockId.ReadOnly = true;
this.colStockId.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colStockId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colStockId.Width = 120;
//
// colParentStockId
//
this.colParentStockId.HeaderText = "备货母单号";
this.colParentStockId.Name = "colParentStockId";
this.colParentStockId.ReadOnly = true;
this.colParentStockId.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colParentStockId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colParentStockId.Width = 120;
//
// colProductSkcPic
//
this.colProductSkcPic.HeaderText = "Skc图片";
this.colProductSkcPic.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom;
this.colProductSkcPic.Name = "colProductSkcPic";
this.colProductSkcPic.ReadOnly = true;
this.colProductSkcPic.Visible = false;
this.colProductSkcPic.Width = 60;
//
// colProductId
//
this.colProductId.HeaderText = "商品Id";
this.colProductId.Name = "colProductId";
this.colProductId.ReadOnly = true;
this.colProductId.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colProductId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colProductId.Visible = false;
//
// colProdSkc
//
this.colProdSkc.FillWeight = 150F;
this.colProdSkc.HeaderText = "商品SKC";
this.colProdSkc.Name = "colProdSkc";
this.colProdSkc.ReadOnly = true;
this.colProdSkc.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colProdSkc.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colProdSkc.Width = 90;
//
// colProdName
//
this.colProdName.HeaderText = "标题";
this.colProdName.Name = "colProdName";
this.colProdName.ReadOnly = true;
this.colProdName.Width = 200;
//
// colPrcie
//
this.colPrcie.HeaderText = "价格";
this.colPrcie.Name = "colPrcie";
this.colPrcie.ReadOnly = true;
this.colPrcie.Visible = false;
//
// colFrom
//
this.colFrom.HeaderText = "来源";
this.colFrom.Name = "colFrom";
this.colFrom.ReadOnly = true;
this.colFrom.Visible = false;
//
// colFromFake
//
this.colFromFake.HeaderText = "来源";
this.colFromFake.Name = "colFromFake";
this.colFromFake.ReadOnly = true;
this.colFromFake.Visible = false;
//
// colInCartNumber7d
//
this.colInCartNumber7d.HeaderText = "近七日加购";
this.colInCartNumber7d.Name = "colInCartNumber7d";
this.colInCartNumber7d.ReadOnly = true;
this.colInCartNumber7d.Visible = false;
this.colInCartNumber7d.Width = 75;
//
// colTodaySaleVolume
//
this.colTodaySaleVolume.HeaderText = "今日销量";
this.colTodaySaleVolume.Name = "colTodaySaleVolume";
this.colTodaySaleVolume.ReadOnly = true;
this.colTodaySaleVolume.Visible = false;
this.colTodaySaleVolume.Width = 70;
//
// colSalesInventoryNum
//
this.colSalesInventoryNum.HeaderText = "仓库可用库存";
this.colSalesInventoryNum.Name = "colSalesInventoryNum";
this.colSalesInventoryNum.ReadOnly = true;
this.colSalesInventoryNum.Visible = false;
this.colSalesInventoryNum.Width = 90;
//
// colWaitReceiveNum
//
this.colWaitReceiveNum.HeaderText = "已发货库存";
this.colWaitReceiveNum.Name = "colWaitReceiveNum";
this.colWaitReceiveNum.ReadOnly = true;
this.colWaitReceiveNum.Visible = false;
this.colWaitReceiveNum.Width = 75;
//
// colNeedStockUp
//
this.colNeedStockUp.HeaderText = "是否需备货";
this.colNeedStockUp.Name = "colNeedStockUp";
this.colNeedStockUp.ReadOnly = true;
this.colNeedStockUp.Visible = false;
this.colNeedStockUp.Width = 75;
//
// colMsg
//
this.colMsg.HeaderText = "状态";
this.colMsg.Name = "colMsg";
this.colMsg.ReadOnly = true;
this.colMsg.Width = 400;
this.dgvStock.Scroll += new System.Windows.Forms.ScrollEventHandler(this.dgvStock_Scroll);
//
// splitContainer4
//
@@ -1589,6 +1441,170 @@ namespace TemuKJD.KJDForms.ProductForms
this.btnClear.Text = "清空结果";
this.btnClear.Visible = false;
//
// colUpId
//
this.colUpId.HeaderText = "上家Id";
this.colUpId.Name = "colUpId";
this.colUpId.ReadOnly = true;
this.colUpId.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colUpId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colUpId.Visible = false;
this.colUpId.Width = 95;
//
// colCheck
//
this.colCheck.HeaderText = "选择";
this.colCheck.Name = "colCheck";
this.colCheck.ReadOnly = true;
this.colCheck.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colCheck.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colCheck.Width = 30;
//
// colSupplierId
//
this.colSupplierId.HeaderText = "店铺Id";
this.colSupplierId.Name = "colSupplierId";
this.colSupplierId.ReadOnly = true;
//
// colSupplierName
//
this.colSupplierName.HeaderText = "店铺名称";
this.colSupplierName.Name = "colSupplierName";
this.colSupplierName.ReadOnly = true;
this.colSupplierName.Width = 110;
//
// colStockId
//
this.colStockId.HeaderText = "备货单号";
this.colStockId.Name = "colStockId";
this.colStockId.ReadOnly = true;
this.colStockId.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colStockId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colStockId.Width = 120;
//
// colParentStockId
//
this.colParentStockId.HeaderText = "备货母单号";
this.colParentStockId.Name = "colParentStockId";
this.colParentStockId.ReadOnly = true;
this.colParentStockId.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colParentStockId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colParentStockId.Width = 120;
//
// colImgUrl
//
this.colImgUrl.HeaderText = "图片路径";
this.colImgUrl.Name = "colImgUrl";
this.colImgUrl.ReadOnly = true;
this.colImgUrl.Visible = false;
//
// colProductSkcPic
//
this.colProductSkcPic.HeaderText = "Skc图片";
this.colProductSkcPic.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom;
this.colProductSkcPic.Name = "colProductSkcPic";
this.colProductSkcPic.ReadOnly = true;
this.colProductSkcPic.Width = 60;
//
// colProductId
//
this.colProductId.HeaderText = "商品Id";
this.colProductId.Name = "colProductId";
this.colProductId.ReadOnly = true;
this.colProductId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// colProdSkc
//
this.colProdSkc.FillWeight = 150F;
this.colProdSkc.HeaderText = "商品SKC";
this.colProdSkc.Name = "colProdSkc";
this.colProdSkc.ReadOnly = true;
this.colProdSkc.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colProdSkc.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colProdSkc.Width = 90;
//
// colProdName
//
this.colProdName.HeaderText = "标题";
this.colProdName.Name = "colProdName";
this.colProdName.ReadOnly = true;
this.colProdName.Width = 200;
//
// colPrcie
//
this.colPrcie.HeaderText = "价格";
this.colPrcie.Name = "colPrcie";
this.colPrcie.ReadOnly = true;
this.colPrcie.Visible = false;
//
// colFrom
//
this.colFrom.HeaderText = "来源";
this.colFrom.Name = "colFrom";
this.colFrom.ReadOnly = true;
this.colFrom.Visible = false;
//
// colFromFake
//
this.colFromFake.HeaderText = "来源";
this.colFromFake.Name = "colFromFake";
this.colFromFake.ReadOnly = true;
this.colFromFake.Visible = false;
//
// colInCartNumber7d
//
this.colInCartNumber7d.HeaderText = "近七日加购";
this.colInCartNumber7d.Name = "colInCartNumber7d";
this.colInCartNumber7d.ReadOnly = true;
this.colInCartNumber7d.Visible = false;
this.colInCartNumber7d.Width = 75;
//
// colTodaySaleVolume
//
this.colTodaySaleVolume.HeaderText = "今日销量";
this.colTodaySaleVolume.Name = "colTodaySaleVolume";
this.colTodaySaleVolume.ReadOnly = true;
this.colTodaySaleVolume.Visible = false;
this.colTodaySaleVolume.Width = 70;
//
// colSalesInventoryNum
//
this.colSalesInventoryNum.HeaderText = "仓库可用库存";
this.colSalesInventoryNum.Name = "colSalesInventoryNum";
this.colSalesInventoryNum.ReadOnly = true;
this.colSalesInventoryNum.Visible = false;
this.colSalesInventoryNum.Width = 90;
//
// colWaitReceiveNum
//
this.colWaitReceiveNum.HeaderText = "已发货库存";
this.colWaitReceiveNum.Name = "colWaitReceiveNum";
this.colWaitReceiveNum.ReadOnly = true;
this.colWaitReceiveNum.Visible = false;
this.colWaitReceiveNum.Width = 75;
//
// colQualityScore
//
this.colQualityScore.HeaderText = "品质分";
this.colQualityScore.Name = "colQualityScore";
this.colQualityScore.ReadOnly = true;
this.colQualityScore.Width = 60;
//
// colNeedStockUp
//
this.colNeedStockUp.HeaderText = "是否需备货";
this.colNeedStockUp.Name = "colNeedStockUp";
this.colNeedStockUp.ReadOnly = true;
this.colNeedStockUp.Visible = false;
this.colNeedStockUp.Width = 75;
//
// colMsg
//
this.colMsg.HeaderText = "状态";
this.colMsg.Name = "colMsg";
this.colMsg.ReadOnly = true;
this.colMsg.Width = 400;
//
// SaleStockUpForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1716,25 +1732,6 @@ namespace TemuKJD.KJDForms.ProductForms
private System.Windows.Forms.TextBox txtScale2;
private System.Windows.Forms.Label label14;
private DevComponents.DotNetBar.PanelEx panelEx1;
private System.Windows.Forms.DataGridViewLinkColumn colUpId;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierName;
private System.Windows.Forms.DataGridViewLinkColumn colStockId;
private System.Windows.Forms.DataGridViewLinkColumn colParentStockId;
private System.Windows.Forms.DataGridViewImageColumn colProductSkcPic;
private System.Windows.Forms.DataGridViewLinkColumn colProductId;
private System.Windows.Forms.DataGridViewLinkColumn colProdSkc;
private System.Windows.Forms.DataGridViewTextBoxColumn colProdName;
private System.Windows.Forms.DataGridViewTextBoxColumn colPrcie;
private System.Windows.Forms.DataGridViewTextBoxColumn colFrom;
private System.Windows.Forms.DataGridViewTextBoxColumn colFromFake;
private System.Windows.Forms.DataGridViewTextBoxColumn colInCartNumber7d;
private System.Windows.Forms.DataGridViewTextBoxColumn colTodaySaleVolume;
private System.Windows.Forms.DataGridViewTextBoxColumn colSalesInventoryNum;
private System.Windows.Forms.DataGridViewTextBoxColumn colWaitReceiveNum;
private System.Windows.Forms.DataGridViewTextBoxColumn colNeedStockUp;
private System.Windows.Forms.DataGridViewTextBoxColumn colMsg;
private System.Windows.Forms.TextBox txtMinBound;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label lblMinBound;
@@ -1752,5 +1749,26 @@ namespace TemuKJD.KJDForms.ProductForms
private System.Windows.Forms.DataGridViewTextBoxColumn colLoginStatus;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCanUse;
private System.Windows.Forms.DataGridViewTextBoxColumn colMessage;
private System.Windows.Forms.DataGridViewLinkColumn colUpId;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierName;
private System.Windows.Forms.DataGridViewLinkColumn colStockId;
private System.Windows.Forms.DataGridViewLinkColumn colParentStockId;
private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colProductSkcPic;
private System.Windows.Forms.DataGridViewLinkColumn colProductId;
private System.Windows.Forms.DataGridViewLinkColumn colProdSkc;
private System.Windows.Forms.DataGridViewTextBoxColumn colProdName;
private System.Windows.Forms.DataGridViewTextBoxColumn colPrcie;
private System.Windows.Forms.DataGridViewTextBoxColumn colFrom;
private System.Windows.Forms.DataGridViewTextBoxColumn colFromFake;
private System.Windows.Forms.DataGridViewTextBoxColumn colInCartNumber7d;
private System.Windows.Forms.DataGridViewTextBoxColumn colTodaySaleVolume;
private System.Windows.Forms.DataGridViewTextBoxColumn colSalesInventoryNum;
private System.Windows.Forms.DataGridViewTextBoxColumn colWaitReceiveNum;
private System.Windows.Forms.DataGridViewTextBoxColumn colQualityScore;
private System.Windows.Forms.DataGridViewTextBoxColumn colNeedStockUp;
private System.Windows.Forms.DataGridViewTextBoxColumn colMsg;
}
}
+190 -45
View File
@@ -165,7 +165,7 @@ namespace TemuKJD.KJDForms.ProductForms
col.Visible = true;
}
if (col.Name == "colTodaySaleVolume" || col.Name == "colInCartNumber7d" || col.Name == "colSalesInventoryNum"
|| col.Name == "colWaitReceiveNum" || col.Name == "colNeedStockUp")
|| col.Name == "colWaitReceiveNum" || col.Name == "colNeedStockUp" || col.Name == "colQualityScore")
{
col.Visible = false;
}
@@ -296,6 +296,7 @@ namespace TemuKJD.KJDForms.ProductForms
sInfo.supplierName,
sInfo.subPurchaseOrderSn,
sInfo.originalPurchaseOrderSn,
sInfo.productSkcPicture.Replace("https", "http"),
null,//image,
sInfo.productId,
sInfo.productSkcId,
@@ -306,6 +307,7 @@ namespace TemuKJD.KJDForms.ProductForms
"",
"",
"",
0.0,
"",
""
);
@@ -314,6 +316,10 @@ namespace TemuKJD.KJDForms.ProductForms
}));
}
}
Invoke(new Action(() =>
{
ShowDgvImg();
}));
int total = BaseRegex.GetStringJson(ref jsonStr, "total").ParseToInt();
totalPage = Math.Ceiling(total / 20.0).ParseToInt();
@@ -435,7 +441,7 @@ namespace TemuKJD.KJDForms.ProductForms
page = Math.Max(page, 1);
string url = "https://seller.kuajingmaihuo.com/marvel-mms/cn/api/kiana/venom/sales/management/listWarehouse";
string body = @"{""pageNo"":" + page + @",""pageSize"":10,""isLack"":0,""selectStatusList"":[12],""priceAdjustRecentDays"":7}";
string body = @"{""pageNo"":" + page + @",""pageSize"":40,""isLack"":0,""selectStatusList"":[12],""priceAdjustRecentDays"":7}";
string refere = "https://seller.kuajingmaihuo.com/main/sale-manage/main";
return KJDHttpResponse.PostResponse(shop, url, body, refere);
@@ -520,6 +526,47 @@ namespace TemuKJD.KJDForms.ProductForms
return KJDHttpResponse.PostResponse2(shop, url, body, refere);
}
/// <summary>
/// 小于60分商品
/// </summary>
private string GetQualityInfo1_2(ShopLoginInfo shop, string productIds)
{
string url = "https://agentseller.temu.com/bg-luna-agent-seller/goods/quality/supplyChain/qualityMetrics/pageQuery";
string body = @"{""page"":1,""pageSize"":40,""qualityScoreEnum"":1,""productIds"":[" + productIds + "]}";
string refere = "https://agentseller.temu.com/main/quality/dashboard";
return KJDHttpResponse.PostResponse2(shop, url, body, refere);
}
/// <summary>
/// 60分到70分商品
/// </summary>
private string GetQualityInfo2_2(ShopLoginInfo shop, string productIds)
{
string url = "https://agentseller.temu.com/bg-luna-agent-seller/goods/quality/supplyChain/qualityMetrics/pageQuery";
string body = @"{""page"":1,""pageSize"":40,""qualityScoreEnum"":2,""productIds"":[" + productIds + "]}";
string refere = "https://agentseller.temu.com/main/quality/dashboard";
return KJDHttpResponse.PostResponse2(shop, url, body, refere);
}
/// <summary>
/// 70分到90分商品
/// </summary>
private string GetQualityInfo3_2(ShopLoginInfo shop, string productIds)
{
string url = "https://agentseller.temu.com/bg-luna-agent-seller/goods/quality/supplyChain/qualityMetrics/pageQuery";
string body = @"{""page"":1,""pageSize"":40,""qualityScoreEnum"":3,""productIds"":[" + productIds + "]}";
string refere = "https://agentseller.temu.com/main/quality/dashboard";
return KJDHttpResponse.PostResponse2(shop, url, body, refere);
}
/// <summary>
/// 90分以上
/// </summary>
private string GetQualityInfo4_2(ShopLoginInfo shop, string productIds, int qualityScoreEnum = 4)
{
string url = "https://agentseller.temu.com/bg-luna-agent-seller/goods/quality/supplyChain/qualityMetrics/pageQuery";
string body = @"{""page"":1,""pageSize"":40,""qualityScoreEnum"":" + qualityScoreEnum + @",""productIds"":[" + productIds + "]}";
string refere = "https://agentseller.temu.com/main/quality/dashboard";
return KJDHttpResponse.PostResponse2(shop, url, body, refere);
}
private void dgvShop_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0)
@@ -730,7 +777,7 @@ namespace TemuKJD.KJDForms.ProductForms
col.Visible = false;
}
if (col.Name == "colTodaySaleVolume" || col.Name == "colInCartNumber7d" || col.Name == "colSalesInventoryNum"
|| col.Name == "colWaitReceiveNum" || col.Name == "colNeedStockUp")
|| col.Name == "colWaitReceiveNum" || col.Name == "colNeedStockUp" || col.Name == "colQualityScore")
{
col.Visible = true;
}
@@ -832,6 +879,8 @@ namespace TemuKJD.KJDForms.ProductForms
{
BaseMsgForm.ShowError(ex.Message);
}
List<SubOrderInfo> subOrderInfoLstTmp = new List<SubOrderInfo>();
foreach (var item in jArr)
{
string sItem = item.ToString();
@@ -862,50 +911,83 @@ namespace TemuKJD.KJDForms.ProductForms
sInfo.needStockUp = true;
else
sInfo.needStockUp = false;
lstSubOrderInfo.Add(sInfo);
//string url = sInfo.productSkcPicture.Replace("https", "http");
//// var stream = WebRequest.Create(url).GetResponse().GetResponseStream();
//Image image = null;
//using (Stream stream = WebRequest.Create(url).GetResponse().GetResponseStream())
//{
// try {
// image = Image.FromStream(stream);
// }
// catch (Exception ex)
// {
// }
//}
Invoke(new Action(() =>
{
var rowId = this.dgvStock.Rows.Add(
"",
true,
sInfo.supplierId,
sInfo.supplierName,
"",//sInfo.subPurchaseOrderSn,
"",//sInfo.originalPurchaseOrderSn,
null,//image,
sInfo.productId,
sInfo.productSkcId,
sInfo.productName,
"",
"",
"",
sInfo.skuQuantityTotalInfo.inCartNumber7d,
sInfo.skuQuantityTotalInfo.todaySaleVolume,
sInfo.skuQuantityTotalInfo.inventoryNumInfo.warehouseInventoryNum,
sInfo.skuQuantityTotalInfo.inventoryNumInfo.waitReceiveNum,
sInfo.needStockUp == false ? "无需备货" : "可备货",
""
);
if (rowId >= 0)
dgvStock.Rows[rowId].Height = 60;
//dgvStock.Rows.Cast[dgvStock.Rows].Height=60;
}));
subOrderInfoLstTmp.Add(sInfo);
}
}
//获取品质信息------------------------------------------------------------------------
List<TemuGoodsQualityInfo> qualityInfoLst = new List<TemuGoodsQualityInfo>();
string productIds = string.Join(",", subOrderInfoLstTmp.Select(o=>o.productId));
string qualityErr = "";
try
{
for (int j = 1; j <= 4; j++)
{
var qualityRst1 = this.GetQualityInfo4_2(shop, productIds, j);
if (qualityRst1.Contains("\"success\":true"))
{
var jObj = JObject.Parse(qualityRst1);
string jStr = JsonHelper.SerializeObject(jObj["result"]["pageItems"]);
qualityInfoLst.AddRange(JsonHelper.DeserializeJsonToList<TemuGoodsQualityInfo>(jStr));
}
else
{
qualityErr = BaseRegex.GetStringJson(ref qualityRst1, "errorMsg");
if (string.IsNullOrWhiteSpace(qualityErr))
qualityErr += BaseRegex.GetStringJson(ref qualityRst1, "error_msg");
}
Thread.Sleep(Randomx.GetId(100, 200));
}
}
catch (Exception ex) { qualityErr += "\r\n" + ex.Message; };
if (qualityErr != "")
{
BaseMsgForm.ShowError("获取商品品质信息失败!" + qualityErr);
}
foreach (var qualityInfo in qualityInfoLst)
{
var order = subOrderInfoLstTmp.FirstOrDefault(o => o.productId == qualityInfo.productId);
if (order != null)
order.goodsAfsScore = qualityInfo.goodsAfsScore;
}
//---------------------------------------------------------------------------------------
lstSubOrderInfo.AddRange(subOrderInfoLstTmp);
foreach (var sInfo in subOrderInfoLstTmp)
{
Invoke(new Action(() =>
{
var rowId = this.dgvStock.Rows.Add(
"",
true,
sInfo.supplierId,
sInfo.supplierName,
"",//sInfo.subPurchaseOrderSn,
"",//sInfo.originalPurchaseOrderSn,
sInfo.productSkcPicture.Replace("https", "http"),
defaultBitmap,//image,
sInfo.productId,
sInfo.productSkcId,
sInfo.productName,
"",
"",
"",
sInfo.skuQuantityTotalInfo.inCartNumber7d,
sInfo.skuQuantityTotalInfo.todaySaleVolume,
sInfo.skuQuantityTotalInfo.inventoryNumInfo.warehouseInventoryNum,
sInfo.skuQuantityTotalInfo.inventoryNumInfo.waitReceiveNum,
sInfo.goodsAfsScore == null ? "-" : (Math.Round(sInfo.goodsAfsScore.Value * 10) / 10).ToString(),
sInfo.needStockUp == false ? "无需备货" : "可备货",
""
);
if (rowId >= 0)
dgvStock.Rows[rowId].Height = 60;
}));
}
Invoke(new Action(() =>
{
ShowDgvImg();
}));
int total = BaseRegex.GetStringJson(ref jsonStr, "total").ParseToInt();
totalPage = Math.Ceiling(total / 10.0).ParseToInt();
@@ -995,6 +1077,17 @@ namespace TemuKJD.KJDForms.ProductForms
}));
continue;
}
if (stockUp.goodsAfsScore != null && stockUp.goodsAfsScore < 75)
{
Invoke(new Action(() =>
{
foreach (var row in rows)
{
row.Cells["colMsg"].Value = "商品品质得分过低,请去网页手动备货";
}
}));
continue;
}
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == stockUp.supplierId.ToString());
if (shop == null || shop.LoginStatus != "登录成功")
@@ -1134,5 +1227,57 @@ namespace TemuKJD.KJDForms.ProductForms
{
this.isNewService = ucCheckBox1.Checked;
}
Bitmap defaultBitmap = new Bitmap(80, 80);
void ShowDgvImg()
{
Task.Run(() =>
{
foreach (DataGridViewRow row in this.dgvStock.Rows)
{
if (row.Index > 0 && row.Cells["colProductSkcPic"].Displayed == false)
{
try
{
Invoke(new Action(() =>
{
row.Cells["colProductSkcPic"].Value = defaultBitmap;
}));
}
catch
{
}
continue;
}
if (row.Cells["colProductSkcPic"].Value != null && row.Cells["colProductSkcPic"].Value != defaultBitmap)
continue;
Image image = null;
string imgUrl = row.Cells["colImgUrl"]?.Value.ParseToString();
string getImgError = "";
if (!string.IsNullOrWhiteSpace(imgUrl))
image = GetHtml.GetUrlImg(imgUrl, out getImgError);
if (!string.IsNullOrEmpty(getImgError))
BaseMsgForm.ShowError(getImgError);
try
{
Invoke(new Action(() =>
{
row.Cells["colProductSkcPic"].Value = image;
}));
}
catch
{
}
}
});
}
private void dgvStock_Scroll(object sender, ScrollEventArgs e)
{
ShowDgvImg();
}
}
}
@@ -156,6 +156,9 @@
<metadata name="colParentStockId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colImgUrl.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colProductSkcPic.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -186,6 +189,9 @@
<metadata name="colWaitReceiveNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colQualityScore.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colNeedStockUp.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>