优化商品核价读取速度,优化jit开通无人值守参数设置,优化产品数据库数据直传批量设置商品

This commit is contained in:
wule_5900x committed 2025-11-20 20:56:56 +08:00
1 parent 6865064eca
commit 55d4a27d90
4 files changed
+359 -155

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@ namespace AllBase
/// <summary>
/// 版本ID
/// </summary>
public static int VersionCount = 683;
public static int VersionCount = 685;
//public static int VersionCount = 613;
/// <summary>
@@ -669,24 +669,27 @@ namespace TemuKJD.KJDForms.AdminForms
var suggestSupplyPrice = "-";
if (type == "待卖家确认")
{
var orderPriceRst = "店铺掉线";
if (shop.LoginStatus2 == "国际版在线")
orderPriceRst = GetCheckPrice(shop, reviewInfo.priceOrderId.ParseToString());
if (orderPriceRst.Contains("登录过期") || orderPriceRst.Contains("Invalid Login State"))
{
AdminShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
}
reviewInfo.suggestSupplyPrice = BaseRegex.GetIntJson(ref orderPriceRst, "suggestSupplyPrice");
reviewInfo.supplyPrice = BaseRegex.GetIntJson(ref orderPriceRst, "supplyPrice");
suggestSupplyPrice = (reviewInfo.suggestSupplyPrice / 100.0).ToString();
if (suggestSupplyPrice == "0")
suggestSupplyPrice = "获取推荐价格失败,请重试" + orderPriceRst;
else
suggestSupplyPrice += "¥";
// 单独一个一个读取建议价格,目前已可以从列表直接获取
//var orderPriceRst = "店铺掉线";
//if (shop.LoginStatus2 == "国际版在线")
// orderPriceRst = GetCheckPrice(shop, reviewInfo.priceOrderId.ParseToString());
//Thread.Sleep(Randomx.GetId(20, 50));
//if (orderPriceRst.Contains("登录过期") || orderPriceRst.Contains("Invalid Login State"))
//{
// AdminShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
//}
//reviewInfo.suggestSupplyPrice = BaseRegex.GetIntJson(ref orderPriceRst, "suggestSupplyPrice");
//reviewInfo.supplyPrice = BaseRegex.GetIntJson(ref orderPriceRst, "supplyPrice");
//suggestSupplyPrice = (reviewInfo.suggestSupplyPrice / 100.0).ToString();
//if (suggestSupplyPrice == "0")
// suggestSupplyPrice = "获取推荐价格失败,请重试" + orderPriceRst;
//else
// suggestSupplyPrice += "¥";
suggestSupplyPrice = (reviewInfo.suggestSupplyPrice / 100.0).ToString() + "¥";
}
var reviewExtCode = priceInfo.skcList.FirstOrDefault()?.extCode;
var extCodePrice = extCodePriceList.FirstOrDefault(p => reviewExtCode == p.ext_code);
Thread.Sleep(Randomx.GetId(20, 50));
Invoke(new Action(() =>
{
@@ -707,6 +710,7 @@ namespace TemuKJD.KJDForms.AdminForms
// sku不同价的会被分成多个review,priceInfo此时为价格范围
reviewInfo.productSkuList.FirstOrDefault()?.supplierPrice, //priceInfo.supplierPrice
suggestSupplyPrice,//核价
//reviewInfo.suggestSupplyPrice == null ? "-" : reviewInfo.suggestSupplyPrice.ParseToString(),
"", //新报价
reviewInfo.times, // 修改报价次数
BaseClass.StampToDateTime((priceInfo.skcList.FirstOrDefault()?.statusTime.createdTime.ParseToLong() / 1000).ParseToInt()).ToString("yy/MM/dd HH:mm:ss"),
@@ -714,7 +718,7 @@ namespace TemuKJD.KJDForms.AdminForms
"拒绝",
"作废",
""
);
); ;
dgvPriceCheck.Rows[rowId].Height = 60;
if (chkFilter.Checked && !CheckContainsWords(priceInfo.productName))
{
+127 -98
View File
@@ -30,21 +30,23 @@ namespace TemuKJD.KJDForms.ProductForms
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
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();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.btnRestoreJitParams = new DevComponents.DotNetBar.PanelEx();
this.btnSaveExtCodeJitConfig = new DevComponents.DotNetBar.PanelEx();
this.line3 = new DevComponents.DotNetBar.Controls.Line();
this.line2 = new DevComponents.DotNetBar.Controls.Line();
this.line1 = new DevComponents.DotNetBar.Controls.Line();
@@ -62,7 +64,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.rbYiwu = new System.Windows.Forms.RadioButton();
this.rbGuangdong = new System.Windows.Forms.RadioButton();
this.txtBatchStock = new System.Windows.Forms.TextBox();
this.pbRealPicture = new System.Windows.Forms.PictureBox();
this.pbBatchRealPicture = new System.Windows.Forms.PictureBox();
this.txtBatchIdentifyCode = new System.Windows.Forms.TextBox();
this.txtBatchPriceMax = new System.Windows.Forms.TextBox();
this.txtBatchPriceMin = new System.Windows.Forms.TextBox();
@@ -140,14 +142,13 @@ namespace TemuKJD.KJDForms.ProductForms
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.btnClear = new DevComponents.DotNetBar.PanelEx();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.btnSaveExtCodeJitConfig = new DevComponents.DotNetBar.PanelEx();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.ucGroupBoxEx1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvExtCode)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbRealPicture)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbBatchRealPicture)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
@@ -194,6 +195,7 @@ namespace TemuKJD.KJDForms.ProductForms
| 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.btnRestoreJitParams);
this.ucGroupBoxEx1.Controls.Add(this.btnSaveExtCodeJitConfig);
this.ucGroupBoxEx1.Controls.Add(this.line3);
this.ucGroupBoxEx1.Controls.Add(this.line2);
@@ -209,7 +211,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.ucGroupBoxEx1.Controls.Add(this.rbYiwu);
this.ucGroupBoxEx1.Controls.Add(this.rbGuangdong);
this.ucGroupBoxEx1.Controls.Add(this.txtBatchStock);
this.ucGroupBoxEx1.Controls.Add(this.pbRealPicture);
this.ucGroupBoxEx1.Controls.Add(this.pbBatchRealPicture);
this.ucGroupBoxEx1.Controls.Add(this.txtBatchIdentifyCode);
this.ucGroupBoxEx1.Controls.Add(this.txtBatchPriceMax);
this.ucGroupBoxEx1.Controls.Add(this.txtBatchPriceMin);
@@ -246,6 +248,54 @@ namespace TemuKJD.KJDForms.ProductForms
this.ucGroupBoxEx1.TabStop = false;
this.ucGroupBoxEx1.Text = "参数设置";
//
// btnRestoreJitParams
//
this.btnRestoreJitParams.CanvasColor = System.Drawing.SystemColors.Control;
this.btnRestoreJitParams.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnRestoreJitParams.DisabledBackColor = System.Drawing.Color.Empty;
this.btnRestoreJitParams.Location = new System.Drawing.Point(1400, 103);
this.btnRestoreJitParams.Name = "btnRestoreJitParams";
this.btnRestoreJitParams.Size = new System.Drawing.Size(60, 23);
this.btnRestoreJitParams.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnRestoreJitParams.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnRestoreJitParams.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnRestoreJitParams.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.btnRestoreJitParams.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnRestoreJitParams.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.btnRestoreJitParams.Style.GradientAngle = 90;
this.btnRestoreJitParams.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.btnRestoreJitParams.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnRestoreJitParams.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnRestoreJitParams.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnRestoreJitParams.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnRestoreJitParams.TabIndex = 1303;
this.btnRestoreJitParams.Text = "重置选中";
this.btnRestoreJitParams.Click += new System.EventHandler(this.btnRestoreJitParams_Click);
//
// btnSaveExtCodeJitConfig
//
this.btnSaveExtCodeJitConfig.CanvasColor = System.Drawing.SystemColors.Control;
this.btnSaveExtCodeJitConfig.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSaveExtCodeJitConfig.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSaveExtCodeJitConfig.Location = new System.Drawing.Point(1283, 103);
this.btnSaveExtCodeJitConfig.Name = "btnSaveExtCodeJitConfig";
this.btnSaveExtCodeJitConfig.Size = new System.Drawing.Size(115, 23);
this.btnSaveExtCodeJitConfig.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnSaveExtCodeJitConfig.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnSaveExtCodeJitConfig.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnSaveExtCodeJitConfig.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.btnSaveExtCodeJitConfig.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSaveExtCodeJitConfig.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.btnSaveExtCodeJitConfig.Style.GradientAngle = 90;
this.btnSaveExtCodeJitConfig.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.btnSaveExtCodeJitConfig.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnSaveExtCodeJitConfig.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSaveExtCodeJitConfig.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSaveExtCodeJitConfig.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnSaveExtCodeJitConfig.TabIndex = 1299;
this.btnSaveExtCodeJitConfig.Text = "存配置到选中货号";
this.btnSaveExtCodeJitConfig.Click += new System.EventHandler(this.btnSaveExtCodeJitConfig_Click);
//
// line3
//
this.line3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
@@ -261,7 +311,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.line2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.line2.Location = new System.Drawing.Point(1414, 21);
this.line2.Name = "line2";
this.line2.Size = new System.Drawing.Size(11, 76);
this.line2.Size = new System.Drawing.Size(11, 59);
this.line2.TabIndex = 1264;
this.line2.Text = "line2";
this.line2.VerticalLine = true;
@@ -316,20 +366,22 @@ namespace TemuKJD.KJDForms.ProductForms
//
this.dgvExtCode.AllowUserToAddRows = false;
this.dgvExtCode.AllowUserToDeleteRows = false;
dataGridViewCellStyle27.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
this.dgvExtCode.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle27;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
this.dgvExtCode.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgvExtCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.dgvExtCode.AutoRowNumber = false;
this.dgvExtCode.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvExtCode.BackgroundColor = System.Drawing.Color.White;
this.dgvExtCode.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle28.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle28.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle28.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle28.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle28.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle28.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle28.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvExtCode.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle28;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvExtCode.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dgvExtCode.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colSelectExtCode,
this.colFilterExtCode,
@@ -382,9 +434,9 @@ namespace TemuKJD.KJDForms.ProductForms
this.btnCancel.CanvasColor = System.Drawing.SystemColors.Control;
this.btnCancel.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnCancel.DisabledBackColor = System.Drawing.Color.Empty;
this.btnCancel.Location = new System.Drawing.Point(1447, 103);
this.btnCancel.Location = new System.Drawing.Point(1470, 103);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(115, 23);
this.btnCancel.Size = new System.Drawing.Size(92, 23);
this.btnCancel.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnCancel.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnCancel.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
@@ -503,15 +555,15 @@ namespace TemuKJD.KJDForms.ProductForms
this.txtBatchStock.Size = new System.Drawing.Size(80, 23);
this.txtBatchStock.TabIndex = 1054;
//
// pbRealPicture
// pbBatchRealPicture
//
this.pbRealPicture.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pbRealPicture.Location = new System.Drawing.Point(1063, 19);
this.pbRealPicture.Name = "pbRealPicture";
this.pbRealPicture.Size = new System.Drawing.Size(108, 108);
this.pbRealPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pbRealPicture.TabIndex = 1051;
this.pbRealPicture.TabStop = false;
this.pbBatchRealPicture.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pbBatchRealPicture.Location = new System.Drawing.Point(1063, 19);
this.pbBatchRealPicture.Name = "pbBatchRealPicture";
this.pbBatchRealPicture.Size = new System.Drawing.Size(108, 108);
this.pbBatchRealPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pbBatchRealPicture.TabIndex = 1051;
this.pbBatchRealPicture.TabStop = false;
//
// txtBatchIdentifyCode
//
@@ -967,19 +1019,19 @@ namespace TemuKJD.KJDForms.ProductForms
//
this.dgvShop.AllowUserToAddRows = false;
this.dgvShop.AllowUserToDeleteRows = false;
dataGridViewCellStyle29.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle29;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
this.dgvShop.AutoRowNumber = true;
this.dgvShop.BackgroundColor = System.Drawing.Color.White;
this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle30.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle30.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle30.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle30.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle30.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle30.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle30.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle30;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colSelect,
@@ -1139,19 +1191,19 @@ namespace TemuKJD.KJDForms.ProductForms
//
this.dgvOpenJit.AllowUserToAddRows = false;
this.dgvOpenJit.AllowUserToDeleteRows = false;
dataGridViewCellStyle31.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
this.dgvOpenJit.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle31;
dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
this.dgvOpenJit.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5;
this.dgvOpenJit.AutoRowNumber = true;
this.dgvOpenJit.BackgroundColor = System.Drawing.Color.White;
this.dgvOpenJit.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle32.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle32.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle32.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle32.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle32.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvOpenJit.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle32;
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvOpenJit.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6;
this.dgvOpenJit.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvOpenJit.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colCheck,
@@ -1218,8 +1270,8 @@ namespace TemuKJD.KJDForms.ProductForms
//
// colSupplierName
//
dataGridViewCellStyle33.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colSupplierName.DefaultCellStyle = dataGridViewCellStyle33;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colSupplierName.DefaultCellStyle = dataGridViewCellStyle7;
this.colSupplierName.HeaderText = "店铺名称";
this.colSupplierName.Name = "colSupplierName";
this.colSupplierName.ReadOnly = true;
@@ -1259,8 +1311,8 @@ namespace TemuKJD.KJDForms.ProductForms
//
// colProdName
//
dataGridViewCellStyle34.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colProdName.DefaultCellStyle = dataGridViewCellStyle34;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colProdName.DefaultCellStyle = dataGridViewCellStyle8;
this.colProdName.HeaderText = "标题";
this.colProdName.Name = "colProdName";
this.colProdName.ReadOnly = true;
@@ -1268,8 +1320,8 @@ namespace TemuKJD.KJDForms.ProductForms
//
// colSkuName
//
dataGridViewCellStyle35.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colSkuName.DefaultCellStyle = dataGridViewCellStyle35;
dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colSkuName.DefaultCellStyle = dataGridViewCellStyle9;
this.colSkuName.HeaderText = "规格名称";
this.colSkuName.Name = "colSkuName";
this.colSkuName.ReadOnly = true;
@@ -1277,8 +1329,8 @@ namespace TemuKJD.KJDForms.ProductForms
//
// colExtCode
//
dataGridViewCellStyle36.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colExtCode.DefaultCellStyle = dataGridViewCellStyle36;
dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colExtCode.DefaultCellStyle = dataGridViewCellStyle10;
this.colExtCode.HeaderText = "货号";
this.colExtCode.Name = "colExtCode";
this.colExtCode.ReadOnly = true;
@@ -1301,8 +1353,8 @@ namespace TemuKJD.KJDForms.ProductForms
//
// colCreatTime
//
dataGridViewCellStyle37.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colCreatTime.DefaultCellStyle = dataGridViewCellStyle37;
dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colCreatTime.DefaultCellStyle = dataGridViewCellStyle11;
this.colCreatTime.HeaderText = "创建时间";
this.colCreatTime.Name = "colCreatTime";
this.colCreatTime.ReadOnly = true;
@@ -1318,8 +1370,8 @@ namespace TemuKJD.KJDForms.ProductForms
//
// colCompliance
//
dataGridViewCellStyle38.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colCompliance.DefaultCellStyle = dataGridViewCellStyle38;
dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colCompliance.DefaultCellStyle = dataGridViewCellStyle12;
this.colCompliance.HeaderText = "合规信息";
this.colCompliance.Name = "colCompliance";
this.colCompliance.ReadOnly = true;
@@ -1352,8 +1404,8 @@ namespace TemuKJD.KJDForms.ProductForms
//
// colRecevieArea
//
dataGridViewCellStyle39.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colRecevieArea.DefaultCellStyle = dataGridViewCellStyle39;
dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colRecevieArea.DefaultCellStyle = dataGridViewCellStyle13;
this.colRecevieArea.HeaderText = "期望到货";
this.colRecevieArea.Name = "colRecevieArea";
this.colRecevieArea.ReadOnly = true;
@@ -1437,30 +1489,6 @@ namespace TemuKJD.KJDForms.ProductForms
this.statusBar.Size = new System.Drawing.Size(1298, 26);
this.statusBar.TabIndex = 2;
//
// btnSaveExtCodeJitConfig
//
this.btnSaveExtCodeJitConfig.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSaveExtCodeJitConfig.CanvasColor = System.Drawing.SystemColors.Control;
this.btnSaveExtCodeJitConfig.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSaveExtCodeJitConfig.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSaveExtCodeJitConfig.Location = new System.Drawing.Point(1283, 103);
this.btnSaveExtCodeJitConfig.Name = "btnSaveExtCodeJitConfig";
this.btnSaveExtCodeJitConfig.Size = new System.Drawing.Size(115, 23);
this.btnSaveExtCodeJitConfig.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnSaveExtCodeJitConfig.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnSaveExtCodeJitConfig.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnSaveExtCodeJitConfig.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.btnSaveExtCodeJitConfig.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSaveExtCodeJitConfig.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.btnSaveExtCodeJitConfig.Style.GradientAngle = 90;
this.btnSaveExtCodeJitConfig.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.btnSaveExtCodeJitConfig.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnSaveExtCodeJitConfig.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSaveExtCodeJitConfig.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSaveExtCodeJitConfig.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnSaveExtCodeJitConfig.TabIndex = 1299;
this.btnSaveExtCodeJitConfig.Text = "存配置到选中货号";
//
// TemuJitForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1478,7 +1506,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.ucGroupBoxEx1.ResumeLayout(false);
this.ucGroupBoxEx1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvExtCode)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbRealPicture)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbBatchRealPicture)).EndInit();
this.splitContainer3.Panel1.ResumeLayout(false);
this.splitContainer3.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
@@ -1554,7 +1582,7 @@ namespace TemuKJD.KJDForms.ProductForms
private System.Windows.Forms.TextBox txtBatchPriceMin;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtBatchIdentifyCode;
private System.Windows.Forms.PictureBox pbRealPicture;
private System.Windows.Forms.PictureBox pbBatchRealPicture;
private DevComponents.DotNetBar.PanelEx btnBatchJit;
private System.Windows.Forms.RadioButton rbYiwu;
private System.Windows.Forms.RadioButton rbGuangdong;
@@ -1602,5 +1630,6 @@ namespace TemuKJD.KJDForms.ProductForms
private System.Windows.Forms.DataGridViewTextBoxColumn colFilterExtCode;
private System.Windows.Forms.DataGridViewTextBoxColumn colJitConfig;
private DevComponents.DotNetBar.PanelEx btnSaveExtCodeJitConfig;
private DevComponents.DotNetBar.PanelEx btnRestoreJitParams;
}
}
+211 -40
View File
@@ -50,8 +50,17 @@ namespace TemuKJD.KJDForms.ProductForms
/// 期望到货区域列表
/// </summary>
public List<SkcReceiveAreaPickOutInfo> lstReceiveArea = new List<SkcReceiveAreaPickOutInfo>();
/// <summary>
/// 界面参数配置
/// </summary>
SetJitConfig setJitConfig = null;
/// <summary>
/// jit开通参数配置
/// </summary>
List<OpenJitParams> lstOpenJitParams = null;
public TemuJitForm()
{
InitializeComponent();
@@ -97,6 +106,11 @@ namespace TemuKJD.KJDForms.ProductForms
this.txtSpuId.TextChanged += Txt_TextChanged;
this.txtExtCode.TextChanged += Txt_TextChanged;
this.chkSearchTime.CheckedChanged += Txt_TextChanged;
// 读取货号开通jit参数
lstOpenJitParams = NaiBa.Util.Helper.ConfigHelper.LoadConfig<List<OpenJitParams>>("open_jit_params");
if (lstOpenJitParams == null)
lstOpenJitParams = new List<OpenJitParams>();
}
private void Txt_TextChanged(object sender, EventArgs e)
@@ -789,7 +803,11 @@ namespace TemuKJD.KJDForms.ProductForms
this.dgvExtCode.Rows.Clear();
foreach (var ext in extCodeLst)
{
this.dgvExtCode.Rows.Add(false, ext);
this.dgvExtCode.Rows.Add(
false,
ext,
lstOpenJitParams.Any(p => p.ExtCode == ext) ? "查看" : "未设置"
);
}
}));
}, cancellationTokenSource.Token);
@@ -1330,31 +1348,10 @@ Content-Disposition: form-data; name=""upload_sign""
BaseMsgForm.ShowError("请查询并选择商品!");
return;
}
var minPriceFen = (txtBatchPriceMin.Text.Trim(' ', '¥').ParseToDecimal() * 100).ParseToInt();
var maxPriceFen = (txtBatchPriceMax.Text.Trim(' ', '¥').ParseToDecimal() * 100).ParseToInt();
if (chkBatchPrice.Checked && (minPriceFen < 500 || maxPriceFen < 500 || maxPriceFen < minPriceFen))
string checkJitParamRst = CheckJitParam();
if (!string.IsNullOrEmpty(checkJitParamRst))
{
BaseMsgForm.ShowError("请合理设置价格!至少为 5 且最大值不能小于最小值!");
return;
}
var identifyCode = txtBatchIdentifyCode.Text.Trim();
if (chkBatchIdentifyCode.Checked && identifyCode.IsNullOrEmpty())
{
BaseMsgForm.ShowError("请填写识别码!");
return;
}
if (chkBatchRealPicture.Checked && pbRealPicture.Tag.ParseToString().IsNullOrEmpty())
{
BaseMsgForm.ShowError("请选择实拍图!");
return;
}
if (chkBatchStock.Checked && txtBatchStock.Text.Trim().ParseToInt() < 1)
{
BaseMsgForm.ShowError("请设置合理库存!大于 0 !");
BaseMsgForm.ShowError(checkJitParamRst);
return;
}
@@ -1376,6 +1373,39 @@ Content-Disposition: form-data; name=""upload_sign""
}, cancellationTokenSource.Token);
}
/// <summary>
/// 检测开通Jit配置是否合理
/// </summary>
/// <returns></returns>
string CheckJitParam()
{
var minPriceFen = (txtBatchPriceMin.Text.Trim(' ', '¥').ParseToDecimal() * 100).ParseToInt();
var maxPriceFen = (txtBatchPriceMax.Text.Trim(' ', '¥').ParseToDecimal() * 100).ParseToInt();
if (chkBatchPrice.Checked && (minPriceFen < 500 || maxPriceFen < 500 || maxPriceFen < minPriceFen))
{
return "请合理设置价格!至少为 5 且最大值不能小于最小值!";
}
var identifyCode = txtBatchIdentifyCode.Text.Trim();
if (chkBatchIdentifyCode.Checked && identifyCode.IsNullOrEmpty())
{
return "请填写识别码!";
}
var realPicture = pbBatchRealPicture.Tag.ParseToString();
if (chkBatchRealPicture.Checked && realPicture.IsNullOrEmpty())
{
return "请选择实拍图!";
}
var stock = txtBatchStock.Text.Trim().ParseToInt();
if (chkBatchStock.Checked && stock < 1)
{
return "请设置合理库存!大于 0 !";
}
return "";
}
void AutoJit(int type = 1)
{
//var batchExtCodeLst = txtBatchExtCode.Text.Trim().Split(new string[] { ",", " " }, StringSplitOptions.RemoveEmptyEntries);
@@ -1393,14 +1423,31 @@ Content-Disposition: form-data; name=""upload_sign""
// BaseMsgForm.ShowError("请选择商品!");
// return;
//}
var minPriceFen = (txtBatchPriceMin.Text.Trim(' ', '¥').ParseToDecimal() * 100).ParseToInt();
var maxPriceFen = (txtBatchPriceMax.Text.Trim(' ', '¥').ParseToDecimal() * 100).ParseToInt();
var dgvRows = this.dgvOpenJit.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colCheck"].Value.ParseToBool() == true).ToList();
var dgvRows = this.dgvOpenJit.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colCheck"].Value.ParseToBool() == true).ToList();
foreach (var dgvRow in dgvRows)
{
if (cancellationTokenSource.IsCancellationRequested)
break;
var minPriceFen = (txtBatchPriceMin.Text.Trim(' ', '¥').ParseToDecimal() * 100).ParseToInt();
var maxPriceFen = (txtBatchPriceMax.Text.Trim(' ', '¥').ParseToDecimal() * 100).ParseToInt();
var identifyCode = txtBatchIdentifyCode.Text.Trim();
var realPicture = pbBatchRealPicture.Tag.ParseToString();
var stock = txtBatchStock.Text.Trim().ParseToInt();
// 如果货号存在Jit开通配置,按货号指定配置开通
var extCode = dgvRow.Cells["colExtCode"].Value.ParseToString();
var extCodeOpenJitParams = lstOpenJitParams.FirstOrDefault(p => p.ExtCode == extCode);
if (extCodeOpenJitParams != null)
{
minPriceFen = (extCodeOpenJitParams.PriceMin * 100).ParseToInt();
maxPriceFen = (extCodeOpenJitParams.PriceMax * 100).ParseToInt();
identifyCode = extCodeOpenJitParams.IdentifyCode;
realPicture = extCodeOpenJitParams.RealPicture;
stock = extCodeOpenJitParams.Stock;
}
string orderId = dgvRow.Cells["colOrderId"].Value.ParseToString();
string prodId = dgvRow.Cells["colProductId"].Value.ParseToString();
string skcId = dgvRow.Cells["colProdSkc"].Value.ParseToString();
@@ -1449,6 +1496,8 @@ Content-Disposition: form-data; name=""upload_sign""
{
Thread.Sleep(100);
}
if (!changePriceForm.IsAdjustPrice && string.IsNullOrEmpty(changePriceForm.ErrMsg))
changePriceForm.ErrMsg = "操作超时";
// 显示调价结果
this.UpdatePriceChange(changePriceForm.IsAdjustPrice, changePriceForm.ErrMsg, product);
Thread.Sleep(500);
@@ -1475,7 +1524,7 @@ Content-Disposition: form-data; name=""upload_sign""
MainForm.instance.Controls.Add(complianceForm);
complianceForm.SendToBack();
complianceForm.Show();
complianceForm.txtCode.Text = this.txtBatchIdentifyCode.Text;
complianceForm.txtCode.Text = identifyCode;
}));
Thread.Sleep(200);
// 成功、失败或超时后继续
@@ -1483,8 +1532,10 @@ Content-Disposition: form-data; name=""upload_sign""
{
Thread.Sleep(100);
}
if (!complianceForm.IsEditComplianceSuccess && string.IsNullOrEmpty(complianceForm.ErrMsg))
complianceForm.ErrMsg = "操作超时";
var rows = dgvOpenJit.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colProductId"].Value.ParseToString() == prodId).ToList();
if (complianceForm?.IsEditComplianceSuccess == true)
if (complianceForm.IsEditComplianceSuccess == true)
{
foreach (var row in rows)
{
@@ -1511,7 +1562,7 @@ Content-Disposition: form-data; name=""upload_sign""
// ----------------------------------------------------------------------------------
if (chkBatchRealPicture.Checked && type == 1 && 1 == 1)
{
var uploadRst = UploadRealPicture(shop, pbRealPicture.Tag.ParseToString(), realPicInfo, dgvRow.Cells["colMsg"]);
var uploadRst = UploadRealPicture(shop, realPicture, realPicInfo, dgvRow.Cells["colMsg"]);
if (uploadRst)
{
var rows = dgvOpenJit.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colProductId"].Value.ParseToString() == prodId).ToList();
@@ -1573,7 +1624,7 @@ Content-Disposition: form-data; name=""upload_sign""
Invoke(new Action(() =>
{
stockForm = new ChangeStockForm(shop, product, txtBatchStock.Text.ParseToInt());
stockForm = new ChangeStockForm(shop, product, stock);
stockForm.IsAuto = true;
stockForm.TopLevel = false;
stockForm.Left = 10;
@@ -1588,6 +1639,8 @@ Content-Disposition: form-data; name=""upload_sign""
{
Thread.Sleep(100);
}
if (!stockForm.IsEditSuccess && string.IsNullOrEmpty(stockForm.ErrMsg))
stockForm.ErrMsg = "操作超时";
var rows = dgvOpenJit.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colProductId"].Value.ParseToString() == prodId).ToList();
if (stockForm.IsEditSuccess)
{
@@ -1820,8 +1873,8 @@ Content-Disposition: form-data; name=""upload_sign""
image.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] imageBytes = memoryStream.ToArray();
}
this.pbRealPicture.Tag = fileFullName;
this.pbRealPicture.Image = image;
this.pbBatchRealPicture.Tag = fileFullName;
this.pbBatchRealPicture.Image = image;
}
catch (Exception ex)
{
@@ -1857,12 +1910,61 @@ Content-Disposition: form-data; name=""upload_sign""
if (e.ColumnIndex < 0 || e.RowIndex < 0)
return;
dgvExtCode.Rows[e.RowIndex].Cells["colSelectExtCode"].Value = !dgvExtCode.Rows[e.RowIndex].Cells["colSelectExtCode"].Value.ParseToBool();
string headerText = dgvExtCode.Columns[e.ColumnIndex].HeaderText;
var row = dgvExtCode.Rows[e.RowIndex];
switch (headerText)
{
case "":
case "选":
case "货号":
row.Cells["colSelectExtCode"].Value = !row.Cells["colSelectExtCode"].Value.ParseToBool();
lstFilterExtCode = dgvExtCode.Rows.Cast<DataGridViewRow>()
.Where(r => r.Cells["colSelectExtCode"].Value.ParseToBool() == true)
.Select(r => r.Cells["colFilterExtCode"].Value.ParseToString()).Distinct().ToList();
FilterRows();
break;
case "JIT配置":
if (row.Cells[e.ColumnIndex].Value.ParseToString() == "查看")
{
var extCode = row.Cells["colFilterExtCode"].Value.ParseToString();
var jitParam = lstOpenJitParams.FirstOrDefault(p => p.ExtCode == extCode);
if (jitParam == null)
{
BaseMsgForm.ShowError("配置已删除");
}
else
{
var displayRst = DisplayOpenJitParams(jitParam);
if (!string.IsNullOrEmpty(displayRst))
BaseMsgForm.ShowError(displayRst);
}
}
break;
}
}
lstFilterExtCode = dgvExtCode.Rows.Cast<DataGridViewRow>()
.Where(r => r.Cells["colSelectExtCode"].Value.ParseToBool() == true)
.Select(r => r.Cells["colFilterExtCode"].Value.ParseToString()).Distinct().ToList();
FilterRows();
string DisplayOpenJitParams(OpenJitParams jitParam)
{
this.txtBatchPriceMin.Text = jitParam.PriceMin.ToString();
this.txtBatchPriceMax.Text = jitParam.PriceMax.ToString();
this.txtBatchIdentifyCode.Text = jitParam.IdentifyCode;
this.txtBatchStock.Text = jitParam.Stock.ToString();
try
{
Image image = Image.FromFile(jitParam.RealPicture);
using (MemoryStream memoryStream = new MemoryStream())
{
image.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] imageBytes = memoryStream.ToArray();
}
this.pbBatchRealPicture.Tag = jitParam.RealPicture;
this.pbBatchRealPicture.Image = image;
}
catch (Exception ex)
{
return ex.Message;
}
return "";
}
void FilterRows()
@@ -2169,8 +2271,74 @@ Content-Disposition: form-data; name=""upload_sign""
{
FilterRows();
}
private void btnSaveExtCodeJitConfig_Click(object sender, EventArgs e)
{
var rows = this.dgvExtCode.Rows.Cast<DataGridViewRow>()
.Where(r => r.Cells["colSelectExtCode"].Value.ParseToBool() == true).ToList();
var extCodeLst = rows.Select(r => r.Cells["colFilterExtCode"].Value.ParseToString()).Distinct().ToList();
if (extCodeLst.Count == 0)
{
BaseMsgForm.ShowError("请查询商品后在左边列表选择货号!");
return;
}
string checkJitParamRst = CheckJitParam();
if (!string.IsNullOrEmpty(checkJitParamRst))
{
BaseMsgForm.ShowError(checkJitParamRst);
return;
}
foreach (var extCode in extCodeLst)
{
lstOpenJitParams.RemoveAll(p => p.ExtCode == extCode);
var jitParam = new OpenJitParams()
{
ExtCode = extCode,
IdentifyCode = txtBatchIdentifyCode.Text.Trim(),
PriceMax = txtBatchPriceMax.Text.Trim().ParseToDecimal(),
PriceMin = txtBatchPriceMin.Text.Trim().ParseToDecimal(),
RealPicture = pbBatchRealPicture.Tag.ParseToString(),
Stock = txtBatchStock.Text.Trim().ParseToInt(),
};
lstOpenJitParams.Add(jitParam);
}
NaiBa.Util.Helper.ConfigHelper.SaveConfig("open_jit_params", lstOpenJitParams);
BaseMsgForm.ShowInfo("选中货号的JIT配置已保存!");
foreach (var row in rows)
{
row.Cells["colJitConfig"].Value = "查看";
}
}
private void btnRestoreJitParams_Click(object sender, EventArgs e)
{
var rows = this.dgvExtCode.Rows.Cast<DataGridViewRow>()
.Where(r => r.Cells["colSelectExtCode"].Value.ParseToBool() == true).ToList();
var extCodeLst = rows.Select(r => r.Cells["colFilterExtCode"].Value.ParseToString()).Distinct().ToList();
if (extCodeLst.Count == 0)
{
BaseMsgForm.ShowError("请查询商品后在左边列表选择货号!");
return;
}
foreach (var extCode in extCodeLst)
{
lstOpenJitParams.RemoveAll(p => p.ExtCode == extCode);
}
NaiBa.Util.Helper.ConfigHelper.SaveConfig("open_jit_params", lstOpenJitParams);
BaseMsgForm.ShowInfo("选中货号的JIT配置已重置!");
foreach (var row in rows)
{
row.Cells["colJitConfig"].Value = "未设置";
}
}
}
// jit操作查询相关设置
public class SetJitConfig
{
public string SearchShopId { get; set; } = "";
@@ -2182,7 +2350,10 @@ Content-Disposition: form-data; name=""upload_sign""
public bool SearchDuration { get; set; } = true;
}
public class OpenJitConfig
/// <summary>
/// 开开通jit配置参数
/// </summary>
public class OpenJitParams
{
public string ExtCode { get; set; }
public decimal PriceMin { get; set; }