平台禁售商品设置
This commit is contained in:
1 parent
9a47ecf102
commit
b5ae0fc2f2
11 files changed
+604
-123
No files matched your search
+63
-13
@@ -29,6 +29,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
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();
|
||||
@@ -36,6 +37,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(JstBanPlatformForm));
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.chkBanPdd = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.chkBanWx = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.btnSetBan = new DevComponents.DotNetBar.PanelEx();
|
||||
this.txtCoid = new System.Windows.Forms.TextBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.btnEmpty = new DevComponents.DotNetBar.PanelEx();
|
||||
@@ -74,6 +78,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.chkBanPdd);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.chkBanWx);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.btnSetBan);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.txtCoid);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.label7);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.btnEmpty);
|
||||
@@ -83,13 +90,56 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(1438, 686);
|
||||
this.splitContainer1.SplitterDistance = 110;
|
||||
this.splitContainer1.SplitterDistance = 69;
|
||||
this.splitContainer1.TabIndex = 1;
|
||||
//
|
||||
// chkBanPdd
|
||||
//
|
||||
this.chkBanPdd.AutoSize = true;
|
||||
this.chkBanPdd.Location = new System.Drawing.Point(668, 24);
|
||||
this.chkBanPdd.Name = "chkBanPdd";
|
||||
this.chkBanPdd.Size = new System.Drawing.Size(87, 21);
|
||||
this.chkBanPdd.TabIndex = 1041;
|
||||
this.chkBanPdd.Text = "拼多多禁售";
|
||||
this.chkBanPdd.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkBanWx
|
||||
//
|
||||
this.chkBanWx.AutoSize = true;
|
||||
this.chkBanWx.Location = new System.Drawing.Point(588, 24);
|
||||
this.chkBanWx.Name = "chkBanWx";
|
||||
this.chkBanWx.Size = new System.Drawing.Size(75, 21);
|
||||
this.chkBanWx.TabIndex = 1040;
|
||||
this.chkBanWx.Text = "微信禁售";
|
||||
this.chkBanWx.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnSetBan
|
||||
//
|
||||
this.btnSetBan.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnSetBan.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.btnSetBan.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.btnSetBan.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnSetBan.Location = new System.Drawing.Point(760, 23);
|
||||
this.btnSetBan.Name = "btnSetBan";
|
||||
this.btnSetBan.Size = new System.Drawing.Size(103, 23);
|
||||
this.btnSetBan.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.btnSetBan.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.btnSetBan.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.btnSetBan.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
|
||||
this.btnSetBan.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
|
||||
this.btnSetBan.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
|
||||
this.btnSetBan.Style.ForeColor.Color = System.Drawing.Color.White;
|
||||
this.btnSetBan.Style.GradientAngle = 90;
|
||||
this.btnSetBan.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.btnSetBan.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
||||
this.btnSetBan.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
||||
this.btnSetBan.TabIndex = 1039;
|
||||
this.btnSetBan.Text = "批量设置禁售";
|
||||
this.btnSetBan.Click += new System.EventHandler(this.btnSetBan_Click);
|
||||
//
|
||||
// txtCoid
|
||||
//
|
||||
this.txtCoid.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtCoid.Location = new System.Drawing.Point(102, 22);
|
||||
this.txtCoid.Location = new System.Drawing.Point(102, 21);
|
||||
this.txtCoid.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.txtCoid.Name = "txtCoid";
|
||||
this.txtCoid.Size = new System.Drawing.Size(243, 23);
|
||||
@@ -97,9 +147,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(31, 25);
|
||||
this.label7.Location = new System.Drawing.Point(31, 24);
|
||||
this.label7.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(81, 17);
|
||||
@@ -108,11 +157,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
// btnEmpty
|
||||
//
|
||||
this.btnEmpty.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.btnEmpty.CanvasColor = System.Drawing.SystemColors.Control;
|
||||
this.btnEmpty.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnEmpty.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.btnEmpty.Location = new System.Drawing.Point(403, 22);
|
||||
this.btnEmpty.Location = new System.Drawing.Point(403, 21);
|
||||
this.btnEmpty.Name = "btnEmpty";
|
||||
this.btnEmpty.Size = new System.Drawing.Size(46, 23);
|
||||
this.btnEmpty.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
@@ -133,12 +181,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
// btnSearchCoid
|
||||
//
|
||||
this.btnSearchCoid.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.btnSearchCoid.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnSearchCoid.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.btnSearchCoid.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.btnSearchCoid.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnSearchCoid.Location = new System.Drawing.Point(351, 22);
|
||||
this.btnSearchCoid.Location = new System.Drawing.Point(351, 21);
|
||||
this.btnSearchCoid.Name = "btnSearchCoid";
|
||||
this.btnSearchCoid.Size = new System.Drawing.Size(46, 23);
|
||||
this.btnSearchCoid.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
@@ -174,15 +221,15 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
this.splitContainer2.Panel2.Controls.Add(this.ucSplitPage1);
|
||||
this.splitContainer2.Panel2.Controls.Add(this.statusBar);
|
||||
this.splitContainer2.Size = new System.Drawing.Size(1438, 572);
|
||||
this.splitContainer2.SplitterDistance = 543;
|
||||
this.splitContainer2.Size = new System.Drawing.Size(1438, 613);
|
||||
this.splitContainer2.SplitterDistance = 584;
|
||||
this.splitContainer2.TabIndex = 0;
|
||||
//
|
||||
// pbLoading
|
||||
//
|
||||
this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue;
|
||||
this.pbLoading.Location = new System.Drawing.Point(694, 246);
|
||||
this.pbLoading.Location = new System.Drawing.Point(694, 267);
|
||||
this.pbLoading.Name = "pbLoading";
|
||||
this.pbLoading.Size = new System.Drawing.Size(50, 50);
|
||||
this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
@@ -221,7 +268,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.dgvBanPlatform.Name = "dgvBanPlatform";
|
||||
this.dgvBanPlatform.ReadOnly = true;
|
||||
this.dgvBanPlatform.RowTemplate.Height = 23;
|
||||
this.dgvBanPlatform.Size = new System.Drawing.Size(1430, 543);
|
||||
this.dgvBanPlatform.Size = new System.Drawing.Size(1430, 584);
|
||||
this.dgvBanPlatform.TabIndex = 6;
|
||||
this.dgvBanPlatform.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellClick);
|
||||
this.dgvBanPlatform.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellContentClick);
|
||||
@@ -349,5 +396,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colBanWx;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colBanPdd;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colOpreateResult;
|
||||
private UserComponent.UcCheckBox chkBanPdd;
|
||||
private UserComponent.UcCheckBox chkBanWx;
|
||||
private DevComponents.DotNetBar.PanelEx btnSetBan;
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
ShopLoginInfo shop = null;
|
||||
public CancellationTokenSource cancellationTokenSource { get; set; } = new CancellationTokenSource();
|
||||
|
||||
ConcurrentList<KJDDBProduct> lstTemuDbProduct = new ConcurrentList<KJDDBProduct>();
|
||||
ConcurrentList<BanPlatformInfo> lstBanPlatformInfo = new ConcurrentList<BanPlatformInfo>();
|
||||
ConcurrentList<string> lstTitleReplaceText = new ConcurrentList<string>();
|
||||
|
||||
public JstBanPlatformForm()
|
||||
@@ -72,14 +72,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
{
|
||||
this.pbLoading.Visible = true;
|
||||
this.dgvBanPlatform.Rows.Clear();
|
||||
lstTemuDbProduct.Clear();
|
||||
lstBanPlatformInfo.Clear();
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.pbLoading.Visible = true;
|
||||
this.dgvBanPlatform.Rows.Clear();
|
||||
lstTemuDbProduct.Clear();
|
||||
lstBanPlatformInfo.Clear();
|
||||
}
|
||||
Task.Run(() =>
|
||||
{
|
||||
@@ -87,28 +87,29 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
int pageSize = 100;
|
||||
decimal seconds;
|
||||
Invoke(new Action(() => { pageSize = this.ucSplitPage1.PageSize; }));
|
||||
var list = GetProductList(out pageCount, out seconds, page, pageSize);
|
||||
lstTemuDbProduct.AddRange(list);
|
||||
var list = GetCoidNameList(out pageCount, out seconds, page, pageSize);
|
||||
lstBanPlatformInfo.AddRange(list);
|
||||
this.ucSplitPage1.TotalPage = pageCount;
|
||||
|
||||
// 获取Bitmap的Graphics对象
|
||||
foreach (var prod in lstTemuDbProduct)
|
||||
foreach (var banInfo in lstBanPlatformInfo)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
int rowIndex = this.dgvBanPlatform.Rows.Add(
|
||||
false,
|
||||
prod.id,
|
||||
prod.from_shop_id,
|
||||
prod.from_shop_name,
|
||||
prod.product_name,
|
||||
prod.sku_img_replace_url,
|
||||
DataGridViewExtension.defaultBitmap,
|
||||
(prod.spu_id).Trim(),
|
||||
prod.skc_id
|
||||
);
|
||||
//banInfo.id,
|
||||
banInfo.coid,
|
||||
banInfo.supplier_name,
|
||||
banInfo.ban_wx == 1 ? "是" : "否",
|
||||
banInfo.ban_pdd == 1 ? "是" : "否",
|
||||
""
|
||||
);
|
||||
|
||||
dgvBanPlatform.Rows[rowIndex].Height = 50;
|
||||
var row = dgvBanPlatform.Rows[rowIndex];
|
||||
row.Height = 50;
|
||||
|
||||
row.Cells["colBanWx"].Style.BackColor = banInfo.ban_wx == 1 ? Color.Yellow : row.Cells["colCoid"].Style.BackColor;
|
||||
row.Cells["colBanPdd"].Style.BackColor = banInfo.ban_pdd == 1 ? Color.Yellow : row.Cells["colCoid"].Style.BackColor;
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -123,20 +124,21 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
});
|
||||
}
|
||||
|
||||
public List<KJDDBProduct> GetProductList(out int pageCount, out decimal seconds, int page = 1, int pageSize = 200)
|
||||
public List<BanPlatformInfo> GetCoidNameList(out int pageCount, out decimal seconds, int page = 1, int pageSize = 200)
|
||||
{
|
||||
List<KJDDBProduct> list = new List<KJDDBProduct>();
|
||||
List<BanPlatformInfo> list = new List<BanPlatformInfo>();
|
||||
pageCount = 1;
|
||||
seconds = 0;
|
||||
|
||||
var url = BaseClass.BuildPDDObjString("product/get_ban_platform_list");
|
||||
var url = BaseClass.BuildPDDObjString("product/get_jst_product_coid_list");
|
||||
var data = "";
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
data = UserLogin.GetSignaturex() +
|
||||
"&page=" + page +
|
||||
"&page_size=" + pageSize +
|
||||
"&coids=" + txtCoid.Text.Trim();
|
||||
"&page_size=" + pageSize;
|
||||
if (!string.IsNullOrEmpty(txtCoid.Text.Trim()))
|
||||
data += "&coids=" + txtCoid.Text.Trim();
|
||||
}));
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
@@ -164,12 +166,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
|
||||
try
|
||||
{
|
||||
list = JsonHelper.DeserializeJsonToList<KJDDBProduct>(sProd);
|
||||
list = JsonHelper.DeserializeJsonToList<BanPlatformInfo>(sProd);
|
||||
return list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new List<KJDDBProduct>();
|
||||
return new List<BanPlatformInfo>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,8 +202,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
if (e.ColumnIndex < 0 || e.RowIndex < 0)
|
||||
return;
|
||||
string headerText = dgvBanPlatform.Columns[e.ColumnIndex].HeaderText;
|
||||
var dbId = dgvBanPlatform.Rows[e.RowIndex].Cells["col_db_id"].Value.ParseToString();
|
||||
var dbProduct = lstTemuDbProduct.FirstOrDefault(p => p.id.ToString() == dbId);
|
||||
var coid = dgvBanPlatform.Rows[e.RowIndex].Cells["colCoid"].Value.ParseToString();
|
||||
var banInfo = lstBanPlatformInfo.FirstOrDefault(p => p.coid == coid);
|
||||
|
||||
switch (headerText)
|
||||
{
|
||||
@@ -218,30 +220,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
if (e.ColumnIndex < 0 || e.RowIndex < 0)
|
||||
return;
|
||||
string headerText = dgvBanPlatform.Columns[e.ColumnIndex].HeaderText;
|
||||
var dbId = dgvBanPlatform.Rows[e.RowIndex].Cells["col_db_id"].Value.ParseToString();
|
||||
var dbProduct = lstTemuDbProduct.FirstOrDefault(p => p.id.ToString() == dbId);
|
||||
var coid = dgvBanPlatform.Rows[e.RowIndex].Cells["colCoid"].Value.ParseToString();
|
||||
var banInfo = lstBanPlatformInfo.FirstOrDefault(p => p.coid == coid);
|
||||
|
||||
switch (headerText)
|
||||
{
|
||||
case "资料编码/真实上家":
|
||||
try
|
||||
{
|
||||
string url = "";
|
||||
if (string.IsNullOrEmpty(dbProduct.real_spu_id) || string.IsNullOrEmpty(dbProduct.real_coid))
|
||||
url = "https://sc.scm121.com/manage/goods/qualitySupplier/goodsDetail/" + dbProduct.spu_id + "?itemCoId=" + dbProduct.skc_id + "&noBack=true";
|
||||
else
|
||||
url = "https://sc.scm121.com/manage/goods/qualitySupplier/goodsDetail/" + dbProduct.real_spu_id + "?itemCoId=" + dbProduct.real_coid + "&noBack=true";
|
||||
Process.Start(new ProcessStartInfo(url)
|
||||
{
|
||||
UseShellExecute = true
|
||||
});
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 可能需要手动指定浏览器路径
|
||||
Process.Start(new ProcessStartInfo("https://www.baidu.com") { UseShellExecute = true });
|
||||
}
|
||||
break;
|
||||
case "":
|
||||
dgvBanPlatform.Rows[e.RowIndex].Cells["colSelect"].Value = !(bool)dgvBanPlatform.Rows[e.RowIndex].Cells["colSelect"].Value;
|
||||
break;
|
||||
@@ -252,24 +235,24 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
|
||||
private void DeleteProduct(string dbId, bool isUpdate = true)
|
||||
{
|
||||
var url = BaseClass.BuildPDDObjString("product/del_db_product");
|
||||
var data = UserLogin.GetSignaturex() +
|
||||
"&db_id=" + dbId;
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgForm.ShowError("删除商品失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg"));
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isUpdate)
|
||||
SearchBanPlatForm(this.ucSplitPage1.CurrentPage);
|
||||
}
|
||||
//var url = BaseClass.BuildPDDObjString("product/del_db_product");
|
||||
//var data = UserLogin.GetSignaturex() +
|
||||
// "&db_id=" + dbId;
|
||||
//var html = GetHtml.PostUtf8(url, data);
|
||||
//if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
// html = GetHtml.PostUtf8(url, data);
|
||||
//if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
// html = GetHtml.PostUtf8(url, data);
|
||||
//if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
//{
|
||||
// BaseMsgForm.ShowError("删除商品失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg"));
|
||||
// return;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// if (isUpdate)
|
||||
// SearchBanPlatForm(this.ucSplitPage1.CurrentPage);
|
||||
//}
|
||||
}
|
||||
|
||||
private void dgvDbProduct_Scroll(object sender, ScrollEventArgs e)
|
||||
@@ -305,5 +288,78 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//}
|
||||
}
|
||||
|
||||
private void btnSetBan_Click(object sender, EventArgs e)
|
||||
{
|
||||
var banCoids = this.dgvBanPlatform.Rows.Cast<DataGridViewRow>().Where(s=>s.Cells["colSelect"].Value.ParseToBool() == true)
|
||||
.Select(s => s.Cells["colCoid"].Value.ParseToString()).Distinct().ToList();
|
||||
if (banCoids.Count == 0)
|
||||
{
|
||||
BaseMsgForm.ShowError("请选择供应商");
|
||||
return;
|
||||
}
|
||||
|
||||
this.pbLoading.Visible = true;
|
||||
Task.Run(() =>
|
||||
{
|
||||
foreach (var coid in banCoids)
|
||||
{
|
||||
var BanWx = chkBanWx.Checked ? 1 : 0;
|
||||
var BanPdd = chkBanPdd.Checked ? 1 : 0;
|
||||
|
||||
var url = BaseClass.BuildPDDObjString("product/add_mdy_jst_product_ban");
|
||||
var data = "";
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
data = UserLogin.GetSignaturex() +
|
||||
"&coid=" + coid +
|
||||
"&ban_wx=" + BanWx +
|
||||
"&ban_pdd=" + BanPdd;
|
||||
}));
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var rows = this.dgvBanPlatform.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colCoid"].Value.ParseToString() == coid);
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Cells["colOpreateResult"].Value = "设置失败 " + BaseRegex.GetStringJson(ref html, "msg");
|
||||
}
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var rows = this.dgvBanPlatform.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colCoid"].Value.ParseToString() == coid);
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Cells["colOpreateResult"].Value = "设置成功";
|
||||
row.Cells["colBanWx"].Value = BanWx == 1 ? "是" : "否";
|
||||
row.Cells["colBanPdd"].Value = BanPdd == 1 ? "是" : "否";
|
||||
row.Cells["colBanWx"].Style.BackColor = BanWx == 1 ? Color.Yellow : row.Cells["colCoid"].Style.BackColor;
|
||||
row.Cells["colBanPdd"].Style.BackColor = BanPdd == 1 ? Color.Yellow : row.Cells["colCoid"].Style.BackColor;
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
pbLoading.Visible = false;
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class BanPlatformInfo
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string coid { get; set; }
|
||||
public string supplier_name { get; set; }
|
||||
public int ban_wx { get; set; }
|
||||
public int ban_pdd { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
+11
-11
@@ -772,7 +772,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
"",
|
||||
"是",
|
||||
"否"});
|
||||
this.cmbPddRelation.Location = new System.Drawing.Point(743, 7);
|
||||
this.cmbPddRelation.Location = new System.Drawing.Point(743, 5);
|
||||
this.cmbPddRelation.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbPddRelation.Name = "cmbPddRelation";
|
||||
this.cmbPddRelation.Size = new System.Drawing.Size(47, 25);
|
||||
@@ -827,7 +827,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
this.cmbCat2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cmbCat2.FormattingEnabled = true;
|
||||
this.cmbCat2.Location = new System.Drawing.Point(278, 75);
|
||||
this.cmbCat2.Location = new System.Drawing.Point(278, 77);
|
||||
this.cmbCat2.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbCat2.Name = "cmbCat2";
|
||||
this.cmbCat2.Size = new System.Drawing.Size(46, 25);
|
||||
@@ -912,7 +912,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
"机会商品",
|
||||
"以图搜品",
|
||||
"外部数据"});
|
||||
this.cmbSourceType.Location = new System.Drawing.Point(278, 40);
|
||||
this.cmbSourceType.Location = new System.Drawing.Point(278, 42);
|
||||
this.cmbSourceType.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbSourceType.Name = "cmbSourceType";
|
||||
this.cmbSourceType.Size = new System.Drawing.Size(46, 25);
|
||||
@@ -958,7 +958,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
"",
|
||||
"是",
|
||||
"否"});
|
||||
this.cmbWxCat.Location = new System.Drawing.Point(622, 5);
|
||||
this.cmbWxCat.Location = new System.Drawing.Point(622, 7);
|
||||
this.cmbWxCat.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbWxCat.Name = "cmbWxCat";
|
||||
this.cmbWxCat.Size = new System.Drawing.Size(47, 25);
|
||||
@@ -980,7 +980,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
this.cmbSort.Items.AddRange(new object[] {
|
||||
"入库时间",
|
||||
"认领总数"});
|
||||
this.cmbSort.Location = new System.Drawing.Point(381, 40);
|
||||
this.cmbSort.Location = new System.Drawing.Point(381, 42);
|
||||
this.cmbSort.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbSort.Name = "cmbSort";
|
||||
this.cmbSort.Size = new System.Drawing.Size(46, 25);
|
||||
@@ -1056,7 +1056,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
this.cmbGroupFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cmbGroupFilter.FormattingEnabled = true;
|
||||
this.cmbGroupFilter.Location = new System.Drawing.Point(175, 40);
|
||||
this.cmbGroupFilter.Location = new System.Drawing.Point(175, 42);
|
||||
this.cmbGroupFilter.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbGroupFilter.Name = "cmbGroupFilter";
|
||||
this.cmbGroupFilter.Size = new System.Drawing.Size(46, 25);
|
||||
@@ -1071,7 +1071,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
"是",
|
||||
"否",
|
||||
"导出未拉回"});
|
||||
this.cmbExportToOutServer.Location = new System.Drawing.Point(622, 40);
|
||||
this.cmbExportToOutServer.Location = new System.Drawing.Point(622, 42);
|
||||
this.cmbExportToOutServer.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbExportToOutServer.Name = "cmbExportToOutServer";
|
||||
this.cmbExportToOutServer.Size = new System.Drawing.Size(47, 25);
|
||||
@@ -1107,7 +1107,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
"安全商品",
|
||||
"违规商品",
|
||||
"未校验"});
|
||||
this.cmbWxSafe.Location = new System.Drawing.Point(501, 40);
|
||||
this.cmbWxSafe.Location = new System.Drawing.Point(501, 42);
|
||||
this.cmbWxSafe.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbWxSafe.Name = "cmbWxSafe";
|
||||
this.cmbWxSafe.Size = new System.Drawing.Size(47, 25);
|
||||
@@ -1149,7 +1149,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
this.cmbCat1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cmbCat1.FormattingEnabled = true;
|
||||
this.cmbCat1.Location = new System.Drawing.Point(175, 75);
|
||||
this.cmbCat1.Location = new System.Drawing.Point(175, 77);
|
||||
this.cmbCat1.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbCat1.Name = "cmbCat1";
|
||||
this.cmbCat1.Size = new System.Drawing.Size(46, 25);
|
||||
@@ -1171,7 +1171,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
//
|
||||
this.cmbCat3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cmbCat3.FormattingEnabled = true;
|
||||
this.cmbCat3.Location = new System.Drawing.Point(381, 75);
|
||||
this.cmbCat3.Location = new System.Drawing.Point(381, 77);
|
||||
this.cmbCat3.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbCat3.Name = "cmbCat3";
|
||||
this.cmbCat3.Size = new System.Drawing.Size(46, 25);
|
||||
@@ -1268,7 +1268,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
|
||||
"是",
|
||||
"否",
|
||||
"修复回传未拉回"});
|
||||
this.cmbHasReturn.Location = new System.Drawing.Point(743, 40);
|
||||
this.cmbHasReturn.Location = new System.Drawing.Point(743, 42);
|
||||
this.cmbHasReturn.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
|
||||
this.cmbHasReturn.Name = "cmbHasReturn";
|
||||
this.cmbHasReturn.Size = new System.Drawing.Size(47, 25);
|
||||
|
||||
+15
-11
@@ -36,9 +36,10 @@
|
||||
System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("1688厂家采集");
|
||||
System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("随机厂商商品");
|
||||
System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("地址管理");
|
||||
System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("图片工具");
|
||||
System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("运单管理");
|
||||
System.Windows.Forms.TreeNode treeNode11 = new System.Windows.Forms.TreeNode("超级权限管理", new System.Windows.Forms.TreeNode[] {
|
||||
System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("设置禁售");
|
||||
System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("图片工具");
|
||||
System.Windows.Forms.TreeNode treeNode11 = new System.Windows.Forms.TreeNode("运单管理");
|
||||
System.Windows.Forms.TreeNode treeNode12 = new System.Windows.Forms.TreeNode("超级权限管理", new System.Windows.Forms.TreeNode[] {
|
||||
treeNode1,
|
||||
treeNode2,
|
||||
treeNode3,
|
||||
@@ -48,7 +49,8 @@
|
||||
treeNode7,
|
||||
treeNode8,
|
||||
treeNode9,
|
||||
treeNode10});
|
||||
treeNode10,
|
||||
treeNode11});
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
@@ -155,14 +157,16 @@
|
||||
treeNode7.Text = "随机厂商商品";
|
||||
treeNode8.Name = "地址管理";
|
||||
treeNode8.Text = "地址管理";
|
||||
treeNode9.Name = "图片工具";
|
||||
treeNode9.Text = "图片工具";
|
||||
treeNode10.Name = "运单管理";
|
||||
treeNode10.Text = "运单管理";
|
||||
treeNode11.Name = "超级权限管理";
|
||||
treeNode11.Text = "超级权限管理";
|
||||
treeNode9.Name = "设置禁售";
|
||||
treeNode9.Text = "设置禁售";
|
||||
treeNode10.Name = "图片工具";
|
||||
treeNode10.Text = "图片工具";
|
||||
treeNode11.Name = "运单管理";
|
||||
treeNode11.Text = "运单管理";
|
||||
treeNode12.Name = "超级权限管理";
|
||||
treeNode12.Text = "超级权限管理";
|
||||
this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
|
||||
treeNode11});
|
||||
treeNode12});
|
||||
this.tv.OverForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
|
||||
this.tv.Size = new System.Drawing.Size(140, 446);
|
||||
this.tv.TabIndex = 1;
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
public Lazy<GetAddressForm> getAddressForm = new Lazy<GetAddressForm>();
|
||||
public Lazy<RandomComProductForm> randomComProductForm = new Lazy<RandomComProductForm>();
|
||||
public Lazy<WXWaybillManageForm> waybillManageForm = new Lazy<WXWaybillManageForm>();
|
||||
public Lazy<JstBanPlatformForm> banPlatformForm = new Lazy<JstBanPlatformForm>();
|
||||
|
||||
public WXAdminForm()
|
||||
{
|
||||
@@ -101,6 +102,9 @@ namespace TemuKJD.WXForms.AdminForms
|
||||
case "地址管理":
|
||||
SetForm(getAddressForm.Value);
|
||||
break;
|
||||
case "设置禁售":
|
||||
SetForm(banPlatformForm.Value);
|
||||
break;
|
||||
case "图片工具":
|
||||
SetForm(imgToolForm.Value);
|
||||
break;
|
||||
|
||||
@@ -1050,7 +1050,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
KJDDBProduct kjdDbProd = selectProd.kjdDbProduct;
|
||||
string errStr = "";
|
||||
if (kjdDbProd == null)
|
||||
kjdDbProd = GetProductDetail(selectProd.out_product_Id.ToString(), out errStr, true);
|
||||
kjdDbProd = GetProductDetail(selectProd.out_product_Id.ToString(), out errStr, true, true);
|
||||
if (kjdDbProd == null || kjdDbProd.id == 0)
|
||||
{
|
||||
if (kjdDbProd?.id == 0)
|
||||
@@ -1221,7 +1221,15 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}));
|
||||
}
|
||||
|
||||
public static KJDDBProduct GetProductDetail(string prodDbId, out string errMsg, bool noViolationProduct = false)
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="prodDbId"></param>
|
||||
/// <param name="errMsg"></param>
|
||||
/// <param name="noViolationProduct">校验违规商品</param>
|
||||
/// <param name="noBanWx">校验微信禁售商品</param>
|
||||
/// <returns></returns>
|
||||
public static KJDDBProduct GetProductDetail(string prodDbId, out string errMsg, bool noViolationProduct = false, bool noBanWx = false)
|
||||
{
|
||||
errMsg = "";
|
||||
|
||||
@@ -1237,6 +1245,8 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
var data = UserLogin.GetSignaturex() + "&search_db_ids=" + prodDbId;
|
||||
if (noViolationProduct)
|
||||
data += "&wx_safe_status=安全商品,未校验";
|
||||
if (noBanWx)
|
||||
data += "&ban_wx=0";
|
||||
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
@@ -4395,6 +4405,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
data = UserLogin.GetSignaturex() +
|
||||
"&page=" + 1 +
|
||||
"&page_size=" + pageSize;
|
||||
data += "&ban_wx=0";
|
||||
if (isNotCount)
|
||||
{
|
||||
data += "&is_not_count=" + true;
|
||||
|
||||
@@ -341,6 +341,10 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
"&search_group=" + cmbGroupFilter.Text.Trim() +
|
||||
"&search_prod_name=" + txtProdName.Text.Trim() +
|
||||
"&wx_safe_status=" + cmbWxSafe.Text.Trim().Replace("安全+未校验", "安全商品,未校验").Replace("违规商品", "");
|
||||
if (BaseClass.MainPath == "weixin")
|
||||
data += "&ban_wx=0";
|
||||
if (BaseClass.MainPath == "binxixi")
|
||||
data += "&ban_pdd=0";
|
||||
if (cmbRelation.Text == "否")
|
||||
data += "&is_relation=0";
|
||||
else if (cmbRelation.Text == "是")
|
||||
|
||||
Reference in new issue
Block a user