diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs
index ff653e5..a6e6458 100644
--- a/AllBase/BaseClass.cs
+++ b/AllBase/BaseClass.cs
@@ -27,8 +27,8 @@ namespace AllBase
///
/// 版本ID
///
- public static int VersionCount = 377;
- //public static int VersionCount = 377;
+ public static int VersionCount = 381;
+ //public static int VersionCount = 381;
///
/// 版本号
diff --git a/AllBase/Model/Result/ShopLoginInfo.cs b/AllBase/Model/Result/ShopLoginInfo.cs
index df4f91d..65954f9 100644
--- a/AllBase/Model/Result/ShopLoginInfo.cs
+++ b/AllBase/Model/Result/ShopLoginInfo.cs
@@ -29,6 +29,7 @@ namespace AllBase.Model.Result
public string Signature { get; set; }
public string TouTiaoId { get; set; }
public string Cookies { get; set; } = "";
+ public string Cookies2 { get; set; } = "";
public Dictionary DictMultiCookies { get; set; } = new Dictionary();
public string LoginStatus { get; set; }
public string ApiAuthStatus { get; set; }
diff --git a/AllBase/Model/Result/TemuDBProduct.cs b/AllBase/Model/Result/TemuDBProduct.cs
index 1e5114e..e433f2c 100644
--- a/AllBase/Model/Result/TemuDBProduct.cs
+++ b/AllBase/Model/Result/TemuDBProduct.cs
@@ -28,5 +28,6 @@ namespace AllBase.Model.Result
/// (某个店铺)上传次数
///
public int select_count { get; set; }
+ public int select_total_count { get; set; }
}
}
diff --git a/AllBase/Model/Result/TemuDBProductSelect.cs b/AllBase/Model/Result/TemuDBProductSelect.cs
index 9f50a5d..f54e1b3 100644
--- a/AllBase/Model/Result/TemuDBProductSelect.cs
+++ b/AllBase/Model/Result/TemuDBProductSelect.cs
@@ -23,7 +23,8 @@ namespace AllBase.Model.Result
public int add_times { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
- public string operate_sub_sa_name { get; set; }
+ public string operate_sub_sa_name { get; set; } = "";
+ public string operate_sub_sa_nick { get; set; } = "";
public DateTime? add_sub_sa_time { get; set; }
#region 外键连接属性
diff --git a/KJDService/KJD_WebService/BLL/ProductManage.cs b/KJDService/KJD_WebService/BLL/ProductManage.cs
index dbac4ee..a83e713 100644
--- a/KJDService/KJD_WebService/BLL/ProductManage.cs
+++ b/KJDService/KJD_WebService/BLL/ProductManage.cs
@@ -83,6 +83,7 @@ namespace KJD_Web.BLL
var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'");
var get_select_count = RegexUtils.GetStringQuery(ref inputData, "get_select_count")?.Replace("'", "\\'");
var select_shop_id = RegexUtils.GetStringQuery(ref inputData, "select_shop_id")?.Replace("'", "\\'");
+ var sort_field = RegexUtils.GetStringQuery(ref inputData, "sort_field")?.Replace("'", "\\'");
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
@@ -122,17 +123,20 @@ namespace KJD_Web.BLL
sql = "select * from kjd.product p where 1=1";
else if (string.IsNullOrEmpty(get_select_count))
sql = "select p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes," +
- "p.add_time,p.mdy_time from kjd.product p where 1=1";
+ "p.add_time,p.mdy_time,p.select_total_count from kjd.product p where 1=1";
else
sql = "SELECT p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes," +
- "p.add_time,p.mdy_time,COUNT(s.id) AS select_count FROM kjd.product p " +
+ "p.add_time,p.mdy_time,p.select_total_count,COUNT(s.id) AS select_count FROM kjd.product p " +
"LEFT JOIN kjd.product_select s ON p.id=s.out_product_id AND s.shop_id='" + select_shop_id + "' WHERE 1=1";
//where子句
sql += where;
sql += " group by p.id";
- sql += " order by p.id desc";
+ if (sort_field == "select_total_count")
+ sql += " order by p.select_total_count desc, p.id desc";
+ else
+ sql += " order by p.id desc";
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
@@ -160,6 +164,7 @@ namespace KJD_Web.BLL
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
notes = row["notes"].ToString(),
+ select_total_count = row["select_total_count"].ParseToInt(),
};
if (isDetail)
{
@@ -298,6 +303,7 @@ namespace KJD_Web.BLL
add_product_remaining = add_product_remaining - 1;
sql += "\r\n";
sql += "update kjd.shop set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
+ sql += "update kjd.product set select_total_count=select_total_count+1 where id=" + out_product_Id + ";";
//sql += "update kjd.shop_count set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
}
var rst = mySql.ExecuteNonQuery(sql);
@@ -379,6 +385,7 @@ namespace KJD_Web.BLL
var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'");
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'");
var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'");
+ var search_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "search_sub_sa_name")?.Replace("'", "\\'");
var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
@@ -390,14 +397,18 @@ namespace KJD_Web.BLL
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "select count(s.id) from kjd.product_select s left join kjd.product p on s.out_product_id=p.id" +
- " where 1=1";
+ string sql = "select count(s.id) from kjd.product_select s " +
+ "left join kjd.product p on s.out_product_id=p.id " +
+ "left join kjd.user u on s.operate_sub_sa_name=u.user_name " +
+ "where 1=1";
string where = "";
if (!isAdmin)
where += " and (s.user_name='" + user_name + "' or s.sub_user_name like'%" + user_name + "%')";
if (!string.IsNullOrEmpty(operate_sub_sa_name))
+ {
where += " and s.operate_sub_sa_name = '" + operate_sub_sa_name + "'";
+ }
if (no_sub_sa == "true")
where += " and s.operate_sub_sa_name is null";
if (!string.IsNullOrEmpty(search_db_ids))
@@ -422,6 +433,11 @@ namespace KJD_Web.BLL
where += " and p.ext_code like '%" + search_ext_code + "%'";
if (!string.IsNullOrWhiteSpace(search_prod_name))
where += " and p.product_name like '%" + search_prod_name + "%'";
+ if (!string.IsNullOrEmpty(search_sub_sa_name))
+ {
+ where += " and (s.operate_sub_sa_name like '%" + search_sub_sa_name + "%'";
+ where += " or u.nick_name like '%" + operate_sub_sa_name + "%')";
+ }
sql += where;
@@ -440,8 +456,11 @@ namespace KJD_Web.BLL
sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," +
"s.sub_user_name,s.notes,s.status,s.draft_id,s.add_times,s.add_time,s.mdy_time," +
"s.operate_sub_sa_name,s.add_sub_sa_time," +
- "p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img " +
- "from kjd.product_select s left join kjd.product p on s.out_product_id=p.id where 1=1";
+ "p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img," +
+ "u.nick_name as operate_sub_sa_nick " +
+ "from kjd.product_select s left join kjd.product p on s.out_product_id=p.id " +
+ "left join kjd.user u on u.user_name=s.operate_sub_sa_name " +
+ "where 1=1";
sql += where; // where子句
@@ -479,7 +498,8 @@ namespace KJD_Web.BLL
add_times = row["add_times"].ParseToInt(),
skc_id = row["skc_id"].ToString(),
spu_id = row["spu_id"].ToString(),
- operate_sub_sa_name = row["operate_sub_sa_name"].ToString()
+ operate_sub_sa_name = row["operate_sub_sa_name"].ToString(),
+ operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString()
//product_json = row["product_json"].ToString(),
//size_json = row["size_json"].ToString(),
};
diff --git a/KJDService/KJD_WebService/BLL/ProductThirdManage.cs b/KJDService/KJD_WebService/BLL/ProductThirdManage.cs
index ff01ce6..d12bee7 100644
--- a/KJDService/KJD_WebService/BLL/ProductThirdManage.cs
+++ b/KJDService/KJD_WebService/BLL/ProductThirdManage.cs
@@ -406,6 +406,7 @@ namespace KJD_Web.BLL
var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'");
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'");
var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'");
+ var search_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "search_sub_sa_name")?.Replace("'", "\\'");
var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
@@ -417,14 +418,18 @@ namespace KJD_Web.BLL
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "select count(s.id) from kjd.third_product_select s left join kjd.third_product p on s.out_product_id=p.id" +
- " where 1=1";
+ string sql = "select count(s.id) from kjd.third_product_select s " +
+ "left join kjd.third_product p on s.out_product_id=p.id " +
+ "left join kjd.user u on s.operate_sub_sa_name=u.user_name " +
+ "where 1=1";
string where = "";
if (!isAdmin)
where += " and (s.user_name='" + user_name + "' or s.sub_user_name like'%" + user_name + "%')";
if (!string.IsNullOrEmpty(operate_sub_sa_name))
+ {
where += " and s.operate_sub_sa_name = '" + operate_sub_sa_name + "'";
+ }
if (no_sub_sa == "true")
where += " and s.operate_sub_sa_name is null";
if (!string.IsNullOrEmpty(search_db_ids))
@@ -449,6 +454,11 @@ namespace KJD_Web.BLL
where += " and p.ext_code like '%" + search_ext_code + "%'";
if (!string.IsNullOrWhiteSpace(search_prod_name))
where += " and p.product_name like '%" + search_prod_name + "%'";
+ if (!string.IsNullOrEmpty(search_sub_sa_name))
+ {
+ where += " and (s.operate_sub_sa_name like '%" + search_sub_sa_name + "%'";
+ where += " or u.nick_name like '%" + operate_sub_sa_name + "%')";
+ }
sql += where;
@@ -467,8 +477,11 @@ namespace KJD_Web.BLL
sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," +
"s.sub_user_name,s.notes,s.status,s.draft_id,s.add_times,s.add_time,s.mdy_time," +
"s.operate_sub_sa_name,s.add_sub_sa_time," +
- "p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img " +
- "from kjd.third_product_select s left join kjd.third_product p on s.out_product_id=p.id where 1=1";
+ "p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img," +
+ "u.nick_name as operate_sub_sa_nick " +
+ "from kjd.third_product_select s left join kjd.third_product p on s.out_product_id=p.id " +
+ "left join kjd.user u on u.user_name=s.operate_sub_sa_name " +
+ "where 1=1";
sql += where; // where子句
@@ -506,12 +519,13 @@ namespace KJD_Web.BLL
add_times = row["add_times"].ParseToInt(),
skc_id = row["skc_id"].ToString(),
spu_id = row["spu_id"].ToString(),
- operate_sub_sa_name = row["operate_sub_sa_name"].ToString()
+ operate_sub_sa_name = row["operate_sub_sa_name"].ToString(),
+ operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString()
//product_json = row["product_json"].ToString(),
//size_json = row["size_json"].ToString(),
- };
- prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?;
- productLst.Add(prodSelect);
+ };
+ prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?;
+ productLst.Add(prodSelect);
}
var data = JsonUtils.SerializerObjectToString(productLst);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
diff --git a/KJDService/KJD_WebService/Model/DBProductResultParam.cs b/KJDService/KJD_WebService/Model/DBProductResultParam.cs
index 324eedf..b93cde3 100644
--- a/KJDService/KJD_WebService/Model/DBProductResultParam.cs
+++ b/KJDService/KJD_WebService/Model/DBProductResultParam.cs
@@ -23,6 +23,13 @@ namespace KJD_Web.Model
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
public string notes { get; set; }
+ ///
+ /// 店铺选品次数
+ ///
public int select_count { get; set; } = 0;
+ ///
+ /// 被选中的总次数
+ ///
+ public int select_total_count { get; set; }
}
}
\ No newline at end of file
diff --git a/KJDService/KJD_WebService/Model/ProductSelectResultParam.cs b/KJDService/KJD_WebService/Model/ProductSelectResultParam.cs
index f5b019e..d0cb78a 100644
--- a/KJDService/KJD_WebService/Model/ProductSelectResultParam.cs
+++ b/KJDService/KJD_WebService/Model/ProductSelectResultParam.cs
@@ -24,6 +24,7 @@ namespace KJD_Web.Model
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
public string operate_sub_sa_name { get; set; }
+ public string operate_sub_sa_nick { get; set; }
public DateTime? add_sub_sa_time { get; set; }
#region 外键连接属性
diff --git a/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.Designer.cs b/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.Designer.cs
index b33c562..78944e1 100644
--- a/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.Designer.cs
+++ b/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.Designer.cs
@@ -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;
}
}
\ No newline at end of file
diff --git a/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.cs b/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.cs
index 87786c0..54d3163 100644
--- a/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.cs
+++ b/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.cs
@@ -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().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;
}
diff --git a/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.resx b/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.resx
index f893773..01778c4 100644
--- a/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.resx
+++ b/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.resx
@@ -147,6 +147,9 @@
True
+
+ True
+
True
diff --git a/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.Designer.cs b/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.Designer.cs
index 7835623..cebe905 100644
--- a/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.Designer.cs
+++ b/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.Designer.cs
@@ -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;
diff --git a/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs b/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs
index 8ca9541..3747766 100644
--- a/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs
+++ b/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs
@@ -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 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().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().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] : "";
}
}
}
diff --git a/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.resx b/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.resx
index d2cf3d7..58ecc01 100644
--- a/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.resx
+++ b/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.resx
@@ -144,6 +144,9 @@
True
+
+ True
+
True
@@ -168,6 +171,9 @@
True
+
+ True
+
True
diff --git a/TEMUKJD/KJDForms/ProductSelectForms/ProductSelectSetSubSaForm.Designer.cs b/TEMUKJD/KJDForms/ProductSelectForms/ProductSelectSetSubSaForm.Designer.cs
index b6d5b8d..1676bac 100644
--- a/TEMUKJD/KJDForms/ProductSelectForms/ProductSelectSetSubSaForm.Designer.cs
+++ b/TEMUKJD/KJDForms/ProductSelectForms/ProductSelectSetSubSaForm.Designer.cs
@@ -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;
}
}
\ No newline at end of file
diff --git a/TEMUKJD/KJDForms/ProductSelectForms/ProductSelectSetSubSaForm.cs b/TEMUKJD/KJDForms/ProductSelectForms/ProductSelectSetSubSaForm.cs
index 212b45f..392d90c 100644
--- a/TEMUKJD/KJDForms/ProductSelectForms/ProductSelectSetSubSaForm.cs
+++ b/TEMUKJD/KJDForms/ProductSelectForms/ProductSelectSetSubSaForm.cs
@@ -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
diff --git a/TEMUKJD/KJDForms/ProductSelectForms/ProductSelectSetSubSaForm.resx b/TEMUKJD/KJDForms/ProductSelectForms/ProductSelectSetSubSaForm.resx
index 3867fb5..dddeeca 100644
--- a/TEMUKJD/KJDForms/ProductSelectForms/ProductSelectSetSubSaForm.resx
+++ b/TEMUKJD/KJDForms/ProductSelectForms/ProductSelectSetSubSaForm.resx
@@ -123,7 +123,7 @@
True
-
+
True
diff --git a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.Designer.cs b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.Designer.cs
index dbf6e6a..d0560e0 100644
--- a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.Designer.cs
+++ b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.Designer.cs
@@ -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;
diff --git a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.cs b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.cs
index 883a6c2..788359c 100644
--- a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.cs
+++ b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.cs
@@ -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 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().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().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] : "";
}
}
}
diff --git a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.resx b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.resx
index d2cf3d7..58ecc01 100644
--- a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.resx
+++ b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.resx
@@ -144,6 +144,9 @@
True
+
+ True
+
True
@@ -168,6 +171,9 @@
True
+
+ True
+
True