diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs index 38b85bc..4f86d88 100644 --- a/AllBase/BaseClass.cs +++ b/AllBase/BaseClass.cs @@ -27,7 +27,7 @@ namespace AllBase /// /// 版本ID /// - public static int VersionCount = 619; + public static int VersionCount = 623; //public static int VersionCount = 613; /// diff --git a/AllBase/Model/Result/PDDResult/PDDProductInfo.cs b/AllBase/Model/Result/PDDResult/PDDProductInfo.cs index 93419b1..adb414c 100644 --- a/AllBase/Model/Result/PDDResult/PDDProductInfo.cs +++ b/AllBase/Model/Result/PDDResult/PDDProductInfo.cs @@ -20,5 +20,11 @@ namespace AllBase.Model.Result.PDDResult /// 长图 /// public PDDMaterialInfo material3 { get; set; } + + + + public string chance_id { get; set; } + public string chance_refere { get; set; } // 记录机会商品提交的refere + public string chance_tab { get; set; } // 记录机会商品提交的tab } } diff --git a/AllBase/Model/Result/TemuDBProductSelect.cs b/AllBase/Model/Result/TemuDBProductSelect.cs index 422e757..ef668c2 100644 --- a/AllBase/Model/Result/TemuDBProductSelect.cs +++ b/AllBase/Model/Result/TemuDBProductSelect.cs @@ -45,7 +45,7 @@ namespace AllBase.Model.Result public string main_img { get; set; } public string spu_id { get; set; } public string skc_id { get; set; } - + public KJDDBProduct kjdDbProduct { get; set; } = null; #endregion } } diff --git a/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs b/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs index 2bb4ec2..0973d98 100644 --- a/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs +++ b/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs @@ -295,7 +295,7 @@ namespace KJD_Web.BLL.BXX return "{\"code\":19999,\"msg\":\"输入为空\"}"; } - public string GetProductGroups(string inputData, bool isDetail = false) + public string GetProductGroups(string inputData) { if (!string.IsNullOrEmpty(inputData)) { @@ -349,6 +349,60 @@ namespace KJD_Web.BLL.BXX return "{\"code\":19999,\"msg\":\"输入为空\"}"; } + public string GetProductCates(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":50001,\"msg\":\"没有用户名\"}"; + } + + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "SELECT DISTINCT p.cat_name FROM `bxx`.`product` p where p.is_del=0"; + + string where = ""; + sql += where; + + var dt = mySql.ExecuteDataTable(sql); + mySql.Close(); + + if (dt != null) + { + try + { + string group_data = ""; + foreach (DataRow row in dt.Rows) + { + group_data += row["cat_name"].ToString() + ","; + } + var data = group_data.Trim(','); + return "{\"code\":200,\"msg\":\"success\",\"data\":\"" + data + "\"}"; + } + catch (Exception ex) + { + return "{\"code\":50002,\"msg\":\"" + ex.Message + "\",\"data\":\"\"}"; + } + } + else + { + return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + /// /// 查询商品替换sku /// @@ -452,6 +506,7 @@ namespace KJD_Web.BLL.BXX var in_ext_codes = RegexUtils.GetStringQuery(ref inputData, "in_ext_codes")?.Replace("'", "\\'"); var in_skc_ids = RegexUtils.GetStringQuery(ref inputData, "in_skc_ids")?.Replace("'", "\\'"); var in_groups = RegexUtils.GetStringQuery(ref inputData, "in_groups")?.Replace("'", "\\'"); + var in_cates = RegexUtils.GetStringQuery(ref inputData, "in_cates")?.Replace("'", "\\'"); int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); @@ -477,6 +532,11 @@ namespace KJD_Web.BLL.BXX in_groups = "'" + string.Join("','", in_groups.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'"; where += " and p.group in (" + in_groups + ")"; } + if (!string.IsNullOrEmpty(in_cates)) + { + in_cates = "'" + string.Join("','", in_cates.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'"; + where += " and (p.cat_name in (" + in_cates + ") or p.main_cat_name in (" + in_cates + "))"; + } sql += where; @@ -552,6 +612,86 @@ namespace KJD_Web.BLL.BXX return "{\"code\":19999,\"msg\":\"输入为空\"}"; } + /// + /// 随机获取商品(无详情) 随机添加到上传列表所以不需要获取详情 + /// + /// + /// + public string GetSkuReplaceImgListRandom(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'"); + var in_img_type = RegexUtils.GetStringQuery(ref inputData, "in_img_type")?.Replace("'", "\\'"); + + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(id) from bxx.sku_img_replace s where 1=1"; + + string where = ""; + if (!string.IsNullOrEmpty(in_img_type)) + { + in_img_type = "'" + string.Join("','", in_img_type.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'"; + where += " and s.img_type in (" + in_img_type + ")"; + } + + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + sql = "select s.img_url from bxx.sku_img_replace s where 1=1"; + + //where子句 + sql += where; + + sql += " ORDER BY RAND()"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + if (dt != null) + { + try + { + List imgs = new List(); + foreach (DataRow row in dt.Rows) + { + imgs.Add(row["img_url"].ToString()); + } + var data = JsonUtils.SerializerObjectToString(imgs); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + public string DelDbProd(string inputData) { if (!string.IsNullOrEmpty(inputData)) diff --git a/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs b/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs index 18bd19a..0e75e86 100644 --- a/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs +++ b/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs @@ -771,6 +771,92 @@ namespace KJD_Web.BLL } return "{\"code\":19999,\"msg\":\"输入为空\"}"; } + + public string GetSelectProductMapDraftIdList(string inputData, bool isDetail = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'"); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":50001,\"msg\":\"用户为空\"}"; + } + + var select_db_id = RegexUtils.GetStringQuery(ref inputData, "select_db_id")?.Replace("'", "\\'"); + if (string.IsNullOrEmpty(select_db_id)) + { + return "{\"code\":50002,\"msg\":\"未选择选品数据\"}"; + } + long l_select_map_table_id = select_db_id.ParseToLong() % 64; + + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(id) from kjd_map.product_select_map_" + l_select_map_table_id + " where 1=1"; + string where = " and product_select_db_id=" + select_db_id; + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + sql = "select * from kjd_map.product_select_map_" + l_select_map_table_id + " where 1=1"; + //where子句 + sql += where; + sql += " order by id desc"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + + if (!string.IsNullOrEmpty(mySql.Message)) + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + if (dt != null) + { + try + { + List productSelectMapLst = new List(); + foreach (DataRow row in dt.Rows) + { + DBProductSelectMapResultParam productSelectMap = new DBProductSelectMapResultParam + { + id = row["id"].ParseToInt(), + product_id = row["product_id"].ParseToLong(), + product_select_db_id = row["product_select_db_id"].ParseToInt(), + shop_id = row["shop_id"].ParseToLong(), + add_time = Convert.ToDateTime(row["add_time"]), + }; + productSelectMapLst.Add(productSelectMap); + } + var data = JsonUtils.SerializerObjectToString(productSelectMapLst); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":500,\"msg\":\"查询结果为空!\",\"data\":[],\"count\":" + 0 + "}"; + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } } } diff --git a/KJDService/KJD_WebService/BLL/KJD/ProductThirdManage.cs b/KJDService/KJD_WebService/BLL/KJD/ProductThirdManage.cs index 905f7c4..e7b006d 100644 --- a/KJDService/KJD_WebService/BLL/KJD/ProductThirdManage.cs +++ b/KJDService/KJD_WebService/BLL/KJD/ProductThirdManage.cs @@ -771,5 +771,91 @@ namespace KJD_Web.BLL } return "{\"code\":19999,\"msg\":\"输入为空\"}"; } + + public string GetSelectProductMapDraftIdList(string inputData, bool isDetail = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'"); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":50001,\"msg\":\"用户为空\"}"; + } + + var select_db_id = RegexUtils.GetStringQuery(ref inputData, "select_db_id")?.Replace("'", "\\'"); + if (string.IsNullOrEmpty(select_db_id)) + { + return "{\"code\":50002,\"msg\":\"未选择选品数据\"}"; + } + long l_select_map_table_id = select_db_id.ParseToLong() % 64; + + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(id) from kjd_map.product_third_select_map_" + l_select_map_table_id + " where 1=1"; + string where = " and product_select_db_id=" + select_db_id; + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + sql = "select * from kjd_map.product_third_select_map_" + l_select_map_table_id + " where 1=1"; + //where子句 + sql += where; + sql += " order by id desc"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + + if (!string.IsNullOrEmpty(mySql.Message)) + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + if (dt != null) + { + try + { + List productSelectMapLst = new List(); + foreach (DataRow row in dt.Rows) + { + DBProductSelectMapResultParam productSelectMap = new DBProductSelectMapResultParam + { + id = row["id"].ParseToInt(), + product_id = row["product_id"].ParseToLong(), + product_select_db_id = row["product_select_db_id"].ParseToInt(), + shop_id = row["shop_id"].ParseToLong(), + add_time = Convert.ToDateTime(row["add_time"]), + }; + productSelectMapLst.Add(productSelectMap); + } + var data = JsonUtils.SerializerObjectToString(productSelectMapLst); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":500,\"msg\":\"查询结果为空!\",\"data\":[],\"count\":" + 0 + "}"; + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } } } \ No newline at end of file diff --git a/KJDService/KJD_WebService/BXXProductService.asmx.cs b/KJDService/KJD_WebService/BXXProductService.asmx.cs index 403fedd..89db346 100644 --- a/KJDService/KJD_WebService/BXXProductService.asmx.cs +++ b/KJDService/KJD_WebService/BXXProductService.asmx.cs @@ -84,6 +84,18 @@ namespace KJD_Web Context.Response.End(); } + [WebMethod] + public void get_sku_replace_img_list_random() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().GetSkuReplaceImgListRandom(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + [WebMethod] public void add_product() { @@ -168,6 +180,18 @@ namespace KJD_Web Context.Response.End(); } + [WebMethod] + public void get_product_cates() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().GetProductCates(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + [WebMethod] public void add_sku_img_replace() { diff --git a/KJDService/KJD_WebService/KJD_WebService.csproj b/KJDService/KJD_WebService/KJD_WebService.csproj index 35b1800..6a97c3a 100644 --- a/KJDService/KJD_WebService/KJD_WebService.csproj +++ b/KJDService/KJD_WebService/KJD_WebService.csproj @@ -107,6 +107,7 @@ + diff --git a/KJDService/KJD_WebService/Model/DBProductSelectMapResultParam.cs b/KJDService/KJD_WebService/Model/DBProductSelectMapResultParam.cs new file mode 100644 index 0000000..80fff54 --- /dev/null +++ b/KJDService/KJD_WebService/Model/DBProductSelectMapResultParam.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace KJD_Web.Model +{ + public class DBProductSelectMapResultParam + { + public int id { get; set; } + public long product_id { get; set; } + public int product_select_db_id { get; set; } + public long shop_id { get; set; } + public DateTime add_time { get; set; } + } +} \ No newline at end of file diff --git a/KJDService/KJD_WebService/ProductService.asmx.cs b/KJDService/KJD_WebService/ProductService.asmx.cs index 2e7ee42..b8a0c8e 100644 --- a/KJDService/KJD_WebService/ProductService.asmx.cs +++ b/KJDService/KJD_WebService/ProductService.asmx.cs @@ -217,5 +217,17 @@ namespace KJD_Web Context.Response.Write(result); Context.Response.End(); } + + + [WebMethod] + public void get_select_product_map_draft_id_list() + { + string jsontext = GetRequestJsonString(); + var result = jsontext; + result = new ProductManage().GetSelectProductMapDraftIdList(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } } } diff --git a/KJDService/KJD_WebService/ProductThirdService.asmx.cs b/KJDService/KJD_WebService/ProductThirdService.asmx.cs index 75df685..34e6988 100644 --- a/KJDService/KJD_WebService/ProductThirdService.asmx.cs +++ b/KJDService/KJD_WebService/ProductThirdService.asmx.cs @@ -217,5 +217,16 @@ namespace KJD_Web Context.Response.Write(result); Context.Response.End(); } + + [WebMethod] + public void get_select_product_map_draft_id_list() + { + string jsontext = GetRequestJsonString(); + var result = jsontext; + result = new ProductThirdManage().GetSelectProductMapDraftIdList(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } } } diff --git a/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs b/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs index 3693686..6aaddfa 100644 --- a/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs +++ b/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs @@ -422,6 +422,22 @@ namespace TemuKJD.KJDForms.ProductSelectForms adminLoginForm.openType = EnumOpenType.manage; adminLoginForm.WindowState = FormWindowState.Maximized; adminLoginForm.ShowDialog(); + return; + + var url = BaseClass.BuildObjString("product/get_select_product_map_draft_id_list"); + var data = UserLogin.GetSignaturex() + "&select_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")) + { + } + else + { + } } break; case "进店": diff --git a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.Designer.cs b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.Designer.cs index a350f5a..3023bf4 100644 --- a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.Designer.cs +++ b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.Designer.cs @@ -29,14 +29,16 @@ 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(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProductThirdSelectListManageForm)); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.label14 = new System.Windows.Forms.Label(); @@ -138,6 +140,14 @@ this.colOpResult = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage(); this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); + this.panel2 = new System.Windows.Forms.Panel(); + this.dataGridViewEx1 = new TemuKJD.UserComponent.DataGridViewEx(); + this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.colMapId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colMapShopId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewLinkColumn5 = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colToPorductPage = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colToDraftPage = new System.Windows.Forms.DataGridViewLinkColumn(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -164,6 +174,8 @@ this.splitContainer2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvSelectProduct)).BeginInit(); + this.panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewEx1)).BeginInit(); this.SuspendLayout(); // // splitContainer1 @@ -797,7 +809,7 @@ "全部", "重上", "已买"}); - this.cmbUserNotes.Location = new System.Drawing.Point(1044, 8); + this.cmbUserNotes.Location = new System.Drawing.Point(1044, 5); this.cmbUserNotes.Margin = new System.Windows.Forms.Padding(0); this.cmbUserNotes.Name = "cmbUserNotes"; this.cmbUserNotes.Size = new System.Drawing.Size(65, 25); @@ -814,7 +826,7 @@ "核价成功", "核价成功(重复)", "重复"}); - this.cmbNotes.Location = new System.Drawing.Point(917, 8); + this.cmbNotes.Location = new System.Drawing.Point(917, 5); this.cmbNotes.Margin = new System.Windows.Forms.Padding(0); this.cmbNotes.Name = "cmbNotes"; this.cmbNotes.Size = new System.Drawing.Size(65, 25); @@ -841,7 +853,7 @@ "已上传", "草稿箱", "全部"}); - this.cmbStatus.Location = new System.Drawing.Point(814, 8); + this.cmbStatus.Location = new System.Drawing.Point(814, 5); this.cmbStatus.Margin = new System.Windows.Forms.Padding(0); this.cmbStatus.Name = "cmbStatus"; this.cmbStatus.Size = new System.Drawing.Size(65, 25); @@ -1251,6 +1263,7 @@ // splitContainer2.Panel1 // this.splitContainer2.Panel1.Controls.Add(this.pbLoading); + this.splitContainer2.Panel1.Controls.Add(this.panel2); this.splitContainer2.Panel1.Controls.Add(this.dgvSelectProduct); this.splitContainer2.Panel1.Padding = new System.Windows.Forms.Padding(4, 0, 4, 0); // @@ -1277,18 +1290,18 @@ // this.dgvSelectProduct.AllowUserToAddRows = false; this.dgvSelectProduct.AllowUserToDeleteRows = false; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke; - this.dgvSelectProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke; + this.dgvSelectProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3; this.dgvSelectProduct.BackgroundColor = System.Drawing.Color.White; this.dgvSelectProduct.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgvSelectProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvSelectProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; this.dgvSelectProduct.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvSelectProduct.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.colSelect, @@ -1427,8 +1440,8 @@ // // colProductName // - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.colProductName.DefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colProductName.DefaultCellStyle = dataGridViewCellStyle5; this.colProductName.HeaderText = "商品标题"; this.colProductName.Name = "colProductName"; this.colProductName.ReadOnly = true; @@ -1436,8 +1449,8 @@ // // colProductCat // - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.colProductCat.DefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colProductCat.DefaultCellStyle = dataGridViewCellStyle6; this.colProductCat.HeaderText = "商品类目"; this.colProductCat.Name = "colProductCat"; this.colProductCat.ReadOnly = true; @@ -1470,8 +1483,8 @@ // // colAddTime // - dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.colAddTime.DefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colAddTime.DefaultCellStyle = dataGridViewCellStyle7; this.colAddTime.HeaderText = "添加时间"; this.colAddTime.Name = "colAddTime"; this.colAddTime.ReadOnly = true; @@ -1479,8 +1492,8 @@ // // colMdyTime // - dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.colMdyTime.DefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colMdyTime.DefaultCellStyle = dataGridViewCellStyle8; this.colMdyTime.HeaderText = "上传时间"; this.colMdyTime.Name = "colMdyTime"; this.colMdyTime.ReadOnly = true; @@ -1495,8 +1508,8 @@ // // colSubSaNick // - dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.colSubSaNick.DefaultCellStyle = dataGridViewCellStyle7; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colSubSaNick.DefaultCellStyle = dataGridViewCellStyle9; this.colSubSaNick.HeaderText = "二级超管"; this.colSubSaNick.Name = "colSubSaNick"; this.colSubSaNick.ReadOnly = true; @@ -1511,8 +1524,8 @@ // // colNotes // - dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.colNotes.DefaultCellStyle = dataGridViewCellStyle8; + dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colNotes.DefaultCellStyle = dataGridViewCellStyle10; this.colNotes.HeaderText = "备注"; this.colNotes.Name = "colNotes"; this.colNotes.ReadOnly = true; @@ -1566,6 +1579,99 @@ this.statusBar.Size = new System.Drawing.Size(1558, 25); this.statusBar.TabIndex = 5; // + // panel2 + // + this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel2.Controls.Add(this.dataGridViewEx1); + this.panel2.Location = new System.Drawing.Point(501, 75); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(557, 342); + this.panel2.TabIndex = 191; + this.panel2.Visible = false; + // + // dataGridViewEx1 + // + this.dataGridViewEx1.AllowUserToAddRows = false; + this.dataGridViewEx1.AllowUserToDeleteRows = false; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke; + this.dataGridViewEx1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + this.dataGridViewEx1.BackgroundColor = System.Drawing.Color.White; + this.dataGridViewEx1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dataGridViewEx1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + this.dataGridViewEx1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridViewEx1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.dataGridViewCheckBoxColumn1, + this.colMapId, + this.colMapShopId, + this.dataGridViewLinkColumn5, + this.colToPorductPage, + this.colToDraftPage}); + this.dataGridViewEx1.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridViewEx1.Location = new System.Drawing.Point(0, 0); + this.dataGridViewEx1.Name = "dataGridViewEx1"; + this.dataGridViewEx1.ReadOnly = true; + this.dataGridViewEx1.RowHeadersWidth = 40; + this.dataGridViewEx1.RowTemplate.Height = 23; + this.dataGridViewEx1.Size = new System.Drawing.Size(555, 340); + this.dataGridViewEx1.TabIndex = 192; + // + // dataGridViewCheckBoxColumn1 + // + this.dataGridViewCheckBoxColumn1.HeaderText = "选择"; + this.dataGridViewCheckBoxColumn1.Name = "dataGridViewCheckBoxColumn1"; + this.dataGridViewCheckBoxColumn1.ReadOnly = true; + this.dataGridViewCheckBoxColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewCheckBoxColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.dataGridViewCheckBoxColumn1.Width = 30; + // + // colMapId + // + this.colMapId.HeaderText = "映射Id"; + this.colMapId.Name = "colMapId"; + this.colMapId.ReadOnly = true; + this.colMapId.Visible = false; + this.colMapId.Width = 125; + // + // colMapShopId + // + this.colMapShopId.HeaderText = "映射店铺Id"; + this.colMapShopId.Name = "colMapShopId"; + this.colMapShopId.ReadOnly = true; + this.colMapShopId.Width = 120; + // + // dataGridViewLinkColumn5 + // + this.dataGridViewLinkColumn5.HeaderText = "商品SPU"; + this.dataGridViewLinkColumn5.Name = "dataGridViewLinkColumn5"; + this.dataGridViewLinkColumn5.ReadOnly = true; + this.dataGridViewLinkColumn5.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewLinkColumn5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.dataGridViewLinkColumn5.Width = 86; + // + // colToPorductPage + // + this.colToPorductPage.HeaderText = "访问商品页"; + this.colToPorductPage.Name = "colToPorductPage"; + this.colToPorductPage.ReadOnly = true; + this.colToPorductPage.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colToPorductPage.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colToPorductPage.Width = 62; + // + // colToDraftPage + // + this.colToDraftPage.HeaderText = "访问草稿页"; + this.colToDraftPage.Name = "colToDraftPage"; + this.colToDraftPage.ReadOnly = true; + this.colToDraftPage.Visible = false; + this.colToDraftPage.Width = 38; + // // ProductThirdSelectListManageForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -1608,6 +1714,8 @@ this.splitContainer2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvSelectProduct)).EndInit(); + this.panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewEx1)).EndInit(); this.ResumeLayout(false); } @@ -1714,5 +1822,13 @@ private DevComponents.DotNetBar.PanelEx btnAdd; private DevComponents.DotNetBar.PanelEx btnSetSubSa; private System.Windows.Forms.Label label14; + private System.Windows.Forms.Panel panel2; + private UserComponent.DataGridViewEx dataGridViewEx1; + private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn1; + private System.Windows.Forms.DataGridViewTextBoxColumn colMapId; + private System.Windows.Forms.DataGridViewTextBoxColumn colMapShopId; + private System.Windows.Forms.DataGridViewLinkColumn dataGridViewLinkColumn5; + private System.Windows.Forms.DataGridViewLinkColumn colToPorductPage; + private System.Windows.Forms.DataGridViewLinkColumn colToDraftPage; } } \ No newline at end of file diff --git a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.cs b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.cs index 9793d77..dd3c258 100644 --- a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.cs +++ b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.cs @@ -362,6 +362,22 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms adminLoginForm.openType = EnumOpenType.manage; adminLoginForm.WindowState = FormWindowState.Maximized; adminLoginForm.ShowDialog(); + return; + + var url = BaseClass.BuildObjString("product_third/get_select_product_map_draft_id_list"); + var data = UserLogin.GetSignaturex() + "&select_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")) + { + } + else + { + } } break; case "进店": diff --git a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.resx b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.resx index 7f138d2..75d89cd 100644 --- a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.resx +++ b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.resx @@ -117,6 +117,24 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True + + + True + + + True + + + True + + + True + + + True + True diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.Designer.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.Designer.cs index b0e0cae..869227f 100644 --- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.Designer.cs +++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.Designer.cs @@ -30,11 +30,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); this.chkKeepChanceGoodsImg = new TemuKJD.UserComponent.UcCheckBox(this.components); @@ -72,11 +72,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.chkLowPriceSku = new TemuKJD.UserComponent.UcCheckBox(this.components); this.lblLowPriceSkuImg = new System.Windows.Forms.Label(); this.ucGroupBoxEx4 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); + this.btnClearFilter = new DevComponents.DotNetBar.PanelEx(); this.txtIdFilter = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); + this.cmbCateFilter = new System.Windows.Forms.ComboBox(); + this.label2 = new System.Windows.Forms.Label(); this.cmbGroupFilter = new System.Windows.Forms.ComboBox(); this.label20 = new System.Windows.Forms.Label(); - this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); this.txtExtCodeFilter = new System.Windows.Forms.TextBox(); this.btnClearUpload = new DevComponents.DotNetBar.PanelEx(); this.lblWaitToUp = new System.Windows.Forms.Label(); @@ -713,11 +715,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms | System.Windows.Forms.AnchorStyles.Left))); this.ucGroupBoxEx4.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); this.ucGroupBoxEx4.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND; + this.ucGroupBoxEx4.Controls.Add(this.btnClearFilter); this.ucGroupBoxEx4.Controls.Add(this.txtIdFilter); this.ucGroupBoxEx4.Controls.Add(this.label1); + this.ucGroupBoxEx4.Controls.Add(this.cmbCateFilter); + this.ucGroupBoxEx4.Controls.Add(this.label2); this.ucGroupBoxEx4.Controls.Add(this.cmbGroupFilter); this.ucGroupBoxEx4.Controls.Add(this.label20); - this.ucGroupBoxEx4.Controls.Add(this.panelEx3); this.ucGroupBoxEx4.Controls.Add(this.txtExtCodeFilter); this.ucGroupBoxEx4.Controls.Add(this.btnClearUpload); this.ucGroupBoxEx4.Controls.Add(this.lblWaitToUp); @@ -732,78 +736,96 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.ucGroupBoxEx4.TabStop = false; this.ucGroupBoxEx4.Text = "待传商品"; // + // btnClearFilter + // + this.btnClearFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnClearFilter.CanvasColor = System.Drawing.SystemColors.Control; + this.btnClearFilter.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnClearFilter.DisabledBackColor = System.Drawing.Color.Empty; + this.btnClearFilter.Location = new System.Drawing.Point(266, 23); + this.btnClearFilter.Margin = new System.Windows.Forms.Padding(4, 2, 2, 2); + this.btnClearFilter.Name = "btnClearFilter"; + this.btnClearFilter.Size = new System.Drawing.Size(48, 51); + this.btnClearFilter.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnClearFilter.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); + this.btnClearFilter.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); + this.btnClearFilter.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; + this.btnClearFilter.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnClearFilter.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; + this.btnClearFilter.Style.GradientAngle = 90; + this.btnClearFilter.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center; + this.btnClearFilter.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnClearFilter.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnClearFilter.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnClearFilter.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White; + this.btnClearFilter.TabIndex = 559; + this.btnClearFilter.Text = "清除\r\n筛选"; + this.btnClearFilter.Click += new System.EventHandler(this.btnClearFilter_Click); + // // txtIdFilter // this.txtIdFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtIdFilter.Location = new System.Drawing.Point(213, 20); + this.txtIdFilter.Location = new System.Drawing.Point(170, 51); this.txtIdFilter.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2); this.txtIdFilter.Name = "txtIdFilter"; - this.txtIdFilter.Size = new System.Drawing.Size(96, 23); + this.txtIdFilter.Size = new System.Drawing.Size(92, 23); this.txtIdFilter.TabIndex = 652; // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(170, 23); + this.label1.Location = new System.Drawing.Point(140, 54); this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(45, 17); + this.label1.Size = new System.Drawing.Size(32, 17); this.label1.TabIndex = 651; - this.label1.Text = "筛选ID"; + this.label1.Text = "编号"; + // + // cmbCateFilter + // + this.cmbCateFilter.FormattingEnabled = true; + this.cmbCateFilter.Location = new System.Drawing.Point(170, 22); + this.cmbCateFilter.Name = "cmbCateFilter"; + this.cmbCateFilter.Size = new System.Drawing.Size(92, 25); + this.cmbCateFilter.TabIndex = 663; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(140, 26); + this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(32, 17); + this.label2.TabIndex = 662; + this.label2.Text = "类目"; // // cmbGroupFilter // this.cmbGroupFilter.FormattingEnabled = true; - this.cmbGroupFilter.Location = new System.Drawing.Point(70, 19); + this.cmbGroupFilter.Location = new System.Drawing.Point(47, 22); this.cmbGroupFilter.Name = "cmbGroupFilter"; - this.cmbGroupFilter.Size = new System.Drawing.Size(96, 25); + this.cmbGroupFilter.Size = new System.Drawing.Size(92, 25); this.cmbGroupFilter.TabIndex = 641; // // label20 // this.label20.AutoSize = true; - this.label20.Location = new System.Drawing.Point(16, 22); + this.label20.Location = new System.Drawing.Point(16, 25); this.label20.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); this.label20.Name = "label20"; - this.label20.Size = new System.Drawing.Size(56, 17); + this.label20.Size = new System.Drawing.Size(32, 17); this.label20.TabIndex = 570; - this.label20.Text = "筛选分组"; - // - // panelEx3 - // - this.panelEx3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.panelEx3.CanvasColor = System.Drawing.SystemColors.Control; - this.panelEx3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.panelEx3.DisabledBackColor = System.Drawing.Color.Empty; - this.panelEx3.Location = new System.Drawing.Point(249, 48); - this.panelEx3.Margin = new System.Windows.Forms.Padding(4, 2, 2, 2); - this.panelEx3.Name = "panelEx3"; - this.panelEx3.Size = new System.Drawing.Size(60, 23); - this.panelEx3.Style.Alignment = System.Drawing.StringAlignment.Center; - this.panelEx3.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); - this.panelEx3.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); - this.panelEx3.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.panelEx3.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - this.panelEx3.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.panelEx3.Style.GradientAngle = 90; - this.panelEx3.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center; - this.panelEx3.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; - this.panelEx3.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - this.panelEx3.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - this.panelEx3.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White; - this.panelEx3.TabIndex = 559; - this.panelEx3.Text = "清除筛选"; - this.panelEx3.Click += new System.EventHandler(this.btnClearFilter_Click); + this.label20.Text = "分组"; // // txtExtCodeFilter // this.txtExtCodeFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtExtCodeFilter.Location = new System.Drawing.Point(70, 48); + this.txtExtCodeFilter.Location = new System.Drawing.Point(47, 51); this.txtExtCodeFilter.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2); this.txtExtCodeFilter.Name = "txtExtCodeFilter"; - this.txtExtCodeFilter.Size = new System.Drawing.Size(176, 23); + this.txtExtCodeFilter.Size = new System.Drawing.Size(92, 23); this.txtExtCodeFilter.TabIndex = 555; // // btnClearUpload @@ -812,7 +834,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.btnClearUpload.CanvasColor = System.Drawing.SystemColors.Control; this.btnClearUpload.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnClearUpload.DisabledBackColor = System.Drawing.Color.Empty; - this.btnClearUpload.Location = new System.Drawing.Point(233, 103); + this.btnClearUpload.Location = new System.Drawing.Point(238, 105); this.btnClearUpload.Margin = new System.Windows.Forms.Padding(4, 2, 2, 2); this.btnClearUpload.Name = "btnClearUpload"; this.btnClearUpload.Size = new System.Drawing.Size(76, 23); @@ -838,7 +860,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.lblWaitToUp.Cursor = System.Windows.Forms.Cursors.Hand; this.lblWaitToUp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblWaitToUp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - this.lblWaitToUp.Location = new System.Drawing.Point(18, 109); + this.lblWaitToUp.Location = new System.Drawing.Point(16, 108); this.lblWaitToUp.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); this.lblWaitToUp.Name = "lblWaitToUp"; this.lblWaitToUp.Size = new System.Drawing.Size(95, 17); @@ -849,7 +871,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms // lblGoodsCount // this.lblGoodsCount.AutoSize = true; - this.lblGoodsCount.Location = new System.Drawing.Point(170, 78); + this.lblGoodsCount.Location = new System.Drawing.Point(167, 81); this.lblGoodsCount.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); this.lblGoodsCount.Name = "lblGoodsCount"; this.lblGoodsCount.Size = new System.Drawing.Size(131, 17); @@ -859,7 +881,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms // // txtAddCount // - this.txtAddCount.Location = new System.Drawing.Point(20, 75); + this.txtAddCount.Location = new System.Drawing.Point(18, 78); this.txtAddCount.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2); this.txtAddCount.Name = "txtAddCount"; this.txtAddCount.Size = new System.Drawing.Size(47, 23); @@ -872,9 +894,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.panelEx2.Cursor = System.Windows.Forms.Cursors.Hand; this.panelEx2.DisabledBackColor = System.Drawing.Color.Empty; this.panelEx2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.panelEx2.Location = new System.Drawing.Point(70, 75); + this.panelEx2.Location = new System.Drawing.Point(68, 78); this.panelEx2.Name = "panelEx2"; - this.panelEx2.Size = new System.Drawing.Size(96, 23); + this.panelEx2.Size = new System.Drawing.Size(92, 23); this.panelEx2.Style.Alignment = System.Drawing.StringAlignment.Center; this.panelEx2.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); this.panelEx2.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); @@ -893,12 +915,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms // label16 // this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(16, 51); + this.label16.Location = new System.Drawing.Point(16, 54); this.label16.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(56, 17); + this.label16.Size = new System.Drawing.Size(32, 17); this.label16.TabIndex = 560; - this.label16.Text = "筛选货号"; + this.label16.Text = "货号"; // // ucGroupBoxEx1 // @@ -984,18 +1006,18 @@ namespace TemuKJD.PDDForms.ProductSelectForms // this.dgvShop.AllowUserToAddRows = false; this.dgvShop.AllowUserToDeleteRows = false; - dataGridViewCellStyle11.BackColor = System.Drawing.Color.WhiteSmoke; - this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle11; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke; + this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; this.dgvShop.BackgroundColor = System.Drawing.Color.White; this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle12; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.colSelect, @@ -1127,18 +1149,18 @@ namespace TemuKJD.PDDForms.ProductSelectForms // this.dgvSelectProduct.AllowUserToAddRows = false; this.dgvSelectProduct.AllowUserToDeleteRows = false; - dataGridViewCellStyle13.BackColor = System.Drawing.Color.WhiteSmoke; - this.dgvSelectProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle13; + dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke; + this.dgvSelectProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3; this.dgvSelectProduct.BackgroundColor = System.Drawing.Color.White; this.dgvSelectProduct.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle14.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgvSelectProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle14; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvSelectProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; this.dgvSelectProduct.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvSelectProduct.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.colCheck, @@ -1278,8 +1300,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms // // colProductName // - dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.colProductName.DefaultCellStyle = dataGridViewCellStyle15; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colProductName.DefaultCellStyle = dataGridViewCellStyle5; this.colProductName.HeaderText = "商品标题"; this.colProductName.Name = "colProductName"; this.colProductName.ReadOnly = true; @@ -1502,7 +1524,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms private DevComponents.DotNetBar.PanelEx panelEx2; private System.Windows.Forms.TextBox txtAddCount; private System.Windows.Forms.Label lblGoodsCount; - private System.Windows.Forms.Label lblWaitToUp; private DevComponents.DotNetBar.PanelEx btnClearUpload; private System.Windows.Forms.Panel panel3; private System.Windows.Forms.Label lblNewAddPrice; @@ -1531,7 +1552,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms private System.Windows.Forms.TextBox txtAddTimesFake; private System.Windows.Forms.Label label10; private UserComponent.UcCheckBox chkActivity; - private DevComponents.DotNetBar.PanelEx panelEx3; + private DevComponents.DotNetBar.PanelEx btnClearFilter; private System.Windows.Forms.TextBox txtExtCodeFilter; private System.Windows.Forms.Label label16; private System.Windows.Forms.Label label19; @@ -1571,5 +1592,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms private DevComponents.DotNetBar.PanelEx panelEx1; private System.Windows.Forms.TextBox txtIdFilter; private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox cmbCateFilter; + private System.Windows.Forms.Label label2; + public System.Windows.Forms.Label lblWaitToUp; } } \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs index 4542ab8..7839f91 100644 --- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs +++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs @@ -43,7 +43,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms bool isStepAddPrice = false; CheckBox chkSelectAll = null; Dictionary dicShopGetCount = new Dictionary(); - NaiBa.Util.ConcurrentList lstTemuDBProductSelect = new NaiBa.Util.ConcurrentList(); + Dictionary> dicNotSupportCate = new Dictionary>(); + public NaiBa.Util.ConcurrentList lstTemuDBProductSelect = new NaiBa.Util.ConcurrentList(); NaiBa.Util.ConcurrentList lstAddPriceRule = new NaiBa.Util.ConcurrentList(); AddPriceRule defaultAddPriceRule = null; PddUploadRule pddUploadRule = null; @@ -135,12 +136,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms isActivityFake = chkActivity.Checked; dgvSelectProduct.Columns["colSkuFakeImg"].Visible = false; -#if DEBUG +//#if DEBUG if (BaseClass.SaLevel == 1) { dgvSelectProduct.Columns["colSkuFakeImg"].Visible = true; } -#endif +//#endif IsLoadComplate = true; } @@ -185,6 +186,36 @@ namespace TemuKJD.PDDForms.ProductSelectForms private void RefreshDbProd() { PDDDBProdListForm.GetPDDProductGroup(cmbGroupFilter); // 同时刷新下商品分组 + + GetPddProductCate(); + } + + /// + /// 获取商品所有类目 + /// + void GetPddProductCate() + { + var url = BaseClass.BuildObjString("product/get_product_cates"); + var data = UserLogin.GetSignaturex(); + 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")); + } + else + { + cmbCateFilter.Items.Clear(); + var groups = BaseRegex.GetStringJson(ref html, "data"); + foreach (var item in groups.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)) + { + cmbCateFilter.Items.Add(item); + } + cmbCateFilter.Items.Add(""); + } } private void RefreshShop() @@ -622,7 +653,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms } while(currentShopList.Any(s => s.ShopId == randomShop.ShopId)) { - Thread.Sleep(100); + Thread.Sleep(500); randomShop = randomShopLst[Randomx.GetId(randomShopLst.Count)]; } currentShopList.Add(randomShop); @@ -731,7 +762,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms continue; } - var kjdDbProd = GetProductDetail(prod.out_product_Id.ToString()); + KJDDBProduct kjdDbProd = prod.kjdDbProduct; + if (kjdDbProd == null) + kjdDbProd = GetProductDetail(prod.out_product_Id.ToString()); if (kjdDbProd == null || kjdDbProd.id == 0) { if (kjdDbProd?.id == 0) @@ -949,40 +982,53 @@ namespace TemuKJD.PDDForms.ProductSelectForms PDDProductDetailInfo chanceDetail = null; if (isChanceApi && currentCount % 700 < 700 && 1 == 1) //通过机会商品接口进入新增商品 { - var searchText = prodInfo.detail.cats.LastOrDefault(c => !string.IsNullOrEmpty(c)).ParseToString(); - if (string.IsNullOrEmpty(searchText)) - searchText = "头发绳"; - var rst = GetChanceGoodsList(shop, searchText); - if (!rst.Contains("\"success\":true")) - { - var error = BaseRegex.GetStringJson(ref rst, "error_msg"); - if (string.IsNullOrEmpty(error)) - error = rst; - return "新建查询失败 " + error; - } + // 记录店铺不支持的类目 + //if (!dicNotSupportCate.Keys.Contains(shop)) + //{ + // dicNotSupportCate[shop] = new List(); + //} - var chance_id = BaseRegex.GetStringJson(ref rst, "chance_id"); - try - { - JObject obj = JObject.Parse(rst); - var chanceGoodJArr = obj["result"]["list"]; - var chanceGoodsString = JsonHelper.SerializeObject(chanceGoodJArr); - var chanceGoodLst = new NaiBa.Util.ConcurrentList(); - chanceGoodLst.AddRange(JsonHelper.DeserializeJsonToList(chanceGoodsString)); - var chanceGood = chanceGoodLst.FirstOrDefault(g => g.cat_id_3 == prodInfo.detail.cat_id || g.cat_id_2 == prodInfo.detail.cat_id); - if (chanceGood != null) - chance_id = chanceGood.chance_id; - } - catch (Exception ex) { } + var searchText = prodInfo.detail.cats.LastOrDefault(c => !string.IsNullOrEmpty(c)).ParseToString(); + //if (string.IsNullOrEmpty(searchText)) + // searchText = "头发绳"; + + string chance_id = prodInfo.chance_id; + string chance_refere = prodInfo.chance_refere; if (string.IsNullOrEmpty(chance_id)) - chance_id = "fff84ef8fc1b2919a9c3383d350f44cc"; + { + + var chanceRst = GetChanceGoodsList(shop, searchText); + if (!chanceRst.Contains("\"success\":true")) + { + var error = BaseRegex.GetStringJson(ref chanceRst, "error_msg"); + if (string.IsNullOrEmpty(error)) + error = chanceRst; + return "新建查询失败 " + error; + } + + chance_id = BaseRegex.GetStringJson(ref chanceRst, "chance_id"); + try + { + JObject obj = JObject.Parse(chanceRst); + var chanceGoodJArr = obj["result"]["list"]; + var chanceGoodsString = JsonHelper.SerializeObject(chanceGoodJArr); + var chanceGoodLst = new NaiBa.Util.ConcurrentList(); + chanceGoodLst.AddRange(JsonHelper.DeserializeJsonToList(chanceGoodsString)); + var chanceGood = chanceGoodLst.FirstOrDefault(g => g.cat_id_3 == prodInfo.detail.cat_id || g.cat_id_2 == prodInfo.detail.cat_id); + if (chanceGood != null) + chance_id = chanceGood.chance_id; + } + catch (Exception ex) { } + //if (string.IsNullOrEmpty(chance_id)) + // chance_id = "fff84ef8fc1b2919a9c3383d350f44cc"; + } Thread.Sleep(Randomx.GetId(2000, 5000)); - rst = GetChanceGoodsId(shop, searchText, chance_id); + var rst = GetChanceGoodsId(shop, searchText, chance_id, chance_refere); if (rst.Contains("操作太过频繁,请稍后再试!")) { Thread.Sleep(Randomx.GetId(10000, 20000)); - rst = GetChanceGoodsId(shop, searchText, chance_id); + rst = GetChanceGoodsId(shop, searchText, chance_id, chance_refere); } if (!rst.Contains("\"success\":true")) { @@ -991,6 +1037,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms // error = rst; //return "新建创建失败 " + error; } + //失败了继续走普通商品上传接口 var draftId = BaseRegex.GetStringJson(ref rst, "draft_id"); var goods_id = BaseRegex.GetLongJson(ref rst, "goods_id"); @@ -1000,7 +1047,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms { Thread.Sleep(Randomx.GetId(20, 80)); //return "新建失败 申请机会商品ID失败" + rst.Replace("\"success\":true", "\"success1\":true"); - string create_new_html = create_prod_commit_id(shop); + string create_new_html = create_prod_commit_id(shop, chance_refere); if (create_new_html.Contains("\"success\":true")) { prodParam.goods_id = goods_id = BaseRegex.GetLongJson(ref create_new_html, "goods_id"); @@ -1019,8 +1066,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms } } + Thread.Sleep(Randomx.GetId(10, 50)); - rst = QueryChanceCommitDetail(shop, goods_id.ToString(), draftId); + rst = QueryChanceCommitDetail(shop, goods_id.ToString(), draftId, prodInfo.chance_tab); if (!rst.Contains("\"success\":true")) { var error = BaseRegex.GetStringJson(ref rst, "error_msg"); @@ -1038,16 +1086,20 @@ namespace TemuKJD.PDDForms.ProductSelectForms } + //Thread.Sleep(Randomx.GetId(10, 50)); + //var catRst = SearchCategories(shop, goods_id.ToString(), draftId, searchText); // 查找店铺能上传的类目 + var chance_cat_id = BaseRegex.GetStringJson(ref rst, "cat_id"); if (chance_cat_id != "0" && chance_cat_id != prodInfo.detail.cat_id.ParseToString()) { //如果机会商品的类目不一致,多获取一次类目模板,模拟进入编辑页后重选类目的行为 Thread.Sleep(Randomx.GetId(10, 50)); - rst = GetChanceProdTemplate(shop, chance_cat_id, goods_id.ParseToString(), draftId); + rst = GetChanceProdTemplate(shop, chance_cat_id, goods_id.ParseToString(), draftId, prodInfo.chance_tab); Thread.Sleep(Randomx.GetId(1000, 5000)); } } - else { + else + { if (isChanceApi) Thread.Sleep(Randomx.GetId(1000, 5000)); // 发起新建商品 @@ -1080,7 +1132,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms //商品属性模板 PDDProductTemplateInfo prodCatTemplateInfo = null; Thread.Sleep(Randomx.GetId(10, 50)); - string prop_template_html = get_cat_template(shop, prodInfo.detail.cat_id.ParseToString(), prodParam.goods_id.ToString(), prodParam.goods_commit_id); + string prop_template_html = get_cat_template(shop, prodInfo.detail.cat_id.ParseToString(), prodParam.goods_id.ToString(), prodParam.goods_commit_id, prodInfo.chance_tab); if (prop_template_html.Contains("\"success\":true")) { try @@ -1106,7 +1158,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms return "编辑失败 " + error; } - string decoration_preview_html = preview_goods_decoration(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + string decoration_preview_html = preview_goods_decoration(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, "", prodInfo.chance_tab); if (decoration_preview_html.Contains("\"success\":true")) { prodParam.decorationPreview = BaseRegex.GetStringJson(ref decoration_preview_html, "preview_url"); @@ -1127,7 +1179,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms })); } //运费模板 - string cost_template_html = get_cost_template(shop, prodInfo.detail.cat_ids, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + string cost_template_html = get_cost_template(shop, prodInfo.detail.cat_ids, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); if (cost_template_html.Contains("\"success\":true")) { prodParam.cost_template_id = BaseRegex.GetStringJson(ref cost_template_html, "costTemplateId").ParseToLong(); @@ -1147,7 +1199,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms { Thread.Sleep(Randomx.GetId(10, 60)); string keywords_html = query_keywords(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.detail.cat_id.ParseToString(), - prodInfo.detail.goods_name, prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1).url); + prodInfo.detail.goods_name, prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1).url, prodInfo.chance_tab); if (!keywords_html.Contains("\"success\":true")) { var error = BaseRegex.GetStringJson(ref keywords_html, "error_msg"); @@ -1277,7 +1329,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms })); } string prop_sub_template_html = get_sub_property_template(shop, prodInfo.detail.cat_id.ParseToString(), - prop.template_pid.ParseToString(), prop.vid.ParseToString(), prodParam.goods_id.ToString(), prodParam.goods_commit_id); + prop.template_pid.ParseToString(), prop.vid.ParseToString(), prodParam.goods_id.ToString(), prodParam.goods_commit_id, prodInfo.chance_tab); if (prop_sub_template_html.Contains("\"success\":true")) { //template_module_vos @@ -1416,7 +1468,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms sleepTimeTotal += sleepTime; Thread.Sleep(sleepTime); var material_html = create_material(shop, prodParam.prefillWhitePic, 1, prodParam.cat_ids, - prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); if (!material_html.Contains("\"success\":true")) { var error = BaseRegex.GetStringJson(ref material_html, "error_msg"); @@ -1433,7 +1485,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms sleepTimeTotal += sleepTime; Thread.Sleep(sleepTime); var material_html = create_material(shop, prodInfo.material3.online_material, 3, prodParam.cat_ids, - prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); if (!material_html.Contains("\"success\":true")) { var error = BaseRegex.GetStringJson(ref material_html, "error_msg"); @@ -1460,8 +1512,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms prodParam.second_hand = prodInfo.detail.second_hand; prodParam.service_time = BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now); // 尝试使用当前系统时间提交 prodParam.shang_men_an_zhuang = prodInfo.detail.shang_men_an_zhuang; - prodParam.shipment_limit_second = prodInfo.detail.shipment_limit_second; - //prodParam.shipment_limit_second = 86400 * 2; + prodParam.shipment_limit_second = prodInfo.detail.shipment_limit_second; //发货时间 + if (prodParam.shipment_limit_second == 0) + prodParam.shipment_limit_second = 86400 * 2; prodParam.shipment_limit_second_origin_value = 0; prodParam.shop_group_id = prodInfo.detail.shop_group_id.ParseToInt(); prodParam.showGoodsInstruction = true; @@ -1529,7 +1582,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (isLowPriceSku) { var newSpecRst = get_spec_by_name(shop, newSpecItem.spec_name, spec.parent_id.ParseToLong(), prodInfo.detail.cat_id.ParseToInt(), - prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); if (!newSpecRst.Contains("\"success\":true")) { var error = BaseRegex.GetStringJson(ref newSpecRst, "error_msg"); @@ -1720,7 +1773,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (prodInfo.size != null && prodInfo.size.classId != null) { Thread.Sleep(Randomx.GetId(15, 70)); - size_result = save_sizespec(shop, prodInfo.size, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + size_result = save_sizespec(shop, prodInfo.size, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); if (!size_result.Contains("\"success\":true")) { //var error = BaseRegex.GetStringJson(ref size_result, "error_msg"); @@ -1829,7 +1882,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms return "上传图片失败,请设置低价sku图"; if (string.IsNullOrEmpty(lowPriceSkuImg)) { - string uploadLowPriceSkuImgRst = UploadProdSkuImg(shop, lowPriceSkuImgBase64, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + string uploadLowPriceSkuImgRst = UploadProdSkuImg(shop, lowPriceSkuImgBase64, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); if (!uploadLowPriceSkuImgRst.Contains("\"url\":\"https:")) { var error = BaseRegex.GetStringJson(ref uploadLowPriceSkuImgRst, "error_msg"); @@ -1852,12 +1905,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms //https://img.pddpic.com/mms-goods-image/2025-09-23/aa714d65-08ba-437b-a62a-429b6f4ad061.jpeg.a.jpeg?imageView2/2/w/1700/q/85 // 图片缩略图格式 //https://img.pddpic.com/open-gw/2024-11-27/8c4b66e0-b80d-4a8f-bbab-9bb0d8adf015.jpeg //机会商品主图 //https://img.pddpic.com/open-gw/2025-08-13/97a2999c-0f60-47fb-a62f-21ecc0765cb9.jpeg //机会商品主图 - List skuImgStrLst = new List() { - "https://img.pddpic.com/mms-goods-image/2025-09-21/4204dcd6-afe0-4090-94fc-a68bf70396da.jpeg.a.jpeg", - "https://img.pddpic.com/mms-goods-image/2025-09-21/5ec7192b-3da3-4fc1-88fd-66493a5bc9cf.jpeg.a.jpeg", - "https://img.pddpic.com/mms-goods-image/2025-09-26/26b4835c-eae1-4a40-823d-c3a325285a21.jpeg.a.jpeg", - "https://img.pddpic.com/mms-goods-image/2025-09-26/34f4a9e8-bbd4-4f74-bf88-730eda5ce250.jpeg.a.jpeg", - "https://img.pddpic.com/mms-goods-image/2025-09-26/d188a763-19cc-4a5a-a8af-f0e6b9c3e483.jpeg.a.jpeg", + List skuImgStrLst = new List() + { + "https://img.pddpic.com/mms-goods-image/2025-10-09/fb24e835-e588-4570-b772-ad7acdf90fdf.jpeg.a.jpeg", + "https://img.pddpic.com/mms-goods-image/2025-10-09/d743cdc2-1a4b-4e3b-ada7-8f857fe49d26.jpeg.a.jpeg", + "https://img.pddpic.com/mms-goods-image/2025-10-09/b63f2256-fe5c-452b-91cd-688e06f3a944.jpeg.a.jpeg", //"https://img.pddpic.com/mms-goods-image/2025-09-23/e7b614a6-07fb-4d49-adf5-6f48e9afd36f.jpeg.a.jpeg", //"https://img.pddpic.com/mms-goods-image/2025-09-23/35151a9e-962e-4490-9d61-3477c090d29f.jpeg.a.jpeg", //"https://img.pddpic.com/mms-goods-image/2025-09-23/7c1d1098-d348-460e-b663-e19c960aede8.jpeg.a.jpeg", @@ -1868,12 +1920,39 @@ namespace TemuKJD.PDDForms.ProductSelectForms //"https://img.pddpic.com/mms-goods-image/2025-09-23/c0e083d2-2e05-4b3d-9543-bcad49a17873.jpeg.a.jpeg", //"https://img.pddpic.com/mms-goods-image/2025-09-23/7ea07200-05da-45b9-9e9a-fba4d46cfec9.jpeg.a.jpeg", }; - if (!string.IsNullOrEmpty(dbProd.sku_img_replace_url)) + + //cat_name + string[] catName = new string[] { "洞洞鞋", "其他凉鞋", "包头拖", "人字拖", "一字拖", "居家鞋", "棉拖鞋", "网面鞋", "居家凉拖", + "沙滩凉鞋", "休闲凉鞋", "凉鞋", "运动拖鞋", "时装凉鞋", "男凉拖", "擦地拖鞋", "亚麻拖鞋", "休闲皮鞋", "T恤", "高帮棉鞋" }; + string img_type = "鞋(不含拖鞋)"; + if (catName.Contains(dbProd.cat_name)) + { + img_type = "拖鞋"; + } + { + var url = BaseClass.BuildObjString("product/get_sku_replace_img_list_random"); + var data = ""; + data = UserLogin.GetSignaturex() + + "&page=" + 1 + + "&page_size=" + 1; + data += "&in_img_type=" + img_type; + var html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + { + } + else + { + JObject jObj = JObject.Parse(html); + fakeImgUrl = jObj["data"].FirstOrDefault().ParseToString();// BaseRegex.GetStringJson(ref html, "data"); + } + } + + if (!string.IsNullOrEmpty(dbProd.sku_img_replace_url) && !string.IsNullOrEmpty(dbProd.sku_img_replace_base64)) fakeImgUrl = dbProd.sku_img_replace_url; if (isActivityFake && string.IsNullOrEmpty(dbProd.sku_img_replace_url) && !string.IsNullOrEmpty(dbProd.sku_img_replace_base64) && 1 == 1) { - string uploadSkuImgRst = UploadProdSkuImg(shop, dbProd.sku_img_replace_base64, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + string uploadSkuImgRst = UploadProdSkuImg(shop, dbProd.sku_img_replace_base64, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); if (!uploadSkuImgRst.Contains("\"url\":\"https:")) { var error = BaseRegex.GetStringJson(ref uploadSkuImgRst, "error_msg"); @@ -2078,11 +2157,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms } var decorationRst = ""; #region 先随即提交一个带 preview_key 的,但是这个不起作用,后面再提交一个不带 preview_key 的才是真实的能查询到的商品详情信息 - decorationRst = save_decoration(shop, decorationParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + decorationRst = save_decoration(shop, decorationParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); if (decorationRst.Contains("http error:500")) { Thread.Sleep(Randomx.GetId(10000, 20000)); - decorationRst = save_decoration(shop, decorationParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + decorationRst = save_decoration(shop, decorationParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); } if (!decorationRst.Contains("\"success\":true")) { @@ -2093,11 +2172,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms } Thread.Sleep(Randomx.GetId(20, 100)); - decoration_preview_html = preview_goods_decoration(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, preview_key); + decoration_preview_html = preview_goods_decoration(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, preview_key, prodInfo.chance_tab); if (decoration_preview_html.Contains("http error:500")) { Thread.Sleep(Randomx.GetId(10000, 20000)); - decoration_preview_html = preview_goods_decoration(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, preview_key); + decoration_preview_html = preview_goods_decoration(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, preview_key, prodInfo.chance_tab); } //decoration_preview_html = GetPddDecorationPreview(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); if (!decoration_preview_html.Contains("\"success\":true")) @@ -2112,11 +2191,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms Thread.Sleep(Randomx.GetId(20, 100)); decorationParam.preview_key = ""; - decorationRst = save_decoration(shop, decorationParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + decorationRst = save_decoration(shop, decorationParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); if (decorationRst.Contains("http error:500")) { Thread.Sleep(Randomx.GetId(10000, 20000)); - decorationRst = save_decoration(shop, decorationParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + decorationRst = save_decoration(shop, decorationParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); } if (!decorationRst.Contains("\"success\":true")) { @@ -2127,11 +2206,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms } Thread.Sleep(Randomx.GetId(20, 100)); - decoration_preview_html = preview_goods_decoration(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + decoration_preview_html = preview_goods_decoration(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, "", prodInfo.chance_tab); if (decoration_preview_html.Contains("http error:500")) { Thread.Sleep(Randomx.GetId(10000, 20000)); - decoration_preview_html = preview_goods_decoration(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + decoration_preview_html = preview_goods_decoration(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, "", prodInfo.chance_tab); } //decoration_preview_html = GetPddDecorationPreview(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); if (decoration_preview_html.Contains("\"success\":true")) @@ -2222,12 +2301,15 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (string.IsNullOrEmpty(error)) error = getProdIdRst; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) return "上传失败"; return "上传失败 校验上传失败 " + error; } - + foreach(var sku in prodParamHighPrice.skus) + { + sku.quantity_delta = 0; + } saveProdRst = save_goods_edit(shop, prodParamHighPrice, prodParamHighPrice.goods_id.ParseToString(), prodParamHighPrice.goods_commit_id, isChanceApi, "edit"); if (!saveProdRst.Contains("\"success\":true")) { @@ -2235,7 +2317,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (string.IsNullOrEmpty(error)) error = saveProdRst; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) return "上传失败"; return "上传失败 保存失败 " + error; } @@ -2249,7 +2331,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (string.IsNullOrEmpty(error)) error = uploadRst; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) return "上传失败"; return "上传失败 提交失败 " + error; } @@ -2283,7 +2365,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (string.IsNullOrEmpty(error)) error = activityRst2; activityErr += "\r\n上传错误 365查询失败 " + error; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg2; } @@ -2297,7 +2379,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (pddActivitiPriceProd == null) { activityErr += "\r\n上传错误 365查询/新建失败 商品未提交成功或不满足参加活动条件"; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg2; } @@ -2310,7 +2392,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (sku == null || sku.multi_price > activitySkuInfo.require_price) { activityErr += "\r\n上传错误 365价格低于产品价 " + activitySkuInfo.require_price + " < " + sku.multi_price; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg2; } @@ -2333,7 +2415,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (sku == null) { activityErr += "\r\n上传错误 365价格sku未找到"; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg2; } @@ -2353,6 +2435,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms goods_vo_item.create_activity_price_vo.create_quantity_vo.goods_activity_quantity = Math.Min(quantity.ParseToInt(), 300); // 7折活动库存上限300 actSubmitParam.goods_volist.Add(goods_vo_item); + actSubmitParam.create_protocol_vo.need_create_cost_template = true; var addActivityRst = add_activity_goods(shop, actSubmitParam, prodParam.goods_id.ParseToString(), 21365, 27); if (addActivityRst.Contains("频繁")) @@ -2367,7 +2450,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (string.IsNullOrEmpty(error)) error = addActivityRst; activityErr += "\r\n上传错误 365新建失败 " + error; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg2; } @@ -2375,7 +2458,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms catch (Exception ex) { activityErr += "\r\n上传错误 365查询/新建失败 " + ex.Message; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg2; } @@ -2393,7 +2476,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (string.IsNullOrEmpty(error)) error = activityRst5; activityErr += "\r\n上传错误 586查询失败 " + error; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg5; } @@ -2407,7 +2490,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (pddActivitiPriceProd == null) { activityErr += "\r\n上传错误 586查询/新建失败 商品未提交成功或不满足参加活动条件"; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg5; } @@ -2417,7 +2500,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (sku == null || sku.multi_price > activitySkuInfo.require_price + 1) { activityErr += "\r\n上传错误 586价格低于产品价 " + activitySkuInfo.require_price + " < " + sku.multi_price; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg5; } @@ -2439,7 +2522,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (sku == null) { activityErr += "\r\n上传错误 586价格sku未找到"; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg5; } @@ -2463,6 +2546,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms actSubmitParam.custom_ability_vo = new custom_ability_vo_item(); actSubmitParam.custom_ability_vo.agree_pyramid_system_enroll = true; actSubmitParam.custom_ability_vo.pyramid_activity_id = "7"; + actSubmitParam.create_protocol_vo.need_create_cost_template = true; var addActivityRst = add_activity_goods(shop, actSubmitParam, prodParam.goods_id.ParseToString(), 18586, 0); var err_msg = BaseRegex.GetStringJson(ref addActivityRst, "error_msg"); @@ -2472,7 +2556,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (string.IsNullOrEmpty(error)) error = addActivityRst; activityErr += "\r\n上传错误 586新建失败 " + error; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg5; } @@ -2480,7 +2564,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms catch (Exception ex) { activityErr += "\r\n上传错误 586查询/新建失败 " + ex.Message; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg5; } @@ -2498,7 +2582,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (string.IsNullOrEmpty(error)) error = activityRst4; activityErr += "\r\n上传错误 620查询失败 " + error; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg4; } @@ -2512,7 +2596,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (pddActivitiPriceProd == null) { activityErr += "\r\n上传错误 620查询/新建失败 商品未提交成功或不满足参加活动条件"; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg4; } @@ -2522,7 +2606,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (sku == null || sku.multi_price > activitySkuInfo.require_price) { activityErr += "\r\n上传错误 620价格低于产品价 " + activitySkuInfo.require_price + " < " + sku.multi_price; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg4; } @@ -2545,7 +2629,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (sku == null) { activityErr += "\r\n上传错误 620价格sku未找到"; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg4; } @@ -2565,6 +2649,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms //goods_vo_item.create_activity_price_vo.create_quantity_vo.goods_activity_quantity = // Math.Min(quantity.ParseToInt(), 300); // 7折活动上限300 actSubmitParam.goods_volist.Add(goods_vo_item); + actSubmitParam.create_protocol_vo.need_create_cost_template = true; var addActivityRst = add_activity_goods(shop, actSubmitParam, prodParam.goods_id.ParseToString(), 23620, 27); if (addActivityRst.Contains("频繁")) @@ -2579,7 +2664,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (string.IsNullOrEmpty(error)) error = addActivityRst; activityErr += "\r\n上传错误 620新建失败 " + error; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg4; } @@ -2587,7 +2672,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms catch (Exception ex) { activityErr += "\r\n上传错误 620查询/新建失败 " + ex.Message; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg4; } @@ -2605,7 +2690,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (string.IsNullOrEmpty(error)) error = activityRst1; activityErr += "\r\n上传错误 981查询失败 " + error; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg1; } @@ -2618,7 +2703,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (pddActivitiInfo == null) { activityErr += "\r\n上传错误 981查询/新建失败 商品未提交成功或不满足参加活动条件"; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg1; } @@ -2629,7 +2714,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (sku == null || sku.multi_price > activitySku.suggest_price) { activityErr += "\r\n上传错误 981价格低于产品价 " + activitySku.suggest_price + " < " + sku.multi_price; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg1; } @@ -2652,7 +2737,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (sku == null) { activityErr += "\r\n上传错误 981价格sku未找到"; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg1; } @@ -2669,6 +2754,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms goods_vo_item.create_activity_price_vo.create_sku_vos.Add(sku_vo_item); } actSubmitParam.goods_volist.Add(goods_vo_item); + actSubmitParam.create_protocol_vo.need_create_cost_template = true; var addActivityRst = add_activity_goods(shop, actSubmitParam, prodParam.goods_id.ParseToString(), 20981, 0); var err_msg = BaseRegex.GetStringJson(ref addActivityRst, "error_msg"); @@ -2678,7 +2764,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (string.IsNullOrEmpty(error)) error = addActivityRst; activityErr += "\r\n上传错误 981新建失败 " + error; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg1; } @@ -2686,7 +2772,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms catch (Exception ex) { activityErr += "\r\n上传错误 981查询/新建失败 " + ex.Message; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg1; } @@ -2704,7 +2790,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (string.IsNullOrEmpty(error)) error = activityRst3; activityErr += "\r\n上传错误 996查询失败 " + error; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg3; } @@ -2718,7 +2804,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (pddActivitiPriceProd == null) { activityErr += "\r\n上传错误 996查询/新建失败 商品未提交成功或不满足参加活动条件"; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg3; } @@ -2728,7 +2814,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (sku == null || sku.multi_price > 2990 /*activitySkuInfo.require_price*/) { activityErr += "\r\n上传错误 996价格低于产品价"; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg3; } @@ -2749,7 +2835,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (sku == null) { activityErr += "\r\n上传错误 996价格sku未找到"; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg3; } @@ -2770,6 +2856,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms goods_vo_item.create_activity_price_vo.create_sku_vos.Add(sku_vo_item); } actSubmitParam.goods_volist.Add(goods_vo_item); + actSubmitParam.create_protocol_vo.need_create_cost_template = true; var addActivityRst = add_activity_goods(shop, actSubmitParam, prodParam.goods_id.ParseToString(), 15996, 18); var err_msg = BaseRegex.GetStringJson(ref addActivityRst, "error_msg"); @@ -2779,7 +2866,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms if (string.IsNullOrEmpty(error)) error = addActivityRst; activityErr += "\r\n上传错误 996新建失败 " + error; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg3; } @@ -2787,7 +2874,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms catch (Exception ex) { activityErr = "\r\n上传错误 996查询/新建失败 " + ex.Message; - if (BaseClass.SaLevel != 1) + if (BaseClass.SaLevel != 1 && 1 != 1) activityErr = "上传错误"; goto restoreSkuImg3; } @@ -2805,19 +2892,19 @@ namespace TemuKJD.PDDForms.ProductSelectForms /// /// /// - public string UploadProdSkuImg(ShopLoginInfo shop, string img_base64, string goods_id, string goods_commit_id) + public string UploadProdSkuImg(ShopLoginInfo shop, string img_base64, string goods_id, string goods_commit_id, string chanceTab) { string img_signature = ""; - var img_signature_rst = get_uploag_sku_img_signature(shop, goods_id, goods_commit_id); + var img_signature_rst = get_uploag_sku_img_signature(shop, goods_id, goods_commit_id, chanceTab); if (!img_signature_rst.Contains("\"success\":true")) { Thread.Sleep(Randomx.GetId(500, 1000)); - img_signature_rst = get_uploag_sku_img_signature(shop, goods_id.ParseToString(), goods_commit_id); + img_signature_rst = get_uploag_sku_img_signature(shop, goods_id.ParseToString(), goods_commit_id, chanceTab); } if (!img_signature_rst.Contains("\"success\":true")) { Thread.Sleep(Randomx.GetId(500, 1000)); - img_signature_rst = get_uploag_sku_img_signature(shop, goods_id.ParseToString(), goods_commit_id); + img_signature_rst = get_uploag_sku_img_signature(shop, goods_id.ParseToString(), goods_commit_id, chanceTab); } if (!img_signature_rst.Contains("\"success\":true")) { @@ -2914,7 +3001,7 @@ Content-Disposition: form-data; name=""pic_operations"" /// /// /// - private string create_prod_commit_id(ShopLoginInfo shop) + private string create_prod_commit_id(ShopLoginInfo shop, string _refere = "") { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -2926,6 +3013,10 @@ Content-Disposition: form-data; name=""pic_operations"" { refere = "https://mms.pinduoduo.com/goods/category?chance_tab=search"; } + if (!string.IsNullOrEmpty(_refere)) + { + refere = _refere; + } var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) { @@ -2983,7 +3074,7 @@ Content-Disposition: form-data; name=""pic_operations"" /// /// /// - private string get_cat_template(ShopLoginInfo shop, string catId, string goodsId, string commitId) + private string get_cat_template(ShopLoginInfo shop, string catId, string goodsId, string commitId, string chanceTab) { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -2996,6 +3087,8 @@ Content-Disposition: form-data; name=""pic_operations"" if (isChanceApi) refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); var result = HttpResponseBLL.PDDGetResponse(shop, url, body, refere, anti); for (int i = 0; i < 5 && (result.Contains("操作太过频繁") || result.Contains("网络繁忙,请不要频繁操作")); i++) { @@ -3022,7 +3115,7 @@ Content-Disposition: form-data; name=""pic_operations"" /// /// /// - private string get_sub_property_template(ShopLoginInfo shop, string catId, string template_pid, string vid, string goodsId, string commitId) + private string get_sub_property_template(ShopLoginInfo shop, string catId, string template_pid, string vid, string goodsId, string commitId, string chanceTab) { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3034,6 +3127,8 @@ Content-Disposition: form-data; name=""pic_operations"" if (isChanceApi) refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti); for (int i = 0; i < 5 && (result.Contains("操作太过频繁") || result.Contains("网络繁忙,请不要频繁操作")); i++) { @@ -3058,7 +3153,7 @@ Content-Disposition: form-data; name=""pic_operations"" /// /// /// - private string preview_goods_decoration(ShopLoginInfo shop, string goodsId, string commitId, string prevewKey = "") + private string preview_goods_decoration(ShopLoginInfo shop, string goodsId, string commitId, string prevewKey = "", string chanceTab = "") { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3072,6 +3167,8 @@ Content-Disposition: form-data; name=""pic_operations"" if (isChanceApi) refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) { @@ -3094,7 +3191,7 @@ Content-Disposition: form-data; name=""pic_operations"" /// /// /// - private string get_cost_template(ShopLoginInfo shop, List catList, string goodsId, string commitId) + private string get_cost_template(ShopLoginInfo shop, List catList, string goodsId, string commitId, string chanceTab) { if (catList == null) catList = new List(); @@ -3113,6 +3210,8 @@ Content-Disposition: form-data; name=""pic_operations"" if (isChanceApi) refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) @@ -3131,7 +3230,7 @@ Content-Disposition: form-data; name=""pic_operations"" private string query_keywords(ShopLoginInfo shop, string goodsId, string commitId, string cat_id = "21999", string title = "头绳女黑色加粗橡皮筋高马尾皮筋扎头发发圈成人耐用皮套发绳头绳", - string image_url = "https://img.pddpic.com/mms-material-img/2021-08-30/1f41bc24-0d8b-4f3e-a804-dec8baf8c0bc.jpeg.a.jpeg") + string image_url = "https://img.pddpic.com/mms-material-img/2021-08-30/1f41bc24-0d8b-4f3e-a804-dec8baf8c0bc.jpeg.a.jpeg", string chanceTab = "") { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3144,6 +3243,8 @@ Content-Disposition: form-data; name=""pic_operations"" if (isChanceApi) refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); var result = HttpResponseBLL.PDDPostResponse(shop, url, body.Replace("0asAntiContent", anti), refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) @@ -3161,7 +3262,7 @@ Content-Disposition: form-data; name=""pic_operations"" return result; } - private string get_spec_by_name(ShopLoginInfo shop, string skuSpecName, long specParentId, int catId, string goodsId, string commitId) + private string get_spec_by_name(ShopLoginInfo shop, string skuSpecName, long specParentId, int catId, string goodsId, string commitId, string chanceTab) { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3173,6 +3274,8 @@ Content-Disposition: form-data; name=""pic_operations"" if (isChanceApi) refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) @@ -3199,7 +3302,7 @@ Content-Disposition: form-data; name=""pic_operations"" /// /// /// - private string create_material(ShopLoginInfo shop, string imgUrl, int type, List catList, string goodsId, string commitId) + private string create_material(ShopLoginInfo shop, string imgUrl, int type, List catList, string goodsId, string commitId, string chanceTab) { if (catList == null) catList = new List(); @@ -3218,6 +3321,9 @@ Content-Disposition: form-data; name=""pic_operations"" if (isChanceApi) refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); + var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) { @@ -3233,7 +3339,7 @@ Content-Disposition: form-data; name=""pic_operations"" return result; } - private string reusable_sizespec(ShopLoginInfo shop, string catId, string goodsId, string commitId) + private string reusable_sizespec(ShopLoginInfo shop, string catId, string goodsId, string commitId, string chanceTab) { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3245,6 +3351,9 @@ Content-Disposition: form-data; name=""pic_operations"" if (isChanceApi) refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); + var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) { @@ -3260,7 +3369,7 @@ Content-Disposition: form-data; name=""pic_operations"" return result; } - private string save_sizespec(ShopLoginInfo shop, PDDSizeSpecInfo sizeInfo, string goodsId, string commitId) + private string save_sizespec(ShopLoginInfo shop, PDDSizeSpecInfo sizeInfo, string goodsId, string commitId, string chanceTab) { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3273,6 +3382,9 @@ Content-Disposition: form-data; name=""pic_operations"" if (isChanceApi) refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); + var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) { @@ -3288,7 +3400,7 @@ Content-Disposition: form-data; name=""pic_operations"" return result; } - private string get_uploag_sku_img_signature(ShopLoginInfo shop, string goodsId, string commitId) + private string get_uploag_sku_img_signature(ShopLoginInfo shop, string goodsId, string commitId, string chanceTab) { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3300,6 +3412,9 @@ Content-Disposition: form-data; name=""pic_operations"" if (isChanceApi) refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); + var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti); for (int i = 0; i < 5 && (result.Contains("\\u975E\\u6CD5\\u8BF7\\u6C42") || result.Contains("网络繁忙,请不要频繁操作")); i++) { @@ -3353,7 +3468,7 @@ Content-Disposition: form-data; name=""pic_operations"" /// /// /// - private string save_decoration(ShopLoginInfo shop,PDDProdDecorationCommitParam decoration, string goodsId, string commitId) + private string save_decoration(ShopLoginInfo shop,PDDProdDecorationCommitParam decoration, string goodsId, string commitId, string chanceTab) { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3366,6 +3481,9 @@ Content-Disposition: form-data; name=""pic_operations"" if (isChanceApi) refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); + var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) { @@ -3634,13 +3752,13 @@ Content-Disposition: form-data; name=""pic_operations"" var draftId = BaseRegex.GetStringJson(ref rst, "draft_id"); var goods_id = BaseRegex.GetLongJson(ref rst, "goods_id"); - rst = QueryChanceCommitDetail(shop, goods_id.ToString(), draftId); - rst = GetChanceProdTemplate(shop, 21999.ToString(), goods_id.ToString(), draftId); + rst = QueryChanceCommitDetail(shop, goods_id.ToString(), draftId, ""); + rst = GetChanceProdTemplate(shop, 21999.ToString(), goods_id.ToString(), draftId, ""); rst = QueryKeywords(shop, goods_id.ToString(), draftId); - rst = SaveDecoration(shop, goods_id.ToString(), draftId); - rst = PreviewDecoration(shop, goods_id.ToString(), draftId); - rst = GoodsCommit(shop, goods_id.ToString(), draftId); - rst = GoodsSubmit(shop, goods_id.ToString(), draftId); + rst = SaveDecoration(shop, goods_id.ToString(), draftId, "", ""); + rst = PreviewDecoration(shop, goods_id.ToString(), draftId, ""); + rst = GoodsCommit(shop, goods_id.ToString(), draftId, "" ,""); + rst = GoodsSubmit(shop, goods_id.ToString(), draftId, ""); } private string GetChanceGoodsList(ShopLoginInfo shop, string searchWord) @@ -3649,6 +3767,7 @@ Content-Disposition: form-data; name=""pic_operations"" if (shop.AntiContents.Count > 0) anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)]; string url = "https://mms.pinduoduo.com/opportunity-goods/chance-goods/home_list"; + //https://mms.pinduoduo.com/opportunity-goods/chance-goods/quick_release string body = @"{""size"":35,""page"":1,""search_word"":""" + searchWord + @"""}"; string refere = "https://mms.pinduoduo.com/goods/goods_list/chance/chance_list?search_word=" + GetHtml.UrlEncodeUtf8(searchWord) + "&sourcePage=goodsListTopButton"; @@ -3667,7 +3786,7 @@ Content-Disposition: form-data; name=""pic_operations"" return result; } - private string GetChanceGoodsId(ShopLoginInfo shop, string searchWord = "头发绳", string chanceId = "fff84ef8fc1b2919a9c3383d350f44cc") + private string GetChanceGoodsId(ShopLoginInfo shop, string searchWord = "头发绳", string chanceId = "fff84ef8fc1b2919a9c3383d350f44cc", string _refere="") { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3676,6 +3795,9 @@ Content-Disposition: form-data; name=""pic_operations"" string body = @"{""chance_id"":""" + chanceId + @"""}"; string refere = "https://mms.pinduoduo.com/goods/goods_list/chance/chance_list?search_word=" + GetHtml.UrlEncodeUtf8(searchWord) + "&sourcePage=goodsListTopButton"; + if (!string.IsNullOrEmpty(_refere)) + refere = _refere; + var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) { @@ -3691,7 +3813,7 @@ Content-Disposition: form-data; name=""pic_operations"" return result; } - private string QueryChanceCommitDetail(ShopLoginInfo shop, string goodsId, string commitId) + private string QueryChanceCommitDetail(ShopLoginInfo shop, string goodsId, string commitId, string chanceTab) { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3700,6 +3822,9 @@ Content-Disposition: form-data; name=""pic_operations"" string body = "{\"goods_commit_id\":\"" + commitId + "\",\"goods_id\":\"" + goodsId + "\"}"; string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); + var result = HttpResponseBLL.PDDPostResponse(shop, url, body.Replace("0asAntiContent", anti), refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) { @@ -3716,7 +3841,33 @@ Content-Disposition: form-data; name=""pic_operations"" return result; } - private string GetChanceProdTemplate(ShopLoginInfo shop, string catId, string prodId, string commitId) + //private string SearchCategories(ShopLoginInfo shop, string goodsId, string commitId, string keyword) + //{ + // var anti = shop.AntiContents.LastOrDefault().ParseToString(); + // if (shop.AntiContents.Count > 0) + // anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)]; + // string url = "https://mms.pinduoduo.com/vodka/v2/mms/search/categories/v2?keyword=" + GetHtml.UrlEncodeUtf8(keyword); + // string body = @""; + // string refere = "https://mms.pinduoduo.com/goods/category?id=" + commitId + "&goods_id=" + goodsId + "&type=add&sourcePage=goodsList"; + // if (isChanceApi) + // refere = "https://mms.pinduoduo.com/goods/category?id=" + commitId + "&is_shop=0&goods_id=" + goodsId + + // "&changeCate=1&type=add&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + // var result = HttpResponseBLL.PDDGetResponse(shop, url, body, refere, anti); + // for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) + // { + // shop.AntiContents.Remove(anti); + // anti = shop.AntiContents.FirstOrDefault().ParseToString(); + // if (shop.AntiContents.Count > 0) + // { + // Thread.Sleep(Randomx.GetId(300, 500)); + // anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)]; + // result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti); + // } + // } + // return result; + //} + + private string GetChanceProdTemplate(ShopLoginInfo shop, string catId, string prodId, string commitId, string chanceTab) { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3727,6 +3878,9 @@ Content-Disposition: form-data; name=""pic_operations"" string body = @""; string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + prodId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); + var result = HttpResponseBLL.PDDGetResponse(shop, url, body, refere, anti); for (int i = 0; i < 5 && (result.Contains("操作太过频繁") || result.Contains("网络繁忙,请不要频繁操作")); i++) { @@ -3744,7 +3898,7 @@ Content-Disposition: form-data; name=""pic_operations"" private string QueryKeywords(ShopLoginInfo shop, string goodsId, string commitId, string cat_id = "21999", string title = "头绳女黑色加粗橡皮筋高马尾皮筋扎头发发圈成人耐用皮套发绳头绳", - string image_url = "https://img.pddpic.com/mms-material-img/2021-08-30/1f41bc24-0d8b-4f3e-a804-dec8baf8c0bc.jpeg.a.jpeg") + string image_url = "https://img.pddpic.com/mms-material-img/2021-08-30/1f41bc24-0d8b-4f3e-a804-dec8baf8c0bc.jpeg.a.jpeg", string chanceTab = "") { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3756,7 +3910,9 @@ Content-Disposition: form-data; name=""pic_operations"" string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; - + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); + var result = HttpResponseBLL.PDDPostResponse(shop, url, body.Replace("0asAntiContent", anti), refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) { @@ -3773,7 +3929,7 @@ Content-Disposition: form-data; name=""pic_operations"" return result; } - private string SaveDecoration(ShopLoginInfo shop, string goodsId, string commitId, string decoration_json = "") + private string SaveDecoration(ShopLoginInfo shop, string goodsId, string commitId, string decoration_json = "", string chanceTab = "") { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3786,6 +3942,8 @@ Content-Disposition: form-data; name=""pic_operations"" string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); var result = HttpResponseBLL.PDDPostResponse(shop, url, body.Replace("0asAntiContent", anti), refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) @@ -3803,7 +3961,7 @@ Content-Disposition: form-data; name=""pic_operations"" return result; } - private string PreviewDecoration(ShopLoginInfo shop, string goodsId, string commitId) + private string PreviewDecoration(ShopLoginInfo shop, string goodsId, string commitId, string chanceTab) { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3814,6 +3972,8 @@ Content-Disposition: form-data; name=""pic_operations"" string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); var result = HttpResponseBLL.PDDPostResponse(shop, url, body.Replace("0asAntiContent", anti), refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) @@ -3831,7 +3991,7 @@ Content-Disposition: form-data; name=""pic_operations"" return result; } - private string GoodsCommit(ShopLoginInfo shop, string goodsId, string commitId, string goods_json = "") + private string GoodsCommit(ShopLoginInfo shop, string goodsId, string commitId, string goods_json = "", string chanceTab = "") { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3855,6 +4015,8 @@ Content-Disposition: form-data; name=""pic_operations"" string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); var result = HttpResponseBLL.PDDPostResponse(shop, url, body.Replace("0asAntiContent", anti), refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) @@ -3872,7 +4034,7 @@ Content-Disposition: form-data; name=""pic_operations"" return result; } - private string GoodsSubmit(ShopLoginInfo shop, string goodsId, string commitId) + private string GoodsSubmit(ShopLoginInfo shop, string goodsId, string commitId, string chanceTab="") { var anti = shop.AntiContents.LastOrDefault().ParseToString(); if (shop.AntiContents.Count > 0) @@ -3890,6 +4052,8 @@ Content-Disposition: form-data; name=""pic_operations"" string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId + "&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE"; + if (!string.IsNullOrEmpty(chanceTab)) + refere = refere.Replace("chance_tab=search", "chance_tab=" + chanceTab); var result = HttpResponseBLL.PDDPostResponse(shop, url, body.Replace("0asAntiContent", anti), refere, anti); for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++) @@ -3969,6 +4133,7 @@ Content-Disposition: form-data; name=""pic_operations"" data += "&in_ext_codes=" + txtExtCodeFilter.Text; data += "&in_skc_ids=" + txtIdFilter.Text; data += "&in_groups=" + cmbGroupFilter.Text; + data += "&in_cates=" + cmbCateFilter.Text; })); var html = GetHtml.PostUtf8(url, data); if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) @@ -4133,6 +4298,10 @@ Content-Disposition: form-data; name=""pic_operations"" txtIdFilter.Text = ""; txtExtCodeFilter.Text = ""; cmbGroupFilter.Text = ""; + cmbCateFilter.Text = ""; + int prodCount; + GetRandomProductList(out prodCount, 1, 1); + lblGoodsCount.Text = "产品库中共有 " + prodCount + " 件商品"; } private void lblLowPriceSkuImg_Click(object sender, EventArgs e) diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.Designer.cs b/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.Designer.cs index b26d264..cfde028 100644 --- a/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.Designer.cs +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.Designer.cs @@ -36,6 +36,8 @@ this.btnMultiLogin = new DevComponents.DotNetBar.PanelEx(); this.btnDel = new DevComponents.DotNetBar.PanelEx(); this.pnlUploadOpBtns = new System.Windows.Forms.Panel(); + this.txtSendCount = new System.Windows.Forms.TextBox(); + this.btnSendToUpload = new DevComponents.DotNetBar.PanelEx(); this.numMinPrice = new System.Windows.Forms.NumericUpDown(); this.label3 = new System.Windows.Forms.Label(); this.pictureBox8 = new System.Windows.Forms.PictureBox(); @@ -49,6 +51,7 @@ this.btnRestoreSkuImg = new DevComponents.DotNetBar.PanelEx(); this.btnSignActivity = new DevComponents.DotNetBar.PanelEx(); this.btnSaveSourceGoodsData = new DevComponents.DotNetBar.PanelEx(); + this.label4 = new System.Windows.Forms.Label(); this.btnLoginAgain = new TemuKJD.UserControls.ButtonEx(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); @@ -61,6 +64,10 @@ this.chkCloseAfterLogin = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.txtAddress = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.txtSendPrice = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.pictureBox9 = new System.Windows.Forms.PictureBox(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -80,6 +87,7 @@ this.splitContainer2.Panel1.SuspendLayout(); this.splitContainer2.Panel2.SuspendLayout(); this.splitContainer2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).BeginInit(); this.SuspendLayout(); // // splitContainer1 @@ -112,7 +120,7 @@ this.splitContainer1.Panel2.Controls.Add(this.btnReload); this.splitContainer1.Panel2.Controls.Add(this.chkCloseAfterLogin); this.splitContainer1.Size = new System.Drawing.Size(1438, 736); - this.splitContainer1.SplitterDistance = 672; + this.splitContainer1.SplitterDistance = 668; this.splitContainer1.SplitterWidth = 3; this.splitContainer1.TabIndex = 4; // @@ -211,6 +219,12 @@ // pnlUploadOpBtns // this.pnlUploadOpBtns.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.pnlUploadOpBtns.Controls.Add(this.pictureBox9); + this.pnlUploadOpBtns.Controls.Add(this.label6); + this.pnlUploadOpBtns.Controls.Add(this.txtSendPrice); + this.pnlUploadOpBtns.Controls.Add(this.label5); + this.pnlUploadOpBtns.Controls.Add(this.txtSendCount); + this.pnlUploadOpBtns.Controls.Add(this.btnSendToUpload); this.pnlUploadOpBtns.Controls.Add(this.numMinPrice); this.pnlUploadOpBtns.Controls.Add(this.label3); this.pnlUploadOpBtns.Controls.Add(this.pictureBox8); @@ -224,11 +238,46 @@ this.pnlUploadOpBtns.Controls.Add(this.btnRestoreSkuImg); this.pnlUploadOpBtns.Controls.Add(this.btnSignActivity); this.pnlUploadOpBtns.Controls.Add(this.btnSaveSourceGoodsData); + this.pnlUploadOpBtns.Controls.Add(this.label4); this.pnlUploadOpBtns.Location = new System.Drawing.Point(338, 3); this.pnlUploadOpBtns.Name = "pnlUploadOpBtns"; this.pnlUploadOpBtns.Size = new System.Drawing.Size(812, 53); this.pnlUploadOpBtns.TabIndex = 463; // + // txtSendCount + // + this.txtSendCount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.txtSendCount.Location = new System.Drawing.Point(778, 3); + this.txtSendCount.Name = "txtSendCount"; + this.txtSendCount.Size = new System.Drawing.Size(31, 23); + this.txtSendCount.TabIndex = 478; + this.txtSendCount.Text = "10"; + // + // btnSendToUpload + // + this.btnSendToUpload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnSendToUpload.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnSendToUpload.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnSendToUpload.DisabledBackColor = System.Drawing.Color.Empty; + this.btnSendToUpload.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSendToUpload.Location = new System.Drawing.Point(616, 28); + this.btnSendToUpload.Name = "btnSendToUpload"; + this.btnSendToUpload.Size = new System.Drawing.Size(193, 23); + this.btnSendToUpload.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnSendToUpload.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSendToUpload.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSendToUpload.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnSendToUpload.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnSendToUpload.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnSendToUpload.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnSendToUpload.Style.GradientAngle = 90; + this.btnSendToUpload.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnSendToUpload.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnSendToUpload.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnSendToUpload.TabIndex = 435; + this.btnSendToUpload.Text = "提交机会商品到上传"; + this.btnSendToUpload.Click += new System.EventHandler(this.btnSendToUpload_Click); + // // numMinPrice // this.numMinPrice.DecimalPlaces = 2; @@ -415,6 +464,17 @@ this.btnSaveSourceGoodsData.Text = "暂存商品图片"; this.btnSaveSourceGoodsData.Click += new System.EventHandler(this.btnSaveSourceGoodsData_Click); // + // label4 + // + this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(723, 6); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(56, 17); + this.label4.TabIndex = 479; + this.label4.Text = "提交份数"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // // btnLoginAgain // this.btnLoginAgain.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -584,6 +644,47 @@ this.txtAddress.TabIndex = 7; this.txtAddress.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtAddress_KeyDown); // + // label5 + // + this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(613, 6); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(56, 17); + this.label5.TabIndex = 491; + this.label5.Text = "提交价格"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtSendPrice + // + this.txtSendPrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.txtSendPrice.Location = new System.Drawing.Point(668, 3); + this.txtSendPrice.Name = "txtSendPrice"; + this.txtSendPrice.Size = new System.Drawing.Size(31, 23); + this.txtSendPrice.TabIndex = 492; + this.txtSendPrice.Text = "20"; + // + // label6 + // + this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(699, 6); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(20, 17); + this.label6.TabIndex = 493; + this.label6.Text = "元"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // pictureBox9 + // + this.pictureBox9.Location = new System.Drawing.Point(586, 27); + this.pictureBox9.Name = "pictureBox9"; + this.pictureBox9.Size = new System.Drawing.Size(24, 24); + this.pictureBox9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.pictureBox9.TabIndex = 494; + this.pictureBox9.TabStop = false; + this.pictureBox9.Tag = "11"; + // // PDDShopLoginForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -620,6 +721,7 @@ this.splitContainer2.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); this.splitContainer2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).EndInit(); this.ResumeLayout(false); } @@ -658,5 +760,12 @@ private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Label label3; private System.Windows.Forms.NumericUpDown numMinPrice; + private System.Windows.Forms.TextBox txtSendCount; + private DevComponents.DotNetBar.PanelEx btnSendToUpload; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox txtSendPrice; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.PictureBox pictureBox9; } } \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.cs b/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.cs index 708e72b..9910ec2 100644 --- a/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.cs +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.cs @@ -25,6 +25,7 @@ using System.Windows.Forms; using Work; using Work.BLL.Tools; using TemuKJD.BLL; +using AllBase.Model.Result.PDDResult; namespace TemuKJD.PDDForms.ShopForms { @@ -38,11 +39,16 @@ namespace TemuKJD.PDDForms.ShopForms { public static PDDShopLoginForm shopLoginInstance { get; set; } = null; public ProductSelectForms.PDDDBProdUserSelectForm prodUserSelectForm { get; set; } = null; - public static string pddUploadGoodsData = ""; + + public string pddUploadGoodsData = ""; //public static AllBase.Model.Param.PDDProdParam.PDDProductUploadParam prodParam = null; - public static string pddSourceGoodsData = ""; - public static string pddSourceGoodsDataTemp = ""; + public string pddSourceGoodsDetail = ""; //public static AllBase.Model.Result.PDDResult.PDDProductDetailInfo prodInfo = null; + public string pddSourceGoodsDetailTemp = ""; + public string pddSourceGoodsDecorationTemp = ""; + public string pddSourceGoodsChanceId = ""; + public string pddGetChanceGoodsRefere = ""; + public string pddEditChanceGoodsRefereChanceTab = ""; public int CloseAfterSecond { get; set; } public EnumOpenType openType = EnumOpenType.manage; @@ -76,7 +82,11 @@ namespace TemuKJD.PDDForms.ShopForms { this.splitContainer1.SplitterDistance = this.splitContainer1.Height - 62; this.pnlUploadOpBtns.Visible = this.prodUserSelectForm != null; - pddSourceGoodsDataTemp = ""; + pddSourceGoodsDetailTemp = ""; + pddSourceGoodsDecorationTemp = ""; // 详情装修 + pddSourceGoodsChanceId = ""; + pddGetChanceGoodsRefere = ""; + pddEditChanceGoodsRefereChanceTab = ""; if (isMultiLogin && shop != null) { @@ -581,6 +591,7 @@ namespace TemuKJD.PDDForms.ShopForms private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request) { var antiContent = request.Headers.AllKeys.Contains("Anti-Content") ? request.Headers["Anti-Content"] : ""; + var refere = request.ReferrerUrl; if (shop != null && !url.StartsWith("https://mms.pinduoduo.com/janus/api/userinfo") && !string.IsNullOrEmpty(antiContent) && request.Method == "POST") { Task.Run(() => @@ -649,24 +660,50 @@ namespace TemuKJD.PDDForms.ShopForms catch (Exception ex) { pddUploadGoodsData = ""; - //prodParam = null; } } + if (prodUserSelectForm != null && url.StartsWith("https://mms.pinduoduo.com/opportunity-goods/chance-goods/quick_release")) + { + var data = postData; + Task.Run(() => + { + pddSourceGoodsChanceId = BaseRegex.GetStringJson(ref postData, "chance_id"); + pddGetChanceGoodsRefere = refere; + }); + } if (prodUserSelectForm != null && url.StartsWith("https://mms.pinduoduo.com/glide/v2/mms/query/commit/detail")) { Task.Run(() => { - pddSourceGoodsDataTemp = responseData; + pddSourceGoodsDetailTemp = responseData; try { - JObject jObj = JObject.Parse(pddSourceGoodsDataTemp); + JObject jObj = JObject.Parse(pddSourceGoodsDetailTemp); var prodInfoStr = JsonHelper.SerializeObject(jObj["result"]); var prodInfo = JsonHelper.DeserializeJsonToObject(prodInfoStr); + pddEditChanceGoodsRefereChanceTab = BaseRegex.GetStringQuery(ref refere, "chance_tab"); } catch (Exception ex) { - pddSourceGoodsDataTemp = ""; - //prodInfo = null; + pddSourceGoodsDetailTemp = ""; + pddEditChanceGoodsRefereChanceTab = ""; + } + }); + } + if (prodUserSelectForm != null && url.StartsWith("https://mms.pinduoduo.com/gorse/mms/goods/decoration/commit/query/V2")) + { + Task.Run(() => + { + pddSourceGoodsDecorationTemp = responseData; + try + { + JObject jObj = JObject.Parse(pddSourceGoodsDecorationTemp); + var prodDecorationTStr = JsonHelper.SerializeObject(jObj["result"]); + var prodDecoration = JsonHelper.DeserializeJsonToObject(prodDecorationTStr); + } + catch (Exception ex) + { + pddSourceGoodsDecorationTemp = ""; } }); } @@ -1116,16 +1153,16 @@ function getElementWithText(sText) private void btnSaveSourceGoodsData_Click(object sender, EventArgs e) { - if (string.IsNullOrEmpty(pddSourceGoodsDataTemp)) + if (string.IsNullOrEmpty(pddSourceGoodsDetailTemp)) { BaseMsgForm.ShowError("未捕获到商品详情!"); return; } - pddSourceGoodsData = pddSourceGoodsDataTemp; + pddSourceGoodsDetail = pddSourceGoodsDetailTemp; try { - JObject jObj = JObject.Parse(pddSourceGoodsData); + JObject jObj = JObject.Parse(pddSourceGoodsDetail); var prodInfoStr = JsonHelper.SerializeObject(jObj["result"]); var prodInfo = JsonHelper.DeserializeJsonToObject(prodInfoStr); @@ -1168,7 +1205,7 @@ function getElementWithText(sText) BaseMsgForm.ShowError("不是从上传界面进入!"); return; } - if (string.IsNullOrEmpty(pddSourceGoodsData)) + if (string.IsNullOrEmpty(pddSourceGoodsDetail)) { BaseMsgForm.ShowError("未捕获到商品详情!"); return; @@ -1180,7 +1217,7 @@ function getElementWithText(sText) } try { - JObject jObj = JObject.Parse(pddSourceGoodsData); + JObject jObj = JObject.Parse(pddSourceGoodsDetail); var prodInfoStr = JsonHelper.SerializeObject(jObj["result"]); prodInfo = JsonHelper.DeserializeJsonToObject(prodInfoStr); prodParam = JsonHelper.DeserializeJsonToObject(pddUploadGoodsData); @@ -1260,7 +1297,7 @@ function getElementWithText(sText) BaseMsgForm.ShowError("不是从上传界面进入!"); return; } - if (string.IsNullOrEmpty(pddSourceGoodsData)) + if (string.IsNullOrEmpty(pddSourceGoodsDetail)) { BaseMsgForm.ShowError("未捕获到商品详情!"); return; @@ -1272,7 +1309,7 @@ function getElementWithText(sText) } try { - JObject jObj = JObject.Parse(pddSourceGoodsData); + JObject jObj = JObject.Parse(pddSourceGoodsDetail); var prodInfoStr = JsonHelper.SerializeObject(jObj["result"]); prodInfo = JsonHelper.DeserializeJsonToObject(prodInfoStr); prodParam = JsonHelper.DeserializeJsonToObject(pddUploadGoodsData); @@ -1333,5 +1370,109 @@ function getElementWithText(sText) { } + + private void btnSendToUpload_Click(object sender, EventArgs e) + { + if (prodUserSelectForm == null) + { + BaseMsgForm.ShowError("上传窗口不存在!"); + return; + } + + try + { + JObject jObj = JObject.Parse(pddSourceGoodsDetailTemp); + var prodInfoStr = JsonHelper.SerializeObject(jObj["result"]); + PDDProductDetailInfo detailInfo = JsonHelper.DeserializeJsonToObject(prodInfoStr); + + var skuPrice = (this.txtSendPrice.Text.ParseToDecimal() * 100).ParseToInt(); + foreach (var sku in detailInfo.sku) + { + sku.multi_price = skuPrice; + sku.price = sku.multi_price + 100; + } + if (detailInfo.market_price < (this.txtSendPrice.Text.ParseToDecimal() * 100).ParseToInt() + 1000) + { + detailInfo.market_price = skuPrice + 1000; + } + + jObj = JObject.Parse(pddSourceGoodsDecorationTemp); + var prodDecorationTStr = JsonHelper.SerializeObject(jObj["result"]); + PDDProductDecorationInfo decorationInfo = JsonHelper.DeserializeJsonToObject(prodDecorationTStr); + + string main_img = detailInfo.image_url; + if (string.IsNullOrEmpty(main_img)) + main_img = detailInfo.hd_thumb_url; + if (string.IsNullOrEmpty(main_img)) + main_img = detailInfo.thumb_url; + if (string.IsNullOrEmpty(main_img)) + main_img = (detailInfo.galleries?.FirstOrDefault()?.url).ParseToString().Replace("https://", "http://"); + + PDDProductInfo pddProdInfo = new PDDProductInfo() + { + chance_id = pddSourceGoodsChanceId, + chance_refere = pddGetChanceGoodsRefere, + chance_tab = pddEditChanceGoodsRefereChanceTab, + decoration = decorationInfo, + detail = detailInfo, + material1 = new PDDMaterialInfo(), + material3 = new PDDMaterialInfo(), + property = new PDDProductPropertyInfo(), + size = new PDDSizeSpecInfo(), + }; + pddProdInfo.property.goods_properties = new List(); + + KJDDBProduct dbProd = new KJDDBProduct() + { + add_time = DateTime.Now, + cat_id = detailInfo.cat_id.ParseToString(), + cat_name = detailInfo.cats?.LastOrDefault(c => !string.IsNullOrEmpty(c)).ParseToString(), + ext_code = "", + end_words = "", + fission_words = "", + from_shop_id = "机会商品", + group = "", + head_words = "", + id = -1, + isPddUpLoad = true, + main_cat_id = (detailInfo.cat_ids?.FirstOrDefault(c => c != null)).ParseToString(), + main_cat_name = (detailInfo.cats?.FirstOrDefault(c => !string.IsNullOrEmpty(c))).ParseToString(), + main_img = main_img, + mdy_time = DateTime.Now, + notes = "机会商品", + price_text = detailInfo.sku.Min(s => s.multi_price).ParseToInt() * 0.01m + "-" + detailInfo.sku.Max(s => s.multi_price).ParseToInt() * 0.01m, + product_json = JsonHelper.SerializeObject(pddProdInfo), + product_name = detailInfo.goods_name, + select_count = 0, + select_total_count = 0, + size_json = "", + skc_id = detailInfo.goods_id.ParseToString(), + sku_img_replace_url = "", + sku_img_replace_id = 0, + sku_img_replace_base64 = "", + spu_id = detailInfo.goods_id.ParseToString(), + }; + + for (int i = 0; i< txtSendCount.Text.ParseToInt(); i++) + { + var selectProd = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(dbProd)); + selectProd.out_product_Id = dbProd.id.ToString(); + selectProd.id = 1; + selectProd.kjdDbProduct = dbProd; + if (prodUserSelectForm.lstTemuDBProductSelect.Count > 0) + selectProd.id = prodUserSelectForm.lstTemuDBProductSelect.Max(p => p.id) + 1; + prodUserSelectForm.lstTemuDBProductSelect.Add(selectProd); + } + + Invoke(new Action(() => + { + prodUserSelectForm.lblWaitToUp.Text = "待上传商品 " + prodUserSelectForm.lstTemuDBProductSelect.Count + " 件"; + NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_db_prod_upload_list", prodUserSelectForm.lstTemuDBProductSelect); + })); + } + catch (Exception ex) + { + } + } } }