diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs index 9a6fbb4..ee9e0fb 100644 --- a/AllBase/BaseClass.cs +++ b/AllBase/BaseClass.cs @@ -27,7 +27,7 @@ namespace AllBase /// /// 版本ID /// - public static int VersionCount = 1128; + public static int VersionCount = 1136; public static string MainPath = "29wx"; //public static string MainPath = "29wx"; //public static string MainPath = "29pdd"; diff --git a/AllBase/Helper/GlobalConfig.cs b/AllBase/Helper/GlobalConfig.cs index 8150f9f..674a0ab 100644 --- a/AllBase/Helper/GlobalConfig.cs +++ b/AllBase/Helper/GlobalConfig.cs @@ -25,6 +25,19 @@ namespace AllBase.Helper /// 店铺列表 /// public static ConcurrentList ShopLoginList { get; set; } = new ConcurrentList(); + public static ConcurrentList ValidShopLoginList + { + get + { + var list = new ConcurrentList(); + list.AddRange(ShopLoginList.Where(s => !s.is_point_shop_expire)); + return list; + } + } + /// + /// 微信小店用户拼多多机会商品采集的拼多多店铺列表 + /// + public static ConcurrentList _29WxPddShopLoginList { get; set; } = new ConcurrentList(); /// /// 店铺默认地址 /// diff --git a/AllBase/Model/Param/WXParam/WXUploadProductParam.cs b/AllBase/Model/Param/WXParam/WXUploadProductParam.cs index 5475825..c9dd9e3 100644 --- a/AllBase/Model/Param/WXParam/WXUploadProductParam.cs +++ b/AllBase/Model/Param/WXParam/WXUploadProductParam.cs @@ -454,8 +454,8 @@ namespace AllBase.Model.Param.WXParam public int? payAfterUse { get; set; } = 0; // 1, 先用后付 public int? freightInsurance { get; set; } = 1; // 运费险 public int? fastRefund { get; set; } = 0; // 1 快速退款 - public int? damageGuarantee { get; set; } = 0; - public int? fakeOnePayFour { get; set; } = 0; + public int? damageGuarantee { get; set; } = 0; // 坏损包退 + public int? fakeOnePayFour { get; set; } = 0; // 假一赔四 public int? refundOrderTime { get; set; } = 0; public int? deliverAfterCheck { get; set; } = 0; public int? exchangeSupport { get; set; } = 1; diff --git a/AllBase/Model/Result/ShopLoginInfo.cs b/AllBase/Model/Result/ShopLoginInfo.cs index 1c34a38..c75fa88 100644 --- a/AllBase/Model/Result/ShopLoginInfo.cs +++ b/AllBase/Model/Result/ShopLoginInfo.cs @@ -205,6 +205,9 @@ namespace AllBase.Model.Result /// public int? expire_time { get; set; } + /// + /// 充值店铺点数过期 + /// public bool is_point_shop_expire { //get diff --git a/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs b/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs index 3e52019..a992407 100644 --- a/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs +++ b/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs @@ -595,6 +595,8 @@ namespace KJD_Web.BLL.BXX var add_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'"); var min_view_uv = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "min_view_uv"))?.ParseToNullableInt(); var is_not_count = RegexUtils.GetStringQuery(ref inputData, "is_not_count").ParseToBool(); // 不计数 + var no_fission_words = RegexUtils.GetStringQuery(ref inputData, "no_fission_words").ParseToBool(); // 未裂变标题 + var fission_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_words"))?.Replace("'", "\\'"); int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); @@ -764,7 +766,20 @@ namespace KJD_Web.BLL.BXX add_user_name = "'" + string.Join("','", add_user_name.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'"; where += " and p.add_user_name in (" + add_user_name + ")"; } + if (no_fission_words) + { + where += " and (fission_words='' or fission_words IS NULL)"; + } + if (!string.IsNullOrEmpty(fission_words)) + { + where += " and fission_words LIKE '" + fission_words + "%'"; + } sql += where; + + if (sql.Contains("15288888888")) + { + + } var count = 0; if (isDetail || is_not_count) @@ -811,6 +826,12 @@ namespace KJD_Web.BLL.BXX //where子句 sql += where; + if (sql.Contains("15288888888")) + { + + } + + if (!isDetail && !string.IsNullOrEmpty(get_select_count)) sql += " group by p.id"; if (sort_field == "select_total_count") @@ -1554,6 +1575,8 @@ namespace KJD_Web.BLL.BXX var ban_wx = RegexUtils.GetStringQuery(ref inputData, "ban_wx")?.Replace("'", "\\'"); var ban_pdd = RegexUtils.GetStringQuery(ref inputData, "ban_pdd")?.Replace("'", "\\'"); var add_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'"); + var no_fission_words = RegexUtils.GetStringQuery(ref inputData, "no_fission_words").ParseToBool(); // 未裂变标题 + var fission_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_words"))?.Replace("'", "\\'"); int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); @@ -1650,6 +1673,14 @@ namespace KJD_Web.BLL.BXX add_user_name = "'" + string.Join("','", add_user_name.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'"; where += " and p.add_user_name in (" + add_user_name + ")"; } + if (no_fission_words) + { + where += " and (fission_words='' or fission_words IS NULL)"; + } + if (!string.IsNullOrEmpty(fission_words)) + { + where += " and fission_words LIKE '" + fission_words + "%'"; + } sql += where; int count = prod_count; @@ -1691,7 +1722,7 @@ namespace KJD_Web.BLL.BXX var db_ids = string.Join(",", dt.Rows.Cast().Select(r => r["id"].ParseToInt()).OrderBy(x => RandomUtils.GetId(10000000)).Take(page_size)); sql = "SELECT p.id,p.from_shop_id,p.spu_id,p.skc_id,p.main_cat_id,p.main_cat_name,p.cat_id,p.cat_name,p.price_text,p.ext_code," + - " p.product_name,p.main_img,p.group,p.notes,p.add_time,p.mdy_time,p.product_get_type," + + " p.product_name,p.main_img,p.group,p.notes,p.add_time,p.mdy_time,p.product_get_type,fission_words," + " p.wx_safe_status,p.special_prod_type,p.wx_cat_1,p.wx_cat_2,p.wx_cat_3,p.send_to_out_server," + " p.wx_cat_leaf,p.is_relation" + " from bxx.product p where p.is_del=0"; @@ -1742,6 +1773,7 @@ namespace KJD_Web.BLL.BXX special_prod_type = row["special_prod_type"].ParseToString(), send_to_out_server = row["send_to_out_server"].ParseToInt(), is_relation = row["is_relation"].ParseToInt(), + fission_words = row["fission_words"].ParseToString(), }; productLst.Add(prod); } diff --git a/KJDService/KJD_WebService/BLL/WXXD/WXShopManage.cs b/KJDService/KJD_WebService/BLL/WXXD/WXShopManage.cs index 89c4bc9..0afc495 100644 --- a/KJDService/KJD_WebService/BLL/WXXD/WXShopManage.cs +++ b/KJDService/KJD_WebService/BLL/WXXD/WXShopManage.cs @@ -1289,7 +1289,358 @@ namespace KJD_Web.BLL.WXXD return "{\"code\":19999,\"msg\":\"输入为空\"}"; } + public string WXAddMdy29WxPddShop(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + if (isAdmin) + user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name"); + string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + string login_pass = RegexUtils.GetStringQuery(ref inputData, "login_pass"); + string sub_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_user_name")); + string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie"); + string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2"); + string anti_contents = RegexUtils.GetStringQuery(ref inputData, "anti_contents"); + string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + string mall_id = RegexUtils.GetStringQuery(ref inputData, "mall_id"); + string shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account"); + string group_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "group_name")); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")); + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + if (string.IsNullOrEmpty(login_name)) + { + return "{\"code\":501,\"msg\":\"没有店铺登录名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = ""; + if (string.IsNullOrEmpty(shop_id)) + sql = "select exists (select 1 from wxxd.pdd_shop where login_name='" + login_name + "' and user_name='" + user_name + "')"; + else + sql = "select exists (select 1 from wxxd.pdd_shop where login_name='" + login_name + "' and user_name='" + user_name + + "' and shop_id='" + shop_id + "')"; + var exist = mySql.ExecuteFirstInt(sql); + if (exist > 0) + { + mySql.Close(); + //return "{\"code\":500,\"msg\":\"店铺" + login_name + " " + shop_account + "已存在\"}"; + return WXMdy29WxPddShop(inputData); + } + + sql = "insert into wxxd.pdd_shop (login_name,login_pass,cookie,cookie2,anti_contents,shop_account,shop_id," + + "mall_id,sub_user_name,user_name,group_name,notes,add_time,mdy_time) " + + "values ('" + login_name + "','" + login_pass + "','" + cookie + "','" + cookie2 + "','" + anti_contents + "','" + shop_account + "','" + shop_id + + "','" + mall_id + "','" + sub_user_name + "','" + user_name + "','" + group_name + "','" + notes + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + public string WXMdy29WxPddShop(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + if (isAdmin) + user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name"); + string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + string login_pass = RegexUtils.GetStringQuery(ref inputData, "login_pass"); + string sub_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_user_name")); + //string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie"); + //string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2"); + string anti_contents = RegexUtils.GetStringQuery(ref inputData, "anti_contents"); + string new_shop_id = RegexUtils.GetStringQuery(ref inputData, "new_shop_id"); + string old_shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + string mall_id = RegexUtils.GetStringQuery(ref inputData, "mall_id"); + string shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account"); + string group_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "group_name")); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")); + string login_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status")); + + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + if (string.IsNullOrEmpty(login_name)) + { + return "{\"code\":501,\"msg\":\"没有店铺登录名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update wxxd.pdd_shop set"; + if (login_pass != null) + sql += " login_pass='" + login_pass + "',"; + //if (cookie != null) + // sql += " cookie='" + cookie + "',"; + //if (cookie2 != null) + // sql += " cookie2='" + cookie2 + "',"; + if (anti_contents != null) + sql += " anti_contents='" + anti_contents + "',"; + if (new_shop_id != null) + sql += " shop_id='" + new_shop_id + "',"; + if (mall_id != null) + sql += " mall_id='" + mall_id + "',"; + if (shop_account != null) + sql += " shop_account='" + shop_account + "',"; + if (sub_user_name != null) + sql += " sub_user_name='" + sub_user_name + "',"; + if (group_name != null) + sql += " group_name='" + group_name + "',"; + if (notes != null) + sql += " notes='" + notes + "',"; + if (login_status != null) + sql += " login_status='" + login_status + "',"; + sql = sql.TrimEnd(','); + sql += " where login_name='" + login_name + "' and (user_name='" + user_name + "' or sub_user_name like '%" + user_name + "%')"; + if (!string.IsNullOrEmpty(old_shop_id)) + sql += " and shop_id='" + old_shop_id + "'"; + + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + public string WXMdy29WxPddCookieAndLoginStatus(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie"); + string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2"); + string login_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status")); + string login_status2 = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status2")); + string pddid = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "pddid")); + + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + if (string.IsNullOrWhiteSpace(login_name)) + { + return "{\"code\":500,\"msg\":\"店铺没有登录名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update wxxd.pdd_shop set"; + if (cookie != null) + sql += " cookie='" + cookie + "',"; + if (cookie2 != null) + sql += " cookie2='" + cookie2 + "',"; + if (login_status != null) + sql += " login_status='" + login_status + "',"; + if (login_status2 != null) + sql += " login_status2='" + login_status2 + "',"; + if (pddid != null) + sql += " pddid='" + pddid + "',"; + sql = sql.TrimEnd(','); + sql += " where login_name='" + login_name + "'"; + + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + public string WXDel29WxPddShop(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + if (isAdmin) + user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + if (string.IsNullOrEmpty(login_name)) + { + return "{\"code\":501,\"msg\":\"没有店铺登录名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from wxxd.pdd_shop where user_name='" + user_name + "' and login_name='" + login_name + "'"; + if (!string.IsNullOrEmpty(shop_id)) + sql += " and shop_id='" + shop_id + "'"; + + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + public string WXGet29WxPddShop(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + var search_id = RegexUtils.GetStringQuery(ref inputData, "search_id"); + var search_user_name = RegexUtils.GetStringQuery(ref inputData, "search_user_name"); + var search_login_name = RegexUtils.GetStringQuery(ref inputData, "search_login_name"); + var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes"); + var search_name = RegexUtils.GetStringQuery(ref inputData, "search_name"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + + // 特殊处理一下修复客户端店铺导入没有立即登录导致的cookie串的bug + //var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", ""); + var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids"); + if (shop_ids == "''") + shop_ids = "999999999999999"; + shop_ids = shop_ids?.Replace("'", ""); + if (!string.IsNullOrWhiteSpace(shop_ids)) + { + List shopIdLst = shop_ids.Split(',').ToList(); + shop_ids = "'" + string.Join("','", shopIdLst) + "'"; + } + var shop_names = RegexUtils.GetStringQuery(ref inputData, "shop_names"); + if (!string.IsNullOrWhiteSpace(shop_names)) + { + List shopNameLst = shop_names.Split(',').ToList(); + shop_names = "'" + string.Join("','", shopNameLst) + "'"; + } + var shop_notes = RegexUtils.GetStringQuery(ref inputData, "shop_notes"); + if (!string.IsNullOrWhiteSpace(shop_notes)) + { + List shopNotesLst = shop_notes.Split(',').ToList(); + shop_notes = "'" + string.Join("','", shopNotesLst) + "'"; + } + + var page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + var page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(); + + if (page_size == 0) + page_size = 50; + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "SELECT COUNT(s.id) FROM wxxd.pdd_shop s WHERE 1=1"; + + //where子句 + string where = ""; + if (isAdmin) + where += " and (s.cookie='' or s.shop_id!='')"; + if (!isAdmin) + where += " and (s.user_name='" + user_name + "' or s.sub_user_name like '%" + user_name + "%')"; + if (!string.IsNullOrWhiteSpace(operate_sub_sa_name)) + where += " and s.operate_sub_sa_name='" + operate_sub_sa_name + "'"; + if (!string.IsNullOrWhiteSpace(search_user_name)) + where += " and s.user_name like '%" + search_user_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_login_name)) + where += " and s.login_name like '%" + search_login_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_notes)) + where += " and s.notes like '%" + search_notes + "%'"; + if (!string.IsNullOrWhiteSpace(search_id)) + where += " and s.shop_id like '%" + search_id + "%'"; + if (!string.IsNullOrWhiteSpace(search_name)) + where += " and s.shop_account like '%" + search_name + "%'"; + if (!string.IsNullOrWhiteSpace(shop_ids)) + where += " and s.shop_id in (" + shop_ids + ")"; + if (!string.IsNullOrWhiteSpace(shop_names)) + where += " and s.shop_account in (" + shop_names + ")"; + if (!string.IsNullOrWhiteSpace(shop_notes)) + where += " and s.notes in (" + shop_notes + ")"; + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.anti_contents,s.pddid,s.mall_id,s.shop_id,s.shop_account,s.sub_user_name," + + "s.user_name,s.company_name,s.notes,s.login_status,s.login_status2," + + "s.add_time,s.mdy_time,s.add_sub_sa_time,s.operate_sub_sa_name"; + //sql += " FROM bxx.shop s WHERE 1=1"; + sql += " FROM wxxd.pdd_shop s WHERE 1=1"; + + sql += where; // where 子句 + + sql += " ORDER BY s.id DESC"; + sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + if (dt != null) + { + List shopList = new List(); + foreach (DataRow row in dt.Rows) + { + ShopParam shop = new ShopParam + { + id = Convert.ToInt32(row["id"]), + login_name = row["login_name"].ToString(), + login_pass = row["login_pass"].ToString(), + cookie = row["cookie"].ToString(), + cookie2 = row["cookie2"].ToString(), + anti_contents = row["anti_contents"].ToString(), + shop_id = row["shop_id"].ToString(), + shop_account = row["shop_account"].ToString(), + sub_user_name = row["sub_user_name"].ToString(), + user_name = row["user_name"].ToString(), + company_name = row["company_name"].ToString(), + notes = row["notes"].ToString(), + login_status = row["login_status"].ToString(), + login_status2 = row["login_status2"].ToString(), + operate_sub_sa_name = row["operate_sub_sa_name"].ParseToString(), + pddid = row["pddid"].ParseToString(), + mall_id = row["mall_id"].ParseToString(), + }; + shopList.Add(shop); + } + + var data = JsonUtils.SerializeObjectToString(shopList); + //return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } public string E57GetWxTokens(string inputData) { diff --git a/KJDService/KJD_WebService/WXShopService.asmx.cs b/KJDService/KJD_WebService/WXShopService.asmx.cs index ccef485..d9db445 100644 --- a/KJDService/KJD_WebService/WXShopService.asmx.cs +++ b/KJDService/KJD_WebService/WXShopService.asmx.cs @@ -422,6 +422,51 @@ namespace KJD_Web Context.Response.End(); } + [WebMethod] + public void wx_add_mdy_29wx_pdd_shop() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new WXShopManage().WXAddMdy29WxPddShop(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + [WebMethod] + public void wx_mdy_29wx_pdd_cookie_and_login_status() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new WXShopManage().WXMdy29WxPddCookieAndLoginStatus(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + [WebMethod] + public void wx_del_29wx_pdd_shop() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new WXShopManage().WXDel29WxPddShop(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + [WebMethod] + public void wx_get_29wx_pdd_shop() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new WXShopManage().WXGet29WxPddShop(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + [WebMethod] public void e57_get_wx_tokens() { diff --git a/TEMUKJD/BLL/WXHttpResponseBLL.cs b/TEMUKJD/BLL/WXHttpResponseBLL.cs index fc784cd..5be6bed 100644 --- a/TEMUKJD/BLL/WXHttpResponseBLL.cs +++ b/TEMUKJD/BLL/WXHttpResponseBLL.cs @@ -413,6 +413,62 @@ namespace TemuKJD.BLL return result; } + public static string kdniaoPostResponse(string _url, string _data, string referer, string kdnAuth = null) + { + HttpWebResponse response = null; + string result; + try + { + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(_url); + + request.KeepAlive = true; + request.Headers.Add("sec-ch-ua-platform", @"""Windows"""); + //request.Headers.Add("kdnAuth", @"62993d99a28947aaadd6b79427929562"); + request.Headers.Add("kdnAuth", @"kdnAuth"); + request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"; + request.Accept = "application/json, text/javascript, */*; q=0.01"; + request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138"""); + request.ContentType = "application/x-www-form-urlencoded"; + request.Headers.Add("sec-ch-ua-mobile", @"?0"); + request.Headers.Add("Origin", @"https://56.kdniao.com"); + request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9"); + request.Headers.Add("Sec-Fetch-Site", @"same-site"); + request.Headers.Add("Sec-Fetch-Mode", @"cors"); + request.Headers.Add("Sec-Fetch-Dest", @"empty"); + request.Referer = referer; + request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate"); + + request.Method = "POST"; + request.ServicePoint.Expect100Continue = false; + + string body = _data; + byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body); + request.ContentLength = postBytes.Length; + Stream stream = request.GetRequestStream(); + stream.Write(postBytes, 0, postBytes.Length); + stream.Close(); + + response = (HttpWebResponse)request.GetResponse(); + } + catch (WebException ex) + { + if (ex.Status == WebExceptionStatus.ProtocolError) + { + response = (HttpWebResponse)ex.Response; + result = GetProxyHtml.ReadResponse(response); + return result; + } + else return ex.Message; + } + catch (Exception e) + { + if (response != null) response.Close(); + return e.Message; + } + result = GetProxyHtml.ReadResponse(response); + return result; + } + public static string e57PostResponse(string _url, string _data, string referer, string Authorization = null) { if (string.IsNullOrEmpty(Authorization)) diff --git a/TEMUKJD/Helper/CustomResourceRequestHandlerLocal.cs b/TEMUKJD/Helper/CustomResourceRequestHandlerLocal.cs index 6987584..d1eade0 100644 --- a/TEMUKJD/Helper/CustomResourceRequestHandlerLocal.cs +++ b/TEMUKJD/Helper/CustomResourceRequestHandlerLocal.cs @@ -26,7 +26,7 @@ namespace TemuKJD.Helper public Func BeforeResourceLoadEvent; // sender, requestUrl, postData, true(表示取消执行) public Action ResourceLoadCompleteEvent; // sender, requestUrl, postData, responseData public Action ResourceRedirectEvent; // sender, requestUrl, postData, redirectUrl - public string[] ResourceContentTypeRegister = new string[] { "application/json", "javascript", "application/x-www-form-urlencoded", "text/html", "text/plain" }; + public string[] ResourceContentTypeRegister = new string[] { "application/json", "javascript", "application/x-www-form-urlencoded", "text/html", "text/plain", "text/event-stream" }; public string GetCharSet(string charSet) { diff --git a/TEMUKJD/KJD.csproj b/TEMUKJD/KJD.csproj index 05f3379..5f028ae 100644 --- a/TEMUKJD/KJD.csproj +++ b/TEMUKJD/KJD.csproj @@ -957,12 +957,6 @@ PDDDBProdUserSelectCacheForm.cs - - Form - - - PDDDBProdUserSelectEditNotesForm.cs - Form @@ -1726,9 +1720,6 @@ PDDDBProdUserSelectCacheForm.cs - - PDDDBProdUserSelectEditNotesForm.cs - PDDDBProdUserSelectForm.cs diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.Designer.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.Designer.cs index 3537dd6..9884b5d 100644 --- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.Designer.cs +++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.Designer.cs @@ -79,6 +79,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.btnPushToOutServer = new DevComponents.DotNetBar.PanelEx(); this.btnGetProdWxCate = new DevComponents.DotNetBar.PanelEx(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.cmbHasFission = new System.Windows.Forms.ComboBox(); + this.label20 = new System.Windows.Forms.Label(); this.txtViewUvMin = new System.Windows.Forms.TextBox(); this.chkViewUvMin = new TemuKJD.UserComponent.UcCheckBox(this.components); this.cmbPddRelation = new System.Windows.Forms.ComboBox(); @@ -137,6 +139,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.pbLoading = new System.Windows.Forms.PictureBox(); this.btnSelect = new DevComponents.DotNetBar.PanelEx(); this.dgvDbProduct = new TemuKJD.UserComponent.DataGridViewEx(); + this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage(); + this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.col_db_id = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colFromShopId = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -172,8 +176,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.col_edit = new System.Windows.Forms.DataGridViewLinkColumn(); this.col_delete = new System.Windows.Forms.DataGridViewLinkColumn(); this.col_select_product = new System.Windows.Forms.DataGridViewLinkColumn(); - this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage(); - this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -773,6 +775,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 12.50328F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel1.Controls.Add(this.cmbHasFission, 15, 1); + this.tableLayoutPanel1.Controls.Add(this.label20, 14, 1); this.tableLayoutPanel1.Controls.Add(this.txtViewUvMin, 13, 1); this.tableLayoutPanel1.Controls.Add(this.chkViewUvMin, 12, 1); this.tableLayoutPanel1.Controls.Add(this.cmbPddRelation, 13, 0); @@ -816,7 +820,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.tableLayoutPanel1.Controls.Add(this.btnSearch, 16, 0); this.tableLayoutPanel1.Controls.Add(this.label11, 14, 0); this.tableLayoutPanel1.Controls.Add(this.cmbSpProdType, 15, 0); - this.tableLayoutPanel1.Controls.Add(this.chkWXComplateProd, 14, 1); + this.tableLayoutPanel1.Controls.Add(this.chkWXComplateProd, 13, 2); this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 4); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 3; @@ -827,6 +831,31 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.tableLayoutPanel1.Size = new System.Drawing.Size(900, 105); this.tableLayoutPanel1.TabIndex = 679; // + // cmbHasFission + // + this.cmbHasFission.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.cmbHasFission.FormattingEnabled = true; + this.cmbHasFission.Items.AddRange(new object[] { + "", + "是", + "否"}); + this.cmbHasFission.Location = new System.Drawing.Point(805, 42); + this.cmbHasFission.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); + this.cmbHasFission.Name = "cmbHasFission"; + this.cmbHasFission.Size = new System.Drawing.Size(38, 25); + this.cmbHasFission.TabIndex = 981; + // + // label20 + // + this.label20.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.label20.AutoSize = true; + this.label20.Location = new System.Drawing.Point(737, 44); + this.label20.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(68, 17); + this.label20.TabIndex = 805; + this.label20.Text = "裂变标题:"; + // // txtViewUvMin // this.txtViewUvMin.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); @@ -1348,7 +1377,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms // this.chkWXComplateProd.Anchor = System.Windows.Forms.AnchorStyles.Left; this.tableLayoutPanel1.SetColumnSpan(this.chkWXComplateProd, 2); - this.chkWXComplateProd.Location = new System.Drawing.Point(740, 42); + this.chkWXComplateProd.Location = new System.Drawing.Point(699, 77); this.chkWXComplateProd.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3); this.chkWXComplateProd.Name = "chkWXComplateProd"; this.chkWXComplateProd.Size = new System.Drawing.Size(87, 21); @@ -1645,6 +1674,31 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.dgvDbProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellContentClick); this.dgvDbProduct.Scroll += new System.Windows.Forms.ScrollEventHandler(this.dgvDbProduct_Scroll); // + // ucSplitPage1 + // + this.ucSplitPage1.CurrentPage = 1; + this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right; + this.ucSplitPage1.IsShowPageSize = true; + this.ucSplitPage1.Location = new System.Drawing.Point(985, 0); + this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0); + this.ucSplitPage1.Name = "ucSplitPage1"; + this.ucSplitPage1.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0); + this.ucSplitPage1.PageSize = 100; + this.ucSplitPage1.Size = new System.Drawing.Size(453, 25); + this.ucSplitPage1.TabIndex = 6; + this.ucSplitPage1.TotalPage = 1; + // + // statusBar + // + this.statusBar.BackColor = System.Drawing.Color.White; + this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill; + this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.statusBar.Location = new System.Drawing.Point(0, 0); + this.statusBar.Margin = new System.Windows.Forms.Padding(0); + this.statusBar.Name = "statusBar"; + this.statusBar.Size = new System.Drawing.Size(1438, 25); + this.statusBar.TabIndex = 5; + // // colSelect // this.colSelect.FillWeight = 26F; @@ -1862,10 +1916,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms // dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.colFissionWords.DefaultCellStyle = dataGridViewCellStyle14; - this.colFissionWords.HeaderText = "裂变词"; + this.colFissionWords.HeaderText = "裂变标题"; this.colFissionWords.Name = "colFissionWords"; this.colFissionWords.ReadOnly = true; - this.colFissionWords.Visible = false; // // colGetType // @@ -1933,31 +1986,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.col_select_product.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.col_select_product.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; // - // ucSplitPage1 - // - this.ucSplitPage1.CurrentPage = 1; - this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right; - this.ucSplitPage1.IsShowPageSize = true; - this.ucSplitPage1.Location = new System.Drawing.Point(985, 0); - this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0); - this.ucSplitPage1.Name = "ucSplitPage1"; - this.ucSplitPage1.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0); - this.ucSplitPage1.PageSize = 100; - this.ucSplitPage1.Size = new System.Drawing.Size(453, 25); - this.ucSplitPage1.TabIndex = 6; - this.ucSplitPage1.TotalPage = 1; - // - // statusBar - // - this.statusBar.BackColor = System.Drawing.Color.White; - this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill; - this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.statusBar.Location = new System.Drawing.Point(0, 0); - this.statusBar.Margin = new System.Windows.Forms.Padding(0); - this.statusBar.Name = "statusBar"; - this.statusBar.Size = new System.Drawing.Size(1438, 25); - this.statusBar.TabIndex = 5; - // // PDDDBProdListForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -2092,6 +2120,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms private System.Windows.Forms.ComboBox cmbPddRelation; private System.Windows.Forms.Label label19; private DevComponents.DotNetBar.PanelEx btnExportIdImg; + private System.Windows.Forms.TextBox txtViewUvMin; + private UserComponent.UcCheckBox chkViewUvMin; + private DevComponents.DotNetBar.PanelEx btnTitleFission; + private System.Windows.Forms.ComboBox cmbHasFission; + private System.Windows.Forms.Label label20; private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect; private System.Windows.Forms.DataGridViewTextBoxColumn col_db_id; private System.Windows.Forms.DataGridViewTextBoxColumn colFromShopId; @@ -2127,8 +2160,5 @@ namespace TemuKJD.PDDForms.ProductSelectForms private System.Windows.Forms.DataGridViewLinkColumn col_edit; private System.Windows.Forms.DataGridViewLinkColumn col_delete; private System.Windows.Forms.DataGridViewLinkColumn col_select_product; - private System.Windows.Forms.TextBox txtViewUvMin; - private UserComponent.UcCheckBox chkViewUvMin; - private DevComponents.DotNetBar.PanelEx btnTitleFission; } } \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.cs index 571c191..ffd1b63 100644 --- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.cs +++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.cs @@ -241,7 +241,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms prod.notes, prod.head_words, prod.end_words, - prod.fission_words, + prod.fission_words.Replace("fission_goods_names:", ""), (prod.product_get_type_text == "厂商直采" ? (prod.product_get_type_text + " " + prod.skc_id).Trim() : prod.product_get_type_text)?.Replace("1688外部数据", "已采集数据"), prod.special_prod_type == "爆款数据" ? "爆款数据" : "普通商品", prod.wx_safe_status, @@ -394,6 +394,15 @@ namespace TemuKJD.PDDForms.ProductSelectForms data += "&has_wx_cat=" + (cmbWxCat.Text.Trim() == "是").ParseToString().ToLower(); } + if (cmbHasFission.Text == "是") + { + data += "&fission_words=fission_goods_names:"; + } + else if (cmbHasFission.Text == "否") + { + data += "&no_fission_words=true"; + } + if (!string.IsNullOrEmpty(cmbExportToOutServer.Text)) { //data += "&has_send_to_out_server=" + (cmbExportToOutServer.Text.Trim() == "是").ParseToString().ToLower(); @@ -606,7 +615,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms dgvDbProduct.Rows[e.RowIndex].Cells["col_ext_code"].Value = dbProduct.ext_code; dgvDbProduct.Rows[e.RowIndex].Cells["colHeadWords"].Value = dbProduct.head_words; dgvDbProduct.Rows[e.RowIndex].Cells["colEndWords"].Value = dbProduct.end_words; - dgvDbProduct.Rows[e.RowIndex].Cells["colFissionWords"].Value = dbProduct.fission_words; + dgvDbProduct.Rows[e.RowIndex].Cells["colFissionWords"].Value = dbProduct.fission_words.Replace("fission_goods_names:", ""); dgvDbProduct.Rows[e.RowIndex].Cells["col_product_name"].Value = dbProduct.product_name; dgvDbProduct.Rows[e.RowIndex].Cells["colSkuReplaceImgUrl"].Value = dbProduct.sku_img_replace_url; break; diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectEditNotesForm.Designer.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectEditNotesForm.Designer.cs deleted file mode 100644 index 8536cfa..0000000 --- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectEditNotesForm.Designer.cs +++ /dev/null @@ -1,248 +0,0 @@ -namespace TemuKJD.PDDForms.ProductSelectForms -{ - partial class PDDDBProdUserSelectEditNotesForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDDDBProdUserSelectEditNotesForm)); - this.panel2 = new System.Windows.Forms.Panel(); - this.cmbUserNotes = new System.Windows.Forms.ComboBox(); - this.lblTextCount = new System.Windows.Forms.Label(); - this.txtSkc = new System.Windows.Forms.TextBox(); - this.txtSpu = new System.Windows.Forms.TextBox(); - this.txtProdName = new System.Windows.Forms.TextBox(); - this.txtShopName = new System.Windows.Forms.TextBox(); - this.label4 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.label8 = new System.Windows.Forms.Label(); - this.btnOk = new TemuKJD.UserControls.ButtonEx(); - this.panel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.SuspendLayout(); - // - // panel2 - // - this.panel2.BackColor = System.Drawing.Color.White; - this.panel2.Controls.Add(this.cmbUserNotes); - this.panel2.Controls.Add(this.lblTextCount); - this.panel2.Controls.Add(this.txtSkc); - this.panel2.Controls.Add(this.txtSpu); - this.panel2.Controls.Add(this.txtProdName); - this.panel2.Controls.Add(this.txtShopName); - this.panel2.Controls.Add(this.label4); - this.panel2.Controls.Add(this.label3); - this.panel2.Controls.Add(this.label2); - this.panel2.Controls.Add(this.label1); - this.panel2.Controls.Add(this.pictureBox1); - this.panel2.Controls.Add(this.label8); - this.panel2.Controls.Add(this.btnOk); - this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel2.Location = new System.Drawing.Point(1, 33); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(391, 546); - this.panel2.TabIndex = 1; - // - // cmbUserNotes - // - this.cmbUserNotes.FormattingEnabled = true; - this.cmbUserNotes.Items.AddRange(new object[] { - "", - "已买", - "重上"}); - this.cmbUserNotes.Location = new System.Drawing.Point(90, 431); - this.cmbUserNotes.Name = "cmbUserNotes"; - this.cmbUserNotes.Size = new System.Drawing.Size(265, 25); - this.cmbUserNotes.TabIndex = 400; - this.cmbUserNotes.Text = "已买"; - // - // lblTextCount - // - this.lblTextCount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.lblTextCount.Location = new System.Drawing.Point(247, 160); - this.lblTextCount.Name = "lblTextCount"; - this.lblTextCount.Size = new System.Drawing.Size(106, 17); - this.lblTextCount.TabIndex = 399; - this.lblTextCount.Text = "label5"; - this.lblTextCount.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.lblTextCount.Visible = false; - // - // txtSkc - // - this.txtSkc.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtSkc.Location = new System.Drawing.Point(90, 365); - this.txtSkc.Name = "txtSkc"; - this.txtSkc.ReadOnly = true; - this.txtSkc.Size = new System.Drawing.Size(265, 23); - this.txtSkc.TabIndex = 398; - // - // txtSpu - // - this.txtSpu.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtSpu.Location = new System.Drawing.Point(90, 332); - this.txtSpu.Name = "txtSpu"; - this.txtSpu.ReadOnly = true; - this.txtSpu.Size = new System.Drawing.Size(265, 23); - this.txtSpu.TabIndex = 397; - // - // txtProdName - // - this.txtProdName.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtProdName.Location = new System.Drawing.Point(90, 180); - this.txtProdName.Multiline = true; - this.txtProdName.Name = "txtProdName"; - this.txtProdName.ReadOnly = true; - this.txtProdName.Size = new System.Drawing.Size(265, 142); - this.txtProdName.TabIndex = 396; - this.txtProdName.TextChanged += new System.EventHandler(this.txtProdName_TextChanged); - // - // txtShopName - // - this.txtShopName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtShopName.Location = new System.Drawing.Point(90, 398); - this.txtShopName.Name = "txtShopName"; - this.txtShopName.ReadOnly = true; - this.txtShopName.Size = new System.Drawing.Size(265, 23); - this.txtShopName.TabIndex = 395; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(27, 401); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(56, 17); - this.label4.TabIndex = 394; - this.label4.Text = "上传店铺"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(27, 183); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(56, 17); - this.label3.TabIndex = 392; - this.label3.Text = "商品标题"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(27, 368); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(56, 17); - this.label2.TabIndex = 391; - this.label2.Text = " SKC ID"; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(27, 335); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(56, 17); - this.label1.TabIndex = 390; - this.label1.Text = " SPU ID"; - // - // pictureBox1 - // - this.pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.pictureBox1.Location = new System.Drawing.Point(128, 22); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(136, 136); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pictureBox1.TabIndex = 389; - this.pictureBox1.TabStop = false; - this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click); - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(28, 434); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(61, 17); - this.label8.TabIndex = 386; - this.label8.Text = "重上/已买"; - // - // btnOk - // - this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnOk.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - this.btnOk.Cursor = System.Windows.Forms.Cursors.Hand; - this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnOk.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnOk.ForeColor = System.Drawing.Color.White; - this.btnOk.Location = new System.Drawing.Point(300, 483); - this.btnOk.Margin = new System.Windows.Forms.Padding(2); - this.btnOk.Name = "btnOk"; - this.btnOk.Size = new System.Drawing.Size(55, 26); - this.btnOk.TabIndex = 372; - this.btnOk.Text = "提交"; - this.btnOk.UseVisualStyleBackColor = false; - this.btnOk.Click += new System.EventHandler(this.btnOk_Click); - // - // PDDDBProdUserSelectEditNotesForm - // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.ClientSize = new System.Drawing.Size(393, 580); - this.Controls.Add(this.panel2); - this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "PDDDBProdUserSelectEditNotesForm"; - this.Text = "编辑上传备注"; - this.TitleText = "编辑上传备注"; - this.Load += new System.EventHandler(this.ProductSelectListForm_Load); - this.Controls.SetChildIndex(this.panel2, 0); - this.panel2.ResumeLayout(false); - this.panel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Panel panel2; - private UserControls.ButtonEx btnOk; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TextBox txtSkc; - private System.Windows.Forms.TextBox txtSpu; - private System.Windows.Forms.TextBox txtProdName; - private System.Windows.Forms.TextBox txtShopName; - private System.Windows.Forms.Label lblTextCount; - private System.Windows.Forms.Label label8; - private System.Windows.Forms.ComboBox cmbUserNotes; - } -} \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectEditNotesForm.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectEditNotesForm.cs deleted file mode 100644 index 0711281..0000000 --- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectEditNotesForm.cs +++ /dev/null @@ -1,113 +0,0 @@ -using AllBase.Helper; -using AllBase.Model.Result; -using TemuKJD.BaseForms; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using AllBase; -using Work; -using TemuKJD.BLL; -using TemuKJD.ToolForms; - -namespace TemuKJD.PDDForms.ProductSelectForms -{ - public partial class PDDDBProdUserSelectEditNotesForm : BaseGeneralForm - { - TemuDBProductSelect dbProdSelect = null; - SetProductSelectType selectNotesType; - - public PDDDBProdUserSelectEditNotesForm(TemuDBProductSelect prod, SetProductSelectType notesType= SetProductSelectType.DbProduct) - { - InitializeComponent(); - - dbProdSelect = prod; - selectNotesType = notesType; - } - - private void ProductSelectListForm_Load(object sender, EventArgs e) - { - if (dbProdSelect != null) - { - txtProdName.Text = dbProdSelect.product_name; - txtSkc.Text = dbProdSelect.skc_id; - txtSpu.Text = dbProdSelect.spu_id; - txtShopName.Text = dbProdSelect.shop_account; - this.pictureBox1.ImageLocation = dbProdSelect.main_img.Replace("https", "http"); - this.cmbUserNotes.Text = dbProdSelect.user_notes; - } - - if (selectNotesType == SetProductSelectType.DbProduct) - { - this.txtProdName.ReadOnly = true; - this.lblTextCount.Visible = false; - } - else - { - this.txtProdName.ReadOnly = true; - this.lblTextCount.Visible = false; - } - } - - private void btnOk_Click(object sender, EventArgs e) - { - if (!string.IsNullOrWhiteSpace(this.cmbUserNotes.Text) && this.cmbUserNotes.Text.Trim() != "重上") - this.cmbUserNotes.Text = "已买"; - - var url = ""; - if (selectNotesType == SetProductSelectType.DbProduct) - url = BaseClass.BuildObjString("product/mdy_product_select_notes"); - else - url = BaseClass.BuildObjString("product_third/mdy_product_select_notes"); - var data = UserLogin.GetSignaturex(); - data += "&db_id="; - data += "&select_add_time=" + dbProdSelect.add_time.ToString("yyyy-MM-dd HH:mm:ss"); - data += dbProdSelect.id + "&user_notes=" + this.cmbUserNotes.Text.Trim(); - - 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 - { - dbProdSelect.user_notes = this.cmbUserNotes.Text.Trim(); - if (selectNotesType == SetProductSelectType.DbProduct) - { - dbProdSelect.fission_product_name = this.txtProdName.Text.Trim(); - } - this.Close(); - } - } - - private void lblSPUId_Click(object sender, EventArgs e) - { - - } - - private void txtProdName_TextChanged(object sender, EventArgs e) - { - var textNumber = Encoding.GetEncoding("gb2312").GetBytes(txtProdName.Text.Trim()).Length; - lblTextCount.Text = "" + textNumber + "/250"; - if (textNumber > 250) - lblTextCount.ForeColor = Color.Red; - else - lblTextCount.ForeColor = Color.Gray; - } - - private void pictureBox1_Click(object sender, EventArgs e) - { - ShowImgForm imgFrom = new ShowImgForm(pictureBox1.ImageLocation); - imgFrom.ShowDialog(); - } - } -} diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectEditNotesForm.resx b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectEditNotesForm.resx deleted file mode 100644 index c963c3c..0000000 --- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectEditNotesForm.resx +++ /dev/null @@ -1,298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - AAABAAEAgIAQYAAAAABoKAAAFgAAACgAAACAAAAAAAEAAAEABAAAAAAAACgAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AAAAAAAAAAAAAAAAABEZmbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMZmZkQAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAZszMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM - zMxmAAAAAAAAAAAAAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMzMZAAAAAAAAAAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMzMzMzMzMxkAAAAAAAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMzMzMzMzMzMzMzMzGQAAAAAAAAAAAAAAAAAAAbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMYAAAAAAAAAAAAAAAAARszMzMzMzMzMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMZAAAAAAAAAAAAAAABszMzMzMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAAAAAGzMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAAAAbMzMzMzMzMzMzMzMzM - zMzMzMzMzMx3d4iIiIiIiIh3fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAABszMzMzMzMzMzM - zMzMzMzMzMzHeIiIiIj/////////iIiIiId8zMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAGzMzMzMzM - zMzMzMzMzMzMzMeIiI/////////////////////4iIh8zMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAATMzM - zMzMzMzMzMzMzMzMzHiI////////////////////////////iIfMzMzMzMzMzMzMzMzMzMzMxAAAAAAA - AGzMzMzMzMzMzMzMzMzMx3iP///////////////////////////////4iHzMzMzMzMzMzMzMzMzMzMYA - AAAAAAbMzMzMzMzMzMzMzMzMx3iP//////////////////////////////////+IfMzMzMzMzMzMzMzM - zMzMYAAAAABMzMzMzMzMzMzMzMzMx3iP/////////////////////////////////////4h8zMzMzMzM - zMzMzMzMzMQAAAAAbMzMzMzMzMzMzMzMzHiP////////////////////////////////////////h3zM - zMzMzMzMzMzMzMzGAAAABMzMzMzMzMzMzMzMzHiP//////////////////////////////////////// - //iHzMzMzMzMzMzMzMzMzEAAAAbMzMzMzMzMzMzMzMeI//////////////////////////////////// - ////////+IfMzMzMzMzMzMzMzMxgAABMzMzMzMzMzMzMzMx4//////////////////////////////// - //////////////+IfMzMzMzMzMzMzMzMxAAAbMzMzMzMzMzMzMzHj/////////////////////////// - /////////////////////4fMzMzMzMzMzMzMzMYAAMzMzMzMzMzMzMzMeP////////////////////// - ///////////////////////////4fMzMzMzMzMzMzMzMAAbMzMzMzMzMzMzMx4////////////////// - /////////////////////////////////4fMzMzMzMzMzMzMzGAGzMzMzMzMzMzMzHj///////////// - ///////////////////////////////////////4fMzMzMzMzMzMzMxgDMzMzMzMzMzMzMyI//////// - /////////////////////////////////////////////4zMzMzMzMzMzMzMwEzMzMzMzMzMzMzHj/// - //////////////////////////////////////////////////+HzMzMzMzMzMzMzMRszMzMzMzMzMzM - eP//////////////////////////////////////////////////////+HzMzMzMzMzMzMzGbMzMzMzM - zMzMzHj///////////////////////////////////////////////////////+MzMzMzMzMzMzMxmzM - zMzMzMzMzMyP////+IiP////////////////////////////////////////+I//////h8zMzMzMzMzM - zMZszMzMzMzMzMzHj////4iIiI//////////////////////////////////////+IiIj/////jMzMzM - zMzMzMzGbMzMzMzMzMzMyP////iIiIiI/////////////////////////////////////4iIiIj////4 - fMzMzMzMzMzMxszMzMzMzMzMzHj////4iIiIiP////////////////////////////////////+IiIiI - j////4zMzMzMzMzMzMbMzMzMzMzMzMx4////iIiIiIj////////////////////////////////////4 - iIiIiI////+HzMzMzMzMzMzMzMzMzMzMzMzMj////4iIiIiI//////////////+IiP//iI////////// - ////+IiIiIiP////h8zMzMzMzMzMzMzMzMzMzMzMzI/////4iIiIiP/////////////4d3eIiIeIj/// - //////////+IiIiIj/////jMzMzMzMzMzMzMzMzMzMzMzMyP////+IiIiIj/////////////iIiId3eI - iI//////////////iIiIiI/////4zMzMzMzMzMzMzMzMzMzMzMzHj/////+IiIiP/////////////4// - /4d4j/+P//////////////iIiIj/////+MzMzMzMzMzMzMzMzMzMzMzMx4//////+IiP//////////// - ///////4j///////////////////iIiP//////jMzMzMzMzMzMzMzMzMzMzMzMeP//////////+IiIj/ - ///////////////////////////////////////////4fMzMzMzMzMzMzMzMzMzMzMzH//////////+H - fMx8eP//////////////////////////iId3iP//////////+HzMzMzMzMzMzMzMzMzMzMzMyP////// - ///4fMzHh8eP////////////////////////+MzMzMd4//////////h8zMzMzMzMzMzMzMzMzMzMzMf/ - ////////+MzMePjMeP///////////////////////4zMzMeHx4/////////4fMzMzMzMzMzMzMzMzMzM - zMzH/////////4fMd3eHzMeP//////////////////////iMzMzIiHx4////////+HzMzMzMzMzMzMzM - zMzMzMzMx/////////+Hx4iIfMzMj//////////////////////4h3d8x4h8yP////////jMzMzMzMzM - zMzMzMzMzMzMzMeP////////+HiP+IfMzI//////////////////////+HiIiHd3zHj////////4zMzM - zMzMzMzMzMzMzMzMzMzHj/////////h4//+HzMeP//////////////////////h4//h8zMyP//////// - +MzMzMzMzMzMzMzMzMzMzMzMzI/////////4iP//h8x4///////////////////////4j//4fMzHj/// - //////jMzMzMzMzMzMzMzMzMzMzMzMyP///////4iIiP+IfHj///////////////////////+Ij/+HzM - eP/////////4zMzMzMzMzMzMzMzMzMzMzMzMj///////iIiIiIh3eP////////////////////////+I - j4h8x3iI////////h8zMzMzMzMzMzMzMzMzMzMzMzH//////+Hj///iIiI////////////////////// - /////4iId4iIiIj//////4zMzMzMzMzMzMzMzMzMzMzMzMx4//////iP////iP////////////////// - /////////////4iP//iI//////+MzMzMzMzMzMzMzMzMzMzMzMzMyP//////////+I////////////// - ///////////////////4eP//iP//////jMzMzMzMzMzMzMzMzMzMzMzMzMj///////////iP//////// - /////////////////////////4j/////////+HzMzMzMzMzMzMzMzMzMzMzMzMzHj/////////////// - //////////////////////////////+I//////////jMzMzMzMzMzMzMzMzMzMzMzMzMzI////////// - //////////////////////////////////////////////+HzMzMzMzMzMzMzMzMzMzMzMzMzMyP//// - ////////////////////////////////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzM - eP///////////////////////////////////////////////////////4zMzMzMzMzMzMzMzMzMzMzM - zMzMzMj///////////////////////////////////////////////////////h8zMzMzMzMzMzMzMzM - zMzMzMzMzMzHj//////////////////////////////////////////////////////4zMzMzMzMzMzM - zMzMzMzMzMzMzMzMzI//////////////////////////////////////////////////////h8zMzMzM - zMzMzMzMzMzMzMzMzMzMzMx4////////////////////////////////////////////////////+HzM - zMzMzMzMzMzMzMzMzMzMzMzMzMzMyI////+I//////////////////////////////////////////// - //h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP////+Ij///////////////////////////////////// - //////+HzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP////+IiIiIj//////////////////////////4 - ////iI/////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMiP/////4iIiP////////////////////// - ////+IiIiIj/////iHzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiP////////////////////////// - ///////////4iIj//////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiP//////////////////// - //////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiP////////////// - //////////////////////////////+HzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHj///////// - ///////////////////////////////////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP//// - ////////////////////////////////////////+MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzI - j/////////////////////////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM - zMzMeP//////////////////////////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMx4////////+I//////////////////////////////////////jMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMzMzMzMeP///////4iIj///////////////////////////iP///////4fMzMzMzMzMzMzMzM - zMzMzMzMzMzMzMzMzMx4////////iIiIiP///////////////////////4iIiP///////4zMzMzMzMzM - zMzMzMzMzMzMzMzMzMzMzMzMj///////+IiIiIiI////////////////////+IiIiIj///////+HzMzM - zMzMzMzMzMzMzMzMzMzMzMzMzMzMx4////////iIiIiIj////////////////////4iIiIiIj/////// - +MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMj///////+IiIiIiI////////////////////+IiIiIiI// - //////h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMx4////////iIiIiIiP////////////////////iIiI - iIiI///////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMj///////+IiIiIiIj/////iIiIiIiIj///// - /4iIiIiIiP///////4zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMx4////////iIiIiIiI/////4zMzMzMzM - j/////+IiIiIiIiP//////+HzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP//////+IiIiIiIj/////+MzM - zMzMzI//////+IiIiIiIj///////+MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzI////////iIiIiIiI//// - //jMzMzMzMyP//////iIiIiIiIj///////jMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP///////4iIiIiI - iP/////4zMzMzMzMj//////4iIiIiIiI///////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzI////////iI - iIiIiI//////+MzMzMzMzI//////+IiIiIiIiP///////4zMzMzMzMzMzMzMzMzMzMzMzMzMzMyP//// - ///4iIiIiIiP//////fMzMzMzMyP//////+IiIiIiIj///////+MzMzMzMzMzMzMzMzMzMzMzMzMzMzH - j///////+IiIiIiI//////+HzMzMzMzMeP//////iIiIiIiIj///////jMzMzMzMzMzMzMzMzMzMzMzM - zMzMyP////////iIiIiIiP//////jMzMzMzMzHj///////iIiIiIiI///////4fMzMzMzMzMzMzMzMzM - zMzMzMzMzMj///////+IiIiIiI///////4zMzMzMzMzI///////4iIiIiIiI///////3zMzMzMzMzMzM - zMzMzMzMzMzMzMzI////////iIiIiIiP//////+MzMzMzMzMyP//////+IiIiIiIiP//////+MzMzMzM - zMzMzMzMzMzMzMzMzMzMeP///////4iIiIiIj///////jMzMzMzMzMj///////+IiIiIiIj///////jM - zMzMzMzMzMzMzMzMzMzMzMzMzI////////+IiIiIiP//////+HzMzMzMzMzHj///////iIiIiIiI//// - ///4zMzMzMzMzMzMzMzMzMzMzMzMzMyP////////iIiIiI////////jMzMzMzMzMzI///////4iIiIiI - iI//////+MzMzMzMzMzMzMzMzMzMzMzMzMzMj////////4iIiIiP///////4zMzMzMzMzMyP///////4 - iIiIiIiP//////jMzMzMzMzMzMzMzMzMzMzMzMzMzI////////+IiIiI////////h8zMzMzMzMzMeP// - /////4iIiIiIj//////4fMzMzMzMzMzMzMzMzMzMzMzMzMyP////////iIiIj////////4fMzMzMzMzM - zHj///////+IiIiIiI//////+HzMzMzMzMzMzMzMzMzMzMzMzMzHj/////////iIiP////////+MzMzM - zMzMzMzI////////+IiIiIiP//////h8zMzMzMzMzMzMxmzMzMzMzMzMx4/////////4iP/////////4 - fMzMzMzMzMzMx4////////+IiIiIj//////4fMzMzMzMzMzMzMZszMzMzMzMzMeP//////////////// - ////+MzMzMzMzMzMzMyP////////iIiIiP//////+HzMzMzMzMzMzMzGbMzMzMzMzMzH//////////// - //////////fMzMzMzMzMzMzMeP////////iIiIj///////98zMzMzMzMzMzMxmzMzMzMzMzMyP////// - //////////////+HzMzMzMzMzMzMzHj/////////+IiP////////jMzMzMzMzMzMzMZszMzMzMzMzMj/ - ////////////////////jMzMzMzMzMzMzMzIj////////////////////4zMzMzMzMzMzMzGTMzMzMzM - zMzH////////////////////+HzMzMzMzMzMzMzMx4////////////////////+MzMzMzMzMzMzMxAzM - zMzMzMzMx/////////////////////jMzMzMzMzMzMzMzMyI///////////////////4fMzMzMzMzMzM - zMAGzMzMzMzMzMeP//////////////////+HzMzMzMzMzMzMzMzMeP//////////////////+HzMzMzM - zMzMzMxgBszMzMzMzMzHj//////////////////4fMzMzMzMzMzMzMzMzMeP//////////////////h8 - zMzMzMzMzMzMYADMzMzMzMzMzI//////////////////+HzMzMzMzMzMzMzMzMzHj/////////////// - ///4zMzMzMzMzMzMzAAAbMzMzMzMzMyP/////////////////4fMzMzMzMzMzMzMzMzMzHj///////// - ////////+MzMzMzMzMzMzMYAAEzMzMzMzMzMj/////////////////+MzMzMzMzMzMzMzMzMzMzIj/// - /////////////4fMzMzMzMzMzMzEAAAGzMzMzMzMzHj////////////////4fMzMzMzMzMzMzMzMzMzM - x4////////////////+MzMzMzMzMzMzMYAAABMzMzMzMzMx4////////////////h8zMzMzMzMzMzMzM - zMzMzMx4///////////////4fMzMzMzMzMzMzEAAAABszMzMzMzMx4//////////////+HzMzMzMzMzM - zMzMzMzMzMzMx4//////////////+MzMzMzMzMzMzMYAAAAATMzMzMzMzMyP/////////////4fMzMzM - zMzMzMzMzMzMzMzMzMeI/////////////4fMzMzMzMzMzMzEAAAAAAbMzMzMzMzMeP////////////h8 - zMzMzMzMzMzMzMzMzMzMzMzMeI////////////h8zMzMzMzMzMzMYAAAAAAAbMzMzMzMzMeP//////// - //iHzMzMzMzMzMzMzMzMzMzMzMzMzMyI//////////+HzMzMzMzMzMzMxgAAAAAAAEzMzMzMzMzMeP// - //////iHfMzMzMzMzMzMzMzMzMzMzMzMzMzMx4/////////4fMzMzMzMzMzMzMQAAAAAAAAGzMzMzMzM - zMeI//////iHfMzMzMzMzMzMzMzMzMzMzMzMzMzMzMx4j//////4h8zMzMzMzMzMzMxgAAAAAAAAAGzM - zMzMzMzMx4iIiIiHzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiIj/+Ih3zMzMzMzMzMzMzGAAAAAAAA - AAAGzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMx3iId8zMzMzMzMzMzMzMYAAA - AAAAAAAAAGzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM - xgAAAAAAAAAAAAAGzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM - zMzMzGAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMzGQAAAAAAAAAAAAAAAAAbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMzMzMzMYAAAAAAAAAAAAAAAAAAARszMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMzMzMzMzMzMZAAAAAAAAAAAAAAAAAAAAABGzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMzMzMzMzMzMzMzMZAAAAAAAAAAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMzMzMzMzMzMzMzMzMzMZAAAAAAAAAAAAAAAAAAAAAAAAAAABmzMzMzMzMzMzMzMzMzMzMzMzM - zMzMzMzMzMzMzMzMzMzMzMzMzMzMzGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARGZmzMzMzMzMzMzMzM - zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMZmZEAAAAAAAAAAAAAAAAD////+AAAAAAAAAAD/////////AAAA - AAAAAAAAAP//////+AAAAAAAAAAAAAAf/////+AAAAAAAAAAAAAAB/////+AAAAAAAAAAAAAAAH////+ - AAAAAAAAAAAAAAAAf////AAAAAAAAAAAAAAAAD////AAAAAAAAAAAAAAAAAP///gAAAAAAAAAAAAAAAA - B///wAAAAAAAAAAAAAAAAAP//4AAAAAAAAAAAAAAAAAB//8AAAAAAAAAAAAAAAAAAP/+AAAAAAAAAAAA - AAAAAAB//gAAAAAAAAAAAAAAAAAAf/wAAAAAAAAAAAAAAAAAAD/4AAAAAAAAAAAAAAAAAAAf+AAAAAAA - AAAAAAAAAAAAH/AAAAAAAAAAAAAAAAAAAA/wAAAAAAAAAAAAAAAAAAAP4AAAAAAAAAAAAAAAAAAAB+AA - AAAAAAAAAAAAAAAAAAfAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAA - AAOAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAA - AAAAAAABgAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAABAAAAAAAA - AAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAA - AAGAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAA - AAAAAAABgAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAAAAAADwAAAAAAA - AAAAAAAAAAAAA+AAAAAAAAAAAAAAAAAAAAfgAAAAAAAAAAAAAAAAAAAH8AAAAAAAAAAAAAAAAAAAD/AA - AAAAAAAAAAAAAAAAAA/4AAAAAAAAAAAAAAAAAAAf+AAAAAAAAAAAAAAAAAAAH/wAAAAAAAAAAAAAAAAA - AD/+AAAAAAAAAAAAAAAAAAB//gAAAAAAAAAAAAAAAAAAf/8AAAAAAAAAAAAAAAAAAP//gAAAAAAAAAAA - AAAAAAH//8AAAAAAAAAAAAAAAAAD///gAAAAAAAAAAAAAAAAB///8AAAAAAAAAAAAAAAAA////wAAAAA - AAAAAAAAAAA////+AAAAAAAAAAAAAAAAf////4AAAAAAAAAAAAAAAf/////gAAAAAAAAAAAAAAf///// - +AAAAAAAAAAAAAAf//////8AAAAAAAAAAAAA/////////gAAAAAAAAAAf////w== - - - \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs index dba3ebe..b3ca9a9 100644 --- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs +++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs @@ -537,13 +537,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms shopLoginForm.Show(); } break; - case "重上/已买": - { - PDDDBProdUserSelectEditNotesForm userNotesForm = new PDDDBProdUserSelectEditNotesForm(dbProduct); - userNotesForm.ShowDialog(); - dgvSelectProduct.Rows[e.RowIndex].Cells["colUserNotes"].Value = (dbProduct.user_notes + " 编辑").Trim(); - } - break; case "上传商品Id": //if (!string.IsNullOrEmpty(draftId) && shop != null) //{ diff --git a/TEMUKJD/StartUp.cs b/TEMUKJD/StartUp.cs index 5e14066..5ca238a 100644 --- a/TEMUKJD/StartUp.cs +++ b/TEMUKJD/StartUp.cs @@ -207,6 +207,9 @@ namespace TemuKJD if (BaseClass.MainPath != "29wx") // 微信才读取违规商品信息 return; + if (BaseClass.UserName == "15288888888") + return; + new WXProdViolationManage().GetShopProdViolation(); }); @@ -231,6 +234,9 @@ namespace TemuKJD if (BaseClass.MainPath != "29wx") // 微信读取 return; + if (BaseClass.UserName == "15288888888") + return; + var url = BaseClass.BuildObjString("product/is_get_wx_recommend_hot_prod"); var data = ""; data = UserLogin.GetSignaturex(); diff --git a/TEMUKJD/ToolForms/DouBaoTitleFissionCefForm.Designer.cs b/TEMUKJD/ToolForms/DouBaoTitleFissionCefForm.Designer.cs index 6c8b977..0e03197 100644 --- a/TEMUKJD/ToolForms/DouBaoTitleFissionCefForm.Designer.cs +++ b/TEMUKJD/ToolForms/DouBaoTitleFissionCefForm.Designer.cs @@ -228,6 +228,7 @@ namespace TemuKJD.ToolForms this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pbLoading.TabIndex = 8; this.pbLoading.TabStop = false; + this.pbLoading.Visible = false; // // textBox1 // @@ -239,7 +240,7 @@ namespace TemuKJD.ToolForms this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(1115, 42); this.textBox1.TabIndex = 0; - this.textBox1.Text = "这个产品生成一百二十个标题,TXT 文本,然后一行一个,不要加一二三四五六七八九这个序号,标题长度30个字,标题不要出现一模一样的。"; + this.textBox1.Text = "这个产品生成一百二十个标题,纯文本,然后一行一个,不要加一二三四五六七八九这个序号,标题长度30个字,标题不要出现一模一样的。"; // // splitContainer2 // @@ -305,6 +306,7 @@ namespace TemuKJD.ToolForms this.btnBatchCreateFissionTitle.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); this.btnBatchCreateFissionTitle.TabIndex = 1128; this.btnBatchCreateFissionTitle.Text = "批量生成裂变标题"; + this.btnBatchCreateFissionTitle.Click += new System.EventHandler(this.btnBatchCreateFissionTitle_Click); // // pbLoading2 // @@ -370,6 +372,7 @@ namespace TemuKJD.ToolForms this.dgvDbProduct.RowTemplate.Height = 23; this.dgvDbProduct.Size = new System.Drawing.Size(357, 528); this.dgvDbProduct.TabIndex = 10; + this.dgvDbProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellContentClick); // // colSelect // diff --git a/TEMUKJD/ToolForms/DouBaoTitleFissionCefForm.cs b/TEMUKJD/ToolForms/DouBaoTitleFissionCefForm.cs index d04f6e5..f43e08f 100644 --- a/TEMUKJD/ToolForms/DouBaoTitleFissionCefForm.cs +++ b/TEMUKJD/ToolForms/DouBaoTitleFissionCefForm.cs @@ -20,6 +20,7 @@ using TemuKJD.BaseForms; using TemuKJD.Extension; using TemuKJD.Helper; using TemuKJD.KJDForms.ProductSelectForms; +using TemuKJD.PDDForms.ProductSelectForms; using Work; using Work.BLL.Tools; @@ -29,6 +30,7 @@ namespace TemuKJD.ToolForms { ChromiumWebBrowser cefWebBrowser = null; List lstDbProd = new List(); + KJDDBProduct currentProd = null; string Url { get; set; } = "https://www.doubao.com/chat/"; List Cookies = new List(); @@ -58,6 +60,10 @@ namespace TemuKJD.ToolForms cefWebBrowser = NaiBa.CefHelper.CEFBrowser.CreateChromiumWebBrowser(Url); cefWebBrowser.AutoSize = true; cefWebBrowser.Dock = DockStyle.Fill; + CustomResourceRequestHandlerLocal resourceRequestHandler = new CustomResourceRequestHandlerLocal(); + resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete; + resourceRequestHandler.BeforeResourceLoadEvent += RequestHandler_BeforeResourceLoad; + cefWebBrowser.RequestHandler = new NaiBa.CefHelper.Handler.CustomRequestHandler(resourceRequestHandler); //cefWebBrowser.RequestContext = new RequestContext(requestContextSettings); cefWebBrowser.KeyboardHandler = new KJDForms.ToolForms.CefKeyboardHandler(); cefWebBrowser.FrameLoadEnd += CefWebBrowser_FrameLoadEnd; @@ -75,6 +81,11 @@ namespace TemuKJD.ToolForms { } + private bool RequestHandler_BeforeResourceLoad(object sender, string url, string postData, IRequest request) + { + return false; + } + void ShopProduct() { dgvDbProduct.Rows.Clear(); @@ -99,7 +110,7 @@ namespace TemuKJD.ToolForms private void DownloadHandler_DownloadComplete(object browser, DownloadItem downloadItem) { - //BaseMsgForm.ShowInfo(downloadItem.FullPath + "下载完成"); + BaseMsgForm.ShowInfo(downloadItem.FullPath + "下载完成"); //Invoke(new Action(() => //{ // if(currentSkuImgItem == null) @@ -143,11 +154,246 @@ namespace TemuKJD.ToolForms private void CefWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEndEventArgs e) { + } private void btnGoTo_Click(object sender, EventArgs e) { this.cefWebBrowser.Load(txtUrl.Text.Trim()); } + + private void btnBatchCreateFissionTitle_Click(object sender, EventArgs e) + { + //var lstProdId = dgvDbProduct.Rows.Cast().Where(row + // => row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["col_spu_id"]?.Value.ToString().Split(' ').FirstOrDefault()).ToList(); + //var prodList = this.lstDbProd.Where(p => lstProdId.Contains(p.spu_id)).ToList(); + //if (prodList.Count == 0) + //{ + // BaseMsgForm.ShowInfo("请选择商品"); + // return; + //} + + Task.Run(() => + { + + var rows = dgvDbProduct.Rows.Cast().Where(row => row.Cells["colSelect"]?.Value.ParseToBool() == true).ToList(); + if (rows.Count == 0) + { + BaseMsgForm.ShowInfo("请选择商品"); + return; + } + + foreach (var row in rows) + { + var cell = row.Cells["colOpResult"]; + Invoke(new Action(() => { cell.Value = ""; })); + + var prodId = row.Cells["col_spu_id"].Value.ParseToString(); + var prod = this.lstDbProd.FirstOrDefault(p => prodId == p.spu_id); + currentProd = prod; + if (prod == null) + { + Invoke(new Action(() => { cell.Value = "商品不存在"; })); + continue; + } + + Thread.Sleep(Randomx.GetId(500, 1000)); + + string resultStr = ""; + var jsStr = @"(function() { + var txtElements = document.getElementsByTagName('textarea'); + for (i = 0; i { cell.Value = "页面打开失败"; })); + continue; + } + + var result = client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true); + result.Wait(5000); + resultStr = result.Result.Result.Value.ParseToString(); + if (resultStr.IsNullOrEmpty()) + { + Invoke(new Action(() => { cell.Value = "商品图片查询失败"; })); + continue; + } + Thread.Sleep(Randomx.GetId(200, 1000)); + + var img_url = prod.main_img; + string getImgError; + if (!img_url.Contains("wst.wxapp.tc.qq.com") && !img_url.Contains("mmecimage.cn")) + img_url = img_url.Replace("https://", "http://"); + var image = GetHtml.GetUrlImg(img_url, out getImgError); + Invoke(new Action(() => { Clipboard.SetImage(image); })); + host.SendKeyEvent(new CefSharp.KeyEvent() { WindowsKeyCode = 86, Type = KeyEventType.RawKeyDown, Modifiers = CefEventFlags.ControlDown }); + Thread.Sleep(Randomx.GetId(1500, 2500)); + + result = client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true); + result.Wait(5000); + resultStr = result.Result.Result.Value.ParseToString(); + if (resultStr.IsNullOrEmpty()) + { + Invoke(new Action(() => { cell.Value = "提示词调用失败"; })); + continue; + } + Thread.Sleep(Randomx.GetId(200, 1000)); + + var askText = ""; + Invoke(new Action(() => + { + askText = textBox1.Text.Trim(); + Clipboard.SetText(askText); + })); + host.SendKeyEvent(new CefSharp.KeyEvent() { WindowsKeyCode = 86, Type = KeyEventType.RawKeyDown, Modifiers = CefEventFlags.ControlDown }); + Thread.Sleep(Randomx.GetId(200, 1000)); + + host.SendKeyEvent(new CefSharp.KeyEvent() { WindowsKeyCode = 13, Type = KeyEventType.RawKeyDown }); + + for (int i = 0; i < 80; i++) + { + Thread.Sleep(1000); + if (currentProd == null) + break; + } + if (currentProd != null) + currentProd = null; + + Invoke(new Action(() => { cefWebBrowser.Load(Url); })); + + Thread.Sleep(Randomx.GetId(3000, 5000)); + } + }); + } + + private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request) + { + + var pData = postData; + var rData = responseData; + + //if (pData.Contains("这个产品生成一百二十个标题,纯文本,然后一行一个,不要加一二三四五六七八九这个序号,标题长度30个字,标题不要出现一模一样的。")) + //{ + + //} + + if (url.StartsWith("https://www.doubao.com/chat/completion")) + { + Task.Run(() => { CefGetFissionTitle(rData); }); + } + } + + public void CefGetFissionTitle(string data) + { + if (currentProd == null || currentProd.spu_id.IsNullOrEmpty()) + { + currentProd = null; + return; + } + + var prodId = currentProd.spu_id; + var dbId = currentProd.id; + var rows = dgvDbProduct.Rows.Cast().Where(r => r.Cells["col_spu_id"].Value.ParseToString() == prodId).ToList(); + + var titleStr = ""; + var stringList = data.Split(new string[] { "data:" }, StringSplitOptions.RemoveEmptyEntries); + foreach(var str in stringList) + { + var strTmp = str; + var tts_content = BaseRegex.GetStringJson(ref strTmp, "tts_content"); + if (!string.IsNullOrEmpty(tts_content)) + { + titleStr += tts_content; + } + } + + var titleList = titleStr.Split(new string[] { "\r", "\n", "\\n" }, StringSplitOptions.RemoveEmptyEntries).ToList(); + for (int i =0; i< titleList.Count; i++) + { + for (int j = 0; j < 500; j++) + if (titleList[i].StartsWith("" + j + ".")) + titleList[i] = titleList[i].Substring(("" + j + ".").Length); + } + titleList = titleList.Where(t => t?.Length > 20).ToList(); + + if (titleList.Count() > 50) + { + var url = BaseClass.BuildPDDObjString("product/mdy_db_product"); + var body = UserLogin.GetSignaturex() + + "&db_id=" + dbId; + body += "&fission_words=fission_goods_names:" + GetHtml.UrlEncodeUtf8(string.Join("\r\n", titleList)); + var html = GetHtml.PostUtf8(url, body); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + html = GetHtml.PostUtf8(url, body); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + html = GetHtml.PostUtf8(url, body); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + { + //BaseMsgForm.ShowError("商品裂变编辑失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg")); + foreach(var row in rows) + { + Invoke(new Action(() => { row.Cells["colOpResult"].Value = "标题裂变失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg"); })); + } + } + else + { + foreach (var row in rows) + { + Invoke(new Action(() => { row.Cells["colOpResult"].Value = "标题裂变成功"; })); + } + } + } + currentProd = null; + } + + private void dgvDbProduct_CellContentClick(object sender, DataGridViewCellEventArgs e) + { + if (e.ColumnIndex < 0 || e.RowIndex < 0) + return; + string headerText = dgvDbProduct.Columns[e.ColumnIndex].HeaderText; + var dbId = dgvDbProduct.Rows[e.RowIndex].Cells["col_db_id"].Value.ParseToString(); + var dbProduct = lstDbProd.FirstOrDefault(p => p.id.ToString() == dbId); + + switch (headerText) + { + case "详情": + case "编辑/详情": + PDDDBProdEditForm editForm = new PDDDBProdEditForm(dbProduct); + if (BaseClass.MainPath != "29pdd") + { + editForm.pnlSkuOption.Visible = false; + editForm.txtProductName.ReadOnly = true; + editForm.txtExtCode.ReadOnly = true; + editForm.lblSkcId.Text = "仓库编码"; + } + editForm.ShowDialog(); + //dgvDbProduct.Rows[e.RowIndex].Cells["col_notes"].Value = dbProduct.notes; + //dgvDbProduct.Rows[e.RowIndex].Cells["col_ext_code"].Value = dbProduct.ext_code; + //dgvDbProduct.Rows[e.RowIndex].Cells["colHeadWords"].Value = dbProduct.head_words; + //dgvDbProduct.Rows[e.RowIndex].Cells["colEndWords"].Value = dbProduct.end_words; + //dgvDbProduct.Rows[e.RowIndex].Cells["colFissionWords"].Value = dbProduct.fission_words; + //dgvDbProduct.Rows[e.RowIndex].Cells["col_product_name"].Value = dbProduct.product_name; + //dgvDbProduct.Rows[e.RowIndex].Cells["colSkuReplaceImgUrl"].Value = dbProduct.sku_img_replace_url; + break; + case "主图": + ShowImgForm imgFrom = new ShowImgForm(dgvDbProduct.Rows[e.RowIndex].Cells["colImgUrl"].Value.ParseToString().Replace("?imageView2/2/w/90/h/90", "")); + imgFrom.ShowDialog(); + break; + case "": + dgvDbProduct.Rows[e.RowIndex].Cells["colSelect"].Value = !(bool)dgvDbProduct.Rows[e.RowIndex].Cells["colSelect"].Value; + break; + default: + break; + } + } } } diff --git a/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.Designer.cs b/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.Designer.cs index 779e803..6a795d3 100644 --- a/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.Designer.cs +++ b/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.Designer.cs @@ -131,6 +131,7 @@ namespace TemuKJD.WXForms.ProductForms this.line1 = new DevComponents.DotNetBar.Controls.Line(); this.label37 = new System.Windows.Forms.Label(); this.ucGroupBoxEx4 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); + this.btnSwitchCatType = new DevComponents.DotNetBar.PanelEx(); this.cmbHot = new System.Windows.Forms.ComboBox(); this.btnProdDb = new DevComponents.DotNetBar.PanelEx(); this.chkWXComplateProd = new TemuKJD.UserComponent.UcCheckBox(this.components); @@ -232,7 +233,8 @@ namespace TemuKJD.WXForms.ProductForms this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); this.btnClear = new DevComponents.DotNetBar.PanelEx(); this.panelEx1 = new DevComponents.DotNetBar.PanelEx(); - this.btnSwitchCatType = new DevComponents.DotNetBar.PanelEx(); + this.chkFissionProduct = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.txtFissionProductCount = new System.Windows.Forms.TextBox(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -1218,6 +1220,8 @@ namespace TemuKJD.WXForms.ProductForms // // 商品裂变 // + this.商品裂变.Controls.Add(this.txtFissionProductCount); + this.商品裂变.Controls.Add(this.chkFissionProduct); this.商品裂变.Controls.Add(this.line2); this.商品裂变.Controls.Add(this.label38); this.商品裂变.Controls.Add(this.txtFissionRandomPriceChange); @@ -1410,7 +1414,7 @@ namespace TemuKJD.WXForms.ProductForms // lblFissionTitleCount // this.lblFissionTitleCount.ForeColor = System.Drawing.Color.Gray; - this.lblFissionTitleCount.Location = new System.Drawing.Point(-10, 32); + this.lblFissionTitleCount.Location = new System.Drawing.Point(25, 33); this.lblFissionTitleCount.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); this.lblFissionTitleCount.Name = "lblFissionTitleCount"; this.lblFissionTitleCount.Size = new System.Drawing.Size(88, 17); @@ -1420,7 +1424,7 @@ namespace TemuKJD.WXForms.ProductForms // // chkFissionGoodsName // - this.chkFissionGoodsName.Location = new System.Drawing.Point(10, 7); + this.chkFissionGoodsName.Location = new System.Drawing.Point(45, 10); this.chkFissionGoodsName.Name = "chkFissionGoodsName"; this.chkFissionGoodsName.Size = new System.Drawing.Size(68, 21); this.chkFissionGoodsName.TabIndex = 893; @@ -1442,11 +1446,11 @@ namespace TemuKJD.WXForms.ProductForms this.txtFissionTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtFissionTitle.Location = new System.Drawing.Point(81, 7); + this.txtFissionTitle.Location = new System.Drawing.Point(115, 7); this.txtFissionTitle.Multiline = true; this.txtFissionTitle.Name = "txtFissionTitle"; this.txtFissionTitle.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.txtFissionTitle.Size = new System.Drawing.Size(496, 79); + this.txtFissionTitle.Size = new System.Drawing.Size(462, 79); this.txtFissionTitle.TabIndex = 0; this.txtFissionTitle.TextChanged += new System.EventHandler(this.txtFissionTitle_TextChanged); // @@ -1516,6 +1520,30 @@ namespace TemuKJD.WXForms.ProductForms this.ucGroupBoxEx4.TabStop = false; this.ucGroupBoxEx4.Text = "待传商品"; // + // btnSwitchCatType + // + this.btnSwitchCatType.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnSwitchCatType.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnSwitchCatType.DisabledBackColor = System.Drawing.Color.Empty; + this.btnSwitchCatType.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSwitchCatType.Location = new System.Drawing.Point(6, 21); + this.btnSwitchCatType.Name = "btnSwitchCatType"; + this.btnSwitchCatType.Size = new System.Drawing.Size(17, 21); + this.btnSwitchCatType.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnSwitchCatType.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSwitchCatType.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSwitchCatType.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnSwitchCatType.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnSwitchCatType.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnSwitchCatType.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnSwitchCatType.Style.GradientAngle = 90; + this.btnSwitchCatType.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnSwitchCatType.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnSwitchCatType.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnSwitchCatType.TabIndex = 856; + this.btnSwitchCatType.Text = "W"; + this.btnSwitchCatType.Click += new System.EventHandler(this.btnSwitchCatType_Click); + // // cmbHot // this.cmbHot.FormattingEnabled = true; @@ -2919,29 +2947,24 @@ namespace TemuKJD.WXForms.ProductForms this.panelEx1.Text = "停止当前操作"; this.panelEx1.Visible = false; // - // btnSwitchCatType + // chkFissionProduct // - this.btnSwitchCatType.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnSwitchCatType.Cursor = System.Windows.Forms.Cursors.Hand; - this.btnSwitchCatType.DisabledBackColor = System.Drawing.Color.Empty; - this.btnSwitchCatType.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnSwitchCatType.Location = new System.Drawing.Point(6, 21); - this.btnSwitchCatType.Name = "btnSwitchCatType"; - this.btnSwitchCatType.Size = new System.Drawing.Size(17, 21); - this.btnSwitchCatType.Style.Alignment = System.Drawing.StringAlignment.Center; - this.btnSwitchCatType.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - this.btnSwitchCatType.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - this.btnSwitchCatType.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.btnSwitchCatType.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; - this.btnSwitchCatType.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; - this.btnSwitchCatType.Style.ForeColor.Color = System.Drawing.Color.White; - this.btnSwitchCatType.Style.GradientAngle = 90; - this.btnSwitchCatType.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; - this.btnSwitchCatType.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); - this.btnSwitchCatType.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); - this.btnSwitchCatType.TabIndex = 856; - this.btnSwitchCatType.Text = "W"; - this.btnSwitchCatType.Click += new System.EventHandler(this.btnSwitchCatType_Click); + this.chkFissionProduct.Location = new System.Drawing.Point(10, 64); + this.chkFissionProduct.Name = "chkFissionProduct"; + this.chkFissionProduct.Size = new System.Drawing.Size(68, 21); + this.chkFissionProduct.TabIndex = 910; + this.chkFissionProduct.Text = "裂变商品"; + this.chkFissionProduct.UseVisualStyleBackColor = true; + // + // txtFissionProductCount + // + this.txtFissionProductCount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.txtFissionProductCount.Location = new System.Drawing.Point(78, 63); + this.txtFissionProductCount.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2); + this.txtFissionProductCount.Name = "txtFissionProductCount"; + this.txtFissionProductCount.Size = new System.Drawing.Size(32, 23); + this.txtFissionProductCount.TabIndex = 911; + this.txtFissionProductCount.Text = "100"; // // WXDBProdUploadForm // @@ -3195,5 +3218,7 @@ namespace TemuKJD.WXForms.ProductForms private DevComponents.DotNetBar.Controls.Line line1; private System.Windows.Forms.Label label37; private DevComponents.DotNetBar.PanelEx btnSwitchCatType; + private System.Windows.Forms.TextBox txtFissionProductCount; + private UserComponent.UcCheckBox chkFissionProduct; } } \ No newline at end of file diff --git a/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs b/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs index 20d2315..9b02f44 100644 --- a/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs +++ b/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs @@ -1441,6 +1441,94 @@ namespace TemuKJD.WXForms.ProductForms })); } + #region 裂变标题 + if (BaseClass.UserAuthority.Contains("商品裂变") && chkFissionGoodsName.Checked) + { + bool isFinish = false; + Invoke(new Action(() => { + var titles = txtFissionTitle.Text.Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries).ToList(); + if (titles.Count == 0) + { + cancellationTokenSource.Cancel(); + if (cell != null) + cell.Value = "裂变标题数量不足,将暂停上传"; + BaseMsgForm.ShowError("裂变标题数量不足,将暂停上传"); + isFinish = true; + } + selectProd.product_name = titles[0]; + titles.RemoveAt(0); + txtFissionTitle.Text = string.Join("\r\n", titles); + cell.Value = "标题裂变成功,更改为:" + selectProd.product_name; + })); + if (isFinish) + { + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"裂变标题数量不足,将暂停上传\"}"; + } + } + #endregion + + #region 跳过已上传商品,默认按商品货号,裂变商品按标题。 + if (chkSkipUploaded.Checked) + { + // 裂变按标题名称 + if (chkFissionProduct.Checked || chkFissionGoodsName.Checked) + { + var searchRst = WXUpload.searchProductWithTitle(shop, GetHtml.UrlEncodeUtf8(selectProd?.product_name)); + if (!searchRst.Contains("\"code\":0") && !searchRst.Contains("\"success\":true")) + { + var error = BaseRegex.GetStringJson(ref searchRst, "msg"); + if (string.IsNullOrEmpty(error)) + error = searchRst; + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品查询错误 " + error + "\"}"; + } + try + { + var num = JObject.Parse(searchRst)["totalNum"].ParseToInt(); + if (num > 0) + { + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品已存在,选择跳过\"}"; + } + } + catch (Exception ex) + { + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品查询错误 " + ex.Message + "\"}"; + } + } + // 非裂变商品按商品Id + else + { + var searchExtCode = dbProd.ext_code; + if (searchExtCode.ParseToString().Length < 10) + searchExtCode = "EC1" + dbProd.spu_id + "A"; + if (dbProd.sku_secret_json != null && dbProd.sku_secret_json.Contains("goodsId")) + { + var sku_secret_json = dbProd.sku_secret_json; + searchExtCode = BaseRegex.GetStringJson(ref sku_secret_json, "goodsId"); + } + var searchRst = WXUpload.searchProduct(shop, searchExtCode); + if (!searchRst.Contains("\"code\":0") && !searchRst.Contains("\"success\":true")) + { + var error = BaseRegex.GetStringJson(ref searchRst, "msg"); + if (string.IsNullOrEmpty(error)) + error = searchRst; + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品查询错误 " + error + "\"}"; + } + try + { + var num = JObject.Parse(searchRst)["totalNum"].ParseToInt(); + if (num > 0) + { + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品已存在,选择跳过\"}"; + } + } + catch (Exception ex) + { + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品查询错误 " + ex.Message + "\"}"; + } + } + } + #endregion + #region 处理佣金上传 int commissionRate = 0; int minCommissionRate = 0; @@ -1520,53 +1608,6 @@ namespace TemuKJD.WXForms.ProductForms } #endregion - #region 跳过已上传商品 - if (chkSkipUploaded.Checked) - { - var searchExtCode = dbProd.ext_code; - if (searchExtCode.ParseToString().Length < 10) - searchExtCode = "EC1" + dbProd.spu_id + "A"; - if (dbProd.sku_secret_json != null && dbProd.sku_secret_json.Contains("goodsId")) - { - var sku_secret_json = dbProd.sku_secret_json; - searchExtCode = BaseRegex.GetStringJson(ref sku_secret_json, "goodsId"); - } - var searchRst = WXUpload.searchProduct(shop, searchExtCode); - if (!searchRst.Contains("\"code\":0") && !searchRst.Contains("\"success\":true")) - { - var error = BaseRegex.GetStringJson(ref searchRst, "msg"); - if (string.IsNullOrEmpty(error)) - error = searchRst; - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品查询错误 " + error + "\"}"; - } - try - { - var num = JObject.Parse(searchRst)["totalNum"].ParseToInt(); - if (num > 0) - { - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品已存在,选择跳过\"}"; - } - } - catch (Exception ex) - { - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品查询错误 " + ex.Message + "\"}"; - } - } - #endregion - - WXGetEditProductInfoLite wxEditProdInfo = null; - if (dbProd.product_get_type_text == "微信店采") - { - try - { - wxEditProdInfo = JsonHelper.DeserializeJsonToObject(dbProd.product_json); - } - catch (Exception ex) - { - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"微信商品格式获取失败" + ex.Message + "\"}"; - } - } - #region 将聚水潭产品数据格式进行转换成pdd格式统一上传,匹配加密的spuCode和skuCoke 微信小店的货号spuCode和外部商品编号outProductId/out_product_id对应加密的聚水潭goodsId if (dbProd.product_get_type_text == "厂商直采") { @@ -1582,11 +1623,26 @@ namespace TemuKJD.WXForms.ProductForms string convertRst = ""; var pInfo = new PDDProdFormConverter().JstPddProdToPddConvert(out convertRst, dbProd); if (!string.IsNullOrEmpty(convertRst)) - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品查询错误 " + convertRst + "\"}"; + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品查询错误 " + convertRst + "\"}"; } #endregion - #region 微信格式转换 + #region 微信店采原始格式还原 + WXGetEditProductInfoLite wxEditProdInfo = null; + if (dbProd.product_get_type_text == "微信店采") + { + try + { + wxEditProdInfo = JsonHelper.DeserializeJsonToObject(dbProd.product_json); + } + catch (Exception ex) + { + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"微信商品格式获取失败" + ex.Message + "\"}"; + } + } + #endregion + + #region 微信店采格式转换 if (dbProd.product_get_type_text == "微信店采") { string convertRst = ""; @@ -1596,6 +1652,33 @@ namespace TemuKJD.WXForms.ProductForms } #endregion + #region 微信回采转换 + if (BaseClass.UserAuthority.ParseToString().Contains("微信回采") && chkUseWXComplateProd.Checked && dbProd.has_wx_format == "1") + { + string errMsg = ""; + wxEditProdInfo = GetProductWXComplate(dbProd.secret_spu_id, out errMsg); + + if (wxEditProdInfo == null) + { + Invoke(new Action(() => + { + cell.Value = errMsg; + })); + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"" + errMsg + "\"}"; + } + } + #endregion + + #region 微信小店app + if (dbProd.product_get_type_text == "微信小店") + { + string convertRst = ""; + var pInfo = new PDDProdFormConverter().WXClientToPddConvert(out convertRst, dbProd); + if (!string.IsNullOrEmpty(convertRst)) + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品查询错误 " + convertRst + "\"}"; + } + #endregion + #region 1688格式转换 if (dbProd.product_get_type_text == "1688厂家") { @@ -1613,16 +1696,6 @@ namespace TemuKJD.WXForms.ProductForms } #endregion - #region 微信小店app - if (dbProd.product_get_type_text == "微信小店") - { - string convertRst = ""; - var pInfo = new PDDProdFormConverter().WXClientToPddConvert(out convertRst, dbProd); - if (!string.IsNullOrEmpty(convertRst)) - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品查询错误 " + convertRst + "\"}"; - } - #endregion - #region 将产品数据初始化成微信小店支持的参数 JObject prodJObj = new JObject(); try @@ -1804,22 +1877,7 @@ namespace TemuKJD.WXForms.ProductForms } #endregion - if (BaseClass.UserAuthority.ParseToString().Contains("微信回采") && chkUseWXComplateProd.Checked && dbProd.has_wx_format == "1") - { - string errMsg = ""; - wxEditProdInfo = GetProductWXComplate(dbProd.secret_spu_id, out errMsg); - - if (wxEditProdInfo == null) - { - Invoke(new Action(() => - { - cell.Value = errMsg; - })); - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"" + errMsg + "\"}"; - } - } - - #region 图片盗链映射 + #region 图片盗链映射生成字典(如果有) bool isChangeImgDic = false; Dictionary wxImgMapDic = new Dictionary(); if (!string.IsNullOrEmpty(dbProd.wx_img_map_json)) @@ -1952,11 +2010,14 @@ namespace TemuKJD.WXForms.ProductForms } #endregion + #region 初始化上传商品对象 // 生成初始化上传商品对象 var upProdInitParam = new WXUploadProductInitParam(); // 生成上传商品对象 var upProdParam = new WXUploadProductParam(); + #endregion + #region 获取店铺 Api Token // 获取店铺的accessToken WXShopTokenInfo token = lstWXShopTokenInfo.FirstOrDefault(t => t.shopId == shop.ShopId); if (token == null) @@ -1979,33 +2040,12 @@ namespace TemuKJD.WXForms.ProductForms // 如果店铺token不可用,随机获取一个上传图片的accessToken if (token == null || token.isExpire || string.IsNullOrEmpty(token.accessToken)) token = new WxApiBLL().GetRandomWxToken(); + #endregion #region 设置标题 - string prodTitle = dbProd.product_name.IsNullOrEmpty() ? prodInfo.detail.goods_name : dbProd.product_name; - - // 裂变标题 - if (BaseClass.UserAuthority.Contains("商品裂变") && chkFissionGoodsName.Checked) - { - bool isFinish = false; - Invoke(new Action(() => { - var titles = txtFissionTitle.Text.Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries).ToList(); - if (titles.Count == 0) - { - cancellationTokenSource.Cancel(); - if (cell != null) - cell.Value = "裂变标题数量不足,将暂停上传"; - BaseMsgForm.ShowError("裂变标题数量不足,将暂停上传"); - isFinish = true; - } - prodTitle = titles[0]; - titles.RemoveAt(0); - txtFissionTitle.Text = string.Join("\r\n", titles); - })); - if (isFinish) - { - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"裂变标题数量不足,将暂停上传\"}"; - } - } + string prodTitle = selectProd.product_name; + if (prodTitle.IsNullOrEmpty()) + prodTitle = dbProd.product_name.IsNullOrEmpty() ? prodInfo.detail.goods_name : dbProd.product_name; upProdInitParam.product.info.title = prodTitle; upProdParam.product.info.title = prodTitle; @@ -3472,21 +3512,31 @@ namespace TemuKJD.WXForms.ProductForms attrValue = "见包装"; if (attr.name == "贮存条件") attrValue = "常温"; - if (attr.name == "保质期") - { - if (chkDefaultBestBefore.Checked == false) - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"食品属性不含保质期,跳过上传\"}"; - if (txtDefaultBestBefore.Text.ParseToInt() < 30) - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"食品默认保质期设置小于30天,跳过上传\"}"; - attrValue = txtDefaultBestBefore.Text.ParseToInt() + " 天"; - } + + //if (attr.name == "保质期") + //{ + // if (chkDefaultBestBefore.Checked == false) + // return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"食品属性不含保质期,跳过上传\"}"; + // if (txtDefaultBestBefore.Text.ParseToInt() < 15) + // return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"食品默认保质期设置小于15天,跳过上传\"}"; + // attrValue = txtDefaultBestBefore.Text.ParseToInt() + " 天"; + //} + } + + if (attr.name == "保质期") + { + if (chkDefaultBestBefore.Checked == false) + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"属性不含保质期,跳过上传\"}"; + if (txtDefaultBestBefore.Text.ParseToInt() < 3) + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"默认保质期设置小于3天,跳过上传\"}"; + attrValue = txtDefaultBestBefore.Text.ParseToInt() + " 天"; } } if (attrValue.IsNullOrEmpty() && attr.type == "string") { attrValue = "其他"; } - if (attr.type == "decimal4_unit" || attr.type == "integer_unit") + if (attrValue.IsNullOrEmpty() && (attr.type == "decimal4_unit" || attr.type == "integer_unit")) { if (attr.value == "%") attrValue = "10 %"; @@ -4471,10 +4521,23 @@ namespace TemuKJD.WXForms.ProductForms { upProdParam.product.info.extraService.freightInsurance = 0; } + // 假1赔3 if (upProdParam.product.info.category[0].name == "珠宝首饰" || upProdParam.product.info.category[1].name == "时尚饰品") { upProdParam.product.info.extraService.fakeOnePayFour = 1; } + // 坏损包退 damageGuarantee + if (upProdParam.product.info.category[0].name == "生鲜" || upProdParam.product.info.category[0].name == "酒类" || + upProdParam.product.info.category[0].name == "食品饮料" || upProdParam.product.info.category[0].name == "保健食品/膳食营养补充食品" || + (upProdParam.product.info.category[0].name == "农资园艺" && upProdParam.product.info.category[1].name == "花卉绿植")) + { + upProdParam.product.info.extraService.damageGuarantee = 1; + } + // 生鲜不支持换货,关闭 + if (upProdParam.product.info.category[0].name == "生鲜") + { + upProdParam.product.info.extraService.exchangeSupport = 0; + } if (cell != null) { @@ -4986,12 +5049,30 @@ namespace TemuKJD.WXForms.ProductForms break; foreach (var prod in prodLst) { - var selectProd = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(prod)); - selectProd.out_product_Id = prod.id.ToString(); - selectProd.id = 1; - if (lstTemuDBProductSelect.Count > 0) - selectProd.id = lstTemuDBProductSelect.Max(p => p.id) + 1; - this.lstTemuDBProductSelect.Add(selectProd); + var productNameLst = new List() { prod.product_name }; + if (BaseClass.UserAuthority.Contains("商品裂变") && chkFissionProduct.Checked) + { + Invoke(new Action(() => + { + var titleCount = txtFissionProductCount.Text.Trim().ParseToInt(); + if (prod.fission_words.ParseToString().Length > 20 && titleCount > 0) + { + productNameLst = prod.fission_words.Replace("fission_goods_names:", "") + .Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries).OrderBy(x => Guid.NewGuid()).Distinct().Take(titleCount) + .ToList(); + } + })); + } + foreach (var productName in productNameLst) + { + var selectProd = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(prod)); + selectProd.out_product_Id = prod.id.ToString(); + selectProd.id = 1; + selectProd.product_name = productName; + if (lstTemuDBProductSelect.Count > 0) + selectProd.id = lstTemuDBProductSelect.Max(p => p.id) + 1; + this.lstTemuDBProductSelect.Add(selectProd); + } Invoke(new Action(() => { @@ -5132,6 +5213,11 @@ namespace TemuKJD.WXForms.ProductForms // 回采数据 if (chkWXComplateProd.Checked) data += "&has_wx_format=1"; + + if (BaseClass.UserAuthority.Contains("商品裂变") && chkFissionProduct.Checked) + { + data += "&fission_words=fission_goods_names:"; + } })); var html = GetHtml.PostUtf8(url, data); if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) @@ -5661,7 +5747,8 @@ namespace TemuKJD.WXForms.ProductForms private void cmbCateFilter1_TextChanged(object sender, EventArgs e) { - if (cmbSourceType.Text != "厂商直采" && cmbSourceType.Text != "1688厂家" && cmbSourceType.Text != "微信店采" && cmbSourceType.Text != "微信小店") + //if (cmbSourceType.Text != "厂商直采" && cmbSourceType.Text != "1688厂家" && cmbSourceType.Text != "微信店采" && cmbSourceType.Text != "微信小店") + if (btnSwitchCatType.Text != "W") return; cmbCateFilter2.Text = ""; @@ -5681,7 +5768,8 @@ namespace TemuKJD.WXForms.ProductForms private void cmbCateFilter2_TextChanged(object sender, EventArgs e) { - if (cmbSourceType.Text != "厂商直采" && cmbSourceType.Text != "1688厂家" && cmbSourceType.Text != "微信店采" && cmbSourceType.Text != "微信小店") + //if (cmbSourceType.Text != "厂商直采" && cmbSourceType.Text != "1688厂家" && cmbSourceType.Text != "微信店采" && cmbSourceType.Text != "微信小店") + if (btnSwitchCatType.Text != "W") return; cmbCateFilter3.Text = ""; diff --git a/TEMUKJD/WXForms/ShopForms/WXShopOptimizeForm.Designer.cs b/TEMUKJD/WXForms/ShopForms/WXShopOptimizeForm.Designer.cs index 1ae7b25..fac5207 100644 --- a/TEMUKJD/WXForms/ShopForms/WXShopOptimizeForm.Designer.cs +++ b/TEMUKJD/WXForms/ShopForms/WXShopOptimizeForm.Designer.cs @@ -134,6 +134,7 @@ namespace TemuKJD.WXForms.ShopForms this.colRemaining = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.btnUpdateKdn = new DevComponents.DotNetBar.PanelEx(); this.txtFilterOrderId = new System.Windows.Forms.TextBox(); this.btnRestoreFilter = new DevComponents.DotNetBar.PanelEx(); this.btnFilter = new DevComponents.DotNetBar.PanelEx(); @@ -272,6 +273,8 @@ namespace TemuKJD.WXForms.ShopForms this.colDgv5OptimizeStatus = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colDgv5Optimize = new System.Windows.Forms.DataGridViewLinkColumn(); this.colDgv5Remark = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.tabPage6 = new System.Windows.Forms.TabPage(); + this.splitContainer4 = new System.Windows.Forms.SplitContainer(); this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); this.splitContainer3 = new System.Windows.Forms.SplitContainer(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); @@ -308,6 +311,9 @@ namespace TemuKJD.WXForms.ShopForms this.panel5.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvData5)).BeginInit(); + this.tabPage6.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit(); + this.splitContainer4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); this.splitContainer3.Panel1.SuspendLayout(); this.splitContainer3.Panel2.SuspendLayout(); @@ -989,21 +995,48 @@ namespace TemuKJD.WXForms.ShopForms // // splitContainer2.Panel2 // + this.splitContainer2.Panel2.Controls.Add(this.btnUpdateKdn); this.splitContainer2.Panel2.Controls.Add(this.txtFilterOrderId); this.splitContainer2.Panel2.Controls.Add(this.btnRestoreFilter); this.splitContainer2.Panel2.Controls.Add(this.btnFilter); this.splitContainer2.Panel2.Controls.Add(this.label3); this.splitContainer2.Panel2.Controls.Add(this.ucTabControl1); this.splitContainer2.Panel2.Padding = new System.Windows.Forms.Padding(0, 0, 4, 0); - this.splitContainer2.Size = new System.Drawing.Size(1772, 533); + this.splitContainer2.Size = new System.Drawing.Size(1467, 533); this.splitContainer2.SplitterDistance = 365; this.splitContainer2.TabIndex = 0; // + // btnUpdateKdn + // + this.btnUpdateKdn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnUpdateKdn.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnUpdateKdn.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnUpdateKdn.DisabledBackColor = System.Drawing.Color.Empty; + this.btnUpdateKdn.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnUpdateKdn.Location = new System.Drawing.Point(604, 7); + this.btnUpdateKdn.Name = "btnUpdateKdn"; + this.btnUpdateKdn.Size = new System.Drawing.Size(115, 25); + this.btnUpdateKdn.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnUpdateKdn.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnUpdateKdn.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnUpdateKdn.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnUpdateKdn.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnUpdateKdn.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnUpdateKdn.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnUpdateKdn.Style.GradientAngle = 90; + this.btnUpdateKdn.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnUpdateKdn.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnUpdateKdn.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnUpdateKdn.TabIndex = 801; + this.btnUpdateKdn.Text = "刷新订单助手状态"; + this.btnUpdateKdn.Visible = false; + this.btnUpdateKdn.Click += new System.EventHandler(this.btnUpdateKdn_Click); + // // txtFilterOrderId // this.txtFilterOrderId.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txtFilterOrderId.Font = new System.Drawing.Font("微软雅黑", 10F); - this.txtFilterOrderId.Location = new System.Drawing.Point(1082, 7); + this.txtFilterOrderId.Location = new System.Drawing.Point(777, 7); this.txtFilterOrderId.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2); this.txtFilterOrderId.Name = "txtFilterOrderId"; this.txtFilterOrderId.Size = new System.Drawing.Size(219, 25); @@ -1015,7 +1048,7 @@ namespace TemuKJD.WXForms.ShopForms this.btnRestoreFilter.CanvasColor = System.Drawing.SystemColors.Control; this.btnRestoreFilter.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnRestoreFilter.DisabledBackColor = System.Drawing.Color.Empty; - this.btnRestoreFilter.Location = new System.Drawing.Point(1351, 7); + this.btnRestoreFilter.Location = new System.Drawing.Point(1046, 7); this.btnRestoreFilter.Name = "btnRestoreFilter"; this.btnRestoreFilter.Size = new System.Drawing.Size(44, 25); this.btnRestoreFilter.Style.Alignment = System.Drawing.StringAlignment.Center; @@ -1041,7 +1074,7 @@ namespace TemuKJD.WXForms.ShopForms this.btnFilter.Cursor = System.Windows.Forms.Cursors.Hand; this.btnFilter.DisabledBackColor = System.Drawing.Color.Empty; this.btnFilter.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnFilter.Location = new System.Drawing.Point(1304, 7); + this.btnFilter.Location = new System.Drawing.Point(999, 7); this.btnFilter.Name = "btnFilter"; this.btnFilter.Size = new System.Drawing.Size(44, 25); this.btnFilter.Style.Alignment = System.Drawing.StringAlignment.Center; @@ -1063,7 +1096,7 @@ namespace TemuKJD.WXForms.ShopForms // this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(1035, 12); + this.label3.Location = new System.Drawing.Point(730, 12); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(56, 17); this.label3.TabIndex = 797; @@ -1077,6 +1110,7 @@ namespace TemuKJD.WXForms.ShopForms this.ucTabControl1.Controls.Add(this.tabPage3); this.ucTabControl1.Controls.Add(this.tabPage4); this.ucTabControl1.Controls.Add(this.tabPage5); + this.ucTabControl1.Controls.Add(this.tabPage6); this.ucTabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.ucTabControl1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.ucTabControl1.ItemSize = new System.Drawing.Size(73, 36); @@ -1084,7 +1118,7 @@ namespace TemuKJD.WXForms.ShopForms this.ucTabControl1.Name = "ucTabControl1"; this.ucTabControl1.SelectedIndex = 0; this.ucTabControl1.ShowCloseButton = false; - this.ucTabControl1.Size = new System.Drawing.Size(1399, 533); + this.ucTabControl1.Size = new System.Drawing.Size(1094, 533); this.ucTabControl1.TabIndex = 781; this.ucTabControl1.TabSelectColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); this.ucTabControl1.TabSelectTextColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); @@ -1095,7 +1129,7 @@ namespace TemuKJD.WXForms.ShopForms this.tabPage1.Controls.Add(this.panel1); this.tabPage1.Location = new System.Drawing.Point(2, 40); this.tabPage1.Name = "tabPage1"; - this.tabPage1.Size = new System.Drawing.Size(1393, 489); + this.tabPage1.Size = new System.Drawing.Size(1088, 489); this.tabPage1.TabIndex = 4; this.tabPage1.Text = " 品质退款 "; this.tabPage1.UseVisualStyleBackColor = true; @@ -1109,14 +1143,14 @@ namespace TemuKJD.WXForms.ShopForms this.panel1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(1393, 489); + this.panel1.Size = new System.Drawing.Size(1088, 489); this.panel1.TabIndex = 2; // // pictureBox1 // this.pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.None; this.pictureBox1.Image = global::TemuKJD.Properties.Resources.loading_blue; - this.pictureBox1.Location = new System.Drawing.Point(671, 219); + this.pictureBox1.Location = new System.Drawing.Point(519, 219); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(50, 50); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; @@ -1136,7 +1170,7 @@ namespace TemuKJD.WXForms.ShopForms this.pnlUpdateRemark.Controls.Add(this.lblOrderId); this.pnlUpdateRemark.Controls.Add(this.lblShopName); this.pnlUpdateRemark.Controls.Add(this.label2); - this.pnlUpdateRemark.Location = new System.Drawing.Point(459, 63); + this.pnlUpdateRemark.Location = new System.Drawing.Point(307, 63); this.pnlUpdateRemark.Name = "pnlUpdateRemark"; this.pnlUpdateRemark.Size = new System.Drawing.Size(474, 146); this.pnlUpdateRemark.TabIndex = 781; @@ -1287,7 +1321,7 @@ namespace TemuKJD.WXForms.ShopForms this.dgvData1.Name = "dgvData1"; this.dgvData1.ReadOnly = true; this.dgvData1.RowTemplate.Height = 23; - this.dgvData1.Size = new System.Drawing.Size(1393, 489); + this.dgvData1.Size = new System.Drawing.Size(1088, 489); this.dgvData1.TabIndex = 187; this.dgvData1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvData_CellContentClick); // @@ -1446,7 +1480,7 @@ namespace TemuKJD.WXForms.ShopForms this.tabPage2.Controls.Add(this.panel2); this.tabPage2.Location = new System.Drawing.Point(2, 40); this.tabPage2.Name = "tabPage2"; - this.tabPage2.Size = new System.Drawing.Size(1393, 489); + this.tabPage2.Size = new System.Drawing.Size(1088, 489); this.tabPage2.TabIndex = 5; this.tabPage2.Text = " 订单评价 "; this.tabPage2.UseVisualStyleBackColor = true; @@ -1459,14 +1493,14 @@ namespace TemuKJD.WXForms.ShopForms this.panel2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.panel2.Location = new System.Drawing.Point(0, 0); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(1393, 489); + this.panel2.Size = new System.Drawing.Size(1088, 489); this.panel2.TabIndex = 3; // // pictureBox2 // this.pictureBox2.Anchor = System.Windows.Forms.AnchorStyles.None; this.pictureBox2.Image = global::TemuKJD.Properties.Resources.loading_blue; - this.pictureBox2.Location = new System.Drawing.Point(671, 219); + this.pictureBox2.Location = new System.Drawing.Point(519, 219); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(50, 50); this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; @@ -1520,7 +1554,7 @@ namespace TemuKJD.WXForms.ShopForms this.dgvData2.Name = "dgvData2"; this.dgvData2.ReadOnly = true; this.dgvData2.RowTemplate.Height = 23; - this.dgvData2.Size = new System.Drawing.Size(1393, 489); + this.dgvData2.Size = new System.Drawing.Size(1088, 489); this.dgvData2.TabIndex = 187; this.dgvData2.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvData_CellContentClick); // @@ -1706,7 +1740,7 @@ namespace TemuKJD.WXForms.ShopForms this.tabPage3.Controls.Add(this.panel3); this.tabPage3.Location = new System.Drawing.Point(2, 40); this.tabPage3.Name = "tabPage3"; - this.tabPage3.Size = new System.Drawing.Size(1393, 489); + this.tabPage3.Size = new System.Drawing.Size(1088, 489); this.tabPage3.TabIndex = 1; this.tabPage3.Text = " 揽收不达标 "; this.tabPage3.UseVisualStyleBackColor = true; @@ -1719,14 +1753,14 @@ namespace TemuKJD.WXForms.ShopForms this.panel3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.panel3.Location = new System.Drawing.Point(0, 0); this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(1393, 489); + this.panel3.Size = new System.Drawing.Size(1088, 489); this.panel3.TabIndex = 1; // // pictureBox3 // this.pictureBox3.Anchor = System.Windows.Forms.AnchorStyles.None; this.pictureBox3.Image = global::TemuKJD.Properties.Resources.loading_blue; - this.pictureBox3.Location = new System.Drawing.Point(677, 219); + this.pictureBox3.Location = new System.Drawing.Point(525, 219); this.pictureBox3.Name = "pictureBox3"; this.pictureBox3.Size = new System.Drawing.Size(50, 50); this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; @@ -1781,7 +1815,7 @@ namespace TemuKJD.WXForms.ShopForms this.dgvData3.Name = "dgvData3"; this.dgvData3.ReadOnly = true; this.dgvData3.RowTemplate.Height = 23; - this.dgvData3.Size = new System.Drawing.Size(1393, 489); + this.dgvData3.Size = new System.Drawing.Size(1088, 489); this.dgvData3.TabIndex = 187; this.dgvData3.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvData_CellContentClick); // @@ -1978,7 +2012,7 @@ namespace TemuKJD.WXForms.ShopForms this.tabPage4.Controls.Add(this.panel4); this.tabPage4.Location = new System.Drawing.Point(2, 40); this.tabPage4.Name = "tabPage4"; - this.tabPage4.Size = new System.Drawing.Size(1393, 489); + this.tabPage4.Size = new System.Drawing.Size(1088, 489); this.tabPage4.TabIndex = 2; this.tabPage4.Text = " 配送不达标 "; this.tabPage4.UseVisualStyleBackColor = true; @@ -1991,14 +2025,14 @@ namespace TemuKJD.WXForms.ShopForms this.panel4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.panel4.Location = new System.Drawing.Point(0, 0); this.panel4.Name = "panel4"; - this.panel4.Size = new System.Drawing.Size(1393, 489); + this.panel4.Size = new System.Drawing.Size(1088, 489); this.panel4.TabIndex = 2; // // pictureBox4 // this.pictureBox4.Anchor = System.Windows.Forms.AnchorStyles.None; this.pictureBox4.Image = global::TemuKJD.Properties.Resources.loading_blue; - this.pictureBox4.Location = new System.Drawing.Point(677, 219); + this.pictureBox4.Location = new System.Drawing.Point(525, 219); this.pictureBox4.Name = "pictureBox4"; this.pictureBox4.Size = new System.Drawing.Size(50, 50); this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; @@ -2053,7 +2087,7 @@ namespace TemuKJD.WXForms.ShopForms this.dgvData4.Name = "dgvData4"; this.dgvData4.ReadOnly = true; this.dgvData4.RowTemplate.Height = 23; - this.dgvData4.Size = new System.Drawing.Size(1393, 489); + this.dgvData4.Size = new System.Drawing.Size(1088, 489); this.dgvData4.TabIndex = 187; this.dgvData4.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvData_CellContentClick); // @@ -2250,7 +2284,7 @@ namespace TemuKJD.WXForms.ShopForms this.tabPage5.Controls.Add(this.panel5); this.tabPage5.Location = new System.Drawing.Point(2, 40); this.tabPage5.Name = "tabPage5"; - this.tabPage5.Size = new System.Drawing.Size(1393, 489); + this.tabPage5.Size = new System.Drawing.Size(1088, 489); this.tabPage5.TabIndex = 3; this.tabPage5.Text = " 物流负向反馈 "; this.tabPage5.UseVisualStyleBackColor = true; @@ -2263,14 +2297,14 @@ namespace TemuKJD.WXForms.ShopForms this.panel5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.panel5.Location = new System.Drawing.Point(0, 0); this.panel5.Name = "panel5"; - this.panel5.Size = new System.Drawing.Size(1393, 489); + this.panel5.Size = new System.Drawing.Size(1088, 489); this.panel5.TabIndex = 3; // // pictureBox5 // this.pictureBox5.Anchor = System.Windows.Forms.AnchorStyles.None; this.pictureBox5.Image = global::TemuKJD.Properties.Resources.loading_blue; - this.pictureBox5.Location = new System.Drawing.Point(677, 219); + this.pictureBox5.Location = new System.Drawing.Point(525, 219); this.pictureBox5.Name = "pictureBox5"; this.pictureBox5.Size = new System.Drawing.Size(50, 50); this.pictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; @@ -2324,7 +2358,7 @@ namespace TemuKJD.WXForms.ShopForms this.dgvData5.Name = "dgvData5"; this.dgvData5.ReadOnly = true; this.dgvData5.RowTemplate.Height = 23; - this.dgvData5.Size = new System.Drawing.Size(1393, 489); + this.dgvData5.Size = new System.Drawing.Size(1088, 489); this.dgvData5.TabIndex = 187; this.dgvData5.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvData_CellContentClick); // @@ -2505,6 +2539,27 @@ namespace TemuKJD.WXForms.ShopForms this.colDgv5Remark.Name = "colDgv5Remark"; this.colDgv5Remark.ReadOnly = true; // + // tabPage6 + // + this.tabPage6.Controls.Add(this.splitContainer4); + this.tabPage6.Location = new System.Drawing.Point(2, 40); + this.tabPage6.Name = "tabPage6"; + this.tabPage6.Padding = new System.Windows.Forms.Padding(3); + this.tabPage6.Size = new System.Drawing.Size(1088, 489); + this.tabPage6.TabIndex = 6; + this.tabPage6.Text = " 快递助手 "; + this.tabPage6.UseVisualStyleBackColor = true; + // + // splitContainer4 + // + this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer4.Location = new System.Drawing.Point(3, 3); + this.splitContainer4.Name = "splitContainer4"; + this.splitContainer4.Panel1MinSize = 0; + this.splitContainer4.Size = new System.Drawing.Size(1082, 483); + this.splitContainer4.SplitterDistance = 0; + this.splitContainer4.TabIndex = 0; + // // statusBar // this.statusBar.BackColor = System.Drawing.Color.White; @@ -2513,7 +2568,7 @@ namespace TemuKJD.WXForms.ShopForms this.statusBar.Location = new System.Drawing.Point(0, 0); this.statusBar.Margin = new System.Windows.Forms.Padding(0); this.statusBar.Name = "statusBar"; - this.statusBar.Size = new System.Drawing.Size(1772, 27); + this.statusBar.Size = new System.Drawing.Size(1467, 27); this.statusBar.TabIndex = 2; // // splitContainer3 @@ -2531,7 +2586,7 @@ namespace TemuKJD.WXForms.ShopForms // splitContainer3.Panel2 // this.splitContainer3.Panel2.Controls.Add(this.statusBar); - this.splitContainer3.Size = new System.Drawing.Size(1772, 564); + this.splitContainer3.Size = new System.Drawing.Size(1467, 564); this.splitContainer3.SplitterDistance = 533; this.splitContainer3.TabIndex = 3; // @@ -2539,7 +2594,7 @@ namespace TemuKJD.WXForms.ShopForms // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(1772, 564); + this.ClientSize = new System.Drawing.Size(1467, 564); this.Controls.Add(this.splitContainer3); this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.KeyPreview = true; @@ -2585,6 +2640,9 @@ namespace TemuKJD.WXForms.ShopForms this.panel5.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvData5)).EndInit(); + this.tabPage6.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit(); + this.splitContainer4.ResumeLayout(false); this.splitContainer3.Panel1.ResumeLayout(false); this.splitContainer3.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); @@ -2778,5 +2836,8 @@ namespace TemuKJD.WXForms.ShopForms private System.Windows.Forms.DataGridViewTextBoxColumn colDgv5OptimizeStatus; private System.Windows.Forms.DataGridViewLinkColumn colDgv5Optimize; private System.Windows.Forms.DataGridViewTextBoxColumn colDgv5Remark; + private System.Windows.Forms.TabPage tabPage6; + private System.Windows.Forms.SplitContainer splitContainer4; + private DevComponents.DotNetBar.PanelEx btnUpdateKdn; } } \ No newline at end of file diff --git a/TEMUKJD/WXForms/ShopForms/WXShopOptimizeForm.cs b/TEMUKJD/WXForms/ShopForms/WXShopOptimizeForm.cs index f91cff3..b51aabd 100644 --- a/TEMUKJD/WXForms/ShopForms/WXShopOptimizeForm.cs +++ b/TEMUKJD/WXForms/ShopForms/WXShopOptimizeForm.cs @@ -31,11 +31,17 @@ using NaiBa.Util; using AllBase.Model.Config; using TemuKJD.WXForms.ProductForms; using TemuKJD.WXForms.AdminForms; +using CefSharp.WinForms; +using NaiBa.CefHelper; +using System.Net; namespace TemuKJD.WXForms.ShopForms { public partial class WXShopOptimizeForm : BaseForm { + public string expressToolUrl = "https://56.kdniao.com/main.html"; + public ChromiumWebBrowser cefWebBrowser = null; + public CancellationTokenSource cancellationTokenSource { get; set; } = null; public bool IsLoadComplate { get; set; } = false; @@ -78,6 +84,15 @@ namespace TemuKJD.WXForms.ShopForms dgvData5.AddSelectorColumn("colDgv5Check"); dgvData5.AddImgColumn("colDgv5Img", "colDgv5ImgUrl"); + this.tabPage6.Select(); + cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(expressToolUrl); + splitContainer4.Panel2.Controls.Add(cefWebBrowser); + Task.Run(() => { + Thread.Sleep(500); + Invoke(new Action(() => { this.tabPage1.Select(); })); + }); + this.ucTabControl1.TabPages.Remove(tabPage6); + IsLoadComplate = true; } @@ -2513,6 +2528,23 @@ namespace TemuKJD.WXForms.ShopForms } } } + + private void btnUpdateKdn_Click(object sender, EventArgs e) + { + List waybillIds = new List(); + var dgvRows1 = dgvData1.Rows.Cast().Where(r => r.Cells["colDgv1OptimizeStatus"].Value.ParseToString().IsNullOrEmpty()).ToList(); + waybillIds.AddRange(dgvRows1.Select(r => r.Cells["colDgv1OrderId"].Value.ParseToString())); + + + while (dgvRows1.Count > 0) + { + var dgvRows1Tmp = dgvRows1.Take(500).ToList(); + dgvRows1.RemoveAll(r => dgvRows1Tmp.Contains(r)); + waybillIds.AddRange(dgvRows1Tmp.Select(r => r.Cells["colDgv1OrderId"].Value.ParseToString())); + } + + //var waybillIds = string.Join(",", dgvRows1Tmp.Select(r => r.Cells["colDgv1OrderId"].Value.ParseToString()).Distinct()); + } } public static class ShopOptimize @@ -2616,5 +2648,20 @@ namespace TemuKJD.WXForms.ShopForms var result = WXHttpResponseBLL.WeiXinPostResponse(shop, url, body, referer); return result; } + + public static string kdniaoGetWayBillPage(string kdnAuth, string wayBillIds = "", int page=1) + { + //string body = @"LogisticsCode=321166519053000%0A773423272400495&PlatformOrderCode=&ShipperCode=&StartTime=2026-05-27+00%3A00%3A00&EndTime=2026-06-03+23%3A59%3A59&StartCollectTime=&EndCollectTime=&StartSignTime=&EndSignTime=&StartPayTime=&EndPayTime=&Remark=&ShopName=&Warehouse=&CustomerName=&PlatformName=&CurrentMonitorStatus=&PageIndex=1&PageSize=500&IsFollow="; + + string url = "https://lmsapinew.kdniao.com/WayBillMonitor/GetWayBillPageResult"; + string referer = "https://56.kdniao.com/"; + string body = @"LogisticsCode=" + wayBillIds.ParseToString().Replace("\r\n", "%0A").Replace("\n", "%0A").Replace(",", "%0A").Replace(",", "%0A") + + @"&PlatformOrderCode=&ShipperCode=&StartTime=" + DateTime.Now.AddDays(-6).ToString("yyyy-MM-dd") + + "+00%3A00%3A00&EndTime=" + DateTime.Now.Date.AddDays(1).ToString("yyyy-MM-dd") + + "+23%3A59%3A59&StartCollectTime=&EndCollectTime=&StartSignTime=&EndSignTime=&StartPayTime=" + + "&EndPayTime=&Remark=&ShopName=&Warehouse=&CustomerName=&PlatformName=&CurrentMonitorStatus=&PageIndex=1&PageSize=500&IsFollow="; + var result = WXHttpResponseBLL.kdniaoPostResponse(kdnAuth, url, body, referer); + return result; + } } }