1产品数据库认领次数计数 2图片后加载功能 3二级超管显示昵称

This commit is contained in:
wule committed 2025-07-25 19:04:52 +08:00
1 parent dfcf5e8a2c
commit bf7b32fb28
20 files changed
+345 -93

No files matched your search

@@ -63,10 +63,13 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.col_cat_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.con_ext_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colAddTimes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSelectTotalCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col_notes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col_edit = new System.Windows.Forms.DataGridViewLinkColumn();
this.col_delete = new System.Windows.Forms.DataGridViewLinkColumn();
this.col_select_product = new System.Windows.Forms.DataGridViewLinkColumn();
this.cmbSort = new System.Windows.Forms.ComboBox();
this.label6 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -90,6 +93,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.cmbSort);
this.splitContainer1.Panel1.Controls.Add(this.btnSelect);
this.splitContainer1.Panel1.Controls.Add(this.txtNotes);
this.splitContainer1.Panel1.Controls.Add(this.lblNotes);
@@ -105,6 +109,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.splitContainer1.Panel1.Controls.Add(this.label3);
this.splitContainer1.Panel1.Controls.Add(this.txtCat);
this.splitContainer1.Panel1.Controls.Add(this.label2);
this.splitContainer1.Panel1.Controls.Add(this.label6);
//
// splitContainer1.Panel2
//
@@ -329,6 +334,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.col_cat_name,
this.con_ext_code,
this.colAddTimes,
this.colSelectTotalCount,
this.col_notes,
this.col_edit,
this.col_delete,
@@ -433,10 +439,17 @@ namespace TemuKJD.KJDForms.ProductSelectForms
// colAddTimes
//
this.colAddTimes.FillWeight = 52F;
this.colAddTimes.HeaderText = "认领次数";
this.colAddTimes.HeaderText = "单店认领次数";
this.colAddTimes.Name = "colAddTimes";
this.colAddTimes.ReadOnly = true;
//
// colSelectTotalCount
//
this.colSelectTotalCount.FillWeight = 52F;
this.colSelectTotalCount.HeaderText = "认领总数";
this.colSelectTotalCount.Name = "colSelectTotalCount";
this.colSelectTotalCount.ReadOnly = true;
//
// col_notes
//
this.col_notes.HeaderText = "备注";
@@ -468,6 +481,27 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.col_select_product.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.col_select_product.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// cmbSort
//
this.cmbSort.FormattingEnabled = true;
this.cmbSort.Items.AddRange(new object[] {
"入库时间",
"认领总数"});
this.cmbSort.Location = new System.Drawing.Point(1001, 15);
this.cmbSort.Name = "cmbSort";
this.cmbSort.Size = new System.Drawing.Size(79, 25);
this.cmbSort.TabIndex = 448;
this.cmbSort.Text = "入库时间";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(944, 19);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(68, 17);
this.label6.TabIndex = 449;
this.label6.Text = "排序方式:";
//
// DbProductListForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -529,9 +563,12 @@ namespace TemuKJD.KJDForms.ProductSelectForms
private System.Windows.Forms.DataGridViewTextBoxColumn col_cat_name;
private System.Windows.Forms.DataGridViewTextBoxColumn con_ext_code;
private System.Windows.Forms.DataGridViewTextBoxColumn colAddTimes;
private System.Windows.Forms.DataGridViewTextBoxColumn colSelectTotalCount;
private System.Windows.Forms.DataGridViewTextBoxColumn col_notes;
private System.Windows.Forms.DataGridViewLinkColumn col_edit;
private System.Windows.Forms.DataGridViewLinkColumn col_delete;
private System.Windows.Forms.DataGridViewLinkColumn col_select_product;
private System.Windows.Forms.ComboBox cmbSort;
private System.Windows.Forms.Label label6;
}
}
@@ -124,6 +124,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
prod.cat_name,
prod.ext_code,
prod.select_count,
prod.select_total_count,
prod.notes,
"编辑",
"删除",
@@ -202,6 +203,10 @@ namespace TemuKJD.KJDForms.ProductSelectForms
data += "&get_select_count=true";
data += "&select_shop_id=" + shop.ShopId;
}
if (this.cmbSort.Text == "认领总数")
{
data += "&sort_field=select_total_count";
}
}));
var html = GetHtml.PostUtf8(url, data);
@@ -211,7 +216,10 @@ namespace TemuKJD.KJDForms.ProductSelectForms
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
BaseMsgForm.ShowError("获取商品列表失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg"));
Invoke(new Action(() =>
{
BaseMsgForm.ShowError("获取商品列表失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg"));
}));
return list;
}
@@ -355,13 +363,16 @@ namespace TemuKJD.KJDForms.ProductSelectForms
}
else
{
prod.select_count++;
prod.select_total_count++;
Invoke(new Action(() =>
{
var row = this.dgvDbProduct.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["col_db_id"].Value.ParseToInt() == prod.id);
if (row != null)
{
row.Cells["colAddTimes"].Value = prod.select_count;
row.Cells["colSelectTotalCount"].Value = prod.select_total_count;
}
}));
shop.AddProductRemaining = shop.AddProductRemaining - 1;
}
@@ -147,6 +147,9 @@
<metadata name="colAddTimes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSelectTotalCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="col_notes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -69,6 +69,7 @@
this.colCopyCookies = new System.Windows.Forms.DataGridViewLinkColumn();
this.colSpuId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colSkcId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colProductSkcPic = new System.Windows.Forms.DataGridViewImageColumn();
this.colProductName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colProductCat = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -77,6 +78,7 @@
this.colDraftId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colMdyTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSubSa = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSubSaNick = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colNotes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colEditNotes = new System.Windows.Forms.DataGridViewLinkColumn();
this.ColDelete = new System.Windows.Forms.DataGridViewLinkColumn();
@@ -412,6 +414,7 @@
this.colCopyCookies,
this.colSpuId,
this.colSkcId,
this.colImgUrl,
this.colProductSkcPic,
this.colProductName,
this.colProductCat,
@@ -420,6 +423,7 @@
this.colDraftId,
this.colMdyTime,
this.colSubSa,
this.colSubSaNick,
this.colNotes,
this.colEditNotes,
this.ColDelete,
@@ -433,6 +437,7 @@
this.dgvSelectProduct.Size = new System.Drawing.Size(1430, 552);
this.dgvSelectProduct.TabIndex = 189;
this.dgvSelectProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvSelectProduct_CellContentClick);
this.dgvSelectProduct.Scroll += new System.Windows.Forms.ScrollEventHandler(this.dgvSelectProduct_Scroll);
//
// ucSplitPage1
//
@@ -539,6 +544,13 @@
this.colSkcId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSkcId.Width = 90;
//
// colImgUrl
//
this.colImgUrl.HeaderText = "图片路径";
this.colImgUrl.Name = "colImgUrl";
this.colImgUrl.ReadOnly = true;
this.colImgUrl.Visible = false;
//
// colProductSkcPic
//
this.colProductSkcPic.HeaderText = "Skc图片";
@@ -593,9 +605,16 @@
//
// colSubSa
//
this.colSubSa.HeaderText = "二级超管";
this.colSubSa.HeaderText = "二级超管账号";
this.colSubSa.Name = "colSubSa";
this.colSubSa.ReadOnly = true;
this.colSubSa.Visible = false;
//
// colSubSaNick
//
this.colSubSaNick.HeaderText = "二级超管";
this.colSubSaNick.Name = "colSubSaNick";
this.colSubSaNick.ReadOnly = true;
//
// colNotes
//
@@ -694,6 +713,7 @@
private System.Windows.Forms.DataGridViewLinkColumn colCopyCookies;
private System.Windows.Forms.DataGridViewLinkColumn colSpuId;
private System.Windows.Forms.DataGridViewLinkColumn colSkcId;
private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colProductSkcPic;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductName;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductCat;
@@ -702,6 +722,7 @@
private System.Windows.Forms.DataGridViewLinkColumn colDraftId;
private System.Windows.Forms.DataGridViewTextBoxColumn colMdyTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSa;
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSaNick;
private System.Windows.Forms.DataGridViewTextBoxColumn colNotes;
private System.Windows.Forms.DataGridViewLinkColumn colEditNotes;
private System.Windows.Forms.DataGridViewLinkColumn ColDelete;
@@ -42,6 +42,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
if (BaseClass.SaLevel != 1)
{
dgvSelectProduct.Columns["colSubSa"].Visible = false;
dgvSelectProduct.Columns["colSubSaNick"].Visible = false;
btnSetSubSa.Visible = false;
chkNoSubSa.Visible = false;
}
@@ -96,16 +97,16 @@ namespace TemuKJD.KJDForms.ProductSelectForms
lstAdminTemuDBProductSelect.AddRange(list);
this.ucSplitPage1.TotalPage = pageCount;
if (defaultBitmap == null)
defaultBitmap = new Bitmap(80, 80);
// 获取Bitmap的Graphics对象
using (Graphics g = Graphics.FromImage(defaultBitmap))
{
// 清除整个Bitmap为蓝色
g.Clear(Color.White);
}
foreach (var prodSelect in lstAdminTemuDBProductSelect)
{
Image image = null;
string imgUrl = prodSelect?.main_img?.Replace("https", "http");
string rst = "";
if (!string.IsNullOrWhiteSpace(imgUrl))
image = GetHtml.GetUrlImg(imgUrl, out rst);
if (!string.IsNullOrEmpty(rst))
BaseMsgForm.ShowError(rst);
Invoke(new Action(() =>
{
int rowIndex = this.dgvSelectProduct.Rows.Add(
@@ -119,7 +120,8 @@ namespace TemuKJD.KJDForms.ProductSelectForms
"复制Cookies",
prodSelect.spu_id,
prodSelect.skc_id,
image,//prod.main_img,
prodSelect.main_img.Replace("https:","http:"),
defaultBitmap,//prod.main_img,
prodSelect.product_name,
prodSelect.cat_name,
prodSelect.ext_code,
@@ -127,6 +129,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
prodSelect.draft_id,
prodSelect.status == "待上传" ? "-" : prodSelect.mdy_time.ToString("yy/MM/dd HH:mm"),
prodSelect.operate_sub_sa_name == "" ? "-" : prodSelect.operate_sub_sa_name,
prodSelect.operate_sub_sa_nick == "" ? "-" : prodSelect.operate_sub_sa_nick,
prodSelect.notes,
"编辑",
"删除",
@@ -138,11 +141,51 @@ namespace TemuKJD.KJDForms.ProductSelectForms
Invoke(new Action(() =>
{
ShowDgvImg();
this.pbLoading.Visible = false;
}));
});
}
Bitmap defaultBitmap = null;
void ShowDgvImg()
{
Task.Run(() =>
{
foreach (DataGridViewRow row in this.dgvSelectProduct.Rows)
{
if (row.Cells["colProductSkcPic"].Displayed == false)
continue;
if (row.Cells["colProductSkcPic"].Value != null && row.Cells["colProductSkcPic"].Value != defaultBitmap)
continue;
Image image = null;
string imgUrl = row.Cells["colImgUrl"]?.Value.ParseToString();
string getImgError = "";
if (!string.IsNullOrWhiteSpace(imgUrl))
image = GetHtml.GetUrlImg(imgUrl, out getImgError);
if (!string.IsNullOrEmpty(getImgError))
BaseMsgForm.ShowError(getImgError);
try
{
Invoke(new Action(() =>
{
row.Cells["colProductSkcPic"].Value = image;
}));
}
catch
{
}
}
});
}
private void dgvSelectProduct_Scroll(object sender, ScrollEventArgs e)
{
ShowDgvImg();
}
public List<TemuDBProductSelect> GetSelectProductList(out int pageCount, int page = 1, int pageSize = 50)
{
@@ -1011,13 +1054,17 @@ namespace TemuKJD.KJDForms.ProductSelectForms
var prodList = this.lstAdminTemuDBProductSelect.Where(p => lstProdId.Contains(p.id.ParseToString())).ToArray();
var rows = dgvSelectProduct.Rows.Cast<DataGridViewRow>().Where(row => row.Cells["colSelect"]?.Value.ParseToBool() == true);
var subSa = subSaName.ParseToString().Split(new string[] { "&&&&&" }, StringSplitOptions.RemoveEmptyEntries);
foreach (var row in rows)
{
row.Cells["colSubSa"].Value = subSaName.ParseToString();
row.Cells["colSubSa"].Value = subSa[0];
row.Cells["colSubSaNick"].Value = subSa.Length > 1 ? subSa[1] : "";
}
foreach (var p in prodList)
{
p.operate_sub_sa_name = subSaName.ParseToString();
p.operate_sub_sa_name = subSa[0];
p.operate_sub_sa_nick = subSa.Length > 1 ? subSa[1] : "";
}
}
else
@@ -1028,13 +1075,17 @@ namespace TemuKJD.KJDForms.ProductSelectForms
var prodList = this.lstAdminTemuDBProductSelect.Where(p => lstSupplierId.Contains(p.shop_id.ParseToString())).ToArray();
var rows = dgvSelectProduct.Rows.Cast<DataGridViewRow>().Where(row => lstSupplierId.Contains(row.Cells["colSupplierId"]?.Value.ParseToString()));
var subSa = subSaName.ParseToString().Split(new string[] { "&&&&&" }, StringSplitOptions.RemoveEmptyEntries);
foreach (var row in rows)
{
row.Cells["colSubSa"].Value = subSaName.ParseToString();
row.Cells["colSubSa"].Value = subSa[0];
row.Cells["colSubSaNick"].Value = subSa.Length > 1 ? subSa[1] : "";
}
foreach (var p in prodList)
{
p.operate_sub_sa_name = subSaName.ParseToString();
p.operate_sub_sa_name = subSa[0];
p.operate_sub_sa_nick = subSa.Length > 1 ? subSa[1] : "";
}
}
}
@@ -144,6 +144,9 @@
<metadata name="colSpuId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colImgUrl.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colProductSkcPic.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -168,6 +171,9 @@
<metadata name="colSubSa.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSubSaNick.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colNotes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -36,12 +36,12 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.panel2 = new System.Windows.Forms.Panel();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.dgvSaUser = new TemuKJD.UserComponent.DataGridViewEx();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colSubSaId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSubUserName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSubSaName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ucCheckBox1 = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.btnOk = new TemuKJD.UserControls.ButtonEx();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colSubSaId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSubSaNick = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSubSaName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
@@ -100,7 +100,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.dgvSaUser.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colSelect,
this.colSubSaId,
this.colSubUserName,
this.colSubSaNick,
this.colSubSaName});
this.dgvSaUser.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvSaUser.Location = new System.Drawing.Point(4, 4);
@@ -112,39 +112,6 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.dgvSaUser.TabIndex = 189;
this.dgvSaUser.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvSaUser_CellContentClick);
//
// colSelect
//
this.colSelect.HeaderText = "选择";
this.colSelect.MinimumWidth = 6;
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 = 30;
//
// colSubSaId
//
this.colSubSaId.HeaderText = "二级超管Id";
this.colSubSaId.MinimumWidth = 6;
this.colSubSaId.Name = "colSubSaId";
this.colSubSaId.ReadOnly = true;
this.colSubSaId.Visible = false;
this.colSubSaId.Width = 125;
//
// colSubUserName
//
this.colSubUserName.HeaderText = "昵称";
this.colSubUserName.Name = "colSubUserName";
this.colSubUserName.ReadOnly = true;
this.colSubUserName.Width = 150;
//
// colSubSaName
//
this.colSubSaName.HeaderText = "账户";
this.colSubSaName.Name = "colSubSaName";
this.colSubSaName.ReadOnly = true;
this.colSubSaName.Width = 150;
//
// ucCheckBox1
//
this.ucCheckBox1.AutoSize = true;
@@ -174,6 +141,39 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.btnOk.UseVisualStyleBackColor = false;
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// colSelect
//
this.colSelect.HeaderText = "选择";
this.colSelect.MinimumWidth = 6;
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 = 30;
//
// colSubSaId
//
this.colSubSaId.HeaderText = "二级超管Id";
this.colSubSaId.MinimumWidth = 6;
this.colSubSaId.Name = "colSubSaId";
this.colSubSaId.ReadOnly = true;
this.colSubSaId.Visible = false;
this.colSubSaId.Width = 125;
//
// colSubSaNick
//
this.colSubSaNick.HeaderText = "昵称";
this.colSubSaNick.Name = "colSubSaNick";
this.colSubSaNick.ReadOnly = true;
this.colSubSaNick.Width = 150;
//
// colSubSaName
//
this.colSubSaName.HeaderText = "账户";
this.colSubSaName.Name = "colSubSaName";
this.colSubSaName.ReadOnly = true;
this.colSubSaName.Width = 150;
//
// ProductSelectSetSubSaForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -203,10 +203,10 @@ namespace TemuKJD.KJDForms.ProductSelectForms
private UserComponent.DataGridViewEx dgvSaUser;
private System.Windows.Forms.SplitContainer splitContainer1;
private UserControls.ButtonEx btnOk;
private UserComponent.UcCheckBox ucCheckBox1;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSaId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSubUserName;
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSaNick;
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSaName;
private UserComponent.UcCheckBox ucCheckBox1;
}
}
@@ -68,6 +68,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
return "请选择要分配的二级管理员!";
}
var sub_sa = selectRow.Cells["colSubSaName"].Value.ParseToString();
var sub_sa_nick = selectRow.Cells["colSubSaNick"].Value.ParseToString();
StringBuilder data = new StringBuilder();
data.Append(UserLogin.GetSignaturex());
@@ -91,7 +92,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
{
if (html.Contains("\"code\":200"))
{
OnSaveComplete(isShopAllSameSaCheck, sub_sa);
OnSaveComplete(isShopAllSameSaCheck, sub_sa + "&&&&&" + sub_sa_nick);
return "";
}
else
@@ -123,7 +123,7 @@
<metadata name="colSubSaId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSubUserName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="colSubSaNick.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSubSaName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -69,6 +69,7 @@
this.colCopyCookies = new System.Windows.Forms.DataGridViewLinkColumn();
this.colSpuId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colSkcId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colProductSkcPic = new System.Windows.Forms.DataGridViewImageColumn();
this.colProductName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colProductCat = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -77,6 +78,7 @@
this.colDraftId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colMdyTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSubSa = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSubSaNick = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colNotes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colEditNotes = new System.Windows.Forms.DataGridViewLinkColumn();
this.ColDelete = new System.Windows.Forms.DataGridViewLinkColumn();
@@ -412,6 +414,7 @@
this.colCopyCookies,
this.colSpuId,
this.colSkcId,
this.colImgUrl,
this.colProductSkcPic,
this.colProductName,
this.colProductCat,
@@ -420,6 +423,7 @@
this.colDraftId,
this.colMdyTime,
this.colSubSa,
this.colSubSaNick,
this.colNotes,
this.colEditNotes,
this.ColDelete,
@@ -433,6 +437,7 @@
this.dgvSelectProduct.Size = new System.Drawing.Size(1430, 552);
this.dgvSelectProduct.TabIndex = 190;
this.dgvSelectProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvSelectProduct_CellContentClick);
this.dgvSelectProduct.Scroll += new System.Windows.Forms.ScrollEventHandler(this.dgvSelectProduct_Scroll);
//
// ucSplitPage1
//
@@ -539,6 +544,13 @@
this.colSkcId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSkcId.Width = 90;
//
// colImgUrl
//
this.colImgUrl.HeaderText = "主图路径";
this.colImgUrl.Name = "colImgUrl";
this.colImgUrl.ReadOnly = true;
this.colImgUrl.Visible = false;
//
// colProductSkcPic
//
this.colProductSkcPic.HeaderText = "Skc图片";
@@ -593,9 +605,16 @@
//
// colSubSa
//
this.colSubSa.HeaderText = "二级超管";
this.colSubSa.HeaderText = "二级超管账号";
this.colSubSa.Name = "colSubSa";
this.colSubSa.ReadOnly = true;
this.colSubSa.Visible = false;
//
// colSubSaNick
//
this.colSubSaNick.HeaderText = "二级超管";
this.colSubSaNick.Name = "colSubSaNick";
this.colSubSaNick.ReadOnly = true;
//
// colNotes
//
@@ -694,6 +713,7 @@
private System.Windows.Forms.DataGridViewLinkColumn colCopyCookies;
private System.Windows.Forms.DataGridViewLinkColumn colSpuId;
private System.Windows.Forms.DataGridViewLinkColumn colSkcId;
private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colProductSkcPic;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductName;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductCat;
@@ -702,6 +722,7 @@
private System.Windows.Forms.DataGridViewLinkColumn colDraftId;
private System.Windows.Forms.DataGridViewTextBoxColumn colMdyTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSa;
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSaNick;
private System.Windows.Forms.DataGridViewTextBoxColumn colNotes;
private System.Windows.Forms.DataGridViewLinkColumn colEditNotes;
private System.Windows.Forms.DataGridViewLinkColumn ColDelete;
@@ -44,6 +44,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
if (BaseClass.SaLevel != 1)
{
dgvSelectProduct.Columns["colSubSa"].Visible = false;
dgvSelectProduct.Columns["colSubSaNick"].Visible = false;
btnSetSubSa.Visible = false;
chkNoSubSa.Visible = false;
}
@@ -98,16 +99,16 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
lstAdminTemuDBProductSelect.AddRange(list);
this.ucSplitPage1.TotalPage = pageCount;
if (defaultBitmap == null)
defaultBitmap = new Bitmap(80, 80);
// 获取Bitmap的Graphics对象
using (Graphics g = Graphics.FromImage(defaultBitmap))
{
// 清除整个Bitmap为蓝色
g.Clear(Color.White);
}
foreach (var prodSelect in lstAdminTemuDBProductSelect)
{
Image image = null;
string imgUrl = prodSelect?.main_img?.Replace("https", "http");
string rst = "";
if (!string.IsNullOrWhiteSpace(imgUrl))
image = GetHtml.GetUrlImg(imgUrl, out rst);
if (!string.IsNullOrEmpty(rst))
BaseMsgForm.ShowError(rst);
Invoke(new Action(() =>
{
int rowIndex = this.dgvSelectProduct.Rows.Add(
@@ -121,14 +122,16 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
"复制Cookies",
prodSelect.spu_id,
prodSelect.skc_id,
image,//prod.main_img,
prodSelect.main_img.Replace("https:", "http:"),
defaultBitmap,//prod.main_img,
prodSelect.product_name,
prodSelect.cat_name,
prodSelect.ext_code,
prodSelect.status,
prodSelect.draft_id,
prodSelect.status == "待上传" ? "-" : prodSelect.mdy_time.ToString("yy/MM/dd HH:mm"),
prodSelect.operate_sub_sa_name == "" ? "-" : prodSelect.operate_sub_sa_name,
string.IsNullOrEmpty(prodSelect.operate_sub_sa_name) ? "-" : prodSelect.operate_sub_sa_name,
string.IsNullOrEmpty(prodSelect.operate_sub_sa_nick) ? "-" : prodSelect.operate_sub_sa_nick,
prodSelect.notes,
"编辑",
"删除",
@@ -140,11 +143,52 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
Invoke(new Action(() =>
{
ShowDgvImg();
this.pbLoading.Visible = false;
}));
});
}
Bitmap defaultBitmap = null;
void ShowDgvImg()
{
Task.Run(() =>
{
foreach (DataGridViewRow row in this.dgvSelectProduct.Rows)
{
if (row.Cells["colProductSkcPic"].Displayed == false)
continue;
if (row.Cells["colProductSkcPic"].Value != null && row.Cells["colProductSkcPic"].Value != defaultBitmap)
continue;
Image image = null;
string imgUrl = row.Cells["colImgUrl"]?.Value.ParseToString();
string getImgError = "";
if (!string.IsNullOrWhiteSpace(imgUrl))
image = GetHtml.GetUrlImg(imgUrl, out getImgError);
if (!string.IsNullOrEmpty(getImgError))
BaseMsgForm.ShowError(getImgError);
try
{
Invoke(new Action(() =>
{
row.Cells["colProductSkcPic"].Value = image;
}));
}
catch
{
}
}
});
}
private void dgvSelectProduct_Scroll(object sender, ScrollEventArgs e)
{
ShowDgvImg();
}
public List<TemuDBProductSelect> GetSelectProductList(out int pageCount, int page = 1, int pageSize = 50)
{
@@ -1023,13 +1067,16 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
var prodList = this.lstAdminTemuDBProductSelect.Where(p => lstProdId.Contains(p.id.ParseToString())).ToArray();
var rows = dgvSelectProduct.Rows.Cast<DataGridViewRow>().Where(row => row.Cells["colSelect"]?.Value.ParseToBool() == true);
var subSa = subSaName.ParseToString().Split(new string[] { "&&&&&" }, StringSplitOptions.RemoveEmptyEntries);
foreach (var row in rows)
{
row.Cells["colSubSa"].Value = subSaName.ParseToString();
row.Cells["colSubSa"].Value = subSa[0];
row.Cells["colSubSaNick"].Value = subSa.Length > 1 ? subSa[1] : "";
}
foreach (var p in prodList)
{
p.operate_sub_sa_name = subSaName.ParseToString();
p.operate_sub_sa_name = subSa[0];
p.operate_sub_sa_nick = subSa.Length > 1 ? subSa[1] : "";
}
}
else
@@ -1040,13 +1087,16 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
var prodList = this.lstAdminTemuDBProductSelect.Where(p => lstSupplierId.Contains(p.shop_id.ParseToString())).ToArray();
var rows = dgvSelectProduct.Rows.Cast<DataGridViewRow>().Where(row => lstSupplierId.Contains(row.Cells["colSupplierId"]?.Value.ParseToString()));
var subSa = subSaName.ParseToString().Split(new string[] { "&&&&&" }, StringSplitOptions.RemoveEmptyEntries);
foreach (var row in rows)
{
row.Cells["colSubSa"].Value = subSaName.ParseToString();
row.Cells["colSubSa"].Value = subSa[0];
row.Cells["colSubSaNick"].Value = subSa.Length > 1 ? subSa[1] : "";
}
foreach (var p in prodList)
{
p.operate_sub_sa_name = subSaName.ParseToString();
p.operate_sub_sa_name = subSa[0];
p.operate_sub_sa_nick = subSa.Length > 1 ? subSa[1] : "";
}
}
}
@@ -144,6 +144,9 @@
<metadata name="colSpuId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colImgUrl.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colProductSkcPic.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -168,6 +171,9 @@
<metadata name="colSubSa.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSubSaNick.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colNotes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>