产品库搜索无分组商品 页面模拟上传优化

This commit is contained in:
wule committed 2026-04-22 21:39:36 +08:00
1 parent ec559bd6cc
commit 2cc12d96c9
20 files changed
+1160 -878

No files matched your search

@@ -208,7 +208,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
}
else
{
row.Cells["colSelect"].Value = !isInit || (selectShopId.Contains(shopEntity.ShopId) && canUse);
row.Cells["colSelect"].Value = selectShopId.Contains(shopEntity.ShopId) && canUse;
row.Cells["colShopLoginName"].Value = shopEntity.LoginName;
row.Cells["colShopName"].Value = shopEntity.ShopAccount;
row.Cells["colShopNotes"].Value = shopEntity.Notes;
@@ -2427,7 +2427,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
List<string> out_goods_sn_list = null;
List<string> skuSns = null;
long? minPrice = null, maxPrice = null;
string jsonStr = PDDProductUpDownForm.shop_goods_search(shop, goods_id_list, goods_name, out_goods_sn_list, skuSns, isOnsale, minPrice, maxPrice, 1, pageSize);
string jsonStr = PDDProductUpDownForm.shop_goods_search(shop, goods_id_list, goods_name, out_goods_sn_list, skuSns, isOnsale, null, minPrice, maxPrice, 1, pageSize);
if (jsonStr.Contains("繁忙") && tryCount < 5)
{
tryCount++;
@@ -2991,7 +2991,9 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
if (skuInfo.quantity != 0)
skuInfo.quantity = txtStockNum.Text.Trim().ParseToInt();
// 聚水潭商品 加邮费×倍率 放前面
var new_multi_price = sku.multi_price + (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
// 使用货号价格做基础价
if (chkUseExtCodePrice.Checked && dbProd.ext_code_price > 0)
{
@@ -2999,7 +3001,6 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
}
skuInfo.multi_price = (new_multi_price * this.txtAddTimes.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt();
//skuInfo.price = (sku.price * this.txtAddTimes.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt();
if (defaultAddPriceRule.AddMorePriceFirst) // 先加后乘
skuInfo.multi_price = ((new_multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimes.Text.Trim().ParseToDecimal()).ParseToInt();
skuInfo.price = skuInfo.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt();
@@ -3020,16 +3021,11 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
}
}
}
// 聚水潭商品 加邮费×倍率 放前面
//skuInfo.multi_price += (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
//skuInfo.price += (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
if (marketPrice < skuInfo.price + 1000)
if (marketPrice < skuInfo.price * 2)
{
marketPrice = skuInfo.price.ParseToInt() + 1000;
//pddApi.Data["market_price"] = marketPrice;
marketPrice = skuInfo.price.ParseToInt() * 2;
}
addPriceSkuInfoLst.Add(skuInfo);
}
}
@@ -3252,18 +3248,21 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
foreach (var prodParam in prodParamLst)
{
var rws = rowOperateLst.Where(r => prodParam.goods_id == r.Cells["colSpuId"].Value.ParseToLong()).ToList();
var lowPrice = prodParam.skus.Where(s => s.sku69_code != "yes" && s.quantity_delta != 0).ToList().Min(s => s.multi_price);
var highPrice = prodParam.skus.Where(s => s.sku69_code != "yes" && s.quantity_delta != 0).ToList().Max(s => s.multi_price);
// sku全部同价不设置低价sku
if (lowPrice == highPrice)
continue;
Invoke(new Action(() =>
{
foreach (var rw in rws) rw.Cells["colOpResult"].Value += " 正在设置低价Sku";
}));
var lowPrice = prodParam.skus.Where(s => s.sku69_code != "yes" && s.quantity_delta != 0).ToList().Min(s => s.multi_price);
//var skuTmp = prodParam.skus.Where(s => s.sku69_code != "yes" && s.quantity_delta != 0).ToList().FirstOrDefault(s => s.multi_price == lowPrice);
//var skuTmpLst = prodParam.skus.Where(s => s.spec[0].spec_id == skuTmp.spec[0].spec_id && s.multi_price == lowPrice).ToList();
var skuTmpLst = prodParam.skus.Where(s => s.multi_price == lowPrice).ToList();
var prodInfo = lstActListProdInfo.FirstOrDefault(a => a.goods_id == prodParam.goods_id).productInfo;
var skuInfos = prodInfo.detail.sku.Where(s => skuTmpLst.Any(st => st.out_sku_sn == s.out_sku_sn)).ToList();
//var newMultiPrice = skuInfos.Max(s => s.multi_price) + (prodInfo.ship_price * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt();
var newMultiPrice = skuInfos.Max(s => s.multi_price) + prodInfo.ship_price;
PddEditProdStockQuantity prodQuantity = new PddEditProdStockQuantity();
@@ -3288,7 +3287,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
}
var mdyQuantityRst = increase_prod_stock_quantity(shop, prodQuantity);
for (int i = 0; i < 5 && !mdyQuantityRst.Contains("\"success\":true"); i++)
for (int i = 0; i < 3 && !mdyQuantityRst.Contains("\"success\":true"); i++)
{
Thread.Sleep(Randomx.GetId(500, 1500));
mdyQuantityRst = increase_prod_stock_quantity(shop, prodQuantity);
@@ -3298,6 +3297,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
if (!mdyQuantityRst.Contains("\"success\":true") && !mdyQuantityRst.Contains("\"errorMsg\":\"库存未修改\""))
{
goodsIds.Add(prodParam.goods_id);
var error = BaseRegex.GetStringJson(ref mdyQuantityRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = mdyQuantityRst;
@@ -3305,13 +3305,14 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
Invoke(new Action(() =>
{
foreach (var rw in rws)
rw.Cells["colOpResult"].Value = rw.Cells["colOpResult"].Value.ParseToString().Replace("正在优化商品以报名活动", "商品优化失败 " + error);
rw.Cells["colOpResult"].Value = rw.Cells["colOpResult"].Value.ParseToString().Replace("正在设置低价Sku", "设置低价Sku失败 " + error);
}));
continue;
}
}
// 移除修改库存失败的商品
prodParamLst.RemoveAll(p => goodsIds.Contains(p.goods_id));
rowOperateLst = rowOperateLst.Where(r => prodParamLst.Any(p => p.goods_id == r.Cells["colSpuId"].Value.ParseToLong())).ToList();
}
string activityRsts = SignActivity(shop, prodParamLst, sign22347, sign20981, sign21365, sign15996, sign23513, sign23730, sign23456);
+324 -119
View File
@@ -35,8 +35,15 @@ namespace TemuKJD.PDDForms.ProductForms
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.label10 = new System.Windows.Forms.Label();
this.txtLowStock = new System.Windows.Forms.TextBox();
this.btnSelectLowStock = new DevComponents.DotNetBar.PanelEx();
this.btnSelectNotActivity = new DevComponents.DotNetBar.PanelEx();
this.txtMinPrice = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.txtMaxPrice = new System.Windows.Forms.TextBox();
@@ -57,10 +64,26 @@ namespace TemuKJD.PDDForms.ProductForms
this.label2 = new System.Windows.Forms.Label();
this.btnDelSelect = new DevComponents.DotNetBar.PanelEx();
this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.btnClearShopFilter = new DevComponents.DotNetBar.PanelEx();
this.btnFilter = new DevComponents.DotNetBar.PanelEx();
this.txtShopGroupFilter = new System.Windows.Forms.TextBox();
this.txtShopNameFilter = new System.Windows.Forms.TextBox();
this.label23 = new System.Windows.Forms.Label();
this.label22 = new System.Windows.Forms.Label();
this.btnRefreshShop = new DevComponents.DotNetBar.PanelEx();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colShopLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopNotes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSelectProduct = new System.Windows.Forms.DataGridViewLinkColumn();
this.colLoginStatus = new System.Windows.Forms.DataGridViewLinkColumn();
this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colRemaining = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.panel1 = new System.Windows.Forms.Panel();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
@@ -78,6 +101,7 @@ namespace TemuKJD.PDDForms.ProductForms
this.colSpuId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colExtCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colProductName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colResource = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colPrice = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colStock = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colFavorites = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -91,16 +115,6 @@ namespace TemuKJD.PDDForms.ProductForms
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.btnClear = new DevComponents.DotNetBar.PanelEx();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colShopLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopNotes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSelectProduct = new System.Windows.Forms.DataGridViewLinkColumn();
this.colLoginStatus = new System.Windows.Forms.DataGridViewLinkColumn();
this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colRemaining = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -152,6 +166,10 @@ namespace TemuKJD.PDDForms.ProductForms
| System.Windows.Forms.AnchorStyles.Right)));
this.ucGroupBoxEx2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx2.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx2.Controls.Add(this.label10);
this.ucGroupBoxEx2.Controls.Add(this.txtLowStock);
this.ucGroupBoxEx2.Controls.Add(this.btnSelectLowStock);
this.ucGroupBoxEx2.Controls.Add(this.btnSelectNotActivity);
this.ucGroupBoxEx2.Controls.Add(this.txtMinPrice);
this.ucGroupBoxEx2.Controls.Add(this.label4);
this.ucGroupBoxEx2.Controls.Add(this.txtMaxPrice);
@@ -171,13 +189,81 @@ namespace TemuKJD.PDDForms.ProductForms
this.ucGroupBoxEx2.Controls.Add(this.txtExtCode);
this.ucGroupBoxEx2.Controls.Add(this.label2);
this.ucGroupBoxEx2.Controls.Add(this.btnDelSelect);
this.ucGroupBoxEx2.Location = new System.Drawing.Point(147, 2);
this.ucGroupBoxEx2.Location = new System.Drawing.Point(145, 2);
this.ucGroupBoxEx2.Name = "ucGroupBoxEx2";
this.ucGroupBoxEx2.Size = new System.Drawing.Size(1212, 140);
this.ucGroupBoxEx2.Size = new System.Drawing.Size(1215, 140);
this.ucGroupBoxEx2.TabIndex = 667;
this.ucGroupBoxEx2.TabStop = false;
this.ucGroupBoxEx2.Text = "商品查询";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(829, 35);
this.label10.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(41, 17);
this.label10.TabIndex = 686;
this.label10.Text = "库存≤";
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtLowStock
//
this.txtLowStock.Location = new System.Drawing.Point(870, 32);
this.txtLowStock.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtLowStock.Name = "txtLowStock";
this.txtLowStock.Size = new System.Drawing.Size(38, 23);
this.txtLowStock.TabIndex = 685;
this.txtLowStock.Text = "1";
//
// btnSelectLowStock
//
this.btnSelectLowStock.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSelectLowStock.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSelectLowStock.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSelectLowStock.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSelectLowStock.Location = new System.Drawing.Point(913, 32);
this.btnSelectLowStock.Name = "btnSelectLowStock";
this.btnSelectLowStock.Size = new System.Drawing.Size(107, 23);
this.btnSelectLowStock.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnSelectLowStock.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSelectLowStock.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSelectLowStock.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnSelectLowStock.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnSelectLowStock.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnSelectLowStock.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnSelectLowStock.Style.GradientAngle = 90;
this.btnSelectLowStock.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnSelectLowStock.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSelectLowStock.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSelectLowStock.TabIndex = 684;
this.btnSelectLowStock.Text = "选中低库存商品";
this.btnSelectLowStock.Click += new System.EventHandler(this.btnSelectLowStock_Click);
//
// btnSelectNotActivity
//
this.btnSelectNotActivity.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSelectNotActivity.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSelectNotActivity.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSelectNotActivity.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSelectNotActivity.Location = new System.Drawing.Point(706, 32);
this.btnSelectNotActivity.Name = "btnSelectNotActivity";
this.btnSelectNotActivity.Size = new System.Drawing.Size(107, 23);
this.btnSelectNotActivity.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnSelectNotActivity.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSelectNotActivity.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSelectNotActivity.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnSelectNotActivity.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnSelectNotActivity.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnSelectNotActivity.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnSelectNotActivity.Style.GradientAngle = 90;
this.btnSelectNotActivity.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnSelectNotActivity.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSelectNotActivity.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSelectNotActivity.TabIndex = 680;
this.btnSelectNotActivity.Text = "选中非大促商品";
this.btnSelectNotActivity.Click += new System.EventHandler(this.btnSelectNotActivity_Click);
//
// txtMinPrice
//
this.txtMinPrice.Location = new System.Drawing.Point(383, 73);
@@ -223,7 +309,7 @@ namespace TemuKJD.PDDForms.ProductForms
this.btnUp.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnUp.DisabledBackColor = System.Drawing.Color.Empty;
this.btnUp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnUp.Location = new System.Drawing.Point(926, 32);
this.btnUp.Location = new System.Drawing.Point(929, 93);
this.btnUp.Name = "btnUp";
this.btnUp.Size = new System.Drawing.Size(124, 23);
this.btnUp.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -248,7 +334,7 @@ namespace TemuKJD.PDDForms.ProductForms
this.btnDown.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnDown.DisabledBackColor = System.Drawing.Color.Empty;
this.btnDown.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDown.Location = new System.Drawing.Point(796, 32);
this.btnDown.Location = new System.Drawing.Point(799, 93);
this.btnDown.Name = "btnDown";
this.btnDown.Size = new System.Drawing.Size(124, 23);
this.btnDown.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -367,6 +453,7 @@ namespace TemuKJD.PDDForms.ProductForms
this.cmbStatus.Items.AddRange(new object[] {
"下架",
"在售",
"售罄",
"全部"});
this.cmbStatus.Location = new System.Drawing.Point(91, 32);
this.cmbStatus.Name = "cmbStatus";
@@ -416,7 +503,7 @@ namespace TemuKJD.PDDForms.ProductForms
this.btnDelSelect.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnDelSelect.DisabledBackColor = System.Drawing.Color.Empty;
this.btnDelSelect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDelSelect.Location = new System.Drawing.Point(1056, 32);
this.btnDelSelect.Location = new System.Drawing.Point(1059, 93);
this.btnDelSelect.Name = "btnDelSelect";
this.btnDelSelect.Size = new System.Drawing.Size(124, 23);
this.btnDelSelect.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -440,14 +527,106 @@ namespace TemuKJD.PDDForms.ProductForms
| System.Windows.Forms.AnchorStyles.Left)));
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.btnClearShopFilter);
this.ucGroupBoxEx1.Controls.Add(this.btnFilter);
this.ucGroupBoxEx1.Controls.Add(this.txtShopGroupFilter);
this.ucGroupBoxEx1.Controls.Add(this.txtShopNameFilter);
this.ucGroupBoxEx1.Controls.Add(this.label23);
this.ucGroupBoxEx1.Controls.Add(this.label22);
this.ucGroupBoxEx1.Controls.Add(this.btnRefreshShop);
this.ucGroupBoxEx1.Location = new System.Drawing.Point(3, 2);
this.ucGroupBoxEx1.Location = new System.Drawing.Point(2, 2);
this.ucGroupBoxEx1.Name = "ucGroupBoxEx1";
this.ucGroupBoxEx1.Size = new System.Drawing.Size(144, 140);
this.ucGroupBoxEx1.TabIndex = 399;
this.ucGroupBoxEx1.TabStop = false;
this.ucGroupBoxEx1.Text = "基础";
//
// btnClearShopFilter
//
this.btnClearShopFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnClearShopFilter.CanvasColor = System.Drawing.SystemColors.Control;
this.btnClearShopFilter.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnClearShopFilter.DisabledBackColor = System.Drawing.Color.Empty;
this.btnClearShopFilter.Location = new System.Drawing.Point(59, 102);
this.btnClearShopFilter.Margin = new System.Windows.Forms.Padding(4, 2, 2, 2);
this.btnClearShopFilter.Name = "btnClearShopFilter";
this.btnClearShopFilter.Size = new System.Drawing.Size(38, 23);
this.btnClearShopFilter.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnClearShopFilter.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnClearShopFilter.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnClearShopFilter.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.btnClearShopFilter.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClearShopFilter.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.btnClearShopFilter.Style.GradientAngle = 90;
this.btnClearShopFilter.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.btnClearShopFilter.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnClearShopFilter.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClearShopFilter.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClearShopFilter.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnClearShopFilter.TabIndex = 577;
this.btnClearShopFilter.Text = "清空\r\n";
this.btnClearShopFilter.Click += new System.EventHandler(this.btnClearShopFilter_Click);
//
// btnFilter
//
this.btnFilter.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnFilter.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnFilter.DisabledBackColor = System.Drawing.Color.Empty;
this.btnFilter.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnFilter.Location = new System.Drawing.Point(100, 102);
this.btnFilter.Name = "btnFilter";
this.btnFilter.Size = new System.Drawing.Size(38, 23);
this.btnFilter.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnFilter.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnFilter.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnFilter.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnFilter.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnFilter.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnFilter.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnFilter.Style.GradientAngle = 90;
this.btnFilter.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnFilter.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnFilter.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnFilter.TabIndex = 576;
this.btnFilter.Text = "筛选";
this.btnFilter.Click += new System.EventHandler(this.btnFilter_Click);
//
// txtShopGroupFilter
//
this.txtShopGroupFilter.Location = new System.Drawing.Point(37, 74);
this.txtShopGroupFilter.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtShopGroupFilter.Name = "txtShopGroupFilter";
this.txtShopGroupFilter.Size = new System.Drawing.Size(101, 23);
this.txtShopGroupFilter.TabIndex = 575;
//
// txtShopNameFilter
//
this.txtShopNameFilter.Location = new System.Drawing.Point(37, 47);
this.txtShopNameFilter.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtShopNameFilter.Name = "txtShopNameFilter";
this.txtShopNameFilter.Size = new System.Drawing.Size(101, 23);
this.txtShopNameFilter.TabIndex = 574;
//
// label23
//
this.label23.AutoSize = true;
this.label23.Location = new System.Drawing.Point(5, 76);
this.label23.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label23.Name = "label23";
this.label23.Size = new System.Drawing.Size(32, 17);
this.label23.TabIndex = 573;
this.label23.Text = "备注";
//
// label22
//
this.label22.AutoSize = true;
this.label22.Location = new System.Drawing.Point(5, 50);
this.label22.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(32, 17);
this.label22.TabIndex = 572;
this.label22.Text = "店名";
//
// btnRefreshShop
//
this.btnRefreshShop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -455,7 +634,7 @@ namespace TemuKJD.PDDForms.ProductForms
this.btnRefreshShop.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnRefreshShop.DisabledBackColor = System.Drawing.Color.Empty;
this.btnRefreshShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRefreshShop.Location = new System.Drawing.Point(17, 31);
this.btnRefreshShop.Location = new System.Drawing.Point(17, 18);
this.btnRefreshShop.Name = "btnRefreshShop";
this.btnRefreshShop.Size = new System.Drawing.Size(110, 24);
this.btnRefreshShop.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -554,6 +733,88 @@ namespace TemuKJD.PDDForms.ProductForms
this.dgvShop.TabIndex = 6;
this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick);
//
// colSelect
//
this.colSelect.HeaderText = "全选";
this.colSelect.Name = "colSelect";
this.colSelect.ReadOnly = true;
this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSelect.Width = 28;
//
// colShopLoginName
//
this.colShopLoginName.HeaderText = "店铺登录名";
this.colShopLoginName.Name = "colShopLoginName";
this.colShopLoginName.ReadOnly = true;
this.colShopLoginName.Visible = false;
//
// colShopId
//
this.colShopId.HeaderText = "店铺Id";
this.colShopId.Name = "colShopId";
this.colShopId.ReadOnly = true;
this.colShopId.Visible = false;
this.colShopId.Width = 55;
//
// colShopName
//
this.colShopName.FillWeight = 150F;
this.colShopName.HeaderText = "店铺名称";
this.colShopName.Name = "colShopName";
this.colShopName.ReadOnly = true;
this.colShopName.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colShopName.Width = 70;
//
// colShopNotes
//
this.colShopNotes.HeaderText = "备注";
this.colShopNotes.Name = "colShopNotes";
this.colShopNotes.ReadOnly = true;
this.colShopNotes.Width = 70;
//
// colSelectProduct
//
this.colSelectProduct.HeaderText = "选择商品";
this.colSelectProduct.Name = "colSelectProduct";
this.colSelectProduct.ReadOnly = true;
this.colSelectProduct.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSelectProduct.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSelectProduct.Visible = false;
this.colSelectProduct.Width = 62;
//
// colLoginStatus
//
this.colLoginStatus.HeaderText = "状态";
this.colLoginStatus.Name = "colLoginStatus";
this.colLoginStatus.ReadOnly = true;
this.colLoginStatus.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colLoginStatus.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colLoginStatus.Width = 40;
//
// colCanUse
//
this.colCanUse.HeaderText = "可用";
this.colCanUse.Name = "colCanUse";
this.colCanUse.ReadOnly = true;
this.colCanUse.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colCanUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colCanUse.Visible = false;
this.colCanUse.Width = 28;
//
// colRemaining
//
this.colRemaining.HeaderText = "月限额";
this.colRemaining.Name = "colRemaining";
this.colRemaining.ReadOnly = true;
this.colRemaining.Visible = false;
//
// colMessage
//
this.colMessage.HeaderText = "消息";
this.colMessage.Name = "colMessage";
this.colMessage.ReadOnly = true;
//
// pbLoading
//
this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None;
@@ -690,6 +951,7 @@ namespace TemuKJD.PDDForms.ProductForms
this.colSpuId,
this.colExtCode,
this.colProductName,
this.colResource,
this.colPrice,
this.colStock,
this.colFavorites,
@@ -769,14 +1031,25 @@ namespace TemuKJD.PDDForms.ProductForms
this.colProductName.HeaderText = "商品标题";
this.colProductName.Name = "colProductName";
this.colProductName.ReadOnly = true;
this.colProductName.Width = 180;
this.colProductName.Width = 150;
//
// colResource
//
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colResource.DefaultCellStyle = dataGridViewCellStyle6;
this.colResource.HeaderText = "资源位";
this.colResource.Name = "colResource";
this.colResource.ReadOnly = true;
this.colResource.Width = 70;
//
// colPrice
//
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colPrice.DefaultCellStyle = dataGridViewCellStyle7;
this.colPrice.HeaderText = "价格";
this.colPrice.Name = "colPrice";
this.colPrice.ReadOnly = true;
this.colPrice.Width = 80;
this.colPrice.Width = 105;
//
// colStock
//
@@ -808,10 +1081,12 @@ namespace TemuKJD.PDDForms.ProductForms
//
// colAddTime
//
this.colAddTime.FillWeight = 110F;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colAddTime.DefaultCellStyle = dataGridViewCellStyle8;
this.colAddTime.HeaderText = "创建时间";
this.colAddTime.Name = "colAddTime";
this.colAddTime.ReadOnly = true;
this.colAddTime.Width = 80;
//
// colIsOnSale
//
@@ -913,88 +1188,6 @@ namespace TemuKJD.PDDForms.ProductForms
this.panelEx1.Text = "停止当前操作";
this.panelEx1.Click += new System.EventHandler(this.btnCancel_Click);
//
// colSelect
//
this.colSelect.HeaderText = "全选";
this.colSelect.Name = "colSelect";
this.colSelect.ReadOnly = true;
this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSelect.Width = 28;
//
// colShopLoginName
//
this.colShopLoginName.HeaderText = "店铺登录名";
this.colShopLoginName.Name = "colShopLoginName";
this.colShopLoginName.ReadOnly = true;
this.colShopLoginName.Visible = false;
//
// colShopId
//
this.colShopId.HeaderText = "店铺Id";
this.colShopId.Name = "colShopId";
this.colShopId.ReadOnly = true;
this.colShopId.Visible = false;
this.colShopId.Width = 55;
//
// colShopName
//
this.colShopName.FillWeight = 150F;
this.colShopName.HeaderText = "店铺名称";
this.colShopName.Name = "colShopName";
this.colShopName.ReadOnly = true;
this.colShopName.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colShopName.Width = 70;
//
// colShopNotes
//
this.colShopNotes.HeaderText = "备注";
this.colShopNotes.Name = "colShopNotes";
this.colShopNotes.ReadOnly = true;
this.colShopNotes.Width = 70;
//
// colSelectProduct
//
this.colSelectProduct.HeaderText = "选择商品";
this.colSelectProduct.Name = "colSelectProduct";
this.colSelectProduct.ReadOnly = true;
this.colSelectProduct.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSelectProduct.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSelectProduct.Visible = false;
this.colSelectProduct.Width = 62;
//
// colLoginStatus
//
this.colLoginStatus.HeaderText = "状态";
this.colLoginStatus.Name = "colLoginStatus";
this.colLoginStatus.ReadOnly = true;
this.colLoginStatus.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colLoginStatus.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colLoginStatus.Width = 40;
//
// colCanUse
//
this.colCanUse.HeaderText = "可用";
this.colCanUse.Name = "colCanUse";
this.colCanUse.ReadOnly = true;
this.colCanUse.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colCanUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colCanUse.Visible = false;
this.colCanUse.Width = 28;
//
// colRemaining
//
this.colRemaining.HeaderText = "月限额";
this.colRemaining.Name = "colRemaining";
this.colRemaining.ReadOnly = true;
this.colRemaining.Visible = false;
//
// colMessage
//
this.colMessage.HeaderText = "消息";
this.colMessage.Name = "colMessage";
this.colMessage.ReadOnly = true;
//
// PDDProductUpDownForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1014,6 +1207,7 @@ namespace TemuKJD.PDDForms.ProductForms
this.ucGroupBoxEx2.ResumeLayout(false);
this.ucGroupBoxEx2.PerformLayout();
this.ucGroupBoxEx1.ResumeLayout(false);
this.ucGroupBoxEx1.PerformLayout();
this.splitContainer3.Panel1.ResumeLayout(false);
this.splitContainer3.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
@@ -1072,23 +1266,6 @@ namespace TemuKJD.PDDForms.ProductForms
private System.Windows.Forms.TextBox txtGoodsName;
private DevComponents.DotNetBar.PanelEx btnDown;
private DevComponents.DotNetBar.PanelEx btnUp;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierName;
private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colProductSkcPic;
private System.Windows.Forms.DataGridViewLinkColumn colSpuId;
private System.Windows.Forms.DataGridViewTextBoxColumn colExtCode;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductName;
private System.Windows.Forms.DataGridViewTextBoxColumn colPrice;
private System.Windows.Forms.DataGridViewTextBoxColumn colStock;
private System.Windows.Forms.DataGridViewTextBoxColumn colFavorites;
private System.Windows.Forms.DataGridViewTextBoxColumn colSales;
private System.Windows.Forms.DataGridViewTextBoxColumn colSalesThirtyDays;
private System.Windows.Forms.DataGridViewTextBoxColumn colAddTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colIsOnSale;
private System.Windows.Forms.DataGridViewTextBoxColumn colStatus;
private System.Windows.Forms.DataGridViewTextBoxColumn colOpResult;
private System.Windows.Forms.TextBox txtMinPrice;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtMaxPrice;
@@ -1103,5 +1280,33 @@ namespace TemuKJD.PDDForms.ProductForms
private System.Windows.Forms.DataGridViewCheckBoxColumn colCanUse;
private System.Windows.Forms.DataGridViewTextBoxColumn colRemaining;
private System.Windows.Forms.DataGridViewTextBoxColumn colMessage;
private DevComponents.DotNetBar.PanelEx btnSelectNotActivity;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierName;
private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colProductSkcPic;
private System.Windows.Forms.DataGridViewLinkColumn colSpuId;
private System.Windows.Forms.DataGridViewTextBoxColumn colExtCode;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductName;
private System.Windows.Forms.DataGridViewTextBoxColumn colResource;
private System.Windows.Forms.DataGridViewTextBoxColumn colPrice;
private System.Windows.Forms.DataGridViewTextBoxColumn colStock;
private System.Windows.Forms.DataGridViewTextBoxColumn colFavorites;
private System.Windows.Forms.DataGridViewTextBoxColumn colSales;
private System.Windows.Forms.DataGridViewTextBoxColumn colSalesThirtyDays;
private System.Windows.Forms.DataGridViewTextBoxColumn colAddTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colIsOnSale;
private System.Windows.Forms.DataGridViewTextBoxColumn colStatus;
private System.Windows.Forms.DataGridViewTextBoxColumn colOpResult;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox txtLowStock;
private DevComponents.DotNetBar.PanelEx btnSelectLowStock;
private DevComponents.DotNetBar.PanelEx btnClearShopFilter;
private DevComponents.DotNetBar.PanelEx btnFilter;
private System.Windows.Forms.TextBox txtShopGroupFilter;
private System.Windows.Forms.TextBox txtShopNameFilter;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.Label label22;
}
}
@@ -88,7 +88,7 @@ namespace TemuKJD.PDDForms.ProductForms
if (row == null)
{
this.dgvShop.Rows.Add(
!isInit || (selectShopId.Contains(shopEntity.ShopId) && canUse),
false, // !isInit || (selectShopId.Contains(shopEntity.ShopId) && canUse),
shopEntity.LoginName,
shopEntity.ShopId,
shopEntity.ShopAccount,
@@ -102,7 +102,7 @@ namespace TemuKJD.PDDForms.ProductForms
}
else
{
row.Cells["colSelect"].Value = !isInit || (selectShopId.Contains(shopEntity.ShopId) && canUse);
row.Cells["colSelect"].Value = selectShopId.Contains(shopEntity.ShopId) && canUse;
row.Cells["colShopLoginName"].Value = shopEntity.LoginName;
row.Cells["colShopName"].Value = shopEntity.ShopAccount;
row.Cells["colShopNotes"].Value = shopEntity.Notes;
@@ -111,6 +111,24 @@ namespace TemuKJD.PDDForms.ProductForms
row.Cells["colCanUse"].Value = canUse;
row.Cells["colRemaining"].Value = shopEntity.AddProductRemaining;
}
displayShopStatus(shopEntity);
}
void displayShopStatus(ShopLoginInfo shop)
{
bool canUse = shop.LoginStatus == "登录成功";
//bool apiAuth = shop.AuthExpiresTime > DateTime.Now;
var rows = this.dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colShopId"].Value.ParseToString() == shop?.ShopId);
foreach (var row in rows)
{
row.Cells["colCanUse"].Value = canUse;
row.Cells["colLoginStatus"].Value = canUse ? "在线" : "掉线";
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Blue : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Blue : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightBlue : Color.OrangeRed;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkBlue : Color.DarkRed;
//row.Cells["colApiStatus"].Style.ForeColor = apiAuth ? Color.Green : Color.OrangeRed;
}
}
private void dgvShop_CellContentClick(object sender, DataGridViewCellEventArgs e)
@@ -279,6 +297,12 @@ namespace TemuKJD.PDDForms.ProductForms
else if (cmbStatus.Text == "下架")
isOnsale = 0;
}));
int? isSoldOut = null;
Invoke(new Action(() =>
{
if (cmbStatus.Text == "售罄")
isSoldOut = 1;
}));
//,"goods_id_list":["819969337632","819963304053"],"
List<string> goods_id_list = null;
if (!string.IsNullOrWhiteSpace(txtSPU.Text))
@@ -294,7 +318,7 @@ namespace TemuKJD.PDDForms.ProductForms
minPrice = (txtMinPrice.Text.Trim().ParseToDecimal() * 100).ParseToLong();
if (!string.IsNullOrWhiteSpace(txtMaxPrice.Text))
maxPrice = (txtMaxPrice.Text.Trim().ParseToDecimal() * 100).ParseToLong();
string jsonStr = shop_goods_search(shop, goods_id_list, txtGoodsName.Text.Trim(), out_goods_sn_list, skuSns, isOnsale, minPrice, maxPrice, page, pageSize);
string jsonStr = shop_goods_search(shop, goods_id_list, txtGoodsName.Text.Trim(), out_goods_sn_list, skuSns, isOnsale, isSoldOut, minPrice, maxPrice, page, pageSize);
if (jsonStr.Contains("繁忙") && tryCount < 5)
{
tryCount++;
@@ -343,29 +367,38 @@ namespace TemuKJD.PDDForms.ProductForms
url = pInfo.hd_thumb_url;
if (string.IsNullOrEmpty(url))
url = pInfo.thumb_url;
var activityPrice = pInfo.sku_group_price;
string activityPriceStr = "";
if (pInfo.sku_group_price.FirstOrDefault() != pInfo.origin_sku_group_price.FirstOrDefault())
activityPriceStr = "\r\n活动价:\r\n" + string.Join("~", pInfo.sku_group_price.Select(s => s / 100m));
Invoke(new Action(() =>
{
int rowId = this.dgvProduct.Rows.Add(
true,
false,
shop.ShopId,
shop.ShopAccount,
url.Replace("https", "http"),
null, // 列表图片
Extension.DataGridViewExtension.defaultBitmap, // 列表图片
pInfo.id,
pInfo.out_goods_sn,
pInfo.goods_name,
string.Join("~", pInfo.sku_group_price.Select(s => s / 100m)),
pInfo.resource.Replace(",", " "),
string.Join("~", pInfo.origin_sku_group_price.Select(s => s / 100m)) + activityPriceStr,
pInfo.quantity,
"", //收藏
"", //总销量
"", //30日销量
BaseClass.StampToDateTime(pInfo.created_at.ParseToInt()),
BaseClass.StampToDateTime(pInfo.created_at.ParseToInt()).ToString("yy-MM-dd HH:mm:ss"),
pInfo.is_onsale == true ? "在售" : "下架",
(pInfo.edit_check == null || pInfo.edit_check.check_status != 3)? "" : "商品修改被驳回",
"" // 操作结果,状态
);
dgvProduct.Rows[rowId].Height = 60;
if (!string.IsNullOrEmpty(activityPriceStr))
{
dgvProduct.Rows[rowId].Cells["colPrice"].Style.ForeColor = Color.DarkOrange;
}
}));
}
}
@@ -416,13 +449,16 @@ namespace TemuKJD.PDDForms.ProductForms
public static string shop_goods_search(ShopLoginInfo shop, List<string> goods_id_list, string goods_name,
List<string> out_goods_sn_list = null, List<string> out_sku_sns = null, int? isOnsale = null, long? minPrice=null, long? maxPrice=null, int page=1, int pageSize = 100)
List<string> out_goods_sn_list = null, List<string> out_sku_sns = null, int? isOnsale = null, int? isSoldOut = null, long? minPrice = null, long? maxPrice = null, int page = 1, int pageSize = 100)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://mms.pinduoduo.com/vodka/v2/mms/query/display/mall/goodsList";
Dictionary<string, object> dicParam = new Dictionary<string, object>();
// 查询售罄商品
// {"page":1,"order_by":"sold_out_time:desc,id:desc","out_goods_sn_gray_flag":true,"pre_sale_type":4,"shipment_time_type":3,"sold_out":1,"size":10}
dicParam["out_goods_sn_gray_flag"] = true;
dicParam["pre_sale_type"] = 4;
dicParam["page"] = page;
@@ -437,8 +473,15 @@ namespace TemuKJD.PDDForms.ProductForms
dicParam["goods_name"] = goods_name;
if (out_sku_sns != null)
dicParam["out_sku_sns"] = out_sku_sns;
dicParam["sold_out"] = 0;
if (isOnsale != null)
dicParam["sold_out"] = 0;
else if (isSoldOut == 1)
{
dicParam["order_by"] = "sold_out_time:desc,id:desc";
dicParam["sold_out"] = 1;
}
dicParam["size"] = pageSize;
if (minPrice != null || maxPrice != null)
{
long[] nArr = new long[] { 0, 1000000000 };
@@ -997,5 +1040,53 @@ namespace TemuKJD.PDDForms.ProductForms
cmbStatus.Text = "在售";
txtSPU.Text = txtGoodsName.Text = txtExtCode.Text = txtSkuSns.Text = txtMinPrice.Text = txtMaxPrice.Text = "";
}
private void btnSelectNotActivity_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow r in dgvProduct.Rows)
{
if (r.Cells["colResource"].Value.ParseToString().Contains("大促活动"))
r.Cells["colCheck"].Value = false;
else
r.Cells["colCheck"].Value = true;
}
}
private void btnSelectLowStock_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow r in dgvProduct.Rows)
{
if (r.Cells["colStock"].Value.ParseToInt() > txtLowStock.Text.ParseToInt())
r.Cells["colCheck"].Value = false;
else
r.Cells["colCheck"].Value = true;
}
}
private void btnFilter_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow r in dgvShop.Rows)
{
r.Visible = true;
if (!string.IsNullOrWhiteSpace(txtShopNameFilter.Text))
{
if (!r.Cells["colShopName"].Value.ParseToString().Contains(txtShopNameFilter.Text.Trim()))
r.Visible = false;
}
if (!string.IsNullOrWhiteSpace(txtShopGroupFilter.Text))
{
if (!r.Cells["colShopNotes"].Value.ParseToString().Contains(txtShopGroupFilter.Text.Trim()))
r.Visible = false;
}
}
}
private void btnClearShopFilter_Click(object sender, EventArgs e)
{
txtShopGroupFilter.Text = "";
txtShopNameFilter.Text = "";
}
}
}
@@ -168,6 +168,9 @@
<metadata name="colProductName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colResource.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colPrice.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>