diff --git a/AllBase/AllBase.csproj b/AllBase/AllBase.csproj index 08bc989..a5db25e 100644 --- a/AllBase/AllBase.csproj +++ b/AllBase/AllBase.csproj @@ -228,6 +228,8 @@ + + diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs index 04b2e3f..bf6b49c 100644 --- a/AllBase/BaseClass.cs +++ b/AllBase/BaseClass.cs @@ -27,7 +27,7 @@ namespace AllBase /// /// 版本ID /// - public static int VersionCount = 661; + public static int VersionCount = 667; //public static int VersionCount = 613; /// diff --git a/AllBase/Model/Result/ShopLoginInfo.cs b/AllBase/Model/Result/ShopLoginInfo.cs index 5b8f151..c7dea57 100644 --- a/AllBase/Model/Result/ShopLoginInfo.cs +++ b/AllBase/Model/Result/ShopLoginInfo.cs @@ -168,6 +168,23 @@ namespace AllBase.Model.Result //在一次检测中是否已检测同一个账户下的不同店铺,如果已检测,使用相同cookie即可,不用多次检测 public bool isCheckLogin { get; set; } + + /// + /// temu推广直通车用户Id + /// + public string ad_seller_unique_id { get; set; } + /// + /// temu推广直通车链接地址(含信息) + /// + public string ad_url { get; set; } + /// + /// temu推广直通车cookie + /// + public string ad_cookie { get; set; } + /// + /// temu推广直通车登录状态 + /// + public string ad_login_status { get; set; } } public class AuthInfo diff --git a/AllBase/Model/Result/TemuResult/AdsDetailInfo.cs b/AllBase/Model/Result/TemuResult/AdsDetailInfo.cs new file mode 100644 index 0000000..70dd8f0 --- /dev/null +++ b/AllBase/Model/Result/TemuResult/AdsDetailInfo.cs @@ -0,0 +1,150 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AllBase.Model.Result.TemuResult +{ + public class AdsDetailInfo + { + public string ad_id { get; set; } // "300000013263418354", + public string goods_id { get; set; } // "601100393886730", + public string goods_title { get; set; } // "女式白色拖鞋,带有花卉点缀 - 开口趾,平跟,人造盖,易于套穿的设计女士夏季坡跟凉鞋:时尚低跟凉鞋舒适行走,足弓支撑,休闲一脚蹬夏季鞋女士坡跟凉鞋镂空一脚蹬防水台坡跟凉鞋夏季休闲步行鞋女式凉鞋时尚夏季舒适拖鞋带花朵休闲防滑防水台轻质坡跟鞋", + public string goods_image_url { get; set; } // "https://img.kwcdn.com/product/fancy/4ad9b614-f0aa-482b-8064-801d0c22cb68.jpg", + public string goods_min_price { get; set; } // "¥26.71", + public string goods_max_price { get; set; } // "¥40.95", + public long? roas { get; set; } // 100000, + public string roas_str { get; set; } // "10", + /// + /// 广告投资回报率 (ROAS) + /// + public decimal? real_roas { get; set; } // 0, + /// + /// 广告费比(广告) + /// + public decimal? acos { get; set; } // 0, + public int? ad_show_status { get; set; } // 0, + public int? ad_phase { get; set; } // 0, + public int? budget { get; set; } // -1, + public string budget_str { get; set; } // "不限", + public int? used_budget { get; set; } // 0, + /// + /// 总花费 + /// + public decimal? used_money { get; set; } // null, + /// + /// 订单量 + /// + public int? order_num { get; set; } // 0, + /// + /// 曝光量 + /// + public int? impr_num { get; set; } // 0, + /// + /// 申报价销售额 + /// + public decimal? supply_price_sale { get; set; } // 0, + public reports_summary_dto_info reports_summary_dto { get; set; } + public object sku_encode { get; set; } // null, + public string spu_id { get; set; } // "1458392528", + public int? budget_remaining_modify_count { get; set; } // 5, + public int? budget_max_modify_count { get; set; } // 5, + public int? roas_remaining_modify_count { get; set; } // 0, + public int? roas_max_modify_count { get; set; } // 0, + public object forbid_reason { get; set; } // null, + public object remain_daily_budget_percent { get; set; } // null, + public ad_roas_info ad_roas_info { get; set; } + public List ad_advice_types { get; set; } // [ 4 ] + public List site_name_list { get; set; } // [ "泰国", "卡塔尔", "约旦", "巴西", ... ] + public object site_price_info_list { get; set; } // null, + public object site_status_info_list { get; set; } // null, + public object group { get; set; } // null + + // 自定义参数 + public string shopId { get; set; } + } + + public class ad_roas_info + { + public int? real_order_cnt { get; set; } // 0, + public int? expected_order_cnt { get; set; } // 10, + public object limit_roas { get; set; } // null, + public int? ad_roas_advice_type { get; set; } // 4 + + } + + public class reports_summary_dto_info + { + public reports_summary_dto_item_info impr_cnt_all { get; set; } + public reports_summary_dto_item_info cart_cnt_all { get; set; } + public reports_summary_dto_item_info clk_cnt_all { get; set; } + public reports_summary_dto_item_info ad_spend_all { get; set; } + public reports_summary_dto_item_info order_pay_amt_all { get; set; } + public reports_summary_dto_item_info order_pay_cnt_all { get; set; } + public reports_summary_dto_item_info roas_all { get; set; } + public reports_summary_dto_item_info ctr_all { get; set; } + public reports_summary_dto_item_info acos_all { get; set; } + /// + /// 每笔成交花费 + /// + public reports_summary_dto_item_info transaction_cost { get; set; } + public object ad_cost_ratio { get; set; } + /// + /// 件数 + /// + public reports_summary_dto_item_info goods_num { get; set; } + public object week_roas { get; set; } + public natural_week_roas_all_info natural_week_roas_all { get; set; } + public object month_roas { get; set; } + public reports_summary_dto_item_info cvr { get; set; } + public reports_summary_dto_item_info net_ad_spend { get; set; } + public reports_summary_dto_item_info net_goods_num { get; set; } + public reports_summary_dto_item_info net_order_pay_amt { get; set; } + public reports_summary_dto_item_info net_roas { get; set; } + public reports_summary_dto_item_info net_acos { get; set; } + public reports_summary_dto_item_info net_order_pay_cnt { get; set; } + /// + /// 每笔净成交花费 + /// + public reports_summary_dto_item_info net_transaction_cost { get; set; } + public reports_summary_dto_item_info total_impr_cnt { get; set; } + public reports_summary_dto_item_info total_order_pay_amt { get; set; } + public reports_summary_dto_item_info total_order_pay_cnt { get; set; } + /// + /// 点击量 + /// + public reports_summary_dto_item_info total_clk_cnt { get; set; } + public reports_summary_dto_item_info total_roas { get; set; } + /// + /// 点击率 + /// + public reports_summary_dto_item_info total_ctr { get; set; } + /// + /// 转化率 + /// + public reports_summary_dto_item_info total_cvr { get; set; } + public reports_summary_dto_item_info total_acos { get; set; } + public reports_summary_dto_item_info total_transaction_cost { get; set; } + public reports_summary_dto_item_info total_goods_num { get; set; } + } + + public class natural_week_roas_all_info + { + public object real_roas { get; set; } // null, + public object real_roas_val { get; set; } // null, + public object incr_rate { get; set; } // null, + public object plan_roas { get; set; } // null, + public object plan_roas_val { get; set; } // null + + } + + public class reports_summary_dto_item_info + { + public int? val { get; set; } // 0, + public object incr_rate { get; set; } // null, + public string trans_val { get; set; } // "0" + + + } +} diff --git a/AllBase/Model/Result/TemuResult/AdsMallGoodsInfo.cs b/AllBase/Model/Result/TemuResult/AdsMallGoodsInfo.cs new file mode 100644 index 0000000..11225aa --- /dev/null +++ b/AllBase/Model/Result/TemuResult/AdsMallGoodsInfo.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AllBase.Model.Result.TemuResult +{ + /// + /// 直通车查询商品结果 + /// + public class AdsQueryMallGoodsInfo + { + public long? mall_id { get; set; } // "634418216147215", + public int? mall_type { get; set; } // "0", + public List goods_info_list { get; set; } + public List optional_category_list { get; set; } + public List site_info_list { get; set; } + } + + public class ads_site_info + { + public int? site_id { get; set; } // 129, + public string site_name{ get; set; } // "泰国", + public string img_url { get; set; } // null + public object promotion_info { get; set; } // null + } + + public class ads_optional_category_info + { + public long? category_id { get; set; } // 24389, + public string category_name { get; set; } // "庭院、草坪和园艺" + + } + + public class ads_goods_info + { + public long? goods_id { get; set; } // "601099667164131", + public string goods_name { get; set; } // "Whimsical Gecko Garden Statue - Resin Hanging Sculpture For Outdoor Decor, Cartoon Animal Theme, Perfect For Ages 14+", + public string thumb_url { get; set; } // "https://img.kwcdn.com/product/fancy/e758f971-5e1f-4630-a6fa-26823c6c69a8.jpg", + public object sku_encode { get; set; } // null, + public string spu_id { get; set; } // "402033440", + public string supply_price_min { get; set; } // "¥29.34", + public string supply_price_max { get; set; } // "¥29.34", + public List category_name_list{ get; set; } // [ "庭院、草坪和园艺" ], + public long? create_timestamp { get; set; } // 1726500080000, + public int? sku_total_quantity { get; set; } // 1, + public int? sales { get; set; } // 7, + public List site_list { get; set; } // [ 129, 130, 131, 132, 134, ... ] + public object gray_reason { get; set; } // null + public List site_name_list { get; set; } // [ "泰国", "卡塔尔", "约旦", "巴西", "阿曼", ... ] + public object site_price_info_list { get; set; } // null, + public object coupon_discount { get; set; } // null, + public object coupon_expiration_time { get; set; } // null + + // 自定义参数 + public string shopId { get; set; } + } +} diff --git a/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs b/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs index ea78e5a..fca6918 100644 --- a/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs +++ b/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs @@ -309,7 +309,7 @@ namespace KJD_Web.BLL.BXX login_status2 = row["login_status2"].ToString(), add_product_remaining = row["add_product_remaining"].ParseToInt(), add_product_month = row["add_product_month"].ParseToInt(), - operate_sub_sa_name = row["operate_sub_sa_name"] as string, + operate_sub_sa_name = row["operate_sub_sa_name"].ParseToString(), }; shopList.Add(shop); diff --git a/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs b/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs index 10be36f..2d5cc2a 100644 --- a/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs +++ b/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs @@ -94,11 +94,7 @@ namespace KJD_Web.BLL } else { - sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.shop_id,s.shop_account,s.sub_user_name,s.user_name," + - "s.company_name,s.notes,s.login_status,s.login_status2,c.add_product_remaining,c.add_product_month,s.add_time,s.mdy_time," + - "s.add_sub_sa_time,s.operate_sub_sa_name"; - //sql += " FROM kjd.shop s WHERE 1=1"; - sql += " FROM kjd.shop s LEFT JOIN kjd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1"; + sql = "SELECT s.* FROM kjd.shop s LEFT JOIN kjd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1"; sql += where; // where 子句 @@ -130,8 +126,11 @@ namespace KJD_Web.BLL login_status2 = row["login_status2"].ToString(), add_product_remaining = row["add_product_remaining"].ParseToInt(), add_product_month = row["add_product_month"].ParseToInt(), - operate_sub_sa_name = row["operate_sub_sa_name"] as string, - + operate_sub_sa_name = row["operate_sub_sa_name"].ParseToString(), + ad_cookie = row["ad_cookie"].ParseToString(), + ad_login_status = row["ad_login_status"].ParseToString(), + ad_seller_unique_id = row["ad_seller_unique_id"].ParseToString(), + ad_url = row["ad_url"].ParseToString(), }; shopList.Add(shop); } @@ -272,10 +271,7 @@ namespace KJD_Web.BLL } else { - sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.shop_id,s.shop_account,s.sub_user_name,s.user_name," + - "s.company_name,s.notes,s.login_status,s.login_status2,c.add_product_remaining,c.add_product_month,s.add_time,s.mdy_time," + - "s.add_sub_sa_time,s.operate_sub_sa_name"; - sql += " FROM kjd.shop s LEFT JOIN kjd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1"; + sql = "SELECT s.* FROM kjd.shop s LEFT JOIN kjd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1"; sql += where; // where 子句 @@ -307,8 +303,11 @@ namespace KJD_Web.BLL login_status2 = row["login_status2"].ToString(), add_product_remaining = row["add_product_remaining"].ParseToInt(), add_product_month = row["add_product_month"].ParseToInt(), - operate_sub_sa_name = row["operate_sub_sa_name"] as string, - + operate_sub_sa_name = row["operate_sub_sa_name"].ParseToString(), + ad_cookie = row["ad_cookie"].ParseToString(), + ad_login_status = row["ad_login_status"].ParseToString(), + ad_seller_unique_id = row["ad_seller_unique_id"].ParseToString(), + ad_url = row["ad_url"].ParseToString(), }; shopList.Add(shop); } @@ -674,6 +673,47 @@ namespace KJD_Web.BLL return "{\"code\":19999,\"msg\":\"未知错误\"}"; } + public string MdyAdsCookieAndLoginStatus(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + string ad_url = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ad_url")); + string ad_seller_unique_id = RegexUtils.GetStringQuery(ref inputData, "ad_seller_unique_id"); + string ad_login_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ad_login_status")); + string ad_cookie = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ad_cookie")); + + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + if (string.IsNullOrEmpty(shop_id)) + { + return "{\"code\":500,\"msg\":\"店铺没有登录名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update kjd.shop set"; + if (ad_url != null) + sql += " ad_url='" + ad_url + "',"; + if (ad_seller_unique_id != null) + sql += " ad_seller_unique_id='" + ad_seller_unique_id + "',"; + if (ad_login_status != null) + sql += " ad_login_status='" + ad_login_status + "',"; + if (ad_cookie != null) + sql += " ad_cookie='" + ad_cookie + "',"; + sql = sql.TrimEnd(','); + sql += " where shop_id='" + shop_id + "'"; + + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } public string DelShop(string inputData, bool isAdmin=false) { diff --git a/KJDService/KJD_WebService/Model/ShopModel/ShopParam.cs b/KJDService/KJD_WebService/Model/ShopModel/ShopParam.cs index a1bbc62..52dfd90 100644 --- a/KJDService/KJD_WebService/Model/ShopModel/ShopParam.cs +++ b/KJDService/KJD_WebService/Model/ShopModel/ShopParam.cs @@ -12,7 +12,13 @@ namespace KJD_Web.Model.ShopModel public string login_pass { get; set; } public string cookie { get; set; } public string cookie2 { get; set; } + /// + /// 拼多多AntiContents + /// public string anti_contents { get; set; } + /// + /// 拼多多Id + /// public string pddid { get; set; } public string shop_id { get; set; } public string shop_account { get; set; } @@ -29,5 +35,22 @@ namespace KJD_Web.Model.ShopModel public int add_product_month { get; set; } public string operate_sub_sa_name { get; set; } + + /// + /// temu推广直通车用户Id + /// + public string ad_seller_unique_id { get; set; } + /// + /// temu推广直通车链接地址(含信息) + /// + public string ad_url { get; set; } + /// + /// temu推广直通车cookie + /// + public string ad_cookie { get; set; } + /// + /// temu推广直通车登录状态 + /// + public string ad_login_status { get; set; } } } \ No newline at end of file diff --git a/KJDService/KJD_WebService/ShopService.asmx.cs b/KJDService/KJD_WebService/ShopService.asmx.cs index ccfacfa..9dbd786 100644 --- a/KJDService/KJD_WebService/ShopService.asmx.cs +++ b/KJDService/KJD_WebService/ShopService.asmx.cs @@ -120,6 +120,19 @@ namespace KJD_Web Context.Response.End(); } + + [WebMethod] + public void mdy_shop_ads_cookie_and_login_status() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new ShopManage().MdyAdsCookieAndLoginStatus(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + [WebMethod] public void admin_get_shop_list() { diff --git a/TEMUKJD/BLL/HttpResponseBLL.cs b/TEMUKJD/BLL/HttpResponseBLL.cs index 458a6a0..80fcdc8 100644 --- a/TEMUKJD/BLL/HttpResponseBLL.cs +++ b/TEMUKJD/BLL/HttpResponseBLL.cs @@ -304,6 +304,92 @@ namespace TemuKJD.BLL return result; } + public static string PostResponseAds(ShopLoginInfo shop, string _url, string _data, string referer) + { + string cookies = ""; + var cookiesArrAds = shop.ad_cookie.Replace("\\", "").Split(';').Select(s => s.Trim()); + foreach (var cook in cookiesArrAds) + { + if (cook.StartsWith("mallid")) + cookies += "mallid=" + shop.ShopId + "; "; + else if (cook.StartsWith("MALL_ID")) + cookies += "MALL_ID=" + shop.ShopId + "; "; + else + cookies += cook + "; "; + } + cookies = cookies.Trim().TrimEnd(';'); + + //var cookiesArr = shop.Cookies2.Replace("\\", "").Split(';').Select(s => s.Trim()); + //foreach (var cook in cookiesArr) + //{ + // if (("; " + cookies).Contains("; " + cook)) + // continue; + + // if (cook.StartsWith("mallid")) + // cookies += "mallid=" + shop.ShopId + "; "; + // else if (cook.StartsWith("MALL_ID")) + // cookies += "MALL_ID=" + shop.ShopId + "; "; + // else + // cookies += cook + "; "; + //} + HttpWebResponse response = null; + string result; + try + { + string url = _url; + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); + + //request.KeepAlive = true; + request.Headers.Add("sec-ch-ua-platform", @"""Windows"""); + request.Headers.Add("x-phan-data", @"0aeJx7xMxiYAgkomMBESQC7A"); + request.Headers.Add("sec-ch-ua", @"""Not)A;Brand"";v=""8"", ""Chromium"";v=""138"""); + request.Headers.Add("sec-ch-ua-mobile", @"?0"); + request.Headers.Add("X-Ad-Request-Id", @"6c0d8ba5-93f2-4083-b56d-8cb9e2362139"); + //request.Headers.Add("x-document-referer", @"https://ads.temu.com/index.html?adAreaOverride=2&refer_page_name=login&refer_page_id=22942_1762243593932_o1u0yfk48r&refer_page_sn=22942&_x_sessn_id=rzrz06wgzk&is_back=1"); + request.Headers.Add("x-document-referer", shop.ad_url); + 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/plain, */*"; + request.ContentType = "application/json;charset=UTF-8"; + request.Headers.Add("Origin", @"https://ads.temu.com"); + request.Headers.Set(HttpRequestHeader.Cookie, cookies); + request.Headers.Add("Sec-Fetch-Site", @"same-origin"); + request.Headers.Add("Sec-Fetch-Mode", @"cors"); + request.Headers.Add("Sec-Fetch-Dest", @"empty"); + request.Referer = referer; + request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd"); + request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9"); + + 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 PDDPostResponse(ShopLoginInfo shop, string _url, string _data, string referer, string AntiContent = null) { diff --git a/TEMUKJD/BLL/ShopBLL.cs b/TEMUKJD/BLL/ShopBLL.cs index bd508f1..bf17726 100644 --- a/TEMUKJD/BLL/ShopBLL.cs +++ b/TEMUKJD/BLL/ShopBLL.cs @@ -231,17 +231,18 @@ namespace TemuKJD.BLL shop.SubUserName = BaseRegex.GetStringJson(ref shopStr, "sub_user_name"); shop.GroupName = BaseRegex.GetStringJson(ref shopStr, "shop_group"); //shop.Cookies = BaseRegex.GetStringJson(ref shopStr, "cookie"); - shop.Cookies = jObj["cookie"].IsNullOrEmpty() ? "[]" : jObj["cookie"].ToString(); - shop.Cookies = shop.Cookies.Replace("&", "&").Replace("%", "%").Replace("+", "+"); - //shop.Cookies2 = BaseRegex.GetStringJson(ref shopStr, "cookie2").ParseToString(); - shop.Cookies2 = jObj["cookie2"].ToString(); - shop.Cookies2 = shop.Cookies2.Replace("&", "&").Replace("%", "%").Replace("+", "+"); + shop.Cookies = jObj["cookie"].ParseToString().Replace("&", "&").Replace("%", "%").Replace("+", "+").Replace(""", "\""); + shop.Cookies2 = jObj["cookie2"].ParseToString().Replace("&", "&").Replace("%", "%").Replace("+", "+").Replace(""", "\""); shop.CompanyName = BaseRegex.GetStringJson(ref shopStr, "company_name"); shop.Notes = BaseRegex.GetStringJson(ref shopStr, "notes"); shop.LoginStatus = BaseRegex.GetStringJson(ref shopStr, "login_status"); shop.LoginStatus2 = BaseRegex.GetStringJson(ref shopStr, "login_status2"); shop.OperateSubSaName = BaseRegex.GetStringJson(ref shopStr, "operate_sub_sa_name"); shop.AddProductRemaining = BaseRegex.GetIntJson(ref shopStr, "add_product_remaining"); + shop.ad_cookie = BaseRegex.GetStringJson(ref shopStr, "ad_cookie").ParseToString().Replace("&", "&").Replace("%", "%").Replace("+", "+").Replace(""", "\""); + shop.ad_login_status = BaseRegex.GetStringJson(ref shopStr, "ad_login_status"); + shop.ad_seller_unique_id = BaseRegex.GetStringJson(ref shopStr, "ad_seller_unique_id"); + shop.ad_url = BaseRegex.GetStringJson(ref shopStr, "ad_url"); shop.pddid = BaseRegex.GetStringJson(ref shopStr, "pddid"); if (BaseClass.MainPath == "binxixi") diff --git a/TEMUKJD/KJD.csproj b/TEMUKJD/KJD.csproj index 7b41a5a..354becd 100644 --- a/TEMUKJD/KJD.csproj +++ b/TEMUKJD/KJD.csproj @@ -171,6 +171,12 @@ AdminProductPriceCheckForm.cs + + Form + + + JoinDeliveryFrom.cs + Form @@ -183,6 +189,12 @@ PurchasePriceForm.cs + + Form + + + TemuAdsForm.cs + Form @@ -857,12 +869,18 @@ AdminProductPriceCheckForm.cs + + JoinDeliveryFrom.cs + ProductChangePriceForm.cs PurchasePriceForm.cs + + TemuAdsForm.cs + DbProductCategorySearch.cs diff --git a/TEMUKJD/KJDForms/AdminForms/AdminForm.Designer.cs b/TEMUKJD/KJDForms/AdminForms/AdminForm.Designer.cs index 5571d11..564a827 100644 --- a/TEMUKJD/KJDForms/AdminForms/AdminForm.Designer.cs +++ b/TEMUKJD/KJDForms/AdminForms/AdminForm.Designer.cs @@ -35,14 +35,16 @@ System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("认领待上传"); System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("库存上传"); System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("商品核价"); - System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("超级权限管理", new System.Windows.Forms.TreeNode[] { + System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("加入发货台"); + System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("超级权限管理", new System.Windows.Forms.TreeNode[] { treeNode1, treeNode2, treeNode3, treeNode4, treeNode5, treeNode6, - treeNode7}); + treeNode7, + treeNode8}); this.panel1 = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel(); @@ -147,10 +149,12 @@ treeNode6.Text = "库存上传"; treeNode7.Name = "商品核价"; treeNode7.Text = "商品核价"; - treeNode8.Name = "超级权限管理"; - treeNode8.Text = "超级权限管理"; + treeNode8.Name = "加入发货台"; + treeNode8.Text = "加入发货台"; + treeNode9.Name = "超级权限管理"; + treeNode9.Text = "超级权限管理"; this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { - treeNode8}); + treeNode9}); this.tv.OverForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this.tv.Size = new System.Drawing.Size(140, 446); this.tv.TabIndex = 1; diff --git a/TEMUKJD/KJDForms/AdminForms/AdminForm.cs b/TEMUKJD/KJDForms/AdminForms/AdminForm.cs index 80e4c42..71c0e21 100644 --- a/TEMUKJD/KJDForms/AdminForms/AdminForm.cs +++ b/TEMUKJD/KJDForms/AdminForms/AdminForm.cs @@ -13,6 +13,7 @@ using TemuKJD.KJDForms.AdminForms; using TemuKJD.BaseForms; using TemuKJD.KJDForms.ProductSelectForms; using TemuKJD.KJDForms.ProductThirdSelectForms; +using TemuKJD.KJDForms.ProductForms; namespace TemuKJD.KJDForms.AdminForms { @@ -25,6 +26,7 @@ namespace TemuKJD.KJDForms.AdminForms public Lazy dbProductSelectListManageForm = new Lazy(); public Lazy productThirdSelectListManageForm = new Lazy(); public Lazy adminProductPriceCheckForm = new Lazy(); + public Lazy joinDeliveryFrom = new Lazy(); public AdminForm() { @@ -35,7 +37,8 @@ namespace TemuKJD.KJDForms.AdminForms tv.SelectedNode = tv.Nodes[0].Nodes[0]; tv.ExpandGroup(tv.Nodes[0].Name); - List hideName = new List() { "超级用户管理", "超级店铺管理", "选品数据库", "选品加价管理", "认领待上传", "库存上传", "商品核价" }; + List hideName = new List() { "超级用户管理", "超级店铺管理", "选品数据库", "选品加价管理", "认领待上传", "库存上传", "商品核价", + "加入发货台" }; if (BaseClass.GroupId == 3) { @@ -49,6 +52,9 @@ namespace TemuKJD.KJDForms.AdminForms hideName.Remove("认领待上传"); hideName.Remove("库存上传"); hideName.Remove("商品核价"); +#if DEBUG + hideName.Remove("加入发货台"); +#endif } if (BaseClass.SaLevel==2) { @@ -56,6 +62,9 @@ namespace TemuKJD.KJDForms.AdminForms hideName.Remove("认领待上传"); hideName.Remove("库存上传"); hideName.Remove("商品核价"); +#if DEBUG + hideName.Remove("加入发货台"); +#endif } } @@ -103,6 +112,10 @@ namespace TemuKJD.KJDForms.AdminForms case "商品核价": SetForm(adminProductPriceCheckForm.Value); break; + case "加入发货台": + joinDeliveryFrom.Value.IsAdmin = true; + SetForm(joinDeliveryFrom.Value); + break; } })); }).Start(); diff --git a/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.cs b/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.cs index 1d94ad7..7755f67 100644 --- a/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.cs +++ b/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.cs @@ -104,7 +104,9 @@ namespace TemuKJD.KJDForms.AdminForms public void SearchShop(int page) { - List shopIdSelectList = GetCheckedShopIdList(); + List userShopIdList = dgvShop.Rows.Cast() + .Where(r => r.Cells["colSelect"].Value.ParseToBool()) + .Select(r => r.Cells["colShopId"].Value.ParseToString() + r.Cells["colUser"].Value.ParseToString()).ToList(); if (InvokeRequired) { Invoke(new Action(() => @@ -133,7 +135,7 @@ namespace TemuKJD.KJDForms.AdminForms Invoke(new Action(() => { int rowIndex = this.dgvShop.Rows.Add( - shopIdSelectList.Contains(shop.ShopId + shop.UserName), + userShopIdList.Contains(shop.ShopId + shop.UserName), shop.UserName, shop.LoginName, shop.ShopId, @@ -144,11 +146,6 @@ namespace TemuKJD.KJDForms.AdminForms string.Empty ); displayShopStatus(shop); - //var row = dgvShop.Rows[rowIndex]; - //(row.Cells["colLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Green : Color.Red; - //(row.Cells["colLoginStatus"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Green : Color.Red; - //(row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightGreen : Color.OrangeRed; - //(row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkGreen : Color.DarkRed; })); } @@ -159,21 +156,6 @@ namespace TemuKJD.KJDForms.AdminForms }); } - private List GetCheckedShopIdList() - { - List shopNameList = new List(); - for (int i = 0; i < dgvShop.Rows.Count; i++) - { - if (dgvShop.Rows[i].Cells["colSelect"].Value.ParseToBool()) - { - string shopName = dgvShop.Rows[i].Cells["colShopId"].Value.ParseToString(); - shopName += dgvShop.Rows[i].Cells["colUser"].Value.ParseToString(); - shopNameList.Add(shopName); - } - } - return shopNameList; - } - public List AdminGetServerShopLst(out int pageCount, int page = 1, int pageSize = 50) { List list = new List(); @@ -213,6 +195,21 @@ namespace TemuKJD.KJDForms.AdminForms txtNotes.Text = txtShopId.Text = txtShopName.Text = ""; } + void displayShopStatus(ShopLoginInfo shop) + { + bool canUse = shop.LoginStatus2 == "国际版在线"; + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colLoginName"].Value.ParseToString() == shop?.LoginName); + foreach (var row in rows) + { + row.Cells["colCanUse"].Value = canUse; + row.Cells["colLoginStatus"].Value = canUse ? "在线" : "掉线"; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Green : Color.Red; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Green : Color.Red; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightGreen : Color.OrangeRed; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkGreen : Color.DarkRed; + } + } + private void dgvShop_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex < 0 || e.RowIndex < 0) @@ -248,21 +245,6 @@ namespace TemuKJD.KJDForms.AdminForms displayShopStatus(shop); } - void displayShopStatus(ShopLoginInfo shop) - { - bool canUse = shop.LoginStatus2 == "国际版在线"; - var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colLoginName"].Value.ParseToString() == shop?.LoginName); - foreach (var row in rows) - { - row.Cells["colCanUse"].Value = canUse; - row.Cells["colLoginStatus"].Value = canUse ? "在线" : "掉线"; - (row.Cells["colLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Green : Color.Red; - (row.Cells["colLoginStatus"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Green : Color.Red; - (row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightGreen : Color.OrangeRed; - (row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkGreen : Color.DarkRed; - } - } - private void dgvCheckPrice_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex < 0 || e.RowIndex < 0) diff --git a/TEMUKJD/KJDForms/AdminForms/AdminShopListForm.cs b/TEMUKJD/KJDForms/AdminForms/AdminShopListForm.cs index 6b0a066..9908111 100644 --- a/TEMUKJD/KJDForms/AdminForms/AdminShopListForm.cs +++ b/TEMUKJD/KJDForms/AdminForms/AdminShopListForm.cs @@ -508,7 +508,7 @@ namespace TemuKJD.KJDForms.AdminForms foreach (var sc in campanys) { sc.LoginStatus = "未登录"; - shop.Cookies = "empty=true;"; + sc.Cookies = "empty=true;"; } } else diff --git a/TEMUKJD/KJDForms/AdminForms/AdminShopLoginForm.cs b/TEMUKJD/KJDForms/AdminForms/AdminShopLoginForm.cs index e821312..4144322 100644 --- a/TEMUKJD/KJDForms/AdminForms/AdminShopLoginForm.cs +++ b/TEMUKJD/KJDForms/AdminForms/AdminShopLoginForm.cs @@ -32,6 +32,10 @@ namespace TemuKJD.KJDForms.AdminForms public partial class AdminShopLoginForm : LRBaseForm { public int CloseAfterSecond { get; set; } + /// + /// 推广直通车登录 + /// + public bool IsAdsLogin { get; set; } = false; public EnumOpenType openType = EnumOpenType.manage; public bool isMultiLogin = false; public string MultiLoginCookieName = ""; @@ -234,7 +238,7 @@ namespace TemuKJD.KJDForms.AdminForms List cookieList2 = CEFBrowser.GetCookieList(shopCookieHead2, cefWebBrowser.GetCookieManager(null)); // cef138 if (cookieList2 != null && cookieList2.Count > 0) { - for(int i =0; i < cookieList2.Count; i++) + for(int i = 0; i < cookieList2.Count; i++) { var cookie = cookieList2[i]; cookies2 += cookie.Name + "=" + cookie.Value + "; "; @@ -280,24 +284,104 @@ namespace TemuKJD.KJDForms.AdminForms ShopListForm.UpdateServerShopCookies(shop); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie } OnSaveComplete(shop); - if (this.Created && this.chkCloseAfterLogin.Checked) + if (!IsAdsLogin) { - //Invoke(new Action(() => { this.Close(); })); + if (this.Created && this.chkCloseAfterLogin.Checked) + Invoke(new Action(() => { this.Close(); })); + else + break; + } + } + + if (IsAdsLogin && !string.IsNullOrEmpty(shop.ad_seller_unique_id) && 1 == 2) + { + var obtainCodeRst = ShopListForm.GetObtainCode(shop); + var obtainCode = BaseRegex.GetStringJson(ref obtainCodeRst, "code"); + //https://ads.temu.com/login.html? + //redirectUrl=https%3A%2F%2Fads.temu.com%2Findex.html%3FadAreaOverride%3D2&userType=1&mallType=0 + //&ticket=Zjze2NHyZFaGP88ROyjN19a47ae59611391a296ae6403bbbfa39e9046ceba744aafe8227fd6 + //&adSellerUniqueId=eyJ1IjoiTVF3NFRGVmN2ZUVyZG1USDdOQ2o5dz09IiwidiI6MX0%3D&source=2&seller_source=11&adAreaOverride=2 + string url = "https://ads.temu.com/login.html?" + + "redirectUrl=https%3A%2F%2Fads.temu.com%2Findex.html%3FadAreaOverride%3D2&userType=1&mallType=0&ticket=" + obtainCode + + "&adSellerUniqueId=" + shop.ad_seller_unique_id + "&source=2&seller_source=11&adAreaOverride=2"; + cefWebBrowser.Load(url); + } + else if (IsAdsLogin) + { + cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sGetElementWithText); + + //点击商品推广按钮 + var adsJsStr = "window.scrollTo(0, document.body.scrollHeight);"; + var adsResponse = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(adsJsStr); + adsResponse.Wait(1000); + Thread.Sleep(Randomx.GetId(500, 1000)); + + adsJsStr = "var clickItem = getElementWithText('商品推广'); " + + "clickItem.click()"; + adsResponse = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(adsJsStr); + adsResponse.Wait(1000); + Thread.Sleep(Randomx.GetId(500, 1000)); + + // 模拟人为点击一次,否则窗口不跳转 + var host = cefWebBrowser.GetBrowser().GetHost(); + int x = Randomx.GetId(50, 200); + int y = Randomx.GetId(1, 10); + // 按下鼠标左键 + host.SendMouseClickEvent(x, y, MouseButtonType.Left, false, 1, CefEventFlags.None); + Thread.Sleep(50 + Randomx.GetId(200)); + host.SendMouseClickEvent(x, y, MouseButtonType.Left, true, 1, CefEventFlags.None); + Thread.Sleep(Randomx.GetId(100, 500)); + + //点击确认授权并前往按钮 + adsJsStr = "var clickItem = getElementWithText('确认授权并前往'); " + + "clickItem.parentElement.click();"; + adsResponse = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(adsJsStr); + adsResponse.Wait(1000); + Thread.Sleep(Randomx.GetId(300, 800)); + } + } + + if (1 == 1 && this.shop != null && currentUrl.StartsWith("https://ads.temu.com/index.html?adAreaOverride=")) + { + if (!cefWebBrowser.GetBrowser().MainFrame.IsValid) + continue; + + if (openType != EnumOpenType.login) + continue; + + if (!lstShopCompany.Any(c => c.AccountId == shop.ShopId)) + continue; + + shop.ad_url = txtAddress.Text; + string cookiesAds = ""; + List cookieAdsList = CEFBrowser.GetCookieList("ads.temu.com", cefWebBrowser.GetCookieManager(null)); + if (cookieAdsList != null && cookieAdsList.Count > 0) + { + for (int i = 0; i < cookieAdsList.Count; i++) + { + var cookie = cookieAdsList[i]; + cookiesAds += cookie.Name + "=" + cookie.Value + "; "; + } + cookiesAds = cookiesAds.Trim().TrimEnd(';'); + } + + if (!string.IsNullOrEmpty(cookiesAds)) + { + shop.ad_login_status = "在线"; + shop.ad_cookie = cookiesAds; + StartUp.SaveLocalShopLoginInfo(); // 店铺保存到本地 + ShopListForm.UpdateServerShopAdsCookies(shop); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie + OnSaveComplete(shop); + if (this.Created && this.chkCloseAfterLogin.Checked) + { + Invoke(new Action(() => { this.Close(); })); + } + else + { + break; } - else - break; } - var obtainCodeRst = ShopListForm.GetObtainCode(shop); - var obtainCode = BaseRegex.GetStringJson(ref obtainCodeRst, "code"); - //https://ads.temu.com/login.html? - //redirectUrl=https%3A%2F%2Fads.temu.com%2Findex.html%3FadAreaOverride%3D2&userType=1&mallType=0 - //&ticket=Zjze2NHyZFaGP88ROyjN19a47ae59611391a296ae6403bbbfa39e9046ceba744aafe8227fd6 - //&adSellerUniqueId=eyJ1IjoiTVF3NFRGVmN2ZUVyZG1USDdOQ2o5dz09IiwidiI6MX0%3D&source=2&seller_source=11&adAreaOverride=2 - string url = "https://ads.temu.com/login.html?" + - "redirectUrl=https%3A%2F%2Fads.temu.com%2Findex.html%3FadAreaOverride%3D2&userType=1&mallType=0&ticket=" + obtainCode + - "&source=2&seller_source=11&adAreaOverride=2"; - cefWebBrowser.Load(url); } } }); diff --git a/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.Designer.cs b/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.Designer.cs new file mode 100644 index 0000000..1641823 --- /dev/null +++ b/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.Designer.cs @@ -0,0 +1,968 @@ + +namespace TemuKJD.KJDForms.ProductForms +{ + partial class JoinDeliveryFrom + { + /// + /// 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() + { + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.ucGroupBoxEx3 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); + this.btnStart = new DevComponents.DotNetBar.PanelEx(); + this.txtRetryInterval = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.btnStop = new DevComponents.DotNetBar.PanelEx(); + this.btnSearch = new DevComponents.DotNetBar.PanelEx(); + this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); + this.btnEmpty = new DevComponents.DotNetBar.PanelEx(); + this.btnRefreshShop = new DevComponents.DotNetBar.PanelEx(); + this.txtNotes = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.txtShopName = new System.Windows.Forms.TextBox(); + this.txtShopId = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.splitContainer3 = new System.Windows.Forms.SplitContainer(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.chkSearchAllShop = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.pbShopLoading = new System.Windows.Forms.PictureBox(); + this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx(); + this.pbLoading = new System.Windows.Forms.PictureBox(); + this.dgvStock = new TemuKJD.UserComponent.DataGridViewEx(); + this.colUpId = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.colSupplierId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colSupplierName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colStockId = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colParentStockId = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colProductSkcPic = new System.Windows.Forms.DataGridViewImageColumn(); + this.colProductId = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colProdSkc = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colProdName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colPrcie = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colFrom = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colFromFake = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colInCartNumber7d = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colTodaySaleVolume = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colLastSevenDaysSaleVolume = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colSalesInventoryNum = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colWaitReceiveNum = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colQualityScore = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colQualityRate = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colQualityCount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colNeedStockUp = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.splitContainer4 = new System.Windows.Forms.SplitContainer(); + this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); + this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage(); + this.btnClear = new DevComponents.DotNetBar.PanelEx(); + this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.colUser = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colShopNotes = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colLoginStatus = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.ucGroupBoxEx3.SuspendLayout(); + this.ucGroupBoxEx1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); + this.splitContainer3.Panel1.SuspendLayout(); + this.splitContainer3.Panel2.SuspendLayout(); + this.splitContainer3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbShopLoading)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgvShop)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgvStock)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit(); + this.splitContainer4.Panel1.SuspendLayout(); + this.splitContainer4.Panel2.SuspendLayout(); + this.splitContainer4.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.ucGroupBoxEx3); + this.splitContainer1.Panel1.Controls.Add(this.ucGroupBoxEx1); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.splitContainer3); + this.splitContainer1.Size = new System.Drawing.Size(1314, 455); + this.splitContainer1.SplitterDistance = 120; + this.splitContainer1.TabIndex = 11; + // + // ucGroupBoxEx3 + // + this.ucGroupBoxEx3.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.ucGroupBoxEx3.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.ucGroupBoxEx3.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND; + this.ucGroupBoxEx3.Controls.Add(this.btnStart); + this.ucGroupBoxEx3.Controls.Add(this.txtRetryInterval); + this.ucGroupBoxEx3.Controls.Add(this.label1); + this.ucGroupBoxEx3.Controls.Add(this.btnStop); + this.ucGroupBoxEx3.Controls.Add(this.btnSearch); + this.ucGroupBoxEx3.Location = new System.Drawing.Point(282, 2); + this.ucGroupBoxEx3.Name = "ucGroupBoxEx3"; + this.ucGroupBoxEx3.Size = new System.Drawing.Size(1030, 120); + this.ucGroupBoxEx3.TabIndex = 666; + this.ucGroupBoxEx3.TabStop = false; + this.ucGroupBoxEx3.Text = "待发货商品操作"; + // + // btnStart + // + this.btnStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnStart.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnStart.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnStart.DisabledBackColor = System.Drawing.Color.Empty; + this.btnStart.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnStart.Location = new System.Drawing.Point(760, 25); + this.btnStart.Name = "btnStart"; + this.btnStart.Size = new System.Drawing.Size(117, 23); + this.btnStart.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnStart.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnStart.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnStart.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnStart.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnStart.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnStart.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnStart.Style.GradientAngle = 90; + this.btnStart.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnStart.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnStart.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnStart.TabIndex = 439; + this.btnStart.Text = "循环加入发货台"; + // + // txtRetryInterval + // + this.txtRetryInterval.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.txtRetryInterval.Location = new System.Drawing.Point(685, 25); + this.txtRetryInterval.Name = "txtRetryInterval"; + this.txtRetryInterval.Size = new System.Drawing.Size(69, 23); + this.txtRetryInterval.TabIndex = 431; + this.txtRetryInterval.Text = "5"; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(611, 28); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(76, 17); + this.label1.TabIndex = 432; + this.label1.Text = "重试间隔(秒)"; + // + // btnStop + // + this.btnStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnStop.CanvasColor = System.Drawing.SystemColors.Control; + this.btnStop.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnStop.DisabledBackColor = System.Drawing.Color.Empty; + this.btnStop.Location = new System.Drawing.Point(883, 25); + this.btnStop.Name = "btnStop"; + this.btnStop.Size = new System.Drawing.Size(117, 23); + this.btnStop.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnStop.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); + this.btnStop.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); + this.btnStop.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; + this.btnStop.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnStop.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; + this.btnStop.Style.GradientAngle = 90; + this.btnStop.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center; + this.btnStop.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnStop.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnStop.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnStop.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White; + this.btnStop.TabIndex = 668; + this.btnStop.Text = "停止操作"; + // + // btnSearch + // + this.btnSearch.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnSearch.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnSearch.DisabledBackColor = System.Drawing.Color.Empty; + this.btnSearch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSearch.Location = new System.Drawing.Point(28, 25); + this.btnSearch.Name = "btnSearch"; + this.btnSearch.Size = new System.Drawing.Size(91, 23); + this.btnSearch.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnSearch.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSearch.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSearch.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnSearch.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnSearch.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnSearch.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnSearch.Style.GradientAngle = 90; + this.btnSearch.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnSearch.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnSearch.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnSearch.TabIndex = 427; + this.btnSearch.Text = "读取待发货"; + this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click); + // + // ucGroupBoxEx1 + // + this.ucGroupBoxEx1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.ucGroupBoxEx1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.ucGroupBoxEx1.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND; + this.ucGroupBoxEx1.Controls.Add(this.btnEmpty); + this.ucGroupBoxEx1.Controls.Add(this.btnRefreshShop); + this.ucGroupBoxEx1.Controls.Add(this.txtNotes); + this.ucGroupBoxEx1.Controls.Add(this.label4); + this.ucGroupBoxEx1.Controls.Add(this.txtShopName); + this.ucGroupBoxEx1.Controls.Add(this.txtShopId); + this.ucGroupBoxEx1.Controls.Add(this.label2); + this.ucGroupBoxEx1.Controls.Add(this.label3); + this.ucGroupBoxEx1.Location = new System.Drawing.Point(2, 2); + this.ucGroupBoxEx1.Name = "ucGroupBoxEx1"; + this.ucGroupBoxEx1.Size = new System.Drawing.Size(280, 120); + this.ucGroupBoxEx1.TabIndex = 399; + this.ucGroupBoxEx1.TabStop = false; + this.ucGroupBoxEx1.Text = "基础"; + // + // btnEmpty + // + this.btnEmpty.CanvasColor = System.Drawing.SystemColors.Control; + this.btnEmpty.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnEmpty.DisabledBackColor = System.Drawing.Color.Empty; + this.btnEmpty.Location = new System.Drawing.Point(227, 81); + this.btnEmpty.Name = "btnEmpty"; + this.btnEmpty.Size = new System.Drawing.Size(40, 23); + this.btnEmpty.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnEmpty.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); + this.btnEmpty.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); + this.btnEmpty.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; + this.btnEmpty.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnEmpty.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; + this.btnEmpty.Style.GradientAngle = 90; + this.btnEmpty.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center; + this.btnEmpty.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnEmpty.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnEmpty.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnEmpty.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White; + this.btnEmpty.TabIndex = 701; + this.btnEmpty.Text = "重置"; + this.btnEmpty.Click += new System.EventHandler(this.btnEmpty_Click); + // + // btnRefreshShop + // + this.btnRefreshShop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnRefreshShop.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnRefreshShop.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnRefreshShop.DisabledBackColor = System.Drawing.Color.Empty; + this.btnRefreshShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnRefreshShop.Location = new System.Drawing.Point(163, 81); + this.btnRefreshShop.Name = "btnRefreshShop"; + this.btnRefreshShop.Size = new System.Drawing.Size(62, 23); + this.btnRefreshShop.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnRefreshShop.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnRefreshShop.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnRefreshShop.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnRefreshShop.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnRefreshShop.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnRefreshShop.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnRefreshShop.Style.GradientAngle = 90; + this.btnRefreshShop.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnRefreshShop.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnRefreshShop.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnRefreshShop.TabIndex = 431; + this.btnRefreshShop.Text = "刷新/查询"; + this.btnRefreshShop.Click += new System.EventHandler(this.btnRefreshShop_Click); + // + // txtNotes + // + this.txtNotes.Location = new System.Drawing.Point(53, 81); + this.txtNotes.Name = "txtNotes"; + this.txtNotes.Size = new System.Drawing.Size(105, 23); + this.txtNotes.TabIndex = 388; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(19, 84); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(44, 17); + this.label4.TabIndex = 389; + this.label4.Text = "分组:"; + // + // txtShopName + // + this.txtShopName.Location = new System.Drawing.Point(53, 53); + this.txtShopName.Name = "txtShopName"; + this.txtShopName.Size = new System.Drawing.Size(214, 23); + this.txtShopName.TabIndex = 386; + // + // txtShopId + // + this.txtShopId.Location = new System.Drawing.Point(53, 25); + this.txtShopId.Name = "txtShopId"; + this.txtShopId.Size = new System.Drawing.Size(214, 23); + this.txtShopId.TabIndex = 384; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(6, 28); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(57, 17); + this.label2.TabIndex = 385; + this.label2.Text = "店铺ID:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(19, 56); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(44, 17); + this.label3.TabIndex = 387; + this.label3.Text = "名称:"; + // + // splitContainer3 + // + this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer3.Location = new System.Drawing.Point(0, 0); + this.splitContainer3.Name = "splitContainer3"; + this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer3.Panel1 + // + this.splitContainer3.Panel1.Controls.Add(this.splitContainer2); + // + // splitContainer3.Panel2 + // + this.splitContainer3.Panel2.Controls.Add(this.splitContainer4); + this.splitContainer3.Size = new System.Drawing.Size(1314, 331); + this.splitContainer3.SplitterDistance = 301; + this.splitContainer3.TabIndex = 1; + // + // splitContainer2 + // + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Name = "splitContainer2"; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.chkSearchAllShop); + this.splitContainer2.Panel1.Controls.Add(this.pbShopLoading); + this.splitContainer2.Panel1.Controls.Add(this.dgvShop); + this.splitContainer2.Panel1.Padding = new System.Windows.Forms.Padding(4, 0, 0, 0); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.pbLoading); + this.splitContainer2.Panel2.Controls.Add(this.dgvStock); + this.splitContainer2.Panel2.Padding = new System.Windows.Forms.Padding(0, 0, 4, 0); + this.splitContainer2.Size = new System.Drawing.Size(1314, 301); + this.splitContainer2.SplitterDistance = 280; + this.splitContainer2.TabIndex = 0; + // + // chkSearchAllShop + // + this.chkSearchAllShop.AutoSize = true; + this.chkSearchAllShop.Checked = true; + this.chkSearchAllShop.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkSearchAllShop.Location = new System.Drawing.Point(24, 42); + this.chkSearchAllShop.Name = "chkSearchAllShop"; + this.chkSearchAllShop.Size = new System.Drawing.Size(147, 21); + this.chkSearchAllShop.TabIndex = 711; + this.chkSearchAllShop.Text = "二级超管查询所有店铺"; + this.chkSearchAllShop.UseVisualStyleBackColor = true; + this.chkSearchAllShop.Visible = false; + // + // pbShopLoading + // + this.pbShopLoading.Anchor = System.Windows.Forms.AnchorStyles.None; + this.pbShopLoading.Image = global::TemuKJD.Properties.Resources.loading_blue; + this.pbShopLoading.Location = new System.Drawing.Point(115, 125); + this.pbShopLoading.Name = "pbShopLoading"; + this.pbShopLoading.Size = new System.Drawing.Size(50, 50); + this.pbShopLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbShopLoading.TabIndex = 677; + this.pbShopLoading.TabStop = false; + this.pbShopLoading.Visible = false; + // + // dgvShop + // + this.dgvShop.AllowUserToAddRows = false; + this.dgvShop.AllowUserToDeleteRows = false; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke; + this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + this.dgvShop.BackgroundColor = System.Drawing.Color.White; + this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.colSelect, + this.colUser, + this.colLoginName, + this.colShopId, + this.colShopName, + this.colShopNotes, + this.colLoginStatus, + this.colCanUse, + this.colMessage}); + this.dgvShop.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgvShop.Location = new System.Drawing.Point(4, 0); + this.dgvShop.Name = "dgvShop"; + this.dgvShop.ReadOnly = true; + this.dgvShop.RowHeadersWidth = 25; + this.dgvShop.RowTemplate.Height = 23; + this.dgvShop.Size = new System.Drawing.Size(276, 301); + this.dgvShop.TabIndex = 6; + // + // pbLoading + // + this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None; + this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue; + this.pbLoading.Location = new System.Drawing.Point(490, 125); + this.pbLoading.Name = "pbLoading"; + this.pbLoading.Size = new System.Drawing.Size(50, 50); + this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbLoading.TabIndex = 188; + this.pbLoading.TabStop = false; + this.pbLoading.Visible = false; + // + // dgvStock + // + this.dgvStock.AllowUserToAddRows = false; + this.dgvStock.AllowUserToDeleteRows = false; + dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke; + this.dgvStock.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3; + this.dgvStock.BackgroundColor = System.Drawing.Color.White; + this.dgvStock.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvStock.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; + this.dgvStock.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgvStock.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.colUpId, + this.colCheck, + this.colSupplierId, + this.colSupplierName, + this.colStockId, + this.colParentStockId, + this.colImgUrl, + this.colProductSkcPic, + this.colProductId, + this.colProdSkc, + this.colProdName, + this.colPrcie, + this.colFrom, + this.colFromFake, + this.colInCartNumber7d, + this.colTodaySaleVolume, + this.colLastSevenDaysSaleVolume, + this.colSalesInventoryNum, + this.colWaitReceiveNum, + this.colQualityScore, + this.colQualityRate, + this.colQualityCount, + this.colNeedStockUp, + this.colMsg}); + this.dgvStock.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgvStock.Location = new System.Drawing.Point(0, 0); + this.dgvStock.Name = "dgvStock"; + this.dgvStock.ReadOnly = true; + this.dgvStock.RowTemplate.Height = 23; + this.dgvStock.Size = new System.Drawing.Size(1026, 301); + this.dgvStock.TabIndex = 189; + // + // colUpId + // + this.colUpId.HeaderText = "上家Id"; + this.colUpId.Name = "colUpId"; + this.colUpId.ReadOnly = true; + this.colUpId.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colUpId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colUpId.Visible = false; + this.colUpId.Width = 95; + // + // colCheck + // + this.colCheck.HeaderText = "选择"; + this.colCheck.Name = "colCheck"; + this.colCheck.ReadOnly = true; + this.colCheck.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colCheck.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colCheck.Width = 30; + // + // colSupplierId + // + this.colSupplierId.HeaderText = "店铺Id"; + this.colSupplierId.Name = "colSupplierId"; + this.colSupplierId.ReadOnly = true; + // + // colSupplierName + // + this.colSupplierName.HeaderText = "店铺名称"; + this.colSupplierName.Name = "colSupplierName"; + this.colSupplierName.ReadOnly = true; + this.colSupplierName.Width = 110; + // + // colStockId + // + this.colStockId.HeaderText = "备货单号"; + this.colStockId.Name = "colStockId"; + this.colStockId.ReadOnly = true; + this.colStockId.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colStockId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colStockId.Width = 120; + // + // colParentStockId + // + this.colParentStockId.HeaderText = "备货母单号"; + this.colParentStockId.Name = "colParentStockId"; + this.colParentStockId.ReadOnly = true; + this.colParentStockId.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colParentStockId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colParentStockId.Width = 120; + // + // colImgUrl + // + this.colImgUrl.HeaderText = "图片路径"; + this.colImgUrl.Name = "colImgUrl"; + this.colImgUrl.ReadOnly = true; + this.colImgUrl.Visible = false; + // + // colProductSkcPic + // + this.colProductSkcPic.HeaderText = "Skc图片"; + this.colProductSkcPic.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom; + this.colProductSkcPic.Name = "colProductSkcPic"; + this.colProductSkcPic.ReadOnly = true; + this.colProductSkcPic.Width = 60; + // + // colProductId + // + this.colProductId.HeaderText = "商品Id"; + this.colProductId.Name = "colProductId"; + this.colProductId.ReadOnly = true; + this.colProductId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colProductId.Width = 90; + // + // colProdSkc + // + this.colProdSkc.FillWeight = 150F; + this.colProdSkc.HeaderText = "商品SKC"; + this.colProdSkc.Name = "colProdSkc"; + this.colProdSkc.ReadOnly = true; + this.colProdSkc.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colProdSkc.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colProdSkc.Width = 90; + // + // colProdName + // + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colProdName.DefaultCellStyle = dataGridViewCellStyle5; + this.colProdName.HeaderText = "标题"; + this.colProdName.Name = "colProdName"; + this.colProdName.ReadOnly = true; + this.colProdName.Width = 180; + // + // colPrcie + // + this.colPrcie.HeaderText = "价格"; + this.colPrcie.Name = "colPrcie"; + this.colPrcie.ReadOnly = true; + this.colPrcie.Visible = false; + // + // colFrom + // + this.colFrom.HeaderText = "来源"; + this.colFrom.Name = "colFrom"; + this.colFrom.ReadOnly = true; + this.colFrom.Visible = false; + // + // colFromFake + // + this.colFromFake.HeaderText = "来源"; + this.colFromFake.Name = "colFromFake"; + this.colFromFake.ReadOnly = true; + this.colFromFake.Visible = false; + // + // colInCartNumber7d + // + this.colInCartNumber7d.HeaderText = "近七日加购"; + this.colInCartNumber7d.Name = "colInCartNumber7d"; + this.colInCartNumber7d.ReadOnly = true; + this.colInCartNumber7d.Visible = false; + this.colInCartNumber7d.Width = 75; + // + // colTodaySaleVolume + // + this.colTodaySaleVolume.HeaderText = "今日销量"; + this.colTodaySaleVolume.Name = "colTodaySaleVolume"; + this.colTodaySaleVolume.ReadOnly = true; + this.colTodaySaleVolume.Visible = false; + this.colTodaySaleVolume.Width = 70; + // + // colLastSevenDaysSaleVolume + // + this.colLastSevenDaysSaleVolume.HeaderText = "七日销量"; + this.colLastSevenDaysSaleVolume.Name = "colLastSevenDaysSaleVolume"; + this.colLastSevenDaysSaleVolume.ReadOnly = true; + this.colLastSevenDaysSaleVolume.Visible = false; + this.colLastSevenDaysSaleVolume.Width = 70; + // + // colSalesInventoryNum + // + this.colSalesInventoryNum.HeaderText = "仓库可用库存"; + this.colSalesInventoryNum.Name = "colSalesInventoryNum"; + this.colSalesInventoryNum.ReadOnly = true; + this.colSalesInventoryNum.Visible = false; + this.colSalesInventoryNum.Width = 90; + // + // colWaitReceiveNum + // + this.colWaitReceiveNum.HeaderText = "已发货库存"; + this.colWaitReceiveNum.Name = "colWaitReceiveNum"; + this.colWaitReceiveNum.ReadOnly = true; + this.colWaitReceiveNum.Visible = false; + this.colWaitReceiveNum.Width = 75; + // + // colQualityScore + // + this.colQualityScore.HeaderText = "品质分"; + this.colQualityScore.Name = "colQualityScore"; + this.colQualityScore.ReadOnly = true; + this.colQualityScore.Width = 50; + // + // colQualityRate + // + this.colQualityRate.HeaderText = "售后率"; + this.colQualityRate.Name = "colQualityRate"; + this.colQualityRate.ReadOnly = true; + this.colQualityRate.Width = 50; + // + // colQualityCount + // + this.colQualityCount.HeaderText = "售后数"; + this.colQualityCount.Name = "colQualityCount"; + this.colQualityCount.ReadOnly = true; + this.colQualityCount.Width = 50; + // + // colNeedStockUp + // + this.colNeedStockUp.HeaderText = "是否需备货"; + this.colNeedStockUp.Name = "colNeedStockUp"; + this.colNeedStockUp.ReadOnly = true; + this.colNeedStockUp.Visible = false; + this.colNeedStockUp.Width = 75; + // + // colMsg + // + this.colMsg.HeaderText = "状态"; + this.colMsg.Name = "colMsg"; + this.colMsg.ReadOnly = true; + this.colMsg.Width = 400; + // + // splitContainer4 + // + this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer4.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer4.Location = new System.Drawing.Point(0, 0); + this.splitContainer4.Name = "splitContainer4"; + // + // splitContainer4.Panel1 + // + this.splitContainer4.Panel1.Controls.Add(this.statusBar); + this.splitContainer4.Panel1.Controls.Add(this.ucSplitPage1); + // + // splitContainer4.Panel2 + // + this.splitContainer4.Panel2.Controls.Add(this.btnClear); + this.splitContainer4.Size = new System.Drawing.Size(1314, 26); + this.splitContainer4.SplitterDistance = 1036; + this.splitContainer4.TabIndex = 3; + // + // statusBar + // + this.statusBar.BackColor = System.Drawing.Color.White; + this.statusBar.Dock = System.Windows.Forms.DockStyle.Left; + 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(282, 0); + this.statusBar.Margin = new System.Windows.Forms.Padding(0); + this.statusBar.Name = "statusBar"; + this.statusBar.Size = new System.Drawing.Size(600, 26); + this.statusBar.TabIndex = 2; + // + // ucSplitPage1 + // + this.ucSplitPage1.CurrentPage = 1; + this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Left; + this.ucSplitPage1.IsShowPageSize = false; + this.ucSplitPage1.Location = new System.Drawing.Point(0, 0); + this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0); + this.ucSplitPage1.Name = "ucSplitPage1"; + this.ucSplitPage1.PageSize = 50; + this.ucSplitPage1.Size = new System.Drawing.Size(282, 26); + this.ucSplitPage1.TabIndex = 6; + this.ucSplitPage1.TotalPage = 1; + this.ucSplitPage1.PageChange += new System.Action(this.ucSplitPage1_PageChange); + // + // btnClear + // + this.btnClear.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.btnClear.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnClear.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnClear.DisabledBackColor = System.Drawing.Color.Empty; + this.btnClear.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnClear.Location = new System.Drawing.Point(180, 1); + this.btnClear.Name = "btnClear"; + this.btnClear.Size = new System.Drawing.Size(90, 21); + this.btnClear.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnClear.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnClear.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnClear.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnClear.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnClear.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnClear.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnClear.Style.GradientAngle = 90; + this.btnClear.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnClear.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnClear.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnClear.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White; + this.btnClear.TabIndex = 440; + this.btnClear.Text = "清空结果"; + this.btnClear.Visible = false; + // + // colSelect + // + this.colSelect.HeaderText = "全选"; + this.colSelect.Name = "colSelect"; + this.colSelect.ReadOnly = true; + this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colSelect.Width = 28; + // + // colUser + // + this.colUser.HeaderText = "用户账户"; + this.colUser.Name = "colUser"; + this.colUser.ReadOnly = true; + this.colUser.Visible = false; + // + // colLoginName + // + this.colLoginName.HeaderText = "店铺登录名"; + this.colLoginName.Name = "colLoginName"; + this.colLoginName.ReadOnly = true; + this.colLoginName.Visible = false; + // + // colShopId + // + this.colShopId.HeaderText = "店铺Id"; + this.colShopId.Name = "colShopId"; + this.colShopId.ReadOnly = true; + this.colShopId.Visible = false; + this.colShopId.Width = 55; + // + // colShopName + // + this.colShopName.HeaderText = "店铺名称"; + this.colShopName.Name = "colShopName"; + this.colShopName.ReadOnly = true; + this.colShopName.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colShopName.Width = 70; + // + // colShopNotes + // + this.colShopNotes.HeaderText = "分组"; + this.colShopNotes.Name = "colShopNotes"; + this.colShopNotes.ReadOnly = true; + this.colShopNotes.Width = 70; + // + // colLoginStatus + // + this.colLoginStatus.HeaderText = "状态"; + this.colLoginStatus.Name = "colLoginStatus"; + this.colLoginStatus.ReadOnly = true; + this.colLoginStatus.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colLoginStatus.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colLoginStatus.Width = 38; + // + // colCanUse + // + this.colCanUse.HeaderText = "可用"; + this.colCanUse.Name = "colCanUse"; + this.colCanUse.ReadOnly = true; + this.colCanUse.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colCanUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colCanUse.Visible = false; + this.colCanUse.Width = 28; + // + // colMessage + // + this.colMessage.HeaderText = "消息"; + this.colMessage.Name = "colMessage"; + this.colMessage.ReadOnly = true; + // + // JoinDeliveryFrom + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(1314, 455); + this.Controls.Add(this.splitContainer1); + this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Name = "JoinDeliveryFrom"; + this.Text = "JoinDeliveryFrom"; + this.Load += new System.EventHandler(this.JoinDeliveryFrom_Load); + this.VisibleChanged += new System.EventHandler(this.JoinDeliveryFrom_VisibleChanged); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.ucGroupBoxEx3.ResumeLayout(false); + this.ucGroupBoxEx3.PerformLayout(); + this.ucGroupBoxEx1.ResumeLayout(false); + this.ucGroupBoxEx1.PerformLayout(); + this.splitContainer3.Panel1.ResumeLayout(false); + this.splitContainer3.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); + this.splitContainer3.ResumeLayout(false); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel1.PerformLayout(); + this.splitContainer2.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); + this.splitContainer2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pbShopLoading)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgvShop)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgvStock)).EndInit(); + this.splitContainer4.Panel1.ResumeLayout(false); + this.splitContainer4.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit(); + this.splitContainer4.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer1; + private UserComponent.UcGroupBoxEx ucGroupBoxEx3; + private DevComponents.DotNetBar.PanelEx btnSearch; + private UserComponent.UcGroupBoxEx ucGroupBoxEx1; + private DevComponents.DotNetBar.PanelEx btnRefreshShop; + private System.Windows.Forms.SplitContainer splitContainer3; + private System.Windows.Forms.SplitContainer splitContainer2; + private UserComponent.DataGridViewEx dgvShop; + private System.Windows.Forms.PictureBox pbLoading; + private System.Windows.Forms.SplitContainer splitContainer4; + private UserControls.StatusBarUserControl statusBar; + private DevComponents.DotNetBar.PanelEx btnClear; + private UserControls.UcSplitPage ucSplitPage1; + private System.Windows.Forms.PictureBox pbShopLoading; + private System.Windows.Forms.TextBox txtNotes; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox txtShopName; + private System.Windows.Forms.TextBox txtShopId; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private DevComponents.DotNetBar.PanelEx btnEmpty; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox txtRetryInterval; + private UserComponent.UcCheckBox chkSearchAllShop; + private DevComponents.DotNetBar.PanelEx btnStart; + private DevComponents.DotNetBar.PanelEx btnStop; + private UserComponent.DataGridViewEx dgvStock; + private System.Windows.Forms.DataGridViewLinkColumn colUpId; + private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck; + private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierId; + private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierName; + private System.Windows.Forms.DataGridViewLinkColumn colStockId; + private System.Windows.Forms.DataGridViewLinkColumn colParentStockId; + private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl; + private System.Windows.Forms.DataGridViewImageColumn colProductSkcPic; + private System.Windows.Forms.DataGridViewLinkColumn colProductId; + private System.Windows.Forms.DataGridViewLinkColumn colProdSkc; + private System.Windows.Forms.DataGridViewTextBoxColumn colProdName; + private System.Windows.Forms.DataGridViewTextBoxColumn colPrcie; + private System.Windows.Forms.DataGridViewTextBoxColumn colFrom; + private System.Windows.Forms.DataGridViewTextBoxColumn colFromFake; + private System.Windows.Forms.DataGridViewTextBoxColumn colInCartNumber7d; + private System.Windows.Forms.DataGridViewTextBoxColumn colTodaySaleVolume; + private System.Windows.Forms.DataGridViewTextBoxColumn colLastSevenDaysSaleVolume; + private System.Windows.Forms.DataGridViewTextBoxColumn colSalesInventoryNum; + private System.Windows.Forms.DataGridViewTextBoxColumn colWaitReceiveNum; + private System.Windows.Forms.DataGridViewTextBoxColumn colQualityScore; + private System.Windows.Forms.DataGridViewTextBoxColumn colQualityRate; + private System.Windows.Forms.DataGridViewTextBoxColumn colQualityCount; + private System.Windows.Forms.DataGridViewTextBoxColumn colNeedStockUp; + private System.Windows.Forms.DataGridViewTextBoxColumn colMsg; + private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect; + private System.Windows.Forms.DataGridViewTextBoxColumn colUser; + private System.Windows.Forms.DataGridViewTextBoxColumn colLoginName; + private System.Windows.Forms.DataGridViewTextBoxColumn colShopId; + private System.Windows.Forms.DataGridViewTextBoxColumn colShopName; + private System.Windows.Forms.DataGridViewTextBoxColumn colShopNotes; + private System.Windows.Forms.DataGridViewLinkColumn colLoginStatus; + private System.Windows.Forms.DataGridViewCheckBoxColumn colCanUse; + private System.Windows.Forms.DataGridViewTextBoxColumn colMessage; + } +} \ No newline at end of file diff --git a/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.cs b/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.cs new file mode 100644 index 0000000..ecafb08 --- /dev/null +++ b/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.cs @@ -0,0 +1,455 @@ +using AllBase; +using AllBase.Helper; +using AllBase.Model.Result; +using NaiBa.Util.Extension; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using TemuKJD.BaseForms; +using TemuKJD.BLL; +using TemuKJD.Extension; +using TemuKJD.KJDForms.AdminForms; +using TemuKJD.KJDForms.ShopForms; +using Work; + +namespace TemuKJD.KJDForms.ProductForms +{ + public partial class JoinDeliveryFrom : Form + { + JoinDeliveryConfig joinDeliveryConfig = null; + public bool IsAdmin = false; + public CancellationTokenSource cancellationTokenSource { get; set; } = null; + public List lstAdminShopInfo { get; set; } = new List(); + /// + /// 备货单列表 + /// + List lstStockInfo = new List(); + + public JoinDeliveryFrom() + { + InitializeComponent(); + } + + private void JoinDeliveryFrom_Load(object sender, EventArgs e) + { + ucSplitPage1.Visible = IsAdmin; + dgvShop.AddSelectorColumn("colSelect"); + dgvStock.AddSelectorColumn("colCheck"); + dgvStock.AddImgColumn("colProductSkcPic", "colImgUrl"); + + joinDeliveryConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig("join_delivery_config"); + if (joinDeliveryConfig == null) + joinDeliveryConfig = new JoinDeliveryConfig(); + this.txtNotes.Text = joinDeliveryConfig.SearchNotes; + this.txtShopId.Text = joinDeliveryConfig.SearchShopId; + this.txtShopName.Text = joinDeliveryConfig.SearchShopName; + this.txtRetryInterval.Text = Math.Max(1, joinDeliveryConfig.RetryInterval).ParseToString(); + this.chkSearchAllShop.Checked = joinDeliveryConfig.SearchAllShop; + + this.txtNotes.TextChanged += Txt_TextChanged; + this.txtShopId.TextChanged += Txt_TextChanged; + this.txtShopName.TextChanged += Txt_TextChanged; + this.txtRetryInterval.TextChanged += Txt_TextChanged; + this.chkSearchAllShop.CheckedChanged += Txt_TextChanged; + } + + private void Txt_TextChanged(object sender, EventArgs e) + { + joinDeliveryConfig.SearchNotes = this.txtNotes.Text.Trim(); + joinDeliveryConfig.SearchShopId = this.txtShopId.Text.Trim(); + joinDeliveryConfig.SearchShopName = this.txtShopName.Text.Trim(); + joinDeliveryConfig.RetryInterval = Math.Max(1, this.txtRetryInterval.Text.Trim().ParseToInt()); + joinDeliveryConfig.SearchAllShop = this.chkSearchAllShop.Checked; + + NaiBa.Util.Helper.ConfigHelper.SaveConfig("join_delivery_config", joinDeliveryConfig); + } + + private void JoinDeliveryFrom_VisibleChanged(object sender, EventArgs e) + { + if (this.Visible) + { + if (IsAdmin) + { + SearchShop(this.ucSplitPage1.CurrentPage); + } + } + } + + private void ucSplitPage1_PageChange(object obj) + { + if (IsAdmin) + { + if (this.ucSplitPage1.CurrentPage != 1) + this.ucSplitPage1.CurrentPage = 1; + else + SearchShop(1); + } + } + + public void SearchShop(int page) + { + List userShopIdList = dgvShop.Rows.Cast() + .Where(r => r.Cells["colSelect"].Value.ParseToBool()) + .Select(r => r.Cells["colShopId"].Value.ParseToString() + r.Cells["colUser"].Value.ParseToString()).ToList(); + + Invoke(new Action(() => + { + this.pbShopLoading.Visible = true; + this.dgvShop.Rows.Clear(); + lstAdminShopInfo.Clear(); + })); + + Task.Run(() => + { + int pageCount; + var list = AdminGetServerShopLst(out pageCount, page); + lstAdminShopInfo.AddRange(list); + this.ucSplitPage1.TotalPage = pageCount; + + foreach (var shop in lstAdminShopInfo) + { + bool canUse = shop.LoginStatus2 == "国际版在线"; + Invoke(new Action(() => + { + int rowIndex = this.dgvShop.Rows.Add( + userShopIdList.Contains(shop.ShopId + shop.UserName), + shop.UserName, + shop.LoginName, + shop.ShopId, + shop.ShopAccount, + shop.Notes, + canUse ? "在线" : "掉线", + canUse, + string.Empty + ); + displayShopStatus(shop); + })); + } + + Invoke(new Action(() => + { + this.pbShopLoading.Visible = false; + })); + }); + } + + void displayShopStatus(ShopLoginInfo shop) + { + bool canUse = shop.LoginStatus2 == "国际版在线"; + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colLoginName"].Value.ParseToString() == shop?.LoginName); + foreach (var row in rows) + { + row.Cells["colCanUse"].Value = canUse; + row.Cells["colLoginStatus"].Value = canUse ? "在线" : "掉线"; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Green : Color.Red; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Green : Color.Red; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightGreen : Color.OrangeRed; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkGreen : Color.DarkRed; + } + } + + public List AdminGetServerShopLst(out int pageCount, int page = 1, int pageSize = 50) + { + List list = new List(); + pageCount = 1; + + var url = BaseClass.BuildObjString("shop/admin_get_shop_list"); + //if (BaseClass.SaLevel > 1 && !chkSearchAllShop.Checked) + // url = BaseClass.BuildObjString("shop/sub_sa_get_select_prod_shop"); + var data = UserLogin.GetSignaturex() + + "&page=" + page + + "&page_size=" + pageSize + + "&shop_ids=" + txtShopId.Text.Trim().Trim(',') + + "&shop_names=" + txtShopName.Text.Trim().Trim(',') + + "&search_notes=" + txtNotes.Text.Trim().Trim(','); + //if (BaseClass.SaLevel > 1 && !chkSearchAllShop.Checked) + // data += "&operate_sub_sa_name=" + BaseClass.UserName; + 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("shop_id") || !html.Contains("shop_account") || !html.Contains("login_pass")) + { + return list; + } + + int count = BaseRegex.GetIntJson(ref html, "count"); + pageCount = Math.Ceiling(1.0 * count / pageSize).ParseToInt(); + pageCount = Math.Max(pageCount, 1); + + return ShopBLL.DeserializationShop(html); + } + + private void btnRefreshShop_Click(object sender, EventArgs e) + { + if (this.ucSplitPage1.CurrentPage != 1) + this.ucSplitPage1.CurrentPage = 1; + else + SearchShop(1); + } + + private void btnEmpty_Click(object sender, EventArgs e) + { + txtNotes.Text = txtShopId.Text = txtShopName.Text = ""; + } + + private void btnSearch_Click(object sender, EventArgs e) + { + var lstShopId = dgvShop.Rows.Cast().Where(row + => row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList(); + if (lstShopId.Count == 0) + { + BaseMsgForm.ShowInfo("请选择店铺!"); + return; + } + + var columns = this.dgvStock.Columns.Cast(); + foreach (var col in columns) + { + if (col.Name == "colParentStockId" || col.Name == "colStockId") + { + col.Visible = true; + } + if (col.Name == "colTodaySaleVolume" || col.Name == "colLastSevenDaysSaleVolume" || col.Name == "colInCartNumber7d" || col.Name == "colSalesInventoryNum" + || col.Name == "colWaitReceiveNum" || col.Name == "colNeedStockUp" || col.Name == "colQualityScore") + { + col.Visible = false; + } + } + + lstStockInfo.Clear(); + dgvStock.Rows.Clear(); + + var dgvRows = this.dgvShop.Rows.Cast();//.Where(r => lstShopId.Contains(r.Cells["colShopId"].Value.ParseToString())); + foreach (var row in dgvRows) + { + row.Cells["colMessage"].Value = ""; + } + + ucGroupBoxEx3.Enabled = false; + + cancellationTokenSource = new CancellationTokenSource(); + Task.Run(() => + { + var lstShopIdTemp = new List(); + lstShopIdTemp.AddRange(lstShopId); + int i = 0; + + foreach (var shopId in lstShopIdTemp) + { + this.Invoke(new Action(() => + { + this.statusBar.lblTaskStatus.Text = "正在查询..."; + this.statusBar.pgbTaskProgress.Maximum = lstShopIdTemp.Count; + this.statusBar.UpdateProgressBar(i + 1); + i++; + })); + + if (cancellationTokenSource.IsCancellationRequested) + break; + + ShopLoginInfo shop = null; + if (IsAdmin) + { + shop = this.lstAdminShopInfo.FirstOrDefault(s => s.ShopId == shopId); + } + else + { + shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId); + } + if (shop == null) + continue; + + #region 检测登录 + if (shop.LoginStatus != "登录成功") + { + continue; + } + if(IsAdmin) + { + AdminShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false); + } + else + { + ShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false); + } + if (shop.LoginStatus != "登录成功") + { + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopLoginName"].Value.ToString() == shop.LoginName); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "店铺掉线"; + row.Cells["colLoginStatus"].Value = "未登录"; + row.Cells["colCanUse"].Value = false; + } + })); + continue; + } + #endregion + + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "正在查询"; + } + })); + + int page = 1; + int totalPage = 1; + int pageSize = 20; + bool isError = false; + while (page <= totalPage) + { + if (cancellationTokenSource.IsCancellationRequested) + break; + + Thread.Sleep(100 + Randomx.GetId(200)); + string jsonStr = GetShopStockList2(shop, page, pageSize); + if (jsonStr.Contains("指定的值含有无效的控制字符")) + { + BaseMsgForm.ShowError("店铺" + shop.LoginName + " " + shop.ShopId + "已掉线"); + isError = true; + break; + } + if (!jsonStr.Contains("\"success\":true")) + jsonStr = GetShopStockList2(shop, page, pageSize); + if (!jsonStr.Contains("\"success\":true")) + { + isError = true; + } + + if (jsonStr.Contains("\"success\":true")) + { + var jArr = new JArray(); + try + { + var jObj = JObject.Parse(jsonStr); + jArr = jObj["result"]?["subOrderForSupplierList"] as JArray; + if (jArr == null) + jArr = new JArray(); + } + catch (Exception ex) { BaseMsgForm.ShowError(ex.Message); } + foreach (var item in jArr) + { + string sItem = item.ToString(); + TemuStockInfo sInfo = JsonHelper.DeserializeJsonToObject(sItem); // 反序列化得到类 + if (sInfo != null) + { + lstStockInfo.Add(sInfo); + + Invoke(new Action(() => + { + int rowId = this.dgvStock.Rows.Add( + "", + true, + sInfo.supplierId, + sInfo.supplierName, + sInfo.subPurchaseOrderSn, + sInfo.originalPurchaseOrderSn, + sInfo.productSkcPicture.Replace("https", "http"), + DataGridViewExtension.defaultBitmap, + sInfo.productId, + sInfo.productSkcId, + sInfo.productName, + "", + "", + "", + "", + "", + "", + 0.0, + "", + "" + ); + + dgvStock.Rows[rowId].Height = 60; + })); + } + } + + int total = BaseRegex.GetStringJson(ref jsonStr, "total").ParseToInt(); + totalPage = Math.Ceiling(1.0m * total / pageSize).ParseToInt(); + } + page++; + } + + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + + if (!isError) + { + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "已查询"; + } + } + else + { + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "查询失败"; + } + } + })); + } + Invoke(new Action(() => + { + ucGroupBoxEx3.Enabled = true; + string sRst = "查询结束!"; + if (cancellationTokenSource.IsCancellationRequested) + sRst = "已取消查询!"; + + BaseMsgForm.ShowInfo(sRst); + this.statusBar.lblTaskStatus.Text = sRst; + })); + }, cancellationTokenSource.Token); + } + + + + /// + /// 读取待加入发货台 + /// + /// + /// + /// + private string GetShopStockList2(ShopLoginInfo shop, int page = 1, int pageSize = 20) + { + page = Math.Max(page, 1); + string url = "https://agentseller.temu.com/mms/venom/api/supplier/purchase/manager/querySubOrderList"; + string body; + body = @"{""pageNo"":" + page + @",""pageSize"":" + pageSize + @",""urgencyType"":0,""isCustomGoods"":false,""statusList"":[1]," + + @"""oneDimensionSort"":{""firstOrderByParam"":""expectLatestDeliverTime"",""firstOrderByDesc"":0}}"; + string refere = "https://agentseller.temu.com/stock/fully-mgt/order-manage"; + + return HttpResponseBLL.PostResponse2(shop, url, body, refere); + } + } + + public class JoinDeliveryConfig + { + public string SearchShopId { get; set; } = ""; + public string SearchShopName { get; set; } = ""; + public string SearchNotes { get; set; } = ""; + /// + /// 重试加入发货台的时间间隔 + /// + public int RetryInterval { get; set; } = 1; + public bool SearchAllShop { get; set; } = true; + } +} diff --git a/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.resx b/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.resx new file mode 100644 index 0000000..5844142 --- /dev/null +++ b/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.resx @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/TEMUKJD/KJDForms/ProductForms/PriceManageForm.Designer.cs b/TEMUKJD/KJDForms/ProductForms/PriceManageForm.Designer.cs index e23ce8c..93efbbb 100644 --- a/TEMUKJD/KJDForms/ProductForms/PriceManageForm.Designer.cs +++ b/TEMUKJD/KJDForms/ProductForms/PriceManageForm.Designer.cs @@ -30,10 +30,10 @@ namespace TemuKJD.KJDForms.ProductForms private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.ucGroupBoxEx3 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); this.txtScale1 = new System.Windows.Forms.TextBox(); @@ -47,6 +47,14 @@ namespace TemuKJD.KJDForms.ProductForms this.splitContainer3 = new System.Windows.Forms.SplitContainer(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx(); + this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.colShopLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colShopNotes = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colLoginStatus = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dgvAdjust = new TemuKJD.UserComponent.DataGridViewEx(); this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.colSupplierId = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -69,14 +77,7 @@ namespace TemuKJD.KJDForms.ProductForms this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); this.panelEx1 = new DevComponents.DotNetBar.PanelEx(); this.btnClear = new DevComponents.DotNetBar.PanelEx(); - this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.colShopLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colShopNotes = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colLoginStatus = new System.Windows.Forms.DataGridViewLinkColumn(); - this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.pbLoading = new System.Windows.Forms.PictureBox(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -98,6 +99,7 @@ namespace TemuKJD.KJDForms.ProductForms this.splitContainer4.Panel1.SuspendLayout(); this.splitContainer4.Panel2.SuspendLayout(); this.splitContainer4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit(); this.SuspendLayout(); // // splitContainer1 @@ -301,6 +303,7 @@ namespace TemuKJD.KJDForms.ProductForms // // splitContainer2.Panel2 // + this.splitContainer2.Panel2.Controls.Add(this.pbLoading); this.splitContainer2.Panel2.Controls.Add(this.dgvAdjust); this.splitContainer2.Panel2.Padding = new System.Windows.Forms.Padding(0, 0, 4, 0); this.splitContainer2.Size = new System.Drawing.Size(1110, 443); @@ -311,18 +314,18 @@ namespace TemuKJD.KJDForms.ProductForms // this.dgvShop.AllowUserToAddRows = false; this.dgvShop.AllowUserToDeleteRows = false; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke; - this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.WhiteSmoke; + this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dgvShop.BackgroundColor = System.Drawing.Color.White; this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6; this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.colSelect, @@ -344,22 +347,86 @@ namespace TemuKJD.KJDForms.ProductForms this.dgvShop.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellClick); this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick); // + // colSelect + // + this.colSelect.HeaderText = "全选"; + this.colSelect.Name = "colSelect"; + this.colSelect.ReadOnly = true; + this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colSelect.Width = 28; + // + // colShopLoginName + // + this.colShopLoginName.HeaderText = "店铺登录名"; + this.colShopLoginName.Name = "colShopLoginName"; + this.colShopLoginName.ReadOnly = true; + this.colShopLoginName.Visible = false; + // + // colShopId + // + this.colShopId.HeaderText = "店铺Id"; + this.colShopId.Name = "colShopId"; + this.colShopId.ReadOnly = true; + this.colShopId.Visible = false; + this.colShopId.Width = 55; + // + // colShopName + // + this.colShopName.HeaderText = "店铺名称"; + this.colShopName.Name = "colShopName"; + this.colShopName.ReadOnly = true; + this.colShopName.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colShopName.Width = 70; + // + // colShopNotes + // + this.colShopNotes.HeaderText = "分组"; + this.colShopNotes.Name = "colShopNotes"; + this.colShopNotes.ReadOnly = true; + this.colShopNotes.Width = 70; + // + // colLoginStatus + // + this.colLoginStatus.HeaderText = "状态"; + this.colLoginStatus.Name = "colLoginStatus"; + this.colLoginStatus.ReadOnly = true; + this.colLoginStatus.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colLoginStatus.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colLoginStatus.Width = 38; + // + // colCanUse + // + this.colCanUse.HeaderText = "可用"; + this.colCanUse.Name = "colCanUse"; + this.colCanUse.ReadOnly = true; + this.colCanUse.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colCanUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colCanUse.Visible = false; + this.colCanUse.Width = 28; + // + // colMessage + // + this.colMessage.HeaderText = "消息"; + this.colMessage.Name = "colMessage"; + this.colMessage.ReadOnly = true; + // // dgvAdjust // this.dgvAdjust.AllowUserToAddRows = false; this.dgvAdjust.AllowUserToDeleteRows = false; - dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke; - this.dgvAdjust.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.WhiteSmoke; + this.dgvAdjust.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7; this.dgvAdjust.BackgroundColor = System.Drawing.Color.White; this.dgvAdjust.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgvAdjust.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvAdjust.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8; this.dgvAdjust.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvAdjust.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.colCheck, @@ -597,69 +664,17 @@ namespace TemuKJD.KJDForms.ProductForms this.btnClear.Text = "清空结果"; this.btnClear.Visible = false; // - // colSelect + // pbLoading // - this.colSelect.HeaderText = "全选"; - this.colSelect.Name = "colSelect"; - this.colSelect.ReadOnly = true; - this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.colSelect.Width = 28; - // - // colShopLoginName - // - this.colShopLoginName.HeaderText = "店铺登录名"; - this.colShopLoginName.Name = "colShopLoginName"; - this.colShopLoginName.ReadOnly = true; - this.colShopLoginName.Visible = false; - // - // colShopId - // - this.colShopId.HeaderText = "店铺Id"; - this.colShopId.Name = "colShopId"; - this.colShopId.ReadOnly = true; - this.colShopId.Visible = false; - this.colShopId.Width = 55; - // - // colShopName - // - this.colShopName.HeaderText = "店铺名称"; - this.colShopName.Name = "colShopName"; - this.colShopName.ReadOnly = true; - this.colShopName.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.colShopName.Width = 70; - // - // colShopNotes - // - this.colShopNotes.HeaderText = "分组"; - this.colShopNotes.Name = "colShopNotes"; - this.colShopNotes.ReadOnly = true; - this.colShopNotes.Width = 70; - // - // colLoginStatus - // - this.colLoginStatus.HeaderText = "状态"; - this.colLoginStatus.Name = "colLoginStatus"; - this.colLoginStatus.ReadOnly = true; - this.colLoginStatus.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.colLoginStatus.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.colLoginStatus.Width = 38; - // - // colCanUse - // - this.colCanUse.HeaderText = "可用"; - this.colCanUse.Name = "colCanUse"; - this.colCanUse.ReadOnly = true; - this.colCanUse.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.colCanUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.colCanUse.Visible = false; - this.colCanUse.Width = 28; - // - // colMessage - // - this.colMessage.HeaderText = "消息"; - this.colMessage.Name = "colMessage"; - this.colMessage.ReadOnly = true; + this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None; + this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue; + this.pbLoading.Location = new System.Drawing.Point(388, 196); + this.pbLoading.Name = "pbLoading"; + this.pbLoading.Size = new System.Drawing.Size(50, 50); + this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbLoading.TabIndex = 188; + this.pbLoading.TabStop = false; + this.pbLoading.Visible = false; // // PriceManageForm // @@ -695,6 +710,7 @@ namespace TemuKJD.KJDForms.ProductForms this.splitContainer4.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit(); this.splitContainer4.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).EndInit(); this.ResumeLayout(false); } @@ -744,5 +760,6 @@ namespace TemuKJD.KJDForms.ProductForms private System.Windows.Forms.DataGridViewLinkColumn colLoginStatus; private System.Windows.Forms.DataGridViewCheckBoxColumn colCanUse; private System.Windows.Forms.DataGridViewTextBoxColumn colMessage; + private System.Windows.Forms.PictureBox pbLoading; } } \ No newline at end of file diff --git a/TEMUKJD/KJDForms/ProductForms/ProductForm.Designer.cs b/TEMUKJD/KJDForms/ProductForms/ProductForm.Designer.cs index cc31276..62f6c52 100644 --- a/TEMUKJD/KJDForms/ProductForms/ProductForm.Designer.cs +++ b/TEMUKJD/KJDForms/ProductForms/ProductForm.Designer.cs @@ -31,16 +31,18 @@ System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("备货管理"); System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("调价管理"); System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("活动报名"); - System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("设置进货价"); - System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("商品认领"); - System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("库存上传"); - System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("商品管理", new System.Windows.Forms.TreeNode[] { + System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("推广直通车"); + System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("设置进货价"); + System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("商品认领"); + System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("库存上传"); + System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("商品管理", new System.Windows.Forms.TreeNode[] { treeNode1, treeNode2, treeNode3, treeNode4, treeNode5, - treeNode6}); + treeNode6, + treeNode7}); this.panel1 = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel(); @@ -137,16 +139,18 @@ treeNode2.Text = "调价管理"; treeNode3.Name = "活动报名"; treeNode3.Text = "活动报名"; - treeNode4.Name = "设置进货价"; - treeNode4.Text = "设置进货价"; - treeNode5.Name = "商品认领"; - treeNode5.Text = "商品认领"; - treeNode6.Name = "库存上传"; - treeNode6.Text = "库存上传"; - treeNode7.Name = "商品管理"; - treeNode7.Text = "商品管理"; + treeNode4.Name = "推广直通车"; + treeNode4.Text = "推广直通车"; + treeNode5.Name = "设置进货价"; + treeNode5.Text = "设置进货价"; + treeNode6.Name = "商品认领"; + treeNode6.Text = "商品认领"; + treeNode7.Name = "库存上传"; + treeNode7.Text = "库存上传"; + treeNode8.Name = "商品管理"; + treeNode8.Text = "商品管理"; this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { - treeNode7}); + treeNode8}); this.tv.OverForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); this.tv.Size = new System.Drawing.Size(140, 521); this.tv.TabIndex = 1; diff --git a/TEMUKJD/KJDForms/ProductForms/ProductForm.cs b/TEMUKJD/KJDForms/ProductForms/ProductForm.cs index b4b9b57..b396aa4 100644 --- a/TEMUKJD/KJDForms/ProductForms/ProductForm.cs +++ b/TEMUKJD/KJDForms/ProductForms/ProductForm.cs @@ -26,6 +26,7 @@ namespace TemuKJD.KJDForms.ProductForms public Lazy userSelectThirdProductForm = new Lazy(); public Lazy marketingActivityForm = new Lazy(); public Lazy purchasePriceForm = new Lazy(); + public Lazy temuAdsForm = new Lazy(); public ProductForm() { @@ -37,6 +38,10 @@ namespace TemuKJD.KJDForms.ProductForms tv.ExpandGroup(tv.Nodes[0].Name); List hideName = new List() { "设置进货价" }; +#if DEBUG +#else + //hideName.Add("推广直通车"); +#endif if (BaseClass.GroupId == 3) { @@ -84,6 +89,9 @@ namespace TemuKJD.KJDForms.ProductForms case "活动报名": SetForm(marketingActivityForm.Value); break; + case "推广直通车": + SetForm(temuAdsForm.Value); + break; case "设置进货价": SetForm(purchasePriceForm.Value); break; diff --git a/TEMUKJD/KJDForms/ProductForms/PurchasePriceForm.cs b/TEMUKJD/KJDForms/ProductForms/PurchasePriceForm.cs index eb068e5..d6f15d8 100644 --- a/TEMUKJD/KJDForms/ProductForms/PurchasePriceForm.cs +++ b/TEMUKJD/KJDForms/ProductForms/PurchasePriceForm.cs @@ -461,7 +461,7 @@ namespace TemuKJD.KJDForms.ProductForms ShowDgvImg(this.dgvProduct); } - List GetPurchasePrice(List productIdList) + public static List GetPurchasePrice(List productIdList) { List list = new List(); @@ -491,7 +491,19 @@ namespace TemuKJD.KJDForms.ProductForms if (jArr.Count() == 0) return list; - return JsonHelper.DeserializeJsonToList(jArr.ToString()); + list = JsonHelper.DeserializeJsonToList(jArr.ToString()); + foreach (var pPrice in list) + { + pPrice.dbSkuPurchasePriceList = JsonHelper.DeserializeJsonToList(pPrice.sku_purchase_price_json); + if (pPrice.dbSkuPurchasePriceList == null) + pPrice.dbSkuPurchasePriceList = new List(); + else + { + pPrice.price_text = "¥" + (pPrice.dbSkuPurchasePriceList.Min(s => s.purchasePriceValue) * 0.01).ParseToDecimal().ToString("0.00") + "~" + + "¥" + (pPrice.dbSkuPurchasePriceList.Max(s => s.purchasePriceValue) * 0.01).ParseToDecimal().ToString("0.00"); + } + } + return list; } } } diff --git a/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.Designer.cs b/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.Designer.cs new file mode 100644 index 0000000..9c6a4c4 --- /dev/null +++ b/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.Designer.cs @@ -0,0 +1,1558 @@ + +namespace TemuKJD.KJDForms.ProductForms +{ + partial class TemuAdsForm + { + /// + /// 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() + { + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.ucGroupBoxEx3 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); + this.txtSelectFilter = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.btnSelectFilter = new DevComponents.DotNetBar.PanelEx(); + this.btnContinueAds = new DevComponents.DotNetBar.PanelEx(); + this.btnPauseAds = new DevComponents.DotNetBar.PanelEx(); + this.txtBudget = new System.Windows.Forms.TextBox(); + this.lblBudget = new System.Windows.Forms.Label(); + this.txtCalculateProfitRate = new System.Windows.Forms.TextBox(); + this.lblCalculateRoasPercentSign = new System.Windows.Forms.Label(); + this.lblCalculateRoas = new System.Windows.Forms.Label(); + this.txtSameRoas = new System.Windows.Forms.TextBox(); + this.lblSameRoas = new System.Windows.Forms.Label(); + this.chkCalculateRoas = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.chkSameRoas = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.label2 = new System.Windows.Forms.Label(); + this.chkLimitValue = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.chkNoLimit = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.label1 = new System.Windows.Forms.Label(); + this.btnDelAds = new DevComponents.DotNetBar.PanelEx(); + this.btnAddAds = new DevComponents.DotNetBar.PanelEx(); + this.btnEdit = new DevComponents.DotNetBar.PanelEx(); + this.label5 = new System.Windows.Forms.Label(); + this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); + this.chk30Days = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.chk7Days = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.chkYesterday = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.chkToday = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.btnSearchAds = new DevComponents.DotNetBar.PanelEx(); + this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); + this.btnCheckAdsLogin = new DevComponents.DotNetBar.PanelEx(); + this.btnRefreshShop = new DevComponents.DotNetBar.PanelEx(); + this.splitContainer3 = new System.Windows.Forms.SplitContainer(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.pbLoading2 = new System.Windows.Forms.PictureBox(); + this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx(); + this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.colShopLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colShopNotes = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colLoginStatus = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colAdsLoginStatus = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.gbxSoloChangeRoas = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); + this.txtCalculateProfitRate2 = new System.Windows.Forms.TextBox(); + this.btnCancelSoloChangeRoas = new DevComponents.DotNetBar.PanelEx(); + this.lblCalculateRoasPercentSign2 = new System.Windows.Forms.Label(); + this.lblCalculateRoas2 = new System.Windows.Forms.Label(); + this.btnSoloChangeRoas = new DevComponents.DotNetBar.PanelEx(); + this.txtSameRoas2 = new System.Windows.Forms.TextBox(); + this.chkCalculateRoas2 = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.lblSameRoas2 = new System.Windows.Forms.Label(); + this.chkSameRoas2 = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.label3 = new System.Windows.Forms.Label(); + this.pbLoading = new System.Windows.Forms.PictureBox(); + this.dgvAds = new TemuKJD.UserComponent.DataGridViewEx(); + this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.colSupplierId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colSupplierName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colImg = new System.Windows.Forms.DataGridViewImageColumn(); + this.colGoodsId = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colSpuId = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colProdName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colSite = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colPrcie = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colCate = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colCreateTime = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colSaleCount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colSetCost = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colSetDiscount = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colAdStatus = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colBudget = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colWantROAS = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colChangeROAS = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colTotalCost = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colSaleVolume = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colROAS = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colRate = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colPerSaleCost = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colExposureCount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colClickCount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colOrderCount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colGoodsNum = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colCTR = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colCVR = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colInCart = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.splitContainer4 = new System.Windows.Forms.SplitContainer(); + this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); + this.panelEx1 = new DevComponents.DotNetBar.PanelEx(); + this.btnClear = new DevComponents.DotNetBar.PanelEx(); + this.lblGoodsId = new System.Windows.Forms.Label(); + this.lblShopId = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.ucGroupBoxEx3.SuspendLayout(); + this.ucGroupBoxEx2.SuspendLayout(); + this.ucGroupBoxEx1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); + this.splitContainer3.Panel1.SuspendLayout(); + this.splitContainer3.Panel2.SuspendLayout(); + this.splitContainer3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbLoading2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgvShop)).BeginInit(); + this.gbxSoloChangeRoas.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgvAds)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit(); + this.splitContainer4.Panel1.SuspendLayout(); + this.splitContainer4.Panel2.SuspendLayout(); + this.splitContainer4.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.ucGroupBoxEx3); + this.splitContainer1.Panel1.Controls.Add(this.ucGroupBoxEx2); + this.splitContainer1.Panel1.Controls.Add(this.ucGroupBoxEx1); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.splitContainer3); + this.splitContainer1.Size = new System.Drawing.Size(1440, 580); + this.splitContainer1.SplitterDistance = 120; + this.splitContainer1.TabIndex = 11; + // + // ucGroupBoxEx3 + // + this.ucGroupBoxEx3.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.ucGroupBoxEx3.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.ucGroupBoxEx3.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND; + this.ucGroupBoxEx3.Controls.Add(this.txtSelectFilter); + this.ucGroupBoxEx3.Controls.Add(this.label4); + this.ucGroupBoxEx3.Controls.Add(this.btnSelectFilter); + this.ucGroupBoxEx3.Controls.Add(this.btnContinueAds); + this.ucGroupBoxEx3.Controls.Add(this.btnPauseAds); + this.ucGroupBoxEx3.Controls.Add(this.txtBudget); + this.ucGroupBoxEx3.Controls.Add(this.lblBudget); + this.ucGroupBoxEx3.Controls.Add(this.txtCalculateProfitRate); + this.ucGroupBoxEx3.Controls.Add(this.lblCalculateRoasPercentSign); + this.ucGroupBoxEx3.Controls.Add(this.lblCalculateRoas); + this.ucGroupBoxEx3.Controls.Add(this.txtSameRoas); + this.ucGroupBoxEx3.Controls.Add(this.lblSameRoas); + this.ucGroupBoxEx3.Controls.Add(this.chkCalculateRoas); + this.ucGroupBoxEx3.Controls.Add(this.chkSameRoas); + this.ucGroupBoxEx3.Controls.Add(this.label2); + this.ucGroupBoxEx3.Controls.Add(this.chkLimitValue); + this.ucGroupBoxEx3.Controls.Add(this.chkNoLimit); + this.ucGroupBoxEx3.Controls.Add(this.label1); + this.ucGroupBoxEx3.Controls.Add(this.btnDelAds); + this.ucGroupBoxEx3.Controls.Add(this.btnAddAds); + this.ucGroupBoxEx3.Controls.Add(this.btnEdit); + this.ucGroupBoxEx3.Controls.Add(this.label5); + this.ucGroupBoxEx3.Location = new System.Drawing.Point(282, 2); + this.ucGroupBoxEx3.Name = "ucGroupBoxEx3"; + this.ucGroupBoxEx3.Size = new System.Drawing.Size(1156, 120); + this.ucGroupBoxEx3.TabIndex = 666; + this.ucGroupBoxEx3.TabStop = false; + this.ucGroupBoxEx3.Text = "直通车推广"; + // + // txtSelectFilter + // + this.txtSelectFilter.Location = new System.Drawing.Point(738, 82); + this.txtSelectFilter.Name = "txtSelectFilter"; + this.txtSelectFilter.Size = new System.Drawing.Size(42, 23); + this.txtSelectFilter.TabIndex = 514; + this.txtSelectFilter.Text = "10"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(624, 85); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(116, 17); + this.label4.TabIndex = 515; + this.label4.Text = "一键勾选订单量低于"; + // + // btnSelectFilter + // + this.btnSelectFilter.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnSelectFilter.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnSelectFilter.DisabledBackColor = System.Drawing.Color.Empty; + this.btnSelectFilter.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSelectFilter.Location = new System.Drawing.Point(813, 82); + this.btnSelectFilter.Name = "btnSelectFilter"; + this.btnSelectFilter.Size = new System.Drawing.Size(38, 23); + this.btnSelectFilter.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnSelectFilter.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSelectFilter.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSelectFilter.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnSelectFilter.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnSelectFilter.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnSelectFilter.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnSelectFilter.Style.GradientAngle = 90; + this.btnSelectFilter.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnSelectFilter.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnSelectFilter.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnSelectFilter.TabIndex = 513; + this.btnSelectFilter.Text = "勾选"; + this.btnSelectFilter.Click += new System.EventHandler(this.btnSelectFilter_Click); + // + // btnContinueAds + // + this.btnContinueAds.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnContinueAds.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnContinueAds.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnContinueAds.DisabledBackColor = System.Drawing.Color.Empty; + this.btnContinueAds.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnContinueAds.Location = new System.Drawing.Point(741, 32); + this.btnContinueAds.Name = "btnContinueAds"; + this.btnContinueAds.Size = new System.Drawing.Size(110, 23); + this.btnContinueAds.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnContinueAds.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnContinueAds.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnContinueAds.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnContinueAds.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnContinueAds.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnContinueAds.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnContinueAds.Style.GradientAngle = 90; + this.btnContinueAds.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnContinueAds.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnContinueAds.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnContinueAds.TabIndex = 494; + this.btnContinueAds.Text = "开启选中直通车"; + this.btnContinueAds.Click += new System.EventHandler(this.btnContinueAds_Click); + // + // btnPauseAds + // + this.btnPauseAds.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnPauseAds.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnPauseAds.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnPauseAds.DisabledBackColor = System.Drawing.Color.Empty; + this.btnPauseAds.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnPauseAds.Location = new System.Drawing.Point(625, 32); + this.btnPauseAds.Name = "btnPauseAds"; + this.btnPauseAds.Size = new System.Drawing.Size(110, 23); + this.btnPauseAds.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnPauseAds.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnPauseAds.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnPauseAds.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnPauseAds.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnPauseAds.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnPauseAds.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnPauseAds.Style.GradientAngle = 90; + this.btnPauseAds.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnPauseAds.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnPauseAds.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnPauseAds.TabIndex = 490; + this.btnPauseAds.Text = "暂停选中直通车"; + this.btnPauseAds.Click += new System.EventHandler(this.btnPauseAds_Click); + // + // txtBudget + // + this.txtBudget.Location = new System.Drawing.Point(212, 25); + this.txtBudget.Name = "txtBudget"; + this.txtBudget.Size = new System.Drawing.Size(43, 23); + this.txtBudget.TabIndex = 441; + this.txtBudget.Text = "100"; + this.txtBudget.Visible = false; + // + // lblBudget + // + this.lblBudget.AutoSize = true; + this.lblBudget.Location = new System.Drawing.Point(255, 28); + this.lblBudget.Name = "lblBudget"; + this.lblBudget.Size = new System.Drawing.Size(20, 17); + this.lblBudget.TabIndex = 477; + this.lblBudget.Text = "元"; + this.lblBudget.Visible = false; + // + // txtCalculateProfitRate + // + this.txtCalculateProfitRate.Location = new System.Drawing.Point(253, 82); + this.txtCalculateProfitRate.Name = "txtCalculateProfitRate"; + this.txtCalculateProfitRate.Size = new System.Drawing.Size(32, 23); + this.txtCalculateProfitRate.TabIndex = 465; + this.txtCalculateProfitRate.Text = "20"; + this.txtCalculateProfitRate.Visible = false; + // + // lblCalculateRoasPercentSign + // + this.lblCalculateRoasPercentSign.AutoSize = true; + this.lblCalculateRoasPercentSign.Location = new System.Drawing.Point(284, 85); + this.lblCalculateRoasPercentSign.Name = "lblCalculateRoasPercentSign"; + this.lblCalculateRoasPercentSign.Size = new System.Drawing.Size(315, 17); + this.lblCalculateRoasPercentSign.TabIndex = 467; + this.lblCalculateRoasPercentSign.Text = "%(未设置商品成本或无法达成目标利润率时将按统一设置)"; + this.lblCalculateRoasPercentSign.Visible = false; + // + // lblCalculateRoas + // + this.lblCalculateRoas.AutoSize = true; + this.lblCalculateRoas.Location = new System.Drawing.Point(186, 85); + this.lblCalculateRoas.Name = "lblCalculateRoas"; + this.lblCalculateRoas.Size = new System.Drawing.Size(68, 17); + this.lblCalculateRoas.TabIndex = 466; + this.lblCalculateRoas.Text = "目标利润率"; + this.lblCalculateRoas.Visible = false; + // + // txtSameRoas + // + this.txtSameRoas.Location = new System.Drawing.Point(143, 82); + this.txtSameRoas.Name = "txtSameRoas"; + this.txtSameRoas.Size = new System.Drawing.Size(32, 23); + this.txtSameRoas.TabIndex = 452; + this.txtSameRoas.Text = "8.0"; + // + // lblSameRoas + // + this.lblSameRoas.AutoSize = true; + this.lblSameRoas.Location = new System.Drawing.Point(104, 85); + this.lblSameRoas.Name = "lblSameRoas"; + this.lblSameRoas.Size = new System.Drawing.Size(41, 17); + this.lblSameRoas.TabIndex = 464; + this.lblSameRoas.Text = "ROAS"; + // + // chkCalculateRoas + // + this.chkCalculateRoas.AutoSize = true; + this.chkCalculateRoas.Location = new System.Drawing.Point(189, 58); + this.chkCalculateRoas.Name = "chkCalculateRoas"; + this.chkCalculateRoas.Size = new System.Drawing.Size(263, 21); + this.chkCalculateRoas.TabIndex = 463; + this.chkCalculateRoas.Text = "根据期望利润率估算(需先设置成本价、折扣)"; + this.chkCalculateRoas.UseVisualStyleBackColor = true; + this.chkCalculateRoas.CheckedChanged += new System.EventHandler(this.chkCalculateRoas_CheckedChanged); + // + // chkSameRoas + // + this.chkSameRoas.AutoSize = true; + this.chkSameRoas.Checked = true; + this.chkSameRoas.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkSameRoas.Location = new System.Drawing.Point(108, 58); + this.chkSameRoas.Name = "chkSameRoas"; + this.chkSameRoas.Size = new System.Drawing.Size(75, 21); + this.chkSameRoas.TabIndex = 462; + this.chkSameRoas.Text = "统一设置"; + this.chkSameRoas.UseVisualStyleBackColor = true; + this.chkSameRoas.CheckedChanged += new System.EventHandler(this.chkSameRoas_CheckedChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(34, 60); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(80, 17); + this.label2.TabIndex = 451; + this.label2.Text = "目标回报率:"; + // + // chkLimitValue + // + this.chkLimitValue.AutoSize = true; + this.chkLimitValue.Location = new System.Drawing.Point(155, 26); + this.chkLimitValue.Name = "chkLimitValue"; + this.chkLimitValue.Size = new System.Drawing.Size(63, 21); + this.chkLimitValue.TabIndex = 440; + this.chkLimitValue.Text = "自定义"; + this.chkLimitValue.UseVisualStyleBackColor = true; + this.chkLimitValue.CheckedChanged += new System.EventHandler(this.chkLimitValue_CheckedChanged); + // + // chkNoLimit + // + this.chkNoLimit.AutoSize = true; + this.chkNoLimit.Checked = true; + this.chkNoLimit.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkNoLimit.Location = new System.Drawing.Point(108, 26); + this.chkNoLimit.Name = "chkNoLimit"; + this.chkNoLimit.Size = new System.Drawing.Size(51, 21); + this.chkNoLimit.TabIndex = 439; + this.chkNoLimit.Text = "不限"; + this.chkNoLimit.UseVisualStyleBackColor = true; + this.chkNoLimit.CheckedChanged += new System.EventHandler(this.chkNoLimit_CheckedChanged); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(34, 28); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(80, 17); + this.label1.TabIndex = 438; + this.label1.Text = "广告日预算:"; + // + // btnDelAds + // + this.btnDelAds.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnDelAds.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnDelAds.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnDelAds.DisabledBackColor = System.Drawing.Color.Empty; + this.btnDelAds.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnDelAds.Location = new System.Drawing.Point(857, 32); + this.btnDelAds.Name = "btnDelAds"; + this.btnDelAds.Size = new System.Drawing.Size(110, 23); + this.btnDelAds.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnDelAds.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnDelAds.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnDelAds.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnDelAds.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnDelAds.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnDelAds.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnDelAds.Style.GradientAngle = 90; + this.btnDelAds.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnDelAds.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnDelAds.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnDelAds.TabIndex = 431; + this.btnDelAds.Text = "删除选中直通车"; + this.btnDelAds.Click += new System.EventHandler(this.btnDelAds_Click); + // + // btnAddAds + // + this.btnAddAds.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnAddAds.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnAddAds.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnAddAds.DisabledBackColor = System.Drawing.Color.Empty; + this.btnAddAds.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnAddAds.Location = new System.Drawing.Point(1007, 32); + this.btnAddAds.Name = "btnAddAds"; + this.btnAddAds.Size = new System.Drawing.Size(132, 23); + this.btnAddAds.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnAddAds.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnAddAds.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnAddAds.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnAddAds.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnAddAds.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnAddAds.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnAddAds.Style.GradientAngle = 90; + this.btnAddAds.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnAddAds.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnAddAds.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnAddAds.TabIndex = 434; + this.btnAddAds.Text = "+自动全店添加直通车"; + this.btnAddAds.Click += new System.EventHandler(this.pnlAdd_Click); + // + // btnEdit + // + this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnEdit.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnEdit.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnEdit.DisabledBackColor = System.Drawing.Color.Empty; + this.btnEdit.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnEdit.Location = new System.Drawing.Point(1007, 61); + this.btnEdit.Name = "btnEdit"; + this.btnEdit.Size = new System.Drawing.Size(132, 23); + this.btnEdit.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnEdit.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnEdit.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnEdit.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnEdit.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnEdit.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnEdit.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnEdit.Style.GradientAngle = 90; + this.btnEdit.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnEdit.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnEdit.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnEdit.TabIndex = 427; + this.btnEdit.Text = "调整选中直通车商品"; + this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click); + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(781, 85); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(32, 17); + this.label5.TabIndex = 534; + this.label5.Text = "商品"; + // + // ucGroupBoxEx2 + // + this.ucGroupBoxEx2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.ucGroupBoxEx2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.ucGroupBoxEx2.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND; + this.ucGroupBoxEx2.Controls.Add(this.chk30Days); + this.ucGroupBoxEx2.Controls.Add(this.chk7Days); + this.ucGroupBoxEx2.Controls.Add(this.chkYesterday); + this.ucGroupBoxEx2.Controls.Add(this.chkToday); + this.ucGroupBoxEx2.Controls.Add(this.btnSearchAds); + this.ucGroupBoxEx2.Location = new System.Drawing.Point(147, 2); + this.ucGroupBoxEx2.Name = "ucGroupBoxEx2"; + this.ucGroupBoxEx2.Size = new System.Drawing.Size(135, 120); + this.ucGroupBoxEx2.TabIndex = 469; + this.ucGroupBoxEx2.TabStop = false; + this.ucGroupBoxEx2.Text = "商品查询"; + // + // chk30Days + // + this.chk30Days.Location = new System.Drawing.Point(70, 85); + this.chk30Days.Name = "chk30Days"; + this.chk30Days.Size = new System.Drawing.Size(59, 21); + this.chk30Days.TabIndex = 443; + this.chk30Days.Text = "近30日"; + this.chk30Days.UseVisualStyleBackColor = true; + this.chk30Days.CheckedChanged += new System.EventHandler(this.chk30Days_CheckedChanged); + // + // chk7Days + // + this.chk7Days.AutoSize = true; + this.chk7Days.Location = new System.Drawing.Point(13, 85); + this.chk7Days.Name = "chk7Days"; + this.chk7Days.Size = new System.Drawing.Size(58, 21); + this.chk7Days.TabIndex = 442; + this.chk7Days.Text = "近7日"; + this.chk7Days.UseVisualStyleBackColor = true; + this.chk7Days.CheckedChanged += new System.EventHandler(this.chk7Days_CheckedChanged); + // + // chkYesterday + // + this.chkYesterday.AutoSize = true; + this.chkYesterday.Location = new System.Drawing.Point(70, 61); + this.chkYesterday.Name = "chkYesterday"; + this.chkYesterday.Size = new System.Drawing.Size(51, 21); + this.chkYesterday.TabIndex = 441; + this.chkYesterday.Text = "昨日"; + this.chkYesterday.UseVisualStyleBackColor = true; + this.chkYesterday.CheckedChanged += new System.EventHandler(this.chkYesterday_CheckedChanged); + // + // chkToday + // + this.chkToday.AutoSize = true; + this.chkToday.Checked = true; + this.chkToday.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkToday.Enabled = false; + this.chkToday.Location = new System.Drawing.Point(13, 61); + this.chkToday.Name = "chkToday"; + this.chkToday.Size = new System.Drawing.Size(51, 21); + this.chkToday.TabIndex = 440; + this.chkToday.Text = "今日"; + this.chkToday.UseVisualStyleBackColor = true; + this.chkToday.CheckedChanged += new System.EventHandler(this.chkToday_CheckedChanged); + // + // btnSearchAds + // + this.btnSearchAds.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnSearchAds.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnSearchAds.DisabledBackColor = System.Drawing.Color.Empty; + this.btnSearchAds.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSearchAds.Location = new System.Drawing.Point(13, 32); + this.btnSearchAds.Name = "btnSearchAds"; + this.btnSearchAds.Size = new System.Drawing.Size(110, 23); + this.btnSearchAds.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnSearchAds.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSearchAds.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSearchAds.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnSearchAds.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnSearchAds.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnSearchAds.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnSearchAds.Style.GradientAngle = 90; + this.btnSearchAds.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnSearchAds.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnSearchAds.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnSearchAds.TabIndex = 427; + this.btnSearchAds.Text = "查询直通车商品"; + this.btnSearchAds.Click += new System.EventHandler(this.btnSearchProduct_Click); + // + // ucGroupBoxEx1 + // + this.ucGroupBoxEx1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.ucGroupBoxEx1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.ucGroupBoxEx1.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND; + this.ucGroupBoxEx1.Controls.Add(this.btnCheckAdsLogin); + this.ucGroupBoxEx1.Controls.Add(this.btnRefreshShop); + this.ucGroupBoxEx1.Location = new System.Drawing.Point(3, 2); + this.ucGroupBoxEx1.Name = "ucGroupBoxEx1"; + this.ucGroupBoxEx1.Size = new System.Drawing.Size(144, 120); + this.ucGroupBoxEx1.TabIndex = 399; + this.ucGroupBoxEx1.TabStop = false; + this.ucGroupBoxEx1.Text = "基础"; + // + // btnCheckAdsLogin + // + this.btnCheckAdsLogin.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnCheckAdsLogin.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnCheckAdsLogin.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnCheckAdsLogin.DisabledBackColor = System.Drawing.Color.Empty; + this.btnCheckAdsLogin.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnCheckAdsLogin.Location = new System.Drawing.Point(17, 71); + this.btnCheckAdsLogin.Name = "btnCheckAdsLogin"; + this.btnCheckAdsLogin.Size = new System.Drawing.Size(110, 24); + this.btnCheckAdsLogin.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnCheckAdsLogin.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnCheckAdsLogin.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnCheckAdsLogin.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnCheckAdsLogin.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnCheckAdsLogin.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnCheckAdsLogin.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnCheckAdsLogin.Style.GradientAngle = 90; + this.btnCheckAdsLogin.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnCheckAdsLogin.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnCheckAdsLogin.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnCheckAdsLogin.TabIndex = 438; + this.btnCheckAdsLogin.Text = "检测直通车状态"; + this.btnCheckAdsLogin.Click += new System.EventHandler(this.btnCheckAdsLogin_Click); + // + // btnRefreshShop + // + this.btnRefreshShop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnRefreshShop.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnRefreshShop.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnRefreshShop.DisabledBackColor = System.Drawing.Color.Empty; + this.btnRefreshShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnRefreshShop.Location = new System.Drawing.Point(17, 31); + this.btnRefreshShop.Name = "btnRefreshShop"; + this.btnRefreshShop.Size = new System.Drawing.Size(110, 24); + this.btnRefreshShop.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnRefreshShop.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnRefreshShop.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnRefreshShop.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnRefreshShop.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnRefreshShop.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnRefreshShop.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnRefreshShop.Style.GradientAngle = 90; + this.btnRefreshShop.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnRefreshShop.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnRefreshShop.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnRefreshShop.TabIndex = 431; + this.btnRefreshShop.Text = "刷新店铺"; + this.btnRefreshShop.Click += new System.EventHandler(this.btnRefreshShop_Click); + // + // splitContainer3 + // + this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer3.Location = new System.Drawing.Point(0, 0); + this.splitContainer3.Name = "splitContainer3"; + this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer3.Panel1 + // + this.splitContainer3.Panel1.Controls.Add(this.splitContainer2); + // + // splitContainer3.Panel2 + // + this.splitContainer3.Panel2.Controls.Add(this.splitContainer4); + this.splitContainer3.Size = new System.Drawing.Size(1440, 456); + this.splitContainer3.SplitterDistance = 426; + this.splitContainer3.TabIndex = 1; + // + // splitContainer2 + // + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Name = "splitContainer2"; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.pbLoading2); + this.splitContainer2.Panel1.Controls.Add(this.dgvShop); + this.splitContainer2.Panel1.Padding = new System.Windows.Forms.Padding(4, 0, 0, 0); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.gbxSoloChangeRoas); + this.splitContainer2.Panel2.Controls.Add(this.label3); + this.splitContainer2.Panel2.Controls.Add(this.pbLoading); + this.splitContainer2.Panel2.Controls.Add(this.dgvAds); + this.splitContainer2.Panel2.Padding = new System.Windows.Forms.Padding(0, 0, 4, 0); + this.splitContainer2.Size = new System.Drawing.Size(1440, 426); + this.splitContainer2.SplitterDistance = 280; + this.splitContainer2.TabIndex = 0; + // + // pbLoading2 + // + this.pbLoading2.Anchor = System.Windows.Forms.AnchorStyles.None; + this.pbLoading2.Image = global::TemuKJD.Properties.Resources.loading_blue; + this.pbLoading2.Location = new System.Drawing.Point(115, 188); + this.pbLoading2.Name = "pbLoading2"; + this.pbLoading2.Size = new System.Drawing.Size(50, 50); + this.pbLoading2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbLoading2.TabIndex = 9; + this.pbLoading2.TabStop = false; + this.pbLoading2.Visible = false; + // + // dgvShop + // + this.dgvShop.AllowUserToAddRows = false; + this.dgvShop.AllowUserToDeleteRows = false; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke; + this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + this.dgvShop.BackgroundColor = System.Drawing.Color.White; + this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + this.dgvShop.ColumnHeadersHeight = 45; + this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.colSelect, + this.colShopLoginName, + this.colShopId, + this.colShopName, + this.colShopNotes, + this.colLoginStatus, + this.colAdsLoginStatus, + this.colCanUse, + this.colMessage}); + this.dgvShop.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgvShop.Location = new System.Drawing.Point(4, 0); + this.dgvShop.Name = "dgvShop"; + this.dgvShop.ReadOnly = true; + this.dgvShop.RowHeadersWidth = 25; + this.dgvShop.RowTemplate.Height = 23; + this.dgvShop.Size = new System.Drawing.Size(276, 426); + this.dgvShop.TabIndex = 6; + this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick); + // + // colSelect + // + this.colSelect.HeaderText = "全选"; + this.colSelect.Name = "colSelect"; + this.colSelect.ReadOnly = true; + this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colSelect.Width = 28; + // + // colShopLoginName + // + this.colShopLoginName.HeaderText = "店铺登录名"; + this.colShopLoginName.Name = "colShopLoginName"; + this.colShopLoginName.ReadOnly = true; + this.colShopLoginName.Visible = false; + // + // colShopId + // + this.colShopId.HeaderText = "店铺Id"; + this.colShopId.Name = "colShopId"; + this.colShopId.ReadOnly = true; + this.colShopId.Visible = false; + this.colShopId.Width = 55; + // + // colShopName + // + this.colShopName.HeaderText = "店铺名"; + this.colShopName.Name = "colShopName"; + this.colShopName.ReadOnly = true; + this.colShopName.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colShopName.Width = 60; + // + // colShopNotes + // + this.colShopNotes.HeaderText = "分组"; + this.colShopNotes.Name = "colShopNotes"; + this.colShopNotes.ReadOnly = true; + this.colShopNotes.Width = 50; + // + // colLoginStatus + // + this.colLoginStatus.HeaderText = "状态"; + this.colLoginStatus.Name = "colLoginStatus"; + this.colLoginStatus.ReadOnly = true; + this.colLoginStatus.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colLoginStatus.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colLoginStatus.Width = 38; + // + // colAdsLoginStatus + // + this.colAdsLoginStatus.HeaderText = "推广状态"; + this.colAdsLoginStatus.Name = "colAdsLoginStatus"; + this.colAdsLoginStatus.ReadOnly = true; + this.colAdsLoginStatus.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colAdsLoginStatus.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colAdsLoginStatus.Width = 38; + // + // colCanUse + // + this.colCanUse.HeaderText = "可用"; + this.colCanUse.Name = "colCanUse"; + this.colCanUse.ReadOnly = true; + this.colCanUse.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colCanUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colCanUse.Visible = false; + this.colCanUse.Width = 28; + // + // colMessage + // + this.colMessage.HeaderText = "消息"; + this.colMessage.Name = "colMessage"; + this.colMessage.ReadOnly = true; + // + // gbxSoloChangeRoas + // + this.gbxSoloChangeRoas.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.gbxSoloChangeRoas.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND; + this.gbxSoloChangeRoas.Controls.Add(this.lblShopId); + this.gbxSoloChangeRoas.Controls.Add(this.lblGoodsId); + this.gbxSoloChangeRoas.Controls.Add(this.txtCalculateProfitRate2); + this.gbxSoloChangeRoas.Controls.Add(this.btnCancelSoloChangeRoas); + this.gbxSoloChangeRoas.Controls.Add(this.lblCalculateRoasPercentSign2); + this.gbxSoloChangeRoas.Controls.Add(this.lblCalculateRoas2); + this.gbxSoloChangeRoas.Controls.Add(this.btnSoloChangeRoas); + this.gbxSoloChangeRoas.Controls.Add(this.txtSameRoas2); + this.gbxSoloChangeRoas.Controls.Add(this.chkCalculateRoas2); + this.gbxSoloChangeRoas.Controls.Add(this.lblSameRoas2); + this.gbxSoloChangeRoas.Controls.Add(this.chkSameRoas2); + this.gbxSoloChangeRoas.Location = new System.Drawing.Point(17, 84); + this.gbxSoloChangeRoas.Name = "gbxSoloChangeRoas"; + this.gbxSoloChangeRoas.Size = new System.Drawing.Size(258, 147); + this.gbxSoloChangeRoas.TabIndex = 496; + this.gbxSoloChangeRoas.TabStop = false; + this.gbxSoloChangeRoas.Text = "修改目标回报率"; + this.gbxSoloChangeRoas.Visible = false; + // + // txtCalculateProfitRate2 + // + this.txtCalculateProfitRate2.Location = new System.Drawing.Point(175, 67); + this.txtCalculateProfitRate2.Name = "txtCalculateProfitRate2"; + this.txtCalculateProfitRate2.Size = new System.Drawing.Size(32, 23); + this.txtCalculateProfitRate2.TabIndex = 683; + this.txtCalculateProfitRate2.Text = "20"; + this.txtCalculateProfitRate2.Visible = false; + // + // btnCancelSoloChangeRoas + // + this.btnCancelSoloChangeRoas.CanvasColor = System.Drawing.SystemColors.Control; + this.btnCancelSoloChangeRoas.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnCancelSoloChangeRoas.DisabledBackColor = System.Drawing.Color.Empty; + this.btnCancelSoloChangeRoas.Location = new System.Drawing.Point(150, 111); + this.btnCancelSoloChangeRoas.Name = "btnCancelSoloChangeRoas"; + this.btnCancelSoloChangeRoas.Size = new System.Drawing.Size(46, 23); + this.btnCancelSoloChangeRoas.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnCancelSoloChangeRoas.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); + this.btnCancelSoloChangeRoas.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); + this.btnCancelSoloChangeRoas.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; + this.btnCancelSoloChangeRoas.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnCancelSoloChangeRoas.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; + this.btnCancelSoloChangeRoas.Style.GradientAngle = 90; + this.btnCancelSoloChangeRoas.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center; + this.btnCancelSoloChangeRoas.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnCancelSoloChangeRoas.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnCancelSoloChangeRoas.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnCancelSoloChangeRoas.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White; + this.btnCancelSoloChangeRoas.TabIndex = 672; + this.btnCancelSoloChangeRoas.Text = "取消"; + this.btnCancelSoloChangeRoas.Click += new System.EventHandler(this.btnCancelSoloChangeRoas_Click); + // + // lblCalculateRoasPercentSign2 + // + this.lblCalculateRoasPercentSign2.AutoSize = true; + this.lblCalculateRoasPercentSign2.Location = new System.Drawing.Point(206, 70); + this.lblCalculateRoasPercentSign2.Name = "lblCalculateRoasPercentSign2"; + this.lblCalculateRoasPercentSign2.Size = new System.Drawing.Size(19, 17); + this.lblCalculateRoasPercentSign2.TabIndex = 685; + this.lblCalculateRoasPercentSign2.Text = "%"; + this.lblCalculateRoasPercentSign2.Visible = false; + // + // lblCalculateRoas2 + // + this.lblCalculateRoas2.AutoSize = true; + this.lblCalculateRoas2.Location = new System.Drawing.Point(108, 70); + this.lblCalculateRoas2.Name = "lblCalculateRoas2"; + this.lblCalculateRoas2.Size = new System.Drawing.Size(68, 17); + this.lblCalculateRoas2.TabIndex = 684; + this.lblCalculateRoas2.Text = "目标利润率"; + this.lblCalculateRoas2.Visible = false; + // + // btnSoloChangeRoas + // + this.btnSoloChangeRoas.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnSoloChangeRoas.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnSoloChangeRoas.DisabledBackColor = System.Drawing.Color.Empty; + this.btnSoloChangeRoas.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSoloChangeRoas.Location = new System.Drawing.Point(199, 111); + this.btnSoloChangeRoas.Name = "btnSoloChangeRoas"; + this.btnSoloChangeRoas.Size = new System.Drawing.Size(46, 23); + this.btnSoloChangeRoas.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnSoloChangeRoas.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSoloChangeRoas.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSoloChangeRoas.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnSoloChangeRoas.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnSoloChangeRoas.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnSoloChangeRoas.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnSoloChangeRoas.Style.GradientAngle = 90; + this.btnSoloChangeRoas.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnSoloChangeRoas.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnSoloChangeRoas.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnSoloChangeRoas.TabIndex = 517; + this.btnSoloChangeRoas.Text = "确定"; + this.btnSoloChangeRoas.Click += new System.EventHandler(this.btnSoloChangeRoas_Click); + // + // txtSameRoas2 + // + this.txtSameRoas2.Location = new System.Drawing.Point(65, 67); + this.txtSameRoas2.Name = "txtSameRoas2"; + this.txtSameRoas2.Size = new System.Drawing.Size(32, 23); + this.txtSameRoas2.TabIndex = 679; + this.txtSameRoas2.Text = "8.0"; + // + // chkCalculateRoas2 + // + this.chkCalculateRoas2.AutoSize = true; + this.chkCalculateRoas2.Location = new System.Drawing.Point(111, 43); + this.chkCalculateRoas2.Name = "chkCalculateRoas2"; + this.chkCalculateRoas2.Size = new System.Drawing.Size(135, 21); + this.chkCalculateRoas2.TabIndex = 681; + this.chkCalculateRoas2.Text = "根据期望利润率估算"; + this.chkCalculateRoas2.UseVisualStyleBackColor = true; + this.chkCalculateRoas2.CheckedChanged += new System.EventHandler(this.chkCalculateRoas2_CheckedChanged); + // + // lblSameRoas2 + // + this.lblSameRoas2.AutoSize = true; + this.lblSameRoas2.Location = new System.Drawing.Point(26, 70); + this.lblSameRoas2.Name = "lblSameRoas2"; + this.lblSameRoas2.Size = new System.Drawing.Size(41, 17); + this.lblSameRoas2.TabIndex = 682; + this.lblSameRoas2.Text = "ROAS"; + // + // chkSameRoas2 + // + this.chkSameRoas2.AutoSize = true; + this.chkSameRoas2.Checked = true; + this.chkSameRoas2.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkSameRoas2.Location = new System.Drawing.Point(30, 43); + this.chkSameRoas2.Name = "chkSameRoas2"; + this.chkSameRoas2.Size = new System.Drawing.Size(75, 21); + this.chkSameRoas2.TabIndex = 680; + this.chkSameRoas2.Text = "自定义值"; + this.chkSameRoas2.UseVisualStyleBackColor = true; + this.chkSameRoas2.CheckedChanged += new System.EventHandler(this.chkSameRoas2_CheckedChanged); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(15, 59); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(128, 17); + this.label3.TabIndex = 495; + this.label3.Text = "目标广告投资回报率:"; + this.label3.Visible = false; + // + // pbLoading + // + this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None; + this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue; + this.pbLoading.Location = new System.Drawing.Point(553, 188); + this.pbLoading.Name = "pbLoading"; + this.pbLoading.Size = new System.Drawing.Size(50, 50); + this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbLoading.TabIndex = 189; + this.pbLoading.TabStop = false; + this.pbLoading.Visible = false; + // + // dgvAds + // + this.dgvAds.AllowUserToAddRows = false; + this.dgvAds.AllowUserToDeleteRows = false; + dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke; + this.dgvAds.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3; + this.dgvAds.BackgroundColor = System.Drawing.Color.White; + this.dgvAds.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgvAds.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; + this.dgvAds.ColumnHeadersHeight = 45; + this.dgvAds.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.colCheck, + this.colSupplierId, + this.colSupplierName, + this.colImgUrl, + this.colImg, + this.colGoodsId, + this.colSpuId, + this.colProdName, + this.colSite, + this.colPrcie, + this.colCate, + this.colCreateTime, + this.colSaleCount, + this.colSetCost, + this.colSetDiscount, + this.colAdStatus, + this.colBudget, + this.colWantROAS, + this.colChangeROAS, + this.colTotalCost, + this.colSaleVolume, + this.colROAS, + this.colRate, + this.colPerSaleCost, + this.colExposureCount, + this.colClickCount, + this.colOrderCount, + this.colGoodsNum, + this.colCTR, + this.colCVR, + this.colInCart, + this.colMsg}); + this.dgvAds.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgvAds.Location = new System.Drawing.Point(0, 0); + this.dgvAds.Name = "dgvAds"; + this.dgvAds.ReadOnly = true; + this.dgvAds.RowHeadersWidth = 35; + this.dgvAds.RowTemplate.Height = 23; + this.dgvAds.Size = new System.Drawing.Size(1152, 426); + this.dgvAds.TabIndex = 187; + this.dgvAds.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvAds_CellContentClick); + // + // colCheck + // + this.colCheck.HeaderText = "选择"; + this.colCheck.Name = "colCheck"; + this.colCheck.ReadOnly = true; + this.colCheck.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colCheck.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colCheck.Width = 30; + // + // colSupplierId + // + this.colSupplierId.HeaderText = "店铺Id"; + this.colSupplierId.Name = "colSupplierId"; + this.colSupplierId.ReadOnly = true; + this.colSupplierId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.colSupplierId.Width = 80; + // + // colSupplierName + // + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colSupplierName.DefaultCellStyle = dataGridViewCellStyle5; + this.colSupplierName.HeaderText = "店铺名称"; + this.colSupplierName.Name = "colSupplierName"; + this.colSupplierName.ReadOnly = true; + this.colSupplierName.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.colSupplierName.Width = 80; + // + // colImgUrl + // + this.colImgUrl.HeaderText = "图片路径"; + this.colImgUrl.Name = "colImgUrl"; + this.colImgUrl.ReadOnly = true; + this.colImgUrl.Visible = false; + // + // colImg + // + this.colImg.HeaderText = "图片"; + this.colImg.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom; + this.colImg.Name = "colImg"; + this.colImg.ReadOnly = true; + this.colImg.Width = 50; + // + // colGoodsId + // + this.colGoodsId.HeaderText = "商品ID"; + this.colGoodsId.Name = "colGoodsId"; + this.colGoodsId.ReadOnly = true; + this.colGoodsId.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colGoodsId.Width = 60; + // + // colSpuId + // + this.colSpuId.FillWeight = 150F; + this.colSpuId.HeaderText = "SPU ID"; + this.colSpuId.Name = "colSpuId"; + this.colSpuId.ReadOnly = true; + this.colSpuId.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colSpuId.Width = 60; + // + // colProdName + // + this.colProdName.HeaderText = "商品标题"; + this.colProdName.Name = "colProdName"; + this.colProdName.ReadOnly = true; + this.colProdName.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.colProdName.Width = 110; + // + // colSite + // + this.colSite.HeaderText = "站点"; + this.colSite.Name = "colSite"; + this.colSite.ReadOnly = true; + this.colSite.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.colSite.Width = 60; + // + // colPrcie + // + dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colPrcie.DefaultCellStyle = dataGridViewCellStyle6; + this.colPrcie.HeaderText = "申报价"; + this.colPrcie.Name = "colPrcie"; + this.colPrcie.ReadOnly = true; + this.colPrcie.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.colPrcie.Width = 65; + // + // colCate + // + this.colCate.HeaderText = "类目"; + this.colCate.Name = "colCate"; + this.colCate.ReadOnly = true; + this.colCate.Visible = false; + // + // colCreateTime + // + this.colCreateTime.HeaderText = "创建时间"; + this.colCreateTime.Name = "colCreateTime"; + this.colCreateTime.ReadOnly = true; + this.colCreateTime.Visible = false; + // + // colSaleCount + // + this.colSaleCount.HeaderText = "销量"; + this.colSaleCount.Name = "colSaleCount"; + this.colSaleCount.ReadOnly = true; + this.colSaleCount.Visible = false; + // + // colSetCost + // + dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colSetCost.DefaultCellStyle = dataGridViewCellStyle7; + this.colSetCost.HeaderText = "成本"; + this.colSetCost.Name = "colSetCost"; + this.colSetCost.ReadOnly = true; + this.colSetCost.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colSetCost.Width = 65; + // + // colSetDiscount + // + dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colSetDiscount.DefaultCellStyle = dataGridViewCellStyle8; + this.colSetDiscount.HeaderText = "折扣"; + this.colSetDiscount.Name = "colSetDiscount"; + this.colSetDiscount.ReadOnly = true; + this.colSetDiscount.Width = 38; + // + // colAdStatus + // + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colAdStatus.DefaultCellStyle = dataGridViewCellStyle9; + this.colAdStatus.HeaderText = "推广状态"; + this.colAdStatus.Name = "colAdStatus"; + this.colAdStatus.ReadOnly = true; + this.colAdStatus.Width = 60; + // + // colBudget + // + this.colBudget.HeaderText = "广告日预算"; + this.colBudget.Name = "colBudget"; + this.colBudget.ReadOnly = true; + this.colBudget.Width = 60; + // + // colWantROAS + // + this.colWantROAS.HeaderText = "目标ROAS"; + this.colWantROAS.Name = "colWantROAS"; + this.colWantROAS.ReadOnly = true; + this.colWantROAS.Width = 50; + // + // colChangeROAS + // + this.colChangeROAS.HeaderText = "改"; + this.colChangeROAS.Name = "colChangeROAS"; + this.colChangeROAS.ReadOnly = true; + this.colChangeROAS.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colChangeROAS.Width = 20; + // + // colTotalCost + // + this.colTotalCost.HeaderText = "总花费"; + this.colTotalCost.Name = "colTotalCost"; + this.colTotalCost.ReadOnly = true; + this.colTotalCost.Width = 70; + // + // colSaleVolume + // + this.colSaleVolume.HeaderText = "申报价销售额"; + this.colSaleVolume.Name = "colSaleVolume"; + this.colSaleVolume.ReadOnly = true; + this.colSaleVolume.Width = 70; + // + // colROAS + // + this.colROAS.HeaderText = "广告投资回报率(ROAS)"; + this.colROAS.Name = "colROAS"; + this.colROAS.ReadOnly = true; + this.colROAS.Width = 98; + // + // colRate + // + this.colRate.HeaderText = "广告费比(广告)"; + this.colRate.Name = "colRate"; + this.colRate.ReadOnly = true; + this.colRate.Width = 78; + // + // colPerSaleCost + // + this.colPerSaleCost.HeaderText = "每笔成交花费"; + this.colPerSaleCost.Name = "colPerSaleCost"; + this.colPerSaleCost.ReadOnly = true; + this.colPerSaleCost.Width = 75; + // + // colExposureCount + // + this.colExposureCount.HeaderText = "曝光量"; + this.colExposureCount.Name = "colExposureCount"; + this.colExposureCount.ReadOnly = true; + this.colExposureCount.Width = 70; + // + // colClickCount + // + this.colClickCount.HeaderText = "点击量"; + this.colClickCount.Name = "colClickCount"; + this.colClickCount.ReadOnly = true; + this.colClickCount.Width = 70; + // + // colOrderCount + // + this.colOrderCount.HeaderText = "订单量"; + this.colOrderCount.Name = "colOrderCount"; + this.colOrderCount.ReadOnly = true; + this.colOrderCount.Width = 70; + // + // colGoodsNum + // + this.colGoodsNum.HeaderText = "件数"; + this.colGoodsNum.Name = "colGoodsNum"; + this.colGoodsNum.ReadOnly = true; + this.colGoodsNum.Width = 70; + // + // colCTR + // + this.colCTR.HeaderText = "点击率(CTR)"; + this.colCTR.Name = "colCTR"; + this.colCTR.ReadOnly = true; + this.colCTR.Width = 70; + // + // colCVR + // + this.colCVR.HeaderText = "转化率(CVR)"; + this.colCVR.Name = "colCVR"; + this.colCVR.ReadOnly = true; + this.colCVR.Width = 70; + // + // colInCart + // + this.colInCart.HeaderText = "加购数"; + this.colInCart.Name = "colInCart"; + this.colInCart.ReadOnly = true; + this.colInCart.Width = 70; + // + // colMsg + // + this.colMsg.HeaderText = "信息"; + this.colMsg.Name = "colMsg"; + this.colMsg.ReadOnly = true; + this.colMsg.Width = 110; + // + // splitContainer4 + // + this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer4.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer4.Location = new System.Drawing.Point(0, 0); + this.splitContainer4.Name = "splitContainer4"; + // + // splitContainer4.Panel1 + // + this.splitContainer4.Panel1.Controls.Add(this.statusBar); + // + // splitContainer4.Panel2 + // + this.splitContainer4.Panel2.Controls.Add(this.panelEx1); + this.splitContainer4.Panel2.Controls.Add(this.btnClear); + this.splitContainer4.Size = new System.Drawing.Size(1440, 26); + this.splitContainer4.SplitterDistance = 1162; + this.splitContainer4.TabIndex = 3; + // + // 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(1162, 26); + this.statusBar.TabIndex = 2; + // + // panelEx1 + // + this.panelEx1.CanvasColor = System.Drawing.SystemColors.Control; + this.panelEx1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.panelEx1.DisabledBackColor = System.Drawing.Color.Empty; + this.panelEx1.Location = new System.Drawing.Point(155, 0); + this.panelEx1.Name = "panelEx1"; + this.panelEx1.Size = new System.Drawing.Size(115, 21); + this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center; + this.panelEx1.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); + this.panelEx1.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); + this.panelEx1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; + this.panelEx1.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.panelEx1.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; + this.panelEx1.Style.GradientAngle = 90; + this.panelEx1.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center; + this.panelEx1.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.panelEx1.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.panelEx1.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.panelEx1.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White; + this.panelEx1.TabIndex = 668; + this.panelEx1.Text = "停止当前操作"; + // + // btnClear + // + this.btnClear.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.btnClear.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnClear.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnClear.DisabledBackColor = System.Drawing.Color.Empty; + this.btnClear.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnClear.Location = new System.Drawing.Point(47, 0); + this.btnClear.Name = "btnClear"; + this.btnClear.Size = new System.Drawing.Size(90, 21); + this.btnClear.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnClear.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnClear.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnClear.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnClear.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnClear.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnClear.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnClear.Style.GradientAngle = 90; + this.btnClear.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnClear.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnClear.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnClear.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White; + this.btnClear.TabIndex = 440; + this.btnClear.Text = "清空结果"; + this.btnClear.Visible = false; + // + // lblGoodsId + // + this.lblGoodsId.AutoSize = true; + this.lblGoodsId.Location = new System.Drawing.Point(27, 23); + this.lblGoodsId.Name = "lblGoodsId"; + this.lblGoodsId.Size = new System.Drawing.Size(58, 17); + this.lblGoodsId.TabIndex = 690; + this.lblGoodsId.Text = "goodsId"; + this.lblGoodsId.Visible = false; + // + // lblShopId + // + this.lblShopId.AutoSize = true; + this.lblShopId.Location = new System.Drawing.Point(108, 23); + this.lblShopId.Name = "lblShopId"; + this.lblShopId.Size = new System.Drawing.Size(49, 17); + this.lblShopId.TabIndex = 691; + this.lblShopId.Text = "shopId"; + this.lblShopId.Visible = false; + // + // TemuAdsForm + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(1440, 580); + this.Controls.Add(this.splitContainer1); + this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Name = "TemuAdsForm"; + this.Text = "TemuAdsForm"; + this.Load += new System.EventHandler(this.TemuAdsForm_Load); + this.VisibleChanged += new System.EventHandler(this.TemuAdsForm_VisibleChanged); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.ucGroupBoxEx3.ResumeLayout(false); + this.ucGroupBoxEx3.PerformLayout(); + this.ucGroupBoxEx2.ResumeLayout(false); + this.ucGroupBoxEx2.PerformLayout(); + this.ucGroupBoxEx1.ResumeLayout(false); + this.splitContainer3.Panel1.ResumeLayout(false); + this.splitContainer3.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); + this.splitContainer3.ResumeLayout(false); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel2.ResumeLayout(false); + this.splitContainer2.Panel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); + this.splitContainer2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pbLoading2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgvShop)).EndInit(); + this.gbxSoloChangeRoas.ResumeLayout(false); + this.gbxSoloChangeRoas.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgvAds)).EndInit(); + this.splitContainer4.Panel1.ResumeLayout(false); + this.splitContainer4.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit(); + this.splitContainer4.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer1; + private UserComponent.UcGroupBoxEx ucGroupBoxEx3; + private DevComponents.DotNetBar.PanelEx btnEdit; + private UserComponent.UcGroupBoxEx ucGroupBoxEx2; + private DevComponents.DotNetBar.PanelEx btnSearchAds; + private UserComponent.UcGroupBoxEx ucGroupBoxEx1; + private DevComponents.DotNetBar.PanelEx btnRefreshShop; + private System.Windows.Forms.SplitContainer splitContainer3; + private System.Windows.Forms.SplitContainer splitContainer2; + private UserComponent.DataGridViewEx dgvShop; + private UserComponent.DataGridViewEx dgvAds; + private System.Windows.Forms.SplitContainer splitContainer4; + private UserControls.StatusBarUserControl statusBar; + private DevComponents.DotNetBar.PanelEx panelEx1; + private DevComponents.DotNetBar.PanelEx btnClear; + private DevComponents.DotNetBar.PanelEx btnCheckAdsLogin; + private System.Windows.Forms.PictureBox pbLoading2; + private System.Windows.Forms.PictureBox pbLoading; + private DevComponents.DotNetBar.PanelEx btnAddAds; + private DevComponents.DotNetBar.PanelEx btnDelAds; + private System.Windows.Forms.TextBox txtBudget; + private UserComponent.UcCheckBox chkLimitValue; + private UserComponent.UcCheckBox chkNoLimit; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox txtSameRoas; + private System.Windows.Forms.Label label2; + private UserComponent.UcCheckBox chkCalculateRoas; + private UserComponent.UcCheckBox chkSameRoas; + private System.Windows.Forms.TextBox txtCalculateProfitRate; + private System.Windows.Forms.Label lblCalculateRoas; + private System.Windows.Forms.Label lblSameRoas; + private System.Windows.Forms.Label lblCalculateRoasPercentSign; + private System.Windows.Forms.Label lblBudget; + private DevComponents.DotNetBar.PanelEx btnContinueAds; + private DevComponents.DotNetBar.PanelEx btnPauseAds; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect; + private System.Windows.Forms.DataGridViewTextBoxColumn colShopLoginName; + private System.Windows.Forms.DataGridViewTextBoxColumn colShopId; + private System.Windows.Forms.DataGridViewTextBoxColumn colShopName; + private System.Windows.Forms.DataGridViewTextBoxColumn colShopNotes; + private System.Windows.Forms.DataGridViewLinkColumn colLoginStatus; + private System.Windows.Forms.DataGridViewLinkColumn colAdsLoginStatus; + private System.Windows.Forms.DataGridViewCheckBoxColumn colCanUse; + private System.Windows.Forms.DataGridViewTextBoxColumn colMessage; + private System.Windows.Forms.TextBox txtSelectFilter; + private System.Windows.Forms.Label label4; + private DevComponents.DotNetBar.PanelEx btnSelectFilter; + private UserComponent.UcCheckBox chkYesterday; + private UserComponent.UcCheckBox chkToday; + private UserComponent.UcCheckBox chk30Days; + private UserComponent.UcCheckBox chk7Days; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck; + private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierId; + private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierName; + private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl; + private System.Windows.Forms.DataGridViewImageColumn colImg; + private System.Windows.Forms.DataGridViewLinkColumn colGoodsId; + private System.Windows.Forms.DataGridViewLinkColumn colSpuId; + private System.Windows.Forms.DataGridViewTextBoxColumn colProdName; + private System.Windows.Forms.DataGridViewTextBoxColumn colSite; + private System.Windows.Forms.DataGridViewTextBoxColumn colPrcie; + private System.Windows.Forms.DataGridViewTextBoxColumn colCate; + private System.Windows.Forms.DataGridViewTextBoxColumn colCreateTime; + private System.Windows.Forms.DataGridViewTextBoxColumn colSaleCount; + private System.Windows.Forms.DataGridViewLinkColumn colSetCost; + private System.Windows.Forms.DataGridViewLinkColumn colSetDiscount; + private System.Windows.Forms.DataGridViewTextBoxColumn colAdStatus; + private System.Windows.Forms.DataGridViewTextBoxColumn colBudget; + private System.Windows.Forms.DataGridViewTextBoxColumn colWantROAS; + private System.Windows.Forms.DataGridViewLinkColumn colChangeROAS; + private System.Windows.Forms.DataGridViewTextBoxColumn colTotalCost; + private System.Windows.Forms.DataGridViewTextBoxColumn colSaleVolume; + private System.Windows.Forms.DataGridViewTextBoxColumn colROAS; + private System.Windows.Forms.DataGridViewTextBoxColumn colRate; + private System.Windows.Forms.DataGridViewTextBoxColumn colPerSaleCost; + private System.Windows.Forms.DataGridViewTextBoxColumn colExposureCount; + private System.Windows.Forms.DataGridViewTextBoxColumn colClickCount; + private System.Windows.Forms.DataGridViewTextBoxColumn colOrderCount; + private System.Windows.Forms.DataGridViewTextBoxColumn colGoodsNum; + private System.Windows.Forms.DataGridViewTextBoxColumn colCTR; + private System.Windows.Forms.DataGridViewTextBoxColumn colCVR; + private System.Windows.Forms.DataGridViewTextBoxColumn colInCart; + private System.Windows.Forms.DataGridViewTextBoxColumn colMsg; + private UserComponent.UcGroupBoxEx gbxSoloChangeRoas; + private DevComponents.DotNetBar.PanelEx btnCancelSoloChangeRoas; + private DevComponents.DotNetBar.PanelEx btnSoloChangeRoas; + private System.Windows.Forms.TextBox txtCalculateProfitRate2; + private System.Windows.Forms.Label lblCalculateRoasPercentSign2; + private System.Windows.Forms.Label lblCalculateRoas2; + private System.Windows.Forms.TextBox txtSameRoas2; + private UserComponent.UcCheckBox chkCalculateRoas2; + private System.Windows.Forms.Label lblSameRoas2; + private UserComponent.UcCheckBox chkSameRoas2; + private System.Windows.Forms.Label lblShopId; + private System.Windows.Forms.Label lblGoodsId; + } +} \ No newline at end of file diff --git a/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.cs b/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.cs new file mode 100644 index 0000000..5b654cf --- /dev/null +++ b/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.cs @@ -0,0 +1,2327 @@ +using AllBase; +using AllBase.Helper; +using AllBase.Model.Result; +using AllBase.Model.Result.TemuResult; +using NaiBa.Util.Extension; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using TemuKJD.BaseForms; +using TemuKJD.BLL; +using TemuKJD.Extension; +using TemuKJD.KJDForms.ShopForms; +using TemuKJD.KJDForms.ShopForms.Statistics; +using TemuKJD.ToolForms; +using Work; + +namespace TemuKJD.KJDForms.ProductForms +{ + public partial class TemuAdsForm : BaseForm + { + static TemuAdsForm instance; + public static TemuAdsForm Instance { get { if (instance == null) instance = new TemuAdsForm(); return instance; } set { instance = value; } } + + public CancellationTokenSource cancellationTokenSource { get; set; } = null; + List lstAdsDetailInfo = new List(); + List lstAdsMallGoodsInfo = new List(); + List lstWareHouse = new List(); + List lstPurchasePrice = new List(); + CheckBox chkSelectAll = null; + + public TemuAdsForm() + { + InitializeComponent(); + + instance = this; + } + + private void TemuAdsForm_Load(object sender, EventArgs e) + { + chkSelectAll = dgvShop.Columns["colSelect"].AddHeaderCheckBox(HorizontalAlignment.Center, 0, 0, null, null, false); + dgvShop.Columns["colSelect"].HeaderText = ""; + chkSelectAll.Width = chkSelectAll.Height = 13; + chkSelectAll.CheckedChanged += chkSelectAll_CheckedChanged; + + this.dgvAds.AddSelectorColumn("colCheck"); + this.dgvShop.Columns["colAdsLoginStatus"].HeaderCell.Style.WrapMode = DataGridViewTriState.True; + this.dgvAds.Columns["colMsg"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleLeft; + + dgvAds.AddImgColumn("colImg", "colImgUrl"); + chkCalculateRoas.Checked = true; + + + this.dgvAds.AddMergeColumnHeader(new List() { "colWantROAS", "colChangeROAS" }, "目标ROAS"); + this.dgvAds.AddMergeColumn(new List() { "colWantROAS", "colChangeROAS" }); + } + + private void chkSelectAll_CheckedChanged(object sender, EventArgs e) + { + if (!chkSelectAll.Checked) + { + foreach (DataGridViewRow row in dgvShop.Rows) + { + row.Cells["colSelect"].Value = false; + } + } + else + { + var list = GlobalConfig.ShopLoginList.Where(s => s.ad_login_status == "在线").Select(ss => ss.ShopId); + foreach (DataGridViewRow row in dgvShop.Rows) + { + if (list.Any(l => l == row.Cells["colShopId"]?.Value?.ToString())) + row.Cells["colSelect"].Value = true; + } + } + } + + private void TemuAdsForm_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + RefreshShop(); + } + + private void btnRefreshShop_Click(object sender, EventArgs e) + { + RefreshShop(); + } + + private void RefreshShop() + { + // 店铺Id + var selectIds = dgvShop.Rows.Cast().Where(row + => row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList(); + // 获取被删除的店铺 + List dgvRowList = dgvShop.Rows.Cast().Where(row + => !GlobalConfig.ShopLoginList.Any(s => s.ShopId == row.Cells["colShopId"]?.Value?.ToString())).ToList(); + // 更新被删除的店铺列表 + foreach (var row in dgvRowList) + { + dgvShop.Rows.Remove(row); + } + // 绑定其他店铺(含新导入的店铺) + foreach (ShopLoginInfo shopEntity in GlobalConfig.ShopLoginList) + { + if (!string.IsNullOrEmpty(shopEntity.ShopId)) + BindShop(shopEntity, selectIds); + } + } + + private void BindShop(ShopLoginInfo shopEntity, List selectShopId = null) + { + if (shopEntity == null) + return; + if (selectShopId == null) + selectShopId = new List(); + + bool canAdsUse = shopEntity.ad_login_status == "在线"; + bool canUse = shopEntity.LoginStatus2 == "国际版在线"; + var row = dgvShop.Rows.Cast().FirstOrDefault(p => p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == shopEntity.ShopId); + if (row == null) + { + int id = this.dgvShop.Rows.Add( + selectShopId.Contains(shopEntity.ShopId) && canAdsUse, + shopEntity.LoginName, + shopEntity.ShopId, + shopEntity.ShopAccount, + shopEntity.Notes, + canUse ? "在线" : "离线", + canAdsUse ? "在线" : "离线", + canAdsUse, + string.Empty + ); + row = dgvShop.Rows[id]; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Green : Color.Red; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Green : Color.Red; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightGreen : Color.OrangeRed; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkGreen : Color.DarkRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canAdsUse ? Color.Green : Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).LinkColor = canAdsUse ? Color.Green : Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canAdsUse ? Color.LightGreen : Color.OrangeRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canAdsUse ? Color.DarkGreen : Color.DarkRed; + } + else + { + row.Cells["colSelect"].Value = selectShopId.Contains(shopEntity.ShopId) && canAdsUse; + row.Cells["colShopLoginName"].Value = shopEntity.LoginName; + row.Cells["colShopName"].Value = shopEntity.ShopAccount; + row.Cells["colShopNotes"].Value = shopEntity.Notes; + row.Cells["colLoginStatus"].Value = canUse ? "在线" : "离线"; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Green : Color.Red; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Green : Color.Red; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightGreen : Color.OrangeRed; + (row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkGreen : Color.DarkRed; + row.Cells["colAdsLoginStatus"].Value = canAdsUse ? "在线" : "离线"; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canAdsUse ? Color.Green : Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).LinkColor = canAdsUse ? Color.Green : Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canAdsUse ? Color.LightGreen : Color.OrangeRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canAdsUse ? Color.DarkGreen : Color.DarkRed; + row.Cells["colCanUse"].Value = canAdsUse; + } + } + + private void dgvShop_CellContentClick(object sender, DataGridViewCellEventArgs e) + { + if (e.ColumnIndex < 0 || e.RowIndex < 0) + return; + string headerText = dgvShop.Columns[e.ColumnIndex].HeaderText; + string columnName = dgvShop.Columns[e.ColumnIndex].Name; + long shopId = dgvShop.Rows[e.RowIndex].Cells["colShopId"].Value.ParseToLong(); + string shopAccount = dgvShop.Rows[e.RowIndex].Cells["colShopName"].Value.ToString(); + var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId.ToString()); + var row = dgvShop.Rows[e.RowIndex]; + switch (columnName) + { + case "colSelect": + if (row.Cells["colCanUse"].Value.ParseToBool() || row.Cells["colSelect"].Value.ParseToBool()) + { + row.Cells["colSelect"].Value = !row.Cells["colSelect"].Value.ParseToBool(); + + chkSelectAll.CheckedChanged -= chkSelectAll_CheckedChanged; + if (dgvShop.Rows.Cast().All(r => r.Cells["colSelect"].Value.ParseToBool())) + chkSelectAll.Checked = true; + else + chkSelectAll.Checked = false; + chkSelectAll.CheckedChanged += chkSelectAll_CheckedChanged; + } + else + { + BaseMsgForm.ShowInfo("店铺推广直通车未登录!"); + return; + } + break; + case "colLoginStatus": + { + ShopLoginForm shopLoginForm = new ShopLoginForm(shop); + shopLoginForm.openType = EnumOpenType.login; + //shopLoginForm.IsAdsLogin = true; + shopLoginForm.ShowDialog(); + RefreshShop(); + } + break; + case "colAdsLoginStatus": + ShopListForm.Instance.CheckShopAdsLogin(shop); + if (shop.ad_login_status == "在线" && !string.IsNullOrEmpty(shop.ad_url)) + { + ShopLoginForm shopLoginForm = new ShopLoginForm(shop); + shopLoginForm.openType = EnumOpenType.ads; + shopLoginForm.InitUrl = shop.ad_url; + shopLoginForm.Show(); + } + else + { + ShopLoginForm shopLoginForm = new ShopLoginForm(shop); + shopLoginForm.openType = EnumOpenType.login; + shopLoginForm.IsAdsLogin = true; + shopLoginForm.ShowDialog(); + RefreshShop(); + } + break; + } + } + + + private void btnCheckAdsLogin_Click(object sender, EventArgs e) + { + var shopIds = this.dgvShop.Rows.Cast().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true).Select(r => r.Cells["colShopId"].Value.ParseToString()).ToList(); + if(shopIds.Count <= 0) + { + BaseMsgForm.ShowError("请选中店铺!"); + return; + } + ShopListForm.Instance.CheckShopAdsLogin(shopIds, pbLoading2, statusBar); + this.RefreshShop(); + } + + public static string getAdsGoodsList(ShopLoginInfo shop, int page = 1, int pageSize = 20) + { + //"is_gray" true则显示不可用商品 + string url = "https://ads.temu.com/api/v1/coconut/ad/query_mall_goods_list"; + string body = @"{""page_number"":" + page + @",""page_size"":" + pageSize + @",""is_gray"":true,""list_id"":""fc1dd2d3-cab6-44c6-91b6-2f951c5c6f2f""}"; + string refere = shop.ad_url.Replace("https://ads.temu.com/index.html", "https://ads.temu.com/create-ads.html"); + + return HttpResponseBLL.PostResponseAds(shop, url, body, refere); + } + + private string GetAdsDetailList(ShopLoginInfo shop, long startTime, long endTime, int page = 1, int pageSize = 50) + { + page = Math.Max(page, 1); + string url = "https://ads.temu.com/api/v1/coconut/ad/ads_detail"; + string body; + body = "{\"ad_status\":[],\"ad_advice_types\":[],\"page_size\":" + pageSize + ",\"page_number\":" + page + + ",\"specific_query_info\":\"\",\"sort_by\":0,\"sort_type\":\"desc\",\"start_time\":" + + startTime + "," + "\"end_time\":" + + endTime + + ",\"need_calculate_goods_summary\":true,\"ad_phase\":-1}"; + + string refere = shop.ad_url.Replace("https://ads.temu.com/index.html", "https://ads.temu.com/ad-list.html"); + + return HttpResponseBLL.PostResponseAds(shop, url, body, refere); + } + + private string CreateAds(ShopLoginInfo shop, CreateAdsParam data) + { + string url = "https://ads.temu.com/api/v1/coconut/ad/create_ads/create"; + string body; + //body = @"{""create_ad_reqs"":[{""goods_id"":""601099667164131"",""site_id"":129,""roas"":77700,""budget"":12300}]}"; + body = JsonHelper.SerializeObject(data); + + string refere = shop.ad_url.Replace("https://ads.temu.com/index.html", "https://ads.temu.com/create-ads.html"); + + return HttpResponseBLL.PostResponseAds(shop, url, body, refere); + } + + private string MdyAds(ShopLoginInfo shop, MdyAdsParam data) + { + string url = "https://ads.temu.com/api/v1/coconut/ad/modify_ads"; + string body; + //body = @"{""modify_ad_dtos"":[{""ad_id"":""300000013237119567"",""roas"":100000,""goods_id"":""601099667071702""}]}"; + body = JsonHelper.SerializeObject(data); + + string refere = shop.ad_url.Replace("https://ads.temu.com/index.html", "https://ads.temu.com/ad-list.html"); + + return HttpResponseBLL.PostResponseAds(shop, url, body, refere); + } + + private string PauseAds(ShopLoginInfo shop, List idList) + { + string url = "https://ads.temu.com/api/v1/coconut/ad/modify_ads"; + string body; + body = "{\"ad_ids\":[\"" + string.Join("\",\"", idList) + "\"],\"status\":2}"; + + string refere = shop.ad_url.Replace("https://ads.temu.com/index.html", "https://ads.temu.com/ad-list.html"); + + return HttpResponseBLL.PostResponseAds(shop, url, body, refere); + } + private string continueAds(ShopLoginInfo shop, List idList) + { + string url = "https://ads.temu.com/api/v1/coconut/ad/modify_ads"; + string body; + body = "{\"ad_ids\":[\"" + string.Join("\",\"", idList) + "\"],\"status\":0}"; + + string refere = shop.ad_url.Replace("https://ads.temu.com/index.html", "https://ads.temu.com/ad-list.html"); + + return HttpResponseBLL.PostResponseAds(shop, url, body, refere); + } + private string DelAds(ShopLoginInfo shop, List idList) + { + string url = "https://ads.temu.com/api/v1/coconut/ad/modify_ads"; + string body; + body = "{\"ad_ids\":[\"" + string.Join("\",\"", idList) + "\"],\"status\":3}"; + + string refere = shop.ad_url.Replace("https://ads.temu.com/index.html", "https://ads.temu.com/ad-list.html"); + + return HttpResponseBLL.PostResponseAds(shop, url, body, refere); + } + + private string GetWarehouseListBySpuIds(ShopLoginInfo shop, string spuIds, int page = 1, int pageSize = 40) + { + page = Math.Max(page, 1); + string url = "https://agentseller.temu.com/mms/venom/api/supplier/sales/management/listWarehouse"; + string body = @"{""pageNo"":" + page + @",""pageSize"":" + pageSize + @",""isLack"":0,""selectStatusList"":[12],""priceAdjustRecentDays"":7," + + @"""productIdList"":[" + spuIds + @"]}"; + string refere = "https://agentseller.temu.com/stock/fully-mgt/sale-manage/main"; + + return HttpResponseBLL.PostResponse2(shop, url, body, refere); + } + + private List GetWareHouseList(ShopLoginInfo shop, List spuIdList, out string errMsg) + { + errMsg = ""; + string html = GetWarehouseListBySpuIds(shop, string.Join(",", spuIdList)); + + if (!html.Contains("\"success\":true")) + { + string errStr = BaseRegex.GetStringJson(ref html, "errorMsg"); + if (string.IsNullOrEmpty(errStr)) + errStr = errStr = BaseRegex.GetStringJson(ref html, "error_msg"); + if (string.IsNullOrEmpty(errStr)) + errStr = html; + if (errStr.Contains("Invalid Login State") || errStr.Contains("指定的值含有无效的控制字符") || 1 == 1) + { + ShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false); + } + Thread.Sleep(Randomx.GetId(100, 200)); + errMsg = errStr; + return new List(); + } + + var jArr = new JArray(); + try + { + var jObj = JObject.Parse(html); + jArr = jObj["result"]["subOrderList"] as JArray; + if (jArr == null) + jArr = new JArray(); + } + catch (Exception ex) + { + errMsg = ex.Message; + return new List(); + } + + List subOrderInfoLstTmp = new List(); + foreach (var item in jArr) + { + string sItem = item.ToString(); + WarehouseProductSubOrderInfo sInfo = JsonHelper.DeserializeJsonToObject(sItem); // 反序列化得到类 + if (sInfo != null) + { + subOrderInfoLstTmp.Add(sInfo); + } + } + return subOrderInfoLstTmp; + } + + List GetPurchasePriceList(List productIdList) + { + List list = new List(); + + for (int i = 0; i < productIdList.Count; i++) + { + productIdList[i] = productIdList[i].Replace(",", "").Replace("'", "").Replace("\"", ""); + } + var url = BaseClass.BuildObjString("price/get_purchase_price_list"); + var data = UserLogin.GetSignaturex(); + data += "&page=1"; + data += "&page_size=" + productIdList.Count; + data += "&in_spu_id=" + string.Join(",", productIdList); + 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")) + { + return list; + } + + if (!html.Contains("data")) + return list; + + var jArr = JObject.Parse(html)["data"]; + if (jArr.Count() == 0) + return list; + + list = JsonHelper.DeserializeJsonToList(jArr.ToString()); + foreach (var pPrice in list) + { + pPrice.dbSkuPurchasePriceList = JsonHelper.DeserializeJsonToList(pPrice.sku_purchase_price_json); + if (pPrice.dbSkuPurchasePriceList == null) + pPrice.dbSkuPurchasePriceList = new List(); + else + { + pPrice.price_text = "¥" + (pPrice.dbSkuPurchasePriceList.Min(s => s.purchasePriceValue) * 0.01).ParseToDecimal().ToString("0.00") + "~" + + "¥" + (pPrice.dbSkuPurchasePriceList.Max(s => s.purchasePriceValue) * 0.01).ParseToDecimal().ToString("0.00"); + } + } + return list; + } + + private void btnSearchProduct_Click(object sender, EventArgs e) + { + var lstShopId = dgvShop.Rows.Cast().Where(row + => row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList(); + if (lstShopId.Count == 0) + { + BaseMsgForm.ShowInfo("请选择店铺!"); + return; + } + + isAddAds = false; + List newAdsColName = new List { "colCate", "colCreateTime", "colSaleCount" }; + List existAdsColName = new List { "colAdStatus", "colBudget", "colWantROAS", "colChangeROAS", "colTotalCost", "colSaleVolume", + "colROAS", "colRate", "colPerSaleCost", "colExposureCount", "colClickCount", "colOrderCount", "colGoodsNum", "colCTR", "colCVR", "colInCart" }; + foreach (DataGridViewColumn column in dgvAds.Columns) + { + if (newAdsColName.Contains(column.Name)) + { + column.Visible = false; + } + else if (existAdsColName.Contains(column.Name)) + { + column.Visible = true; + } + } + + lstAdsDetailInfo.Clear(); + lstWareHouse.Clear(); + lstPurchasePrice.Clear(); + dgvAds.Rows.Clear(); + + var dgvRows = this.dgvShop.Rows.Cast();//.Where(r => lstShopId.Contains(r.Cells["colShopId"].Value.ParseToString())); + foreach (var row in dgvRows) + { + row.Cells["colMessage"].Value = ""; + } + + ucGroupBoxEx2.Enabled = false; + ucGroupBoxEx3.Enabled = false; + + cancellationTokenSource = new CancellationTokenSource(); + Task.Run(() => + { + var lstShopIdTemp = new List(); + lstShopIdTemp.AddRange(lstShopId); + int i = 0; + + foreach (var shopId in lstShopIdTemp) + { + this.Invoke(new Action(() => + { + this.statusBar.lblTaskStatus.Text = "正在查询..."; + this.statusBar.pgbTaskProgress.Maximum = lstShopIdTemp.Count; + this.statusBar.UpdateProgressBar(i + 1); + i++; + })); + + if (cancellationTokenSource.IsCancellationRequested) + break; + + var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId); + if (shop == null) + continue; + + #region 检测登录 + if (shop.ad_login_status != "在线") + { + continue; + } + if (ShopListForm.Instance == null) + ShopListForm.Instance = new ShopListForm(); + ShopListForm.Instance.CheckShopAdsLogin(new List { shop.ShopId }); + if (shop.ad_login_status != "在线") + { + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "店铺直通车掉线"; + row.Cells["colAdsLoginStatus"].Value = "离线"; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).LinkColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = Color.OrangeRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = Color.DarkRed; + row.Cells["colCanUse"].Value = false; + } + })); + continue; + } + #endregion + + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "正在查询"; + } + })); + + int page = 1; + int totalPage = 1; + int pageSize = 40; + bool isError = false; + string errMsg = ""; + while (page <= totalPage) + { + if (cancellationTokenSource.IsCancellationRequested) + break; + + int tryCount = 0; + tryAgain: + Thread.Sleep(100 + Randomx.GetId(200)); + var startTime = BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now.Date); + var endTime = BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now); + if (chkYesterday.Checked) + { + startTime = BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now.Date.AddDays(-1)); + endTime = BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now.Date) - 1; + } + else if (chk7Days.Checked) + { + startTime = BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now.Date.AddDays(-7)); + endTime = BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now); + } + else if (chk30Days.Checked) + { + startTime = BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now.Date.AddDays(-30)); + endTime = BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now); + } + string jsonStr = GetAdsDetailList(shop, startTime, endTime, page, pageSize); + //eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiZGlyIn0..239DkQh2tOmakDpH.P4o6IPrjql1GrM5-AgfVRCsQeJvfzN_bZXtQUVhZjpZmGreQuoCR3Dn5Q1PEuM7JaTjUV6HXojNKdRPx_zXDOtni6fyelErJYxjskpPR7hiEdrSASOPVUz-PMwOTlT7DrrYKppclzCv97nMnovKGTrsZIsB98eeI2fgvF9jehPtnEFwE7_eu1EwRC-vd-zPedIJoxwc_B2Hlwi10O1Db-AAUYTL6qZqRPbrH9FtEJffD1qsfwy5L-iMaO_aK9eyz0WmF0E0K6wLhmGknPwpytm5Iz_ekUCsjEbrlYe4tOTD_K3rKePer_y2-9MHZ3Hk_0pObdVostRNwOXyimkGBdow0x96kC8U5BMcWX_jvAVXfuokRJv_LOYtj1qi_zM4pjJa1ySPEdDUfAgp1GmFIRRjGDG-bE7uwbZK_4eN0w5txs0MN9AbEYdD4BYVUQwE.YWnmDgmj14CEoz0FYxBPGQ + //eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiZGlyIn0..A2mlig51hgFP7JXx.RDqzwYzKc8jEyg_DY2qkk0VrhdPUPnpx1nAS8GA7QtGSPe3Lfe3LZsZneOWsBMIvERXZa9iiF7X_8dSr3NIiHpAG4Q6Vp1cqzO_BG-KY-B31Z46H5EDzzj9Hfi3r24HFWhHU7E1E-Bug8k_ytczY1YqfK5SiiGPm0TYWKbG3CYrVx2kFCGfeu8u8qPNfx6k5ZqYpxh_3ExgYQQKSI-DV47ti3KYyHB2JkcxvDRVRT6LhxW1tcusLsEXUskY5M1CNV3UIxUvnpKK7kB_Juz3WQcpLX5jf5wKE5dQG_UaBywV7yRjsScHeUjG8jFl_SM2zxXcd2wLy6u1dM4sBGpOhZrIe8L6mZOIuFlYHh3Y4wZT-N_Eq_wDqKbSmjyw3QZzQzQruICtU2uF7xLZJr1-c_Yg7adtR2TJatjaQPIimzBHCs-QDHtICKHON0wGdmuA.bnXgv0qN4PgRNhFeN9UOQA + if (jsonStr.Contains("当前操作人数太多,请稍后重试") && tryCount < 5) + { + tryCount++; + Thread.Sleep(Randomx.GetId(500, 1000)); + goto tryAgain; + } + + if (!jsonStr.Contains("\"success\":true")) + { + isError = true; + string sErr = BaseRegex.GetStringJson(ref jsonStr, "errorMsg"); + if (!string.IsNullOrWhiteSpace(sErr) && !errMsg.Contains(sErr)) + errMsg += sErr + " "; + page++; + + ShopListForm.Instance.CheckShopAdsLogin(new List { shop.ShopId }); + if (shop.ad_login_status != "在线") + { + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "店铺直通车掉线"; + row.Cells["colAdsLoginStatus"].Value = "离线"; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).LinkColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = Color.OrangeRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = Color.DarkRed; + row.Cells["colCanUse"].Value = false; + } + })); + break; + } + else + continue; + } + + if (jsonStr.Contains("\"success\":true")) + { + var jArr = new JArray(); + try + { + var jObj = JObject.Parse(jsonStr); + jArr = jObj["result"]?["ads_detail"] as JArray; + if (jArr == null) + jArr = new JArray(); + } + catch (Exception ex) { BaseMsgForm.ShowError(ex.Message); } + List spuIdLst = new List(); + foreach (var item in jArr) + { + string sItem = item.ToString(); + AdsDetailInfo adsInfo = JsonHelper.DeserializeJsonToObject(sItem); // 反序列化得到类 + if (adsInfo != null && !lstAdsDetailInfo.Any(a => a.ad_id == adsInfo.ad_id)) + { + adsInfo.shopId = shop.ShopId; + lstAdsDetailInfo.Add(adsInfo); + spuIdLst.Add(adsInfo.spu_id); + + //string url = pInfo.image.Replace("https", "http"); + //var image = Image.FromStream(WebRequest.Create(url).GetResponse().GetResponseStream()); + + Invoke(new Action(() => + { + int rowId = this.dgvAds.Rows.Add( + true, + adsInfo.shopId, + shop.ShopAccount, + adsInfo.goods_image_url.Replace("https", "http").Replace("img.kwcdn.com", "img.cdnfe.com"), + DataGridViewExtension.defaultBitmap,//image, // skc图片 + adsInfo.goods_id, + adsInfo.spu_id, + adsInfo.goods_title, + string.Join("、", adsInfo.site_name_list), + adsInfo.goods_min_price + "~" + adsInfo.goods_max_price, + "类目", + "创建时间", + "销量", + "", //"设置", // 成本 + "", //"设置", // 折扣 + GetAdsShowStatus(adsInfo.ad_show_status.ParseToInt()) + (" " + adsInfo.forbid_reason).TrimEnd(), + adsInfo.budget_str, // 广告日预算 + adsInfo.roas_str, // 目标roas + "改", + adsInfo.reports_summary_dto.ad_spend_all.trans_val, //adsInfo.used_budget * 0.01, // 总花费 + adsInfo.reports_summary_dto.order_pay_amt_all.trans_val, //adsInfo.supply_price_sale.ParseToInt() * 0.01, // 申报价销售额 + adsInfo.reports_summary_dto.roas_all.trans_val, //adsInfo.real_roas * 0.001, // 广告投资回报率 (ROAS) + adsInfo.reports_summary_dto.acos_all.trans_val, //adsInfo.acos * 0.01, // 广告费比(广告) + adsInfo.reports_summary_dto.transaction_cost.trans_val, // 每笔成交花费 + adsInfo.reports_summary_dto.impr_cnt_all.trans_val, //adsInfo.impr_num, // 曝光量 + adsInfo.reports_summary_dto.clk_cnt_all.trans_val, // 点击量 + adsInfo.reports_summary_dto.order_pay_cnt_all.trans_val, // 订单量 + adsInfo.reports_summary_dto.goods_num.trans_val, // 件数 + adsInfo.reports_summary_dto.ctr_all.trans_val, // 点击率(CTR) + adsInfo.reports_summary_dto.cvr.trans_val, // 转化率(CVR) + adsInfo.reports_summary_dto.cart_cnt_all.trans_val, // 加入购物车数 + "" // 操作结果,状态 + ); ; + + dgvAds.Rows[rowId].Height = 50; + if (adsInfo.ad_show_status != 8) + { + dgvAds.Rows[rowId].Cells["colAdStatus"].Style.ForeColor = Color.Red; + } + else + { + dgvAds.Rows[rowId].Cells["colAdStatus"].Style.ForeColor = Color.Green; + } + })); + } + } + + Thread.Sleep(100 + Randomx.GetId(200)); + string error = ""; + var wareHouses = this.GetWareHouseList(shop, spuIdLst, out error); + if(!string.IsNullOrEmpty(error)) + { + BaseMsgForm.ShowError(error); + this.RefreshShop(); + } + lstWareHouse.AddRange(wareHouses); + + Thread.Sleep(100 + Randomx.GetId(200)); + var purchasePrices = this.GetPurchasePriceList(spuIdLst); + lstPurchasePrice.AddRange(purchasePrices); + + foreach(var spuId in spuIdLst) + { + var purchase = purchasePrices.FirstOrDefault(p => p.spu_id == spuId); + var row = this.dgvAds.Rows.Cast().FirstOrDefault(r => r.Cells["colSpuId"].Value.ParseToString() == spuId); + + if (row != null) + { + if (purchase != null) + { + row.Cells["colSetCost"].Value = purchase.price_text; + row.Cells["colSetDiscount"].Value = (purchase.discount * 0.01).ToString("0.00"); + } + else + { + row.Cells["colSetCost"].Value = "设置"; + row.Cells["colSetDiscount"].Value = "设置"; + } + } + } + + int total = BaseRegex.GetStringJson(ref jsonStr, "total").ParseToInt(); + totalPage = Math.Ceiling(1.0 * total / pageSize).ParseToInt(); + } + page++; + } + + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + + if (!isError) + { + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "已查询"; + } + } + else + { + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "查询失败 " + errMsg; + } + } + })); + } + Invoke(new Action(() => + { + ucGroupBoxEx2.Enabled = true; + ucGroupBoxEx3.Enabled = true; + string sRst = "查询结束!"; + if (cancellationTokenSource.IsCancellationRequested) + sRst = "已取消查询!"; + + BaseMsgForm.ShowInfo(sRst); + this.statusBar.lblTaskStatus.Text = sRst; + })); + }, cancellationTokenSource.Token); + } + + bool isAddAds = false; + private void pnlAdd_Click(object sender, EventArgs e) + { + var lstShopId = dgvShop.Rows.Cast().Where(row + => row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList(); + if (lstShopId.Count == 0) + { + BaseMsgForm.ShowInfo("请选择店铺!"); + return; + } + if (txtBudget.Text.ParseToDecimal() <= 0 && chkLimitValue.Checked) + { + BaseMsgForm.ShowInfo("请正确填写日预算!"); + return; + } + if (BaseMsgForm.ShowConfirm("确定要将全店商品添加到直通车?").DialogResult == DialogResult.Cancel) + return; + + isAddAds = true; + List newAdsColName = new List { "colCate", "colCreateTime", "colSaleCount" }; + List existAdsColName = new List { "colAdStatus", "colBudget", "colWantROAS", "colChangeROAS", "colTotalCost", "colSaleVolume", + "colROAS", "colRate", "colPerSaleCost", "colExposureCount", "colClickCount", "colOrderCount", "colGoodsNum", "colCTR", "colCVR", "colInCart" }; + foreach (DataGridViewColumn column in dgvAds.Columns) + { + if (existAdsColName.Contains(column.Name)) + { + column.Visible = false; + } + else if (newAdsColName.Contains(column.Name)) + { + column.Visible = true; + } + } + + lstAdsMallGoodsInfo.Clear(); + dgvAds.Rows.Clear(); + + var dgvRows = this.dgvShop.Rows.Cast();//.Where(r => lstShopId.Contains(r.Cells["colShopId"].Value.ParseToString())); + foreach (var row in dgvRows) + { + row.Cells["colMessage"].Value = ""; + } + + ucGroupBoxEx2.Enabled = false; + ucGroupBoxEx3.Enabled = false; + + cancellationTokenSource = new CancellationTokenSource(); + Task.Run(() => + { + var lstShopIdTemp = new List(); + lstShopIdTemp.AddRange(lstShopId); + int i = 0; + + foreach (var shopId in lstShopIdTemp) + { + this.Invoke(new Action(() => + { + this.statusBar.lblTaskStatus.Text = "正在查询..."; + this.statusBar.pgbTaskProgress.Maximum = lstShopIdTemp.Count; + this.statusBar.UpdateProgressBar(i + 1); + i++; + })); + + if (cancellationTokenSource.IsCancellationRequested) + break; + + var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId); + if (shop == null) + continue; + + #region 检测登录 + if (shop.ad_login_status != "在线") + { + continue; + } + if (ShopListForm.Instance == null) + ShopListForm.Instance = new ShopListForm(); + ShopListForm.Instance.CheckShopAdsLogin(new List { shop.ShopId }); + if (shop.ad_login_status != "在线") + { + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "店铺直通车掉线"; + row.Cells["colAdsLoginStatus"].Value = "离线"; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).LinkColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = Color.OrangeRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = Color.DarkRed; + row.Cells["colCanUse"].Value = false; + } + })); + continue; + } + #endregion + + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "正在查询"; + } + })); + + int page = 1; + int totalPage = 1; + int pageSize = 40; + bool isError = false; + string errMsg = ""; + while (page <= totalPage) + { + if (cancellationTokenSource.IsCancellationRequested) + break; + + int tryCount = 0; + tryAgain: + Thread.Sleep(100 + Randomx.GetId(200)); + string jsonStr = getAdsGoodsList(shop, page, pageSize); + if (jsonStr.Contains("当前操作人数太多,请稍后重试") && tryCount < 5) + { + tryCount++; + Thread.Sleep(Randomx.GetId(500, 1000)); + goto tryAgain; + } + + if (!jsonStr.Contains("\"success\":true")) + { + isError = true; + string sErr = BaseRegex.GetStringJson(ref jsonStr, "errorMsg"); + if (!string.IsNullOrWhiteSpace(sErr) && !errMsg.Contains(sErr)) + errMsg += sErr + " "; + page++; + + ShopListForm.Instance.CheckShopAdsLogin(new List { shop.ShopId }); + if (shop.ad_login_status != "在线") + { + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "店铺直通车掉线"; + row.Cells["colAdsLoginStatus"].Value = "离线"; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).LinkColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = Color.OrangeRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = Color.DarkRed; + row.Cells["colCanUse"].Value = false; + } + })); + break; + } + else + continue; + } + + if (jsonStr.Contains("\"success\":true")) + { + var jArr = new JArray(); + try + { + var jObj = JObject.Parse(jsonStr); + jArr = jObj["result"]?["goods_info_list"] as JArray; + if (jArr == null) + jArr = new JArray(); + } + catch (Exception ex) { BaseMsgForm.ShowError(ex.Message); } + + CreateAdsParam createAds = new CreateAdsParam(); + createAds.create_ad_reqs = new List(); + List spuIdLst = new List(); + foreach (var item in jArr) + { + string sItem = item.ToString(); + ads_goods_info adsGoodsInfo = JsonHelper.DeserializeJsonToObject(sItem); // 反序列化得到类 + if (adsGoodsInfo != null && !lstAdsMallGoodsInfo.Any(a => a.goods_id == adsGoodsInfo.goods_id)) + { + if (adsGoodsInfo.gray_reason != null) + continue; + + adsGoodsInfo.shopId = shop.ShopId; + lstAdsMallGoodsInfo.Add(adsGoodsInfo); + spuIdLst.Add(adsGoodsInfo.spu_id); + + var create_ad_req_param = new create_ad_req_param() + { + budget = chkLimitValue.Checked ? (txtBudget.Text.ParseToDecimal() * 100).ParseToInt() : -1, + goods_id = adsGoodsInfo.goods_id.ParseToString(), + site_id = adsGoodsInfo.site_list.FirstOrDefault().ParseToInt(), + roas = (txtSameRoas.Text.ParseToDecimal() * 10000).ParseToInt(), + }; + createAds.create_ad_reqs.Add(create_ad_req_param); + + Invoke(new Action(() => + { + int rowId = this.dgvAds.Rows.Add( + true, + adsGoodsInfo.shopId, + shop.ShopAccount, + adsGoodsInfo.thumb_url.Replace("https", "http").Replace("img.kwcdn.com", "img.cdnfe.com"), + DataGridViewExtension.defaultBitmap,//image, // skc图片 + adsGoodsInfo.goods_id, + adsGoodsInfo.spu_id, + adsGoodsInfo.goods_name, + string.Join("、", adsGoodsInfo.site_name_list), + adsGoodsInfo.supply_price_min + "~" + adsGoodsInfo.supply_price_max, + adsGoodsInfo.category_name_list.LastOrDefault().ParseToString(), // "类目", + BaseClass.StampToDateTime((int)(adsGoodsInfo.create_timestamp.ParseToLong() / 1000)).ToString(), // "创建时间", + adsGoodsInfo.sales, // "销量", + "", //"设置", // 成本 + "", //"设置", // 折扣 + "推广状态", + "广告日预算", + "目标roas", + "修改roas", + "总花费", + "申报价销售额", + "广告投资回报率 (ROAS)", + "广告费比(广告)", + "每笔成交花费", + "曝光量", + "点击量", + "订单量", + "件数", + "点击率(CTR)", + "转化率(CVR)", + "加入购物车数", + "" // 操作结果,状态 + ); + + dgvAds.Rows[rowId].Height = 50; + })); + } + } + + if (createAds.create_ad_reqs.Count > 0) + { + Thread.Sleep(100 + Randomx.GetId(200)); + string error = ""; + var wareHouses = this.GetWareHouseList(shop, spuIdLst, out error); + if (!string.IsNullOrEmpty(error)) + { + BaseMsgForm.ShowError(error); + this.RefreshShop(); + } + lstWareHouse.AddRange(wareHouses); + + Thread.Sleep(100 + Randomx.GetId(200)); + var purchasePrices = this.GetPurchasePriceList(spuIdLst); + lstPurchasePrice.AddRange(purchasePrices); + + // 根据期望利润率估算目标回报率 + if (chkCalculateRoas.Checked) + { + //(申报价销售额 × 活动折扣) ÷ ((申报价销售额 × 活动折扣) - 产品成本 - (申报价销售额 × 活动折扣) × 目标利润率) + foreach (var create_ad_req_param in createAds.create_ad_reqs) + { + var adsGoodsInfo = lstAdsMallGoodsInfo.FirstOrDefault(g => g.goods_id.ParseToString() == create_ad_req_param.goods_id); + if (adsGoodsInfo == null) + continue; + + var purchasePrice = lstPurchasePrice.FirstOrDefault(p => p.spu_id == adsGoodsInfo.spu_id); + if (purchasePrice != null) + { + var avgPrice = purchasePrice.dbSkuPurchasePriceList.Sum(p => p.priceValue.ParseToInt()) * 0.01m / purchasePrice.dbSkuPurchasePriceList.Count; + var avgPurchasePrice = purchasePrice.dbSkuPurchasePriceList.Sum(p => p.purchasePriceValue.ParseToInt()) * 0.01m / purchasePrice.dbSkuPurchasePriceList.Count; + var discount = purchasePrice.discount * 0.01m; + var discountPrice = avgPrice * discount; + var profitRate = txtCalculateProfitRate.Text.ParseToDecimal(); + if (discountPrice - avgPurchasePrice - discountPrice * profitRate * 0.01m > 0) + { + var roas = discountPrice / (discountPrice - avgPurchasePrice - discountPrice * profitRate * 0.01m); + create_ad_req_param.roas = (roas * 10000).ParseToInt(); + } + } + } + } + + foreach (var spuId in spuIdLst) + { + var purchase = purchasePrices.FirstOrDefault(p => p.spu_id == spuId); + var row = this.dgvAds.Rows.Cast().FirstOrDefault(r => r.Cells["colSpuId"].Value.ParseToString() == spuId); + + if (row != null) + { + if (purchase != null) + { + row.Cells["colSetCost"].Value = purchase.price_text; + row.Cells["colSetDiscount"].Value = (purchase.discount * 0.01).ToString("0.00"); + } + else + { + row.Cells["colSetCost"].Value = "设置"; + row.Cells["colSetDiscount"].Value = "设置"; + } + } + } + + Thread.Sleep(Randomx.GetId(500, 2000)); + var createRst = CreateAds(shop, createAds); + //{"success":true,"error_code":1000000,"error_msg":null,"result":{"success":false,"error_code":null,"error_msg":null,"result":null,"success_create_product_num":1,"already_created_goods_num":1,"success_goods_id_lists":null,"create_goods_fail_map":{}}} + //{"success":true,"error_code":1000000,"error_msg":null,"result":{"success":false,"error_code":null,"error_msg":null,"result":null,"success_create_product_num":0,"already_created_goods_num":0,"success_goods_id_lists":null,"create_goods_fail_map":{"601099667164131":"广告已创建"}}} + + if (createRst.Contains("\"success\":true")) + { + foreach (var adsReqItem in createAds.create_ad_reqs) + { + var dgvRow = this.dgvAds.Rows.Cast().FirstOrDefault(r => r.Cells["colGoodsId"].Value.ParseToString() == + adsReqItem.goods_id); + if (dgvRow == null) + continue; + + var failInfo = BaseRegex.GetStringJson(ref createRst, "" + adsReqItem.goods_id); + if (string.IsNullOrEmpty(failInfo)) + { + dgvRow.Cells["colMsg"].Value = "创建直通车成功"; + } + else + { + dgvRow.Cells["colMsg"].Value = failInfo; + } + } + } + else + { + foreach (var adsReqItem in createAds.create_ad_reqs) + { + string sErr = BaseRegex.GetStringJson(ref createRst, "errorMsg"); + if (string.IsNullOrEmpty(sErr)) + sErr = BaseRegex.GetStringJson(ref createRst, "error_msg"); + if (string.IsNullOrEmpty(sErr)) + sErr = createRst; + + var dgvRow = this.dgvAds.Rows.Cast().FirstOrDefault(r => r.Cells["colGoodsId"].Value.ParseToString() == + adsReqItem.goods_id); + if (dgvRow == null) + continue; + + dgvRow.Cells["colMsg"].Value = sErr; + } + break; + } + } + + int total = BaseRegex.GetStringJson(ref jsonStr, "total").ParseToInt(); + totalPage = Math.Ceiling(1.0 * total / pageSize).ParseToInt(); + } + page++; + } + + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + + if (!isError) + { + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "已查询"; + } + } + else + { + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "查询失败 " + errMsg; + } + } + })); + } + Invoke(new Action(() => + { + ucGroupBoxEx2.Enabled = true; + ucGroupBoxEx3.Enabled = true; + string sRst = "查询结束!"; + if (cancellationTokenSource.IsCancellationRequested) + sRst = "已取消查询!"; + + BaseMsgForm.ShowInfo(sRst); + this.statusBar.lblTaskStatus.Text = sRst; + })); + }, cancellationTokenSource.Token); + } + + private void chkLimitValue_CheckedChanged(object sender, EventArgs e) + { + chkNoLimit.Checked = !chkLimitValue.Checked; + txtBudget.Visible = lblBudget.Visible = chkLimitValue.Checked; + } + + private void chkNoLimit_CheckedChanged(object sender, EventArgs e) + { + chkLimitValue.Checked = !chkNoLimit.Checked; + } + + private void dgvAds_CellContentClick(object sender, DataGridViewCellEventArgs e) + { + if (e.ColumnIndex < 0 || e.RowIndex < 0) + return; + string headerText = dgvAds.Columns[e.ColumnIndex].HeaderText; + long spuId = dgvAds.Rows[e.RowIndex].Cells["colSpuId"].Value.ParseToLong(); + long shopId = dgvAds.Rows[e.RowIndex].Cells["colSupplierId"].Value.ParseToLong(); + var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId.ToString()); + var row = dgvAds.Rows[e.RowIndex]; + switch (headerText) + { + case "删除": + break; + case "图片": + { + string url = dgvAds.Rows[e.RowIndex].Cells["colImgUrl"].Value.ParseToString(); + ShowImgForm imgFrom = new ShowImgForm(url); + imgFrom.ShowDialog(); + } + break; + case "改": + var point = dgvAds.PointToClient(Control.MousePosition); + if (point.X + gbxSoloChangeRoas.Width > dgvAds.Width) + point.X -= gbxSoloChangeRoas.Width; + + if (point.Y + gbxSoloChangeRoas.Height > dgvAds.Height) + point.Y -= gbxSoloChangeRoas.Height; + + gbxSoloChangeRoas.Visible = true; + gbxSoloChangeRoas.Location = new Point(point.X, point.Y); + lblGoodsId.Text = row.Cells["colGoodsId"].Value.ParseToString(); + lblShopId.Text = row.Cells["colSupplierId"].Value.ParseToString(); + break; + case "成本": + case "折扣": + var order = lstWareHouse.FirstOrDefault(r => r.productId == spuId); + if (order == null) + { + BaseMsgForm.ShowError("商品详情不可用,请重新登录后再试!"); + return; + } + var purchasePrice = lstPurchasePrice.FirstOrDefault(p => p.spu_id == spuId.ParseToString()); + if (purchasePrice != null) + { + order.purchasePriceInfo = purchasePrice; + order.discount = purchasePrice.discount; + foreach (var sku in order.skuQuantityDetailList) + { + var purchaseSku = purchasePrice.dbSkuPurchasePriceList.FirstOrDefault(s => s.productSkuId == sku.productSkuId); + if (purchaseSku != null) + { + sku.purchasePrice = purchaseSku.purchasePriceValue.ParseToInt(); + } + } + } + foreach (var sku in order.skuQuantityDetailList) + { + if (sku.purchasePrice == 0) + sku.purchasePrice = sku.supplierPrice.ParseToInt(); + } + ShopSetPurchasePriceForm detailForm = new ShopSetPurchasePriceForm(shop, order); + detailForm.ShowDialog(); + + //更新列表显示 + var newPurchasePrices = this.GetPurchasePriceList(new List() { order.productId.ParseToString() }); + if (purchasePrice != null) + lstPurchasePrice.Remove(purchasePrice); + lstPurchasePrice.AddRange(newPurchasePrices); + var newPurchase = newPurchasePrices.FirstOrDefault(); + if (newPurchase != null) + { + row.Cells["colSetCost"].Value = newPurchase.price_text; + row.Cells["colSetDiscount"].Value = (newPurchase.discount * 0.01).ToString("0.00"); + } + else + { + row.Cells["colSetCost"].Value = "设置"; + row.Cells["colSetDiscount"].Value = "设置"; + } + break; + case "": + dgvAds.Rows[e.RowIndex].Cells["colCheck"].Value = !(bool)dgvAds.Rows[e.RowIndex].Cells["colCheck"].Value; + break; + default: + break; + } + } + + private void chkSameRoas_CheckedChanged(object sender, EventArgs e) + { + chkCalculateRoas.Checked = !chkSameRoas.Checked; + } + + private void chkCalculateRoas_CheckedChanged(object sender, EventArgs e) + { + chkSameRoas.Checked = !chkCalculateRoas.Checked; + lblCalculateRoas.Visible = lblCalculateRoasPercentSign.Visible = txtCalculateProfitRate.Visible = chkCalculateRoas.Checked; + } + + private void btnEdit_Click(object sender, EventArgs e) + { + if (isAddAds == true) + { + BaseMsgForm.ShowInfo("请先查询直通车商品再调整数值!"); + return; + } + + var adsGoodsIdLst = dgvAds.Rows.Cast().Where(row + => row.Cells["colCheck"]?.Value.ParseToBool() == true).Select(r => r.Cells["colGoodsId"]?.Value.ToString()).ToList(); + var shopIdLst = dgvAds.Rows.Cast().Where(row + => row.Cells["colCheck"]?.Value.ParseToBool() == true).Select(r => r.Cells["colSupplierId"]?.Value.ToString()).Distinct().ToList(); + if (shopIdLst.Count == 0 || adsGoodsIdLst.Count == 0) + { + BaseMsgForm.ShowInfo("请选择商品!"); + return; + } + + if (txtBudget.Text.ParseToDecimal() <= 0 && chkLimitValue.Checked) + { + BaseMsgForm.ShowInfo("日预算数值需要大于等于100元!"); + return; + } + + EditAds(adsGoodsIdLst, shopIdLst); + } + + void EditAds(List adsGoodsIdLst, List shopIdLst, bool isBatch = true) + { + var adsDetailLst = lstAdsDetailInfo.Where(ad => adsGoodsIdLst.Contains(ad.goods_id.ParseToString())).ToList(); + var shopLst = GlobalConfig.ShopLoginList.Where(s => shopIdLst.Contains(s.ShopId)).ToList(); + + var dgvRowLst = this.dgvShop.Rows.Cast();//.Where(r => lstShopId.Contains(r.Cells["colShopId"].Value.ParseToString())); + foreach (var row in dgvRowLst) + { + row.Cells["colMessage"].Value = ""; + } + dgvRowLst = this.dgvAds.Rows.Cast().Where(r => adsGoodsIdLst.Contains(r.Cells["colGoodsId"].Value.ParseToString())).ToList(); + foreach (var row in dgvRowLst) + { + row.Cells["colMsg"].Value = ""; + } + + ucGroupBoxEx2.Enabled = false; + ucGroupBoxEx3.Enabled = false; + + cancellationTokenSource = new CancellationTokenSource(); + Task.Run(() => + { + var tmpShopIdLst = new List(); + tmpShopIdLst.AddRange(shopIdLst); + int i = 0; + foreach (var shopId in tmpShopIdLst) + { + this.Invoke(new Action(() => + { + this.statusBar.lblTaskStatus.Text = "正在操作..."; + this.statusBar.pgbTaskProgress.Maximum = tmpShopIdLst.Count; + this.statusBar.UpdateProgressBar(i + 1); + i++; + })); + + if (cancellationTokenSource.IsCancellationRequested) + break; + + var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId); + if (shop == null) + continue; + + #region 检测登录 + if (shop.ad_login_status != "在线") + { + continue; + } + if (ShopListForm.Instance == null) + ShopListForm.Instance = new ShopListForm(); + ShopListForm.Instance.CheckShopAdsLogin(new List { shop.ShopId }); + if (shop.ad_login_status != "在线") + { + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "店铺直通车掉线"; + row.Cells["colAdsLoginStatus"].Value = "离线"; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).LinkColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = Color.OrangeRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = Color.DarkRed; + row.Cells["colCanUse"].Value = false; + } + })); + continue; + } + #endregion + + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "正在查询"; + } + })); + + bool isError = false; + string errMsg = ""; + var shopAdsDetailLst = adsDetailLst.Where(ad => ad.shopId == shop.ShopId).ToList(); + while (shopAdsDetailLst.Count > 0) + { + if (cancellationTokenSource.IsCancellationRequested) + break; + + var tmpAdsDetailLst = shopAdsDetailLst.Take(20).ToList(); + foreach (var ads in tmpAdsDetailLst) + { + shopAdsDetailLst.Remove(ads); + } + + int tryCount = 0; + tryAgain: + Thread.Sleep(100 + Randomx.GetId(200)); + + MdyAdsParam mdyAdsParam = new MdyAdsParam(); + mdyAdsParam.modify_ad_dtos = new List(); + foreach (var ads in tmpAdsDetailLst) + { + modify_ad_dto_param modify_ad_dto_param = new modify_ad_dto_param() + { + budget = chkLimitValue.Checked ? (txtBudget.Text.ParseToDecimal() * 100).ParseToInt() : -1, + goods_id = ads.goods_id.ParseToString(), + ad_id = ads.ad_id, + roas = (txtSameRoas.Text.ParseToDecimal() * 10000).ParseToInt(), + }; + + // 根据期望利润率估算目标回报率 + if (chkCalculateRoas.Checked) + { + //(申报价销售额 × 活动折扣) ÷ ((申报价销售额 × 活动折扣) - 产品成本 - (申报价销售额 × 活动折扣) × 目标利润率) + var purchasePrice = lstPurchasePrice.FirstOrDefault(p => p.spu_id == ads.spu_id); + if (purchasePrice != null) + { + var avgPrice = purchasePrice.dbSkuPurchasePriceList.Sum(p => p.priceValue.ParseToInt()) * 0.01m / purchasePrice.dbSkuPurchasePriceList.Count; + var avgPurchasePrice = purchasePrice.dbSkuPurchasePriceList.Sum(p => p.purchasePriceValue.ParseToInt()) * 0.01m / purchasePrice.dbSkuPurchasePriceList.Count; + var discount = purchasePrice.discount * 0.01m; + var discountPrice = avgPrice * discount; + var profitRate = txtCalculateProfitRate.Text.ParseToDecimal(); + if (discountPrice - avgPurchasePrice - discountPrice * profitRate * 0.01m > 0) + { + var roas = discountPrice / (discountPrice - avgPurchasePrice - discountPrice * profitRate * 0.01m); + modify_ad_dto_param.roas = (roas * 10000).ParseToInt(); + } + } + } + + // 如果不是批量处理,使用小框内的设置 + if (!isBatch) + { + modify_ad_dto_param.roas = (txtSameRoas2.Text.ParseToDecimal() * 10000).ParseToInt(); + modify_ad_dto_param.budget = null; + // 根据期望利润率估算目标回报率 + if (chkCalculateRoas2.Checked) + { + //(申报价销售额 × 活动折扣) ÷ ((申报价销售额 × 活动折扣) - 产品成本 - (申报价销售额 × 活动折扣) × 目标利润率) + var purchasePrice = lstPurchasePrice.FirstOrDefault(p => p.spu_id == ads.spu_id); + if (purchasePrice != null) + { + var avgPrice = purchasePrice.dbSkuPurchasePriceList.Sum(p => p.priceValue.ParseToInt()) * 0.01m / purchasePrice.dbSkuPurchasePriceList.Count; + var avgPurchasePrice = purchasePrice.dbSkuPurchasePriceList.Sum(p => p.purchasePriceValue.ParseToInt()) * 0.01m / purchasePrice.dbSkuPurchasePriceList.Count; + var discount = purchasePrice.discount * 0.01m; + var discountPrice = avgPrice * discount; + var profitRate = txtCalculateProfitRate2.Text.ParseToDecimal(); + if (discountPrice - avgPurchasePrice - discountPrice * profitRate * 0.01m > 0) + { + var roas = discountPrice / (discountPrice - avgPurchasePrice - discountPrice * profitRate * 0.01m); + modify_ad_dto_param.roas = (roas * 10000).ParseToInt(); + } + } + } + } + + mdyAdsParam.modify_ad_dtos.Add(modify_ad_dto_param); + if (modify_ad_dto_param.budget == ads.budget) + { + modify_ad_dto_param.budget = null; + } + if (modify_ad_dto_param.roas == ads.roas) + { + modify_ad_dto_param.roas = null; + } + } + + MdyAdsParam tmpMdyAdsParam = new MdyAdsParam(); + tmpMdyAdsParam.modify_ad_dtos = mdyAdsParam.modify_ad_dtos.Where(m => m.roas != null || m.budget != null).ToList(); + string mdyRst = MdyAds(shop, tmpMdyAdsParam); + if (mdyRst.Contains("当前操作人数太多,请稍后重试") && tryCount < 5) + { + tryCount++; + Thread.Sleep(Randomx.GetId(500, 1000)); + goto tryAgain; + } + + if (!mdyRst.Contains("\"success\":true")) + { + string sErr = BaseRegex.GetStringJson(ref mdyRst, "errorMsg"); + if (string.IsNullOrEmpty(sErr)) + sErr = BaseRegex.GetStringJson(ref mdyRst, "error_msg"); + if (string.IsNullOrEmpty(sErr)) + sErr = mdyRst; + errMsg += sErr + " "; + + foreach (var adsReqItem in mdyAdsParam.modify_ad_dtos) + { + var dgvRow = this.dgvAds.Rows.Cast().FirstOrDefault(r => r.Cells["colGoodsId"].Value.ParseToString() == + adsReqItem.goods_id); + if (dgvRow == null) + continue; + dgvRow.Cells["colMsg"].Value = sErr; + } + + ShopListForm.Instance.CheckShopAdsLogin(new List { shop.ShopId }); + if (shop.ad_login_status != "在线") + { + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "店铺直通车掉线"; + row.Cells["colAdsLoginStatus"].Value = "离线"; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).LinkColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = Color.OrangeRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = Color.DarkRed; + row.Cells["colCanUse"].Value = false; + } + })); + break; + } + else + continue; + } + if (mdyRst.Contains("\"success\":true")) + { + foreach (var adsReqItem in mdyAdsParam.modify_ad_dtos) + { + var dgvRow = this.dgvAds.Rows.Cast().FirstOrDefault(r => r.Cells["colGoodsId"].Value.ParseToString() == + adsReqItem.goods_id); + if (dgvRow == null) + continue; + + if (adsReqItem.budget == null && adsReqItem.roas == null) + { + dgvRow.Cells["colMsg"].Value = "无需调整"; + continue; + } + + var failInfo = BaseRegex.GetStringJson(ref mdyRst, "" + adsReqItem.goods_id); + if (string.IsNullOrEmpty(failInfo)) + { + dgvRow.Cells["colMsg"].Value = "调整直通车成功"; + if (adsReqItem.roas != null) + dgvRow.Cells["colWantROAS"].Value = (adsReqItem.roas.Value * 0.0001).ToString("0.00"); + if (adsReqItem.budget != null) + dgvRow.Cells["colBudget"].Value = adsReqItem.budget.Value < 0 ? "不限" : "¥" + (adsReqItem.budget.Value * 0.01).ToString("0.00"); + } + else + { + dgvRow.Cells["colMsg"].Value = failInfo; + } + } + } + } + + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + + if (!isError) + { + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "已调整"; + } + } + else + { + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "调整失败 " + errMsg; + } + } + })); + } + Invoke(new Action(() => + { + ucGroupBoxEx2.Enabled = true; + ucGroupBoxEx3.Enabled = true; + string sRst = "调整结束!"; + if (cancellationTokenSource.IsCancellationRequested) + sRst = "已取消调整!"; + + BaseMsgForm.ShowInfo(sRst); + this.statusBar.lblTaskStatus.Text = sRst; + })); + }, cancellationTokenSource.Token); + } + + private void btnDelAds_Click(object sender, EventArgs e) + { + if (isAddAds == true) + { + BaseMsgForm.ShowInfo("请先查询直通车商品再调整数值!"); + return; + } + + var adsGoodsIdLst = dgvAds.Rows.Cast().Where(row + => row.Cells["colCheck"]?.Value.ParseToBool() == true).Select(r => r.Cells["colGoodsId"]?.Value.ToString()).ToList(); + var shopIdLst = dgvAds.Rows.Cast().Where(row + => row.Cells["colCheck"]?.Value.ParseToBool() == true).Select(r => r.Cells["colSupplierId"]?.Value.ToString()).Distinct().ToList(); + if (shopIdLst.Count == 0 || adsGoodsIdLst.Count == 0) + { + BaseMsgForm.ShowInfo("请选择直通车商品!"); + return; + } + if (BaseMsgForm.ShowConfirm("确定要删除选中直通车?").DialogResult == DialogResult.Cancel) + return; + + var adsDetailLst = lstAdsDetailInfo.Where(ad => adsGoodsIdLst.Contains(ad.goods_id.ParseToString())).ToList(); + var shopLst = GlobalConfig.ShopLoginList.Where(s => shopIdLst.Contains(s.ShopId)).ToList(); + + var dgvRowLst = this.dgvShop.Rows.Cast();//.Where(r => lstShopId.Contains(r.Cells["colShopId"].Value.ParseToString())); + foreach (var row in dgvRowLst) + { + row.Cells["colMessage"].Value = ""; + } + dgvRowLst = this.dgvAds.Rows.Cast().Where(r => adsGoodsIdLst.Contains(r.Cells["colGoodsId"].Value.ParseToString())).ToList(); + foreach (var row in dgvRowLst) + { + row.Cells["colMsg"].Value = ""; + } + + ucGroupBoxEx2.Enabled = false; + ucGroupBoxEx3.Enabled = false; + + cancellationTokenSource = new CancellationTokenSource(); + Task.Run(() => + { + var tmpShopIdLst = new List(); + tmpShopIdLst.AddRange(shopIdLst); + int i = 0; + foreach (var shopId in tmpShopIdLst) + { + this.Invoke(new Action(() => + { + this.statusBar.lblTaskStatus.Text = "正在操作..."; + this.statusBar.pgbTaskProgress.Maximum = tmpShopIdLst.Count; + this.statusBar.UpdateProgressBar(i + 1); + i++; + })); + + if (cancellationTokenSource.IsCancellationRequested) + break; + + var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId); + if (shop == null) + continue; + + #region 检测登录 + if (shop.ad_login_status != "在线") + { + continue; + } + if (ShopListForm.Instance == null) + ShopListForm.Instance = new ShopListForm(); + ShopListForm.Instance.CheckShopAdsLogin(new List { shop.ShopId }); + if (shop.ad_login_status != "在线") + { + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "店铺直通车掉线"; + row.Cells["colAdsLoginStatus"].Value = "离线"; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).LinkColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = Color.OrangeRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = Color.DarkRed; + row.Cells["colCanUse"].Value = false; + } + })); + continue; + } + #endregion + + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "正在查询"; + } + })); + + bool isError = false; + string errMsg = ""; + var shopAdsDetailLst = adsDetailLst.Where(ad => ad.shopId == shop.ShopId).ToList(); + while (shopAdsDetailLst.Count > 0) + { + if (cancellationTokenSource.IsCancellationRequested) + break; + + var tmpAdsDetailLst = shopAdsDetailLst.Take(20).ToList(); + foreach (var ads in tmpAdsDetailLst) + { + shopAdsDetailLst.Remove(ads); + } + + int tryCount = 0; + tryAgain: + Thread.Sleep(100 + Randomx.GetId(200)); + + var adIdLst = tmpAdsDetailLst.Select(a => a.ad_id).ToList(); + string mdyRst = DelAds(shop, adIdLst); + if (mdyRst.Contains("当前操作人数太多,请稍后重试") && tryCount < 5) + { + tryCount++; + Thread.Sleep(Randomx.GetId(500, 1000)); + goto tryAgain; + } + + if (!mdyRst.Contains("\"success\":true")) + { + string sErr = BaseRegex.GetStringJson(ref mdyRst, "errorMsg"); + if (string.IsNullOrEmpty(sErr)) + sErr = BaseRegex.GetStringJson(ref mdyRst, "error_msg"); + if (string.IsNullOrEmpty(sErr)) + sErr = mdyRst; + errMsg += sErr + " "; + + foreach (var adsDetail in tmpAdsDetailLst) + { + var dgvRow = this.dgvAds.Rows.Cast().FirstOrDefault(r => r.Cells["colGoodsId"].Value.ParseToString() == + adsDetail.goods_id); + if (dgvRow == null) + continue; + dgvRow.Cells["colMsg"].Value = sErr; + } + + ShopListForm.Instance.CheckShopAdsLogin(new List { shop.ShopId }); + if (shop.ad_login_status != "在线") + { + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "店铺直通车掉线"; + row.Cells["colAdsLoginStatus"].Value = "离线"; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).LinkColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = Color.OrangeRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = Color.DarkRed; + row.Cells["colCanUse"].Value = false; + } + })); + break; + } + else + continue; + } + if (mdyRst.Contains("\"success\":true")) + { + foreach (var adsDetailItem in tmpAdsDetailLst) + { + var dgvRow = this.dgvAds.Rows.Cast().FirstOrDefault(r => r.Cells["colGoodsId"].Value.ParseToString() == + adsDetailItem.goods_id); + if (dgvRow == null) + continue; + + var failInfo = BaseRegex.GetStringJson(ref mdyRst, "" + adsDetailItem.goods_id); + if (string.IsNullOrEmpty(failInfo)) + { + dgvRow.Cells["colMsg"].Value = "删除直通车成功"; + } + else + { + dgvRow.Cells["colMsg"].Value = failInfo; + } + } + } + } + + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + + if (!isError) + { + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "已删除"; + } + } + else + { + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "删除失败 " + errMsg; + } + } + })); + } + Invoke(new Action(() => + { + ucGroupBoxEx2.Enabled = true; + ucGroupBoxEx3.Enabled = true; + string sRst = "删除设置结束!"; + if (cancellationTokenSource.IsCancellationRequested) + sRst = "已取消删除!"; + + BaseMsgForm.ShowInfo(sRst); + this.statusBar.lblTaskStatus.Text = sRst; + })); + }, cancellationTokenSource.Token); + } + + private void btnPauseAds_Click(object sender, EventArgs e) + { + if (isAddAds == true) + { + BaseMsgForm.ShowInfo("请先查询直通车商品再调整数值!"); + return; + } + + var adsGoodsIdLst = dgvAds.Rows.Cast().Where(row + => row.Cells["colCheck"]?.Value.ParseToBool() == true).Select(r => r.Cells["colGoodsId"]?.Value.ToString()).ToList(); + var shopIdLst = dgvAds.Rows.Cast().Where(row + => row.Cells["colCheck"]?.Value.ParseToBool() == true).Select(r => r.Cells["colSupplierId"]?.Value.ToString()).Distinct().ToList(); + if (shopIdLst.Count == 0 || adsGoodsIdLst.Count == 0) + { + BaseMsgForm.ShowInfo("请选择直通车商品!"); + return; + } + + var adsDetailLst = lstAdsDetailInfo.Where(ad => adsGoodsIdLst.Contains(ad.goods_id.ParseToString())).ToList(); + var shopLst = GlobalConfig.ShopLoginList.Where(s => shopIdLst.Contains(s.ShopId)).ToList(); + + var dgvRowLst = this.dgvShop.Rows.Cast();//.Where(r => lstShopId.Contains(r.Cells["colShopId"].Value.ParseToString())); + foreach (var row in dgvRowLst) + { + row.Cells["colMessage"].Value = ""; + } + dgvRowLst = this.dgvAds.Rows.Cast().Where(r => adsGoodsIdLst.Contains(r.Cells["colGoodsId"].Value.ParseToString())).ToList(); + foreach (var row in dgvRowLst) + { + row.Cells["colMsg"].Value = ""; + } + + ucGroupBoxEx2.Enabled = false; + ucGroupBoxEx3.Enabled = false; + + cancellationTokenSource = new CancellationTokenSource(); + Task.Run(() => + { + var tmpShopIdLst = new List(); + tmpShopIdLst.AddRange(shopIdLst); + int i = 0; + foreach (var shopId in tmpShopIdLst) + { + this.Invoke(new Action(() => + { + this.statusBar.lblTaskStatus.Text = "正在操作..."; + this.statusBar.pgbTaskProgress.Maximum = tmpShopIdLst.Count; + this.statusBar.UpdateProgressBar(i + 1); + i++; + })); + + if (cancellationTokenSource.IsCancellationRequested) + break; + + var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId); + if (shop == null) + continue; + + #region 检测登录 + if (shop.ad_login_status != "在线") + { + continue; + } + if (ShopListForm.Instance == null) + ShopListForm.Instance = new ShopListForm(); + ShopListForm.Instance.CheckShopAdsLogin(new List { shop.ShopId }); + if (shop.ad_login_status != "在线") + { + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "店铺直通车掉线"; + row.Cells["colAdsLoginStatus"].Value = "离线"; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).LinkColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = Color.OrangeRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = Color.DarkRed; + row.Cells["colCanUse"].Value = false; + } + })); + continue; + } + #endregion + + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "正在查询"; + } + })); + + bool isError = false; + string errMsg = ""; + var shopAdsDetailLst = adsDetailLst.Where(ad => ad.shopId == shop.ShopId).ToList(); + while (shopAdsDetailLst.Count > 0) + { + if (cancellationTokenSource.IsCancellationRequested) + break; + + var tmpAdsDetailLst = shopAdsDetailLst.Take(20).ToList(); + foreach (var ads in tmpAdsDetailLst) + { + shopAdsDetailLst.Remove(ads); + } + + int tryCount = 0; + tryAgain: + Thread.Sleep(100 + Randomx.GetId(200)); + + var adIdLst = tmpAdsDetailLst.Select(a => a.ad_id).ToList(); + string mdyRst = PauseAds(shop, adIdLst); + if (mdyRst.Contains("当前操作人数太多,请稍后重试") && tryCount < 5) + { + tryCount++; + Thread.Sleep(Randomx.GetId(500, 1000)); + goto tryAgain; + } + + if (!mdyRst.Contains("\"success\":true")) + { + string sErr = BaseRegex.GetStringJson(ref mdyRst, "errorMsg"); + if (string.IsNullOrEmpty(sErr)) + sErr = BaseRegex.GetStringJson(ref mdyRst, "error_msg"); + if (string.IsNullOrEmpty(sErr)) + sErr = mdyRst; + errMsg += sErr + " "; + + foreach (var adsDetail in tmpAdsDetailLst) + { + var dgvRow = this.dgvAds.Rows.Cast().FirstOrDefault(r => r.Cells["colGoodsId"].Value.ParseToString() == + adsDetail.goods_id); + if (dgvRow == null) + continue; + dgvRow.Cells["colMsg"].Value = sErr; + } + + ShopListForm.Instance.CheckShopAdsLogin(new List { shop.ShopId }); + if (shop.ad_login_status != "在线") + { + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "店铺直通车掉线"; + row.Cells["colAdsLoginStatus"].Value = "离线"; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).LinkColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = Color.OrangeRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = Color.DarkRed; + row.Cells["colCanUse"].Value = false; + } + })); + break; + } + else + continue; + } + if (mdyRst.Contains("\"success\":true")) + { + foreach (var adsDetailItem in tmpAdsDetailLst) + { + var dgvRow = this.dgvAds.Rows.Cast().FirstOrDefault(r => r.Cells["colGoodsId"].Value.ParseToString() == + adsDetailItem.goods_id); + if (dgvRow == null) + continue; + + var failInfo = BaseRegex.GetStringJson(ref mdyRst, "" + adsDetailItem.goods_id); + if (string.IsNullOrEmpty(failInfo)) + { + dgvRow.Cells["colMsg"].Value = "暂停直通车成功"; + } + else + { + dgvRow.Cells["colMsg"].Value = failInfo; + } + } + } + } + + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + + if (!isError) + { + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "已暂停"; + } + } + else + { + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "暂停失败 " + errMsg; + } + } + })); + } + Invoke(new Action(() => + { + ucGroupBoxEx2.Enabled = true; + ucGroupBoxEx3.Enabled = true; + string sRst = "暂停设置结束!"; + if (cancellationTokenSource.IsCancellationRequested) + sRst = "已取消暂停!"; + + BaseMsgForm.ShowInfo(sRst); + this.statusBar.lblTaskStatus.Text = sRst; + })); + }, cancellationTokenSource.Token); + } + + + private void btnContinueAds_Click(object sender, EventArgs e) + { + if (isAddAds == true) + { + BaseMsgForm.ShowInfo("请先查询直通车商品再调整数值!"); + return; + } + + var adsGoodsIdLst = dgvAds.Rows.Cast().Where(row + => row.Cells["colCheck"]?.Value.ParseToBool() == true).Select(r => r.Cells["colGoodsId"]?.Value.ToString()).ToList(); + var shopIdLst = dgvAds.Rows.Cast().Where(row + => row.Cells["colCheck"]?.Value.ParseToBool() == true).Select(r => r.Cells["colSupplierId"]?.Value.ToString()).Distinct().ToList(); + if (shopIdLst.Count == 0 || adsGoodsIdLst.Count == 0) + { + BaseMsgForm.ShowInfo("请选择直通车商品!"); + return; + } + + var adsDetailLst = lstAdsDetailInfo.Where(ad => adsGoodsIdLst.Contains(ad.goods_id.ParseToString())).ToList(); + var shopLst = GlobalConfig.ShopLoginList.Where(s => shopIdLst.Contains(s.ShopId)).ToList(); + + var dgvRowLst = this.dgvShop.Rows.Cast();//.Where(r => lstShopId.Contains(r.Cells["colShopId"].Value.ParseToString())); + foreach (var row in dgvRowLst) + { + row.Cells["colMessage"].Value = ""; + } + dgvRowLst = this.dgvAds.Rows.Cast().Where(r => adsGoodsIdLst.Contains(r.Cells["colGoodsId"].Value.ParseToString())).ToList(); + foreach (var row in dgvRowLst) + { + row.Cells["colMsg"].Value = ""; + } + + ucGroupBoxEx2.Enabled = false; + ucGroupBoxEx3.Enabled = false; + + cancellationTokenSource = new CancellationTokenSource(); + Task.Run(() => + { + var tmpShopIdLst = new List(); + tmpShopIdLst.AddRange(shopIdLst); + int i = 0; + foreach (var shopId in tmpShopIdLst) + { + this.Invoke(new Action(() => + { + this.statusBar.lblTaskStatus.Text = "正在操作..."; + this.statusBar.pgbTaskProgress.Maximum = tmpShopIdLst.Count; + this.statusBar.UpdateProgressBar(i + 1); + i++; + })); + + if (cancellationTokenSource.IsCancellationRequested) + break; + + var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId); + if (shop == null) + continue; + + #region 检测登录 + if (shop.ad_login_status != "在线") + { + continue; + } + if (ShopListForm.Instance == null) + ShopListForm.Instance = new ShopListForm(); + ShopListForm.Instance.CheckShopAdsLogin(new List { shop.ShopId }); + if (shop.ad_login_status != "在线") + { + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "店铺直通车掉线"; + row.Cells["colAdsLoginStatus"].Value = "离线"; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).LinkColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = Color.OrangeRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = Color.DarkRed; + row.Cells["colCanUse"].Value = false; + } + })); + continue; + } + #endregion + + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "正在查询"; + } + })); + + bool isError = false; + string errMsg = ""; + var shopAdsDetailLst = adsDetailLst.Where(ad => ad.shopId == shop.ShopId).ToList(); + while (shopAdsDetailLst.Count > 0) + { + if (cancellationTokenSource.IsCancellationRequested) + break; + + var tmpAdsDetailLst = shopAdsDetailLst.Take(20).ToList(); + foreach (var ads in tmpAdsDetailLst) + { + shopAdsDetailLst.Remove(ads); + } + + int tryCount = 0; + tryAgain: + Thread.Sleep(100 + Randomx.GetId(200)); + + var adIdLst = tmpAdsDetailLst.Select(a => a.ad_id).ToList(); + string mdyRst = continueAds(shop, adIdLst); + if (mdyRst.Contains("当前操作人数太多,请稍后重试") && tryCount < 5) + { + tryCount++; + Thread.Sleep(Randomx.GetId(500, 1000)); + goto tryAgain; + } + + if (!mdyRst.Contains("\"success\":true")) + { + string sErr = BaseRegex.GetStringJson(ref mdyRst, "errorMsg"); + if (string.IsNullOrEmpty(sErr)) + sErr = BaseRegex.GetStringJson(ref mdyRst, "error_msg"); + if (string.IsNullOrEmpty(sErr)) + sErr = mdyRst; + errMsg += sErr + " "; + + foreach (var adsDetail in tmpAdsDetailLst) + { + var dgvRow = this.dgvAds.Rows.Cast().FirstOrDefault(r => r.Cells["colGoodsId"].Value.ParseToString() == + adsDetail.goods_id); + if (dgvRow == null) + continue; + dgvRow.Cells["colMsg"].Value = sErr; + } + + ShopListForm.Instance.CheckShopAdsLogin(new List { shop.ShopId }); + if (shop.ad_login_status != "在线") + { + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "店铺直通车掉线"; + row.Cells["colAdsLoginStatus"].Value = "离线"; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).LinkColor = Color.Red; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = Color.OrangeRed; + (row.Cells["colAdsLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = Color.DarkRed; + row.Cells["colCanUse"].Value = false; + } + })); + break; + } + else + continue; + } + if (mdyRst.Contains("\"success\":true")) + { + foreach (var adsDetailItem in tmpAdsDetailLst) + { + var dgvRow = this.dgvAds.Rows.Cast().FirstOrDefault(r => r.Cells["colGoodsId"].Value.ParseToString() == + adsDetailItem.goods_id); + if (dgvRow == null) + continue; + + var failInfo = BaseRegex.GetStringJson(ref mdyRst, "" + adsDetailItem.goods_id); + if (string.IsNullOrEmpty(failInfo)) + { + dgvRow.Cells["colMsg"].Value = "开启直通车成功"; + } + else + { + dgvRow.Cells["colMsg"].Value = failInfo; + } + } + } + } + + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId); + + if (!isError) + { + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "已开启"; + } + } + else + { + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "开启失败 " + errMsg; + } + } + })); + } + Invoke(new Action(() => + { + ucGroupBoxEx2.Enabled = true; + ucGroupBoxEx3.Enabled = true; + string sRst = "开启设置结束!"; + if (cancellationTokenSource.IsCancellationRequested) + sRst = "已取消开启!"; + + BaseMsgForm.ShowInfo(sRst); + this.statusBar.lblTaskStatus.Text = sRst; + })); + }, cancellationTokenSource.Token); + } + + private void btnSelectFilter_Click(object sender, EventArgs e) + { + foreach(DataGridViewRow row in dgvAds.Rows) + { + if (row.Cells["colOrderCount"].Value.ParseToString().Replace(",", "").ParseToInt() < txtSelectFilter.Text.Trim().ParseToInt()) + row.Cells["colCheck"].Value = true; + else + row.Cells["colCheck"].Value = false; + } + } + + string GetAdsShowStatus(int statusId) + { + if (statusId == 8) + return "投放中"; + if (statusId == 7) + return "手动暂停"; + if (statusId == 5) + return "审核驳回"; + if (statusId == 0) + return "账户资金不足"; + return "未投放 详情请后台查看"; + } + + private void chkToday_CheckedChanged(object sender, EventArgs e) + { + if (chkToday.Checked == true) + { + chkToday.Enabled = false; + chkYesterday.Checked = chk7Days.Checked = chk30Days.Checked = false; + chkYesterday.Enabled = chk7Days.Enabled = chk30Days.Enabled = true; + } + } + + private void chkYesterday_CheckedChanged(object sender, EventArgs e) + { + if (chkYesterday.Checked == true) + { + chkYesterday.Enabled = false; + chkToday.Checked = chk7Days.Checked = chk30Days.Checked = false; + chkToday.Enabled = chk7Days.Enabled = chk30Days.Enabled = true; + } + } + + private void chk7Days_CheckedChanged(object sender, EventArgs e) + { + if (chk7Days.Checked == true) + { + chk7Days.Enabled = false; + chkToday.Checked = chkYesterday.Checked = chk30Days.Checked = false; + chkToday.Enabled = chkYesterday.Enabled = chk30Days.Enabled = true; + } + } + + private void chk30Days_CheckedChanged(object sender, EventArgs e) + { + if (chk30Days.Checked == true) + { + chk30Days.Enabled = false; + chkToday.Checked = chkYesterday.Checked = chk7Days.Checked = false; + chkToday.Enabled = chkYesterday.Enabled = chk7Days.Enabled = true; + } + } + + private void btnCancelSoloChangeRoas_Click(object sender, EventArgs e) + { + gbxSoloChangeRoas.Visible = false; + } + + private void btnSoloChangeRoas_Click(object sender, EventArgs e) + { + List goodsIds = new List() { lblGoodsId.Text }; + List shopIds = new List() { lblShopId.Text }; + + EditAds(goodsIds, shopIds, false); + gbxSoloChangeRoas.Visible = false; + } + + private void chkSameRoas2_CheckedChanged(object sender, EventArgs e) + { + chkCalculateRoas2.Checked = !chkSameRoas2.Checked; + } + + private void chkCalculateRoas2_CheckedChanged(object sender, EventArgs e) + { + chkSameRoas2.Checked = !chkCalculateRoas2.Checked; + lblCalculateRoas2.Visible = lblCalculateRoasPercentSign2.Visible = txtCalculateProfitRate2.Visible = chkCalculateRoas2.Checked; + } + } + + public class CreateAdsParam + { + public List create_ad_reqs { get; set; } + } + + public class create_ad_req_param + { + public string goods_id { get; set; } // "601099667164131" + public int site_id { get; set; } // 129, + public int roas { get; set; } // 77700, + public int budget { get; set; } // 12300 //单位分 + } + + public class MdyAdsParam + { + public List modify_ad_dtos { get; set; } + } + + public class modify_ad_dto_param + { + public string ad_id { get; set; } // "300000013237119567", + public int? roas { get; set; } // 77700, //实际设置值7.77 * 10000 + public int? budget { get; set; } // 12300 //单位分 + public string goods_id { get; set; } // "601099667164131" + } +} diff --git a/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.resx b/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.resx new file mode 100644 index 0000000..e7ca5df --- /dev/null +++ b/TEMUKJD/KJDForms/ProductForms/TemuAdsForm.resx @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.Designer.cs b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.Designer.cs index 5520632..71688ec 100644 --- a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.Designer.cs +++ b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.Designer.cs @@ -1305,7 +1305,7 @@ // this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel2.Controls.Add(this.dataGridViewEx1); - this.panel2.Location = new System.Drawing.Point(501, 75); + this.panel2.Location = new System.Drawing.Point(489, 75); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(557, 342); this.panel2.TabIndex = 191; diff --git a/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.cs b/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.cs index 12a3dbe..2d930fb 100644 --- a/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.cs +++ b/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.cs @@ -102,6 +102,11 @@ namespace TemuKJD.KJDForms.SalesCenterForms { try { + var activityThematicName = row.Cells["colActivityThematicName"].Value.ToString(); + if (activityThematicName == "官方大促") + { + + } if (row.Cells["colDiscountTenth"].Value.ParseToInt() > 0) { int discount = this.GetNearDiscount(row.Cells["colDiscountTenth"].Value.ParseToInt()); @@ -753,6 +758,7 @@ namespace TemuKJD.KJDForms.SalesCenterForms actInfo.discount += "0"; // 补0 Invoke(new Action(() => { + actRow.Cells["colDiscountTenth"].Value = actInfo.discount; actRow.Cells["colDiscount"].Value = string.IsNullOrEmpty(actInfo.discount) ? "-" : actInfo.discount.TrimEnd('0') + "折"; actRow.Cells["colActivityMsg"].Value = "折扣查询成功"; shopRow.Cells["colMessage"].Value = ""; diff --git a/TEMUKJD/KJDForms/ShopForms/ShopListForm.Designer.cs b/TEMUKJD/KJDForms/ShopForms/ShopListForm.Designer.cs index 7ff4928..a0607c0 100644 --- a/TEMUKJD/KJDForms/ShopForms/ShopListForm.Designer.cs +++ b/TEMUKJD/KJDForms/ShopForms/ShopListForm.Designer.cs @@ -28,12 +28,14 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.label1 = new System.Windows.Forms.Label(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.panel5 = new System.Windows.Forms.Panel(); + this.chkLoginAds = new TemuKJD.UserComponent.UcCheckBox(this.components); this.btnRefreshShop = new TemuKJD.UserControls.ButtonEx(); this.btnLoginSelect = new TemuKJD.UserControls.ButtonEx(); this.btnCheck = new TemuKJD.UserControls.ButtonEx(); @@ -139,14 +141,25 @@ // // panel5 // + this.panel5.Controls.Add(this.chkLoginAds); this.panel5.Controls.Add(this.btnRefreshShop); this.panel5.Controls.Add(this.btnLoginSelect); this.panel5.Controls.Add(this.btnCheck); - this.panel5.Location = new System.Drawing.Point(1032, 3); + this.panel5.Location = new System.Drawing.Point(901, 3); this.panel5.Name = "panel5"; - this.panel5.Size = new System.Drawing.Size(229, 40); + this.panel5.Size = new System.Drawing.Size(360, 40); this.panel5.TabIndex = 1; // + // chkLoginAds + // + this.chkLoginAds.AutoSize = true; + this.chkLoginAds.Location = new System.Drawing.Point(254, 11); + this.chkLoginAds.Name = "chkLoginAds"; + this.chkLoginAds.Size = new System.Drawing.Size(111, 21); + this.chkLoginAds.TabIndex = 376; + this.chkLoginAds.Text = "同时登录直通车"; + this.chkLoginAds.UseVisualStyleBackColor = true; + // // btnRefreshShop // this.btnRefreshShop.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); @@ -154,7 +167,7 @@ this.btnRefreshShop.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnRefreshShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnRefreshShop.ForeColor = System.Drawing.Color.White; - this.btnRefreshShop.Location = new System.Drawing.Point(21, 9); + this.btnRefreshShop.Location = new System.Drawing.Point(43, 8); this.btnRefreshShop.Margin = new System.Windows.Forms.Padding(2); this.btnRefreshShop.Name = "btnRefreshShop"; this.btnRefreshShop.Size = new System.Drawing.Size(66, 26); @@ -170,7 +183,7 @@ this.btnLoginSelect.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnLoginSelect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnLoginSelect.ForeColor = System.Drawing.Color.White; - this.btnLoginSelect.Location = new System.Drawing.Point(162, 9); + this.btnLoginSelect.Location = new System.Drawing.Point(184, 8); this.btnLoginSelect.Margin = new System.Windows.Forms.Padding(2); this.btnLoginSelect.Name = "btnLoginSelect"; this.btnLoginSelect.Size = new System.Drawing.Size(66, 26); @@ -186,7 +199,7 @@ this.btnCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCheck.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnCheck.ForeColor = System.Drawing.Color.White; - this.btnCheck.Location = new System.Drawing.Point(92, 9); + this.btnCheck.Location = new System.Drawing.Point(114, 8); this.btnCheck.Margin = new System.Windows.Forms.Padding(2); this.btnCheck.Name = "btnCheck"; this.btnCheck.Size = new System.Drawing.Size(66, 26); @@ -210,13 +223,13 @@ this.panel4.Dock = System.Windows.Forms.DockStyle.Fill; this.panel4.Location = new System.Drawing.Point(3, 3); this.panel4.Name = "panel4"; - this.panel4.Size = new System.Drawing.Size(1023, 40); + this.panel4.Size = new System.Drawing.Size(892, 40); this.panel4.TabIndex = 0; // // cmbNotes // this.cmbNotes.FormattingEnabled = true; - this.cmbNotes.Location = new System.Drawing.Point(597, 10); + this.cmbNotes.Location = new System.Drawing.Point(597, 9); this.cmbNotes.Name = "cmbNotes"; this.cmbNotes.Size = new System.Drawing.Size(120, 25); this.cmbNotes.TabIndex = 413; @@ -227,7 +240,7 @@ this.pnlEmpty.CanvasColor = System.Drawing.SystemColors.Control; this.pnlEmpty.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.pnlEmpty.DisabledBackColor = System.Drawing.Color.Empty; - this.pnlEmpty.Location = new System.Drawing.Point(799, 9); + this.pnlEmpty.Location = new System.Drawing.Point(799, 8); this.pnlEmpty.Name = "pnlEmpty"; this.pnlEmpty.Size = new System.Drawing.Size(66, 26); this.pnlEmpty.Style.Alignment = System.Drawing.StringAlignment.Center; @@ -253,7 +266,7 @@ this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSearch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnSearch.ForeColor = System.Drawing.Color.White; - this.btnSearch.Location = new System.Drawing.Point(728, 9); + this.btnSearch.Location = new System.Drawing.Point(728, 8); this.btnSearch.Margin = new System.Windows.Forms.Padding(2); this.btnSearch.Name = "btnSearch"; this.btnSearch.Size = new System.Drawing.Size(66, 26); @@ -265,7 +278,7 @@ // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(538, 14); + this.label4.Location = new System.Drawing.Point(538, 13); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(68, 17); this.label4.TabIndex = 377; @@ -273,7 +286,7 @@ // // txtShopName // - this.txtShopName.Location = new System.Drawing.Point(415, 11); + this.txtShopName.Location = new System.Drawing.Point(415, 10); this.txtShopName.Name = "txtShopName"; this.txtShopName.Size = new System.Drawing.Size(110, 23); this.txtShopName.TabIndex = 374; @@ -281,7 +294,7 @@ // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(367, 14); + this.label3.Location = new System.Drawing.Point(367, 13); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(56, 17); this.label3.TabIndex = 375; @@ -289,7 +302,7 @@ // // txtShopId // - this.txtShopId.Location = new System.Drawing.Point(245, 11); + this.txtShopId.Location = new System.Drawing.Point(245, 10); this.txtShopId.Name = "txtShopId"; this.txtShopId.Size = new System.Drawing.Size(110, 23); this.txtShopId.TabIndex = 372; @@ -297,7 +310,7 @@ // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(197, 14); + this.label2.Location = new System.Drawing.Point(197, 13); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(55, 17); this.label2.TabIndex = 373; @@ -310,7 +323,7 @@ this.btnImport.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnImport.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnImport.ForeColor = System.Drawing.Color.White; - this.btnImport.Location = new System.Drawing.Point(71, 9); + this.btnImport.Location = new System.Drawing.Point(71, 8); this.btnImport.Margin = new System.Windows.Forms.Padding(2); this.btnImport.Name = "btnImport"; this.btnImport.Size = new System.Drawing.Size(66, 26); @@ -326,7 +339,7 @@ this.btnAddShop.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnAddShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnAddShop.ForeColor = System.Drawing.Color.White; - this.btnAddShop.Location = new System.Drawing.Point(1, 9); + this.btnAddShop.Location = new System.Drawing.Point(1, 8); this.btnAddShop.Margin = new System.Windows.Forms.Padding(2); this.btnAddShop.Name = "btnAddShop"; this.btnAddShop.Size = new System.Drawing.Size(66, 26); @@ -356,7 +369,7 @@ this.splitContainer2.Panel2.Controls.Add(this.chkAutoDrag); this.splitContainer2.Panel2.Controls.Add(this.statusBar); this.splitContainer2.Size = new System.Drawing.Size(1264, 572); - this.splitContainer2.SplitterDistance = 540; + this.splitContainer2.SplitterDistance = 539; this.splitContainer2.TabIndex = 0; // // btnRefreshAuth @@ -380,7 +393,7 @@ // this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None; this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue; - this.pbLoading.Location = new System.Drawing.Point(607, 245); + this.pbLoading.Location = new System.Drawing.Point(607, 244); this.pbLoading.Name = "pbLoading"; this.pbLoading.Size = new System.Drawing.Size(50, 50); this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; @@ -391,19 +404,19 @@ // this.dgvShop.AllowUserToAddRows = false; this.dgvShop.AllowUserToDeleteRows = false; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke; - this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.WhiteSmoke; + this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.dgvShop.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dgvShop.BackgroundColor = System.Drawing.Color.White; this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6; this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.colSelect, @@ -434,7 +447,7 @@ this.dgvShop.Name = "dgvShop"; this.dgvShop.ReadOnly = true; this.dgvShop.RowTemplate.Height = 23; - this.dgvShop.Size = new System.Drawing.Size(1256, 540); + this.dgvShop.Size = new System.Drawing.Size(1256, 539); this.dgvShop.TabIndex = 5; this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick); // @@ -644,7 +657,7 @@ this.statusBar.BackColor = System.Drawing.Color.White; this.statusBar.Dock = System.Windows.Forms.DockStyle.Bottom; 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, -1); + 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(1264, 29); @@ -669,6 +682,7 @@ this.splitContainer1.ResumeLayout(false); this.tableLayoutPanel2.ResumeLayout(false); this.panel5.ResumeLayout(false); + this.panel5.PerformLayout(); this.panel4.ResumeLayout(false); this.panel4.PerformLayout(); this.splitContainer2.Panel1.ResumeLayout(false); @@ -732,5 +746,6 @@ private System.Windows.Forms.DataGridViewLinkColumn colEdit; private System.Windows.Forms.DataGridViewLinkColumn colDelete; private System.Windows.Forms.ComboBox cmbNotes; + private UserComponent.UcCheckBox chkLoginAds; } } \ No newline at end of file diff --git a/TEMUKJD/KJDForms/ShopForms/ShopListForm.cs b/TEMUKJD/KJDForms/ShopForms/ShopListForm.cs index c759bc0..5a1ae5c 100644 --- a/TEMUKJD/KJDForms/ShopForms/ShopListForm.cs +++ b/TEMUKJD/KJDForms/ShopForms/ShopListForm.cs @@ -22,6 +22,7 @@ using NaiBa.Util; using System.Globalization; using TemuKJD.KJDForms.AdminForms; using TemuKJD.BLL; +using TemuKJD.UserControls; namespace TemuKJD.KJDForms.ShopForms { @@ -209,7 +210,7 @@ namespace TemuKJD.KJDForms.ShopForms #region 服务端店铺Cookie管理 /// - /// 添加京东店铺Cookies + /// 添加店铺Cookies /// /// 店铺名称 /// cookies @@ -234,6 +235,34 @@ namespace TemuKJD.KJDForms.ShopForms BaseMsgForm.ShowError("服务端登录状态保存失败!请检查网络连接。"); } } + + /// + /// 添加店铺直通车Cookies + /// + /// cookies + /// 工具名称(可不填写) + public static void UpdateServerShopAdsCookies(ShopLoginInfo shop, string fromTool = null) + { + var fTool = string.IsNullOrEmpty(fromTool) ? "" : "&from_tool=" + fromTool; + var url = BaseClass.BuildObjString("shop/mdy_shop_ads_cookie_and_login_status"); + var data = UserLogin.GetSignaturex() + //+ "&login_name=" + shop.LoginName + //直通车相同账户的不同店铺之间是隔离的,所以只能填店铺id更新一个店铺 + + "&shop_id=" + shop.ShopId + + "&ad_url=" + GetHtml.UrlEncodeUtf8(shop.ad_url) + + "&ad_seller_unique_id=" + shop.ad_seller_unique_id + + "&ad_login_status=" + shop.ad_login_status + + "&ad_cookie=" + shop.ad_cookie.Replace("&", "&").Replace("%", "%").Replace("+", "+").Replace("\"", """) + + fTool; + var result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200")) + result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200")) + { + BaseMsgForm.ShowError("直通车登录状态保存失败!请检查网络连接。"); + } + } + ///// ///// 获取店铺Cookies ///// @@ -563,7 +592,7 @@ namespace TemuKJD.KJDForms.ShopForms { this.Invoke(new Action(() => { - this.pbLoading.Visible = true; + this.pbLoading.Visible = false; this.statusBar.lblTaskStatus.Text = "检测完毕"; })); } @@ -571,7 +600,6 @@ namespace TemuKJD.KJDForms.ShopForms public void CheckShopLogin(string[] shopNames, bool isShowProgress = true) { - for (int i = 0; i < shopNames.Length; i++) { var campanys = GlobalConfig.ShopLoginList.Where(v => v.LoginName == shopNames[i]).ToList(); @@ -601,7 +629,7 @@ namespace TemuKJD.KJDForms.ShopForms foreach (var sc in campanys) { sc.LoginStatus = "未登录"; - shop.Cookies = "empty=true;"; + sc.Cookies = "empty=true;"; } } else @@ -609,6 +637,7 @@ namespace TemuKJD.KJDForms.ShopForms foreach(var sc in campanys) { sc.LoginStatus = "登录成功"; + sc.Cookies = shop.Cookies; sc.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd"); } } @@ -627,6 +656,7 @@ namespace TemuKJD.KJDForms.ShopForms foreach (var sc in campanys) { sc.LoginStatus2 = "国际版在线"; + sc.Cookies2 = shop.Cookies2; sc.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd"); } } @@ -647,6 +677,95 @@ namespace TemuKJD.KJDForms.ShopForms } } + public void CheckShopAdsLogin(ShopLoginInfo shop) + { + if (shop == null) + return; + + CheckShopAdsLogin(new List { shop.ShopId }); + } + + public void CheckShopAdsLogin(List shopIdLst, PictureBox _pbLoading = null, StatusBarUserControl _statusBar = null) + { + if (_pbLoading != null) + { + MainForm.instance.Invoke(new Action(() => + { + _pbLoading.Visible = true; + })); + } + if (_statusBar != null) + { + MainForm.instance.Invoke(new Action(() => + { + _statusBar.lblTaskStatus.Text = "正在检测..."; + _statusBar.pgbTaskProgress.Value = 0; + _statusBar.pgbTaskProgress.Maximum = shopIdLst.Count; + _statusBar.pgbTaskProgress.Text = "0" + "/" + shopIdLst.Count; + })); + } + + Task.Run(() => + { + for (int i = 0; i < shopIdLst.Count; i++) + { + var shopId = shopIdLst[i]; + var shop = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.ShopId == shopId); + + // 先从服务端取最新直通车cookie + var serverCampanys = ShopBLL.AdminGetServerShopLstByIds(new List() { shop.ShopId }); + var serverShop = serverCampanys.FirstOrDefault(); + if (shop != null && serverShop != null) + { + shop.ad_cookie = serverShop.ad_cookie; + } + + if (shop != null) + { + var loginResult = getSellerCenter(shop); + if (!loginResult.Contains("\"success\":true")) + { + shop.ad_cookie = "empty=true;"; + shop.ad_login_status = "离线"; + } + else + { + shop.ad_login_status = "在线"; + shop.ad_cookie = serverShop.ad_cookie; + } + + StartUp.SaveLocalShopLoginInfo(); + ShopListForm.UpdateServerShopAdsCookies(shop); // 店铺cookie写入服务端 + } + + if (_statusBar != null) + { + MainForm.instance.Invoke(new Action(() => + { + _statusBar.lblTaskStatus.Text = "正在检测..."; + _statusBar.pgbTaskProgress.Value = (i + 1); + _statusBar.pgbTaskProgress.Text = (i + 1) + "/" + shopIdLst.Count; + })); + } + } + + if (_pbLoading != null) + { + MainForm.instance.Invoke(new Action(() => + { + _pbLoading.Visible = false; + })); + } + if (_statusBar != null) + { + MainForm.instance.Invoke(new Action(() => + { + _statusBar.lblTaskStatus.Text = "检测完毕"; + })); + } + }); + } + public static string GetShopStatus(ShopLoginInfo shop) { string url = "https://seller.kuajingmaihuo.com/bg/quiet/api/mms/userInfo"; @@ -684,6 +803,20 @@ namespace TemuKJD.KJDForms.ShopForms return HttpResponseBLL.PostResponse2(shop, url, body, refere); } + /// + /// 获取直通车登录状态 + /// + /// + /// + public static string getSellerCenter(ShopLoginInfo shop) + { + string url = "https://ads.temu.com/api/v1/coconut/account/get_seller_center"; + string body = "{}"; + string refere = shop.ad_url; + + return HttpResponseBLL.PostResponseAds(shop, url, body, refere); + } + private void ShopListForm_VisibleChanged(object sender, EventArgs e) { if (this.Visible == true) @@ -846,6 +979,7 @@ namespace TemuKJD.KJDForms.ShopForms { ShopLoginForm shopLoginForm = new ShopLoginForm(shop); shopLoginForm.openType = EnumOpenType.login; + shopLoginForm.IsAdsLogin = this.chkLoginAds.Checked; shopLoginForm.SaveComplete += shopLoginForm_SaveComplete; shopLoginForm.ShowDialog(); btnRefreshCookie_Click(null, null); diff --git a/TEMUKJD/KJDForms/ShopForms/ShopLoginForm.Designer.cs b/TEMUKJD/KJDForms/ShopForms/ShopLoginForm.Designer.cs index ec1caf9..ba0a059 100644 --- a/TEMUKJD/KJDForms/ShopForms/ShopLoginForm.Designer.cs +++ b/TEMUKJD/KJDForms/ShopForms/ShopLoginForm.Designer.cs @@ -83,7 +83,7 @@ this.splitContainer1.Panel2.Controls.Add(this.btnReload); this.splitContainer1.Panel2.Controls.Add(this.chkCloseAfterLogin); this.splitContainer1.Size = new System.Drawing.Size(1438, 736); - this.splitContainer1.SplitterDistance = 674; + this.splitContainer1.SplitterDistance = 675; this.splitContainer1.SplitterWidth = 3; this.splitContainer1.TabIndex = 4; // @@ -345,6 +345,7 @@ this.txtAddress.Name = "txtAddress"; this.txtAddress.Size = new System.Drawing.Size(1432, 23); this.txtAddress.TabIndex = 7; + this.txtAddress.TextChanged += new System.EventHandler(this.txtAddress_TextChanged); this.txtAddress.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtAddress_KeyDown); // // ShopLoginForm diff --git a/TEMUKJD/KJDForms/ShopForms/ShopLoginForm.cs b/TEMUKJD/KJDForms/ShopForms/ShopLoginForm.cs index 2af57e4..8d901d8 100644 --- a/TEMUKJD/KJDForms/ShopForms/ShopLoginForm.cs +++ b/TEMUKJD/KJDForms/ShopForms/ShopLoginForm.cs @@ -33,18 +33,24 @@ namespace TemuKJD.KJDForms.ShopForms { login, manage, + ads, // 广告登录 } public partial class ShopLoginForm : LRBaseForm { public static ShopLoginForm shopLoginInstance { get; set; } = null; public int CloseAfterSecond { get; set; } + /// + /// 推广直通车登录 + /// + public bool IsAdsLogin { get; set; } = false; public EnumOpenType openType = EnumOpenType.manage; public bool isMultiLogin = false; public string MultiLoginCookieName = ""; public string InitUrl = ""; private string shopCookieHead = "kuajingmaihuo.com"; private string shopCookieHead2 = "temu.com"; + private string shopCookieHead3 = "ads.temu.com"; private string shopLoginUrl = "http://seller.kuajingmaihuo.com/login"; private string shopMainUrl = "https://seller.kuajingmaihuo.com"; private string shopMainUrl2 = "https://agentseller.temu.com"; @@ -222,10 +228,29 @@ namespace TemuKJD.KJDForms.ShopForms else { var cookie2 = shop.Cookies2; + //var cookie2Lst = cookie2.Split(new string[] { ";", " " }, StringSplitOptions.RemoveEmptyEntries); + //cookie2 = ""; + //foreach (var item in cookie2Lst) + //{ + // if (item.StartsWith("mallid=")) + // cookie2 += "mallid=" + shop.ShopId + ";"; + // else + // cookie2 += item + ";"; + //} var t = CEFBrowser.SetCookieAsync(shopCookieHead2, cookie2, cefWebBrowser.GetCookieManager(null)); t.Wait(5000); cefWebBrowser.Load("https://agentseller.temu.com"); } + + Thread.Sleep(500); + if (!string.IsNullOrEmpty(shop.ShopId)) + { + var storageJsCode = "window.localStorage.setItem('" + "mall-info-id" + "', '" + shop.ShopId + "');\r\n"; + storageJsCode += "window.localStorage.setItem('" + "agentseller-mall-info-id" + "', '" + shop.ShopId + "');\r\n"; + while (!cefWebBrowser.IsBrowserInitialized || !cefWebBrowser.GetBrowser().MainFrame.IsValid || cefWebBrowser.IsLoading) + Thread.Sleep(20); + cefWebBrowser.GetBrowser().MainFrame.ExecuteJavaScriptAsync(storageJsCode); + } } @@ -299,14 +324,106 @@ namespace TemuKJD.KJDForms.ShopForms } StartUp.SaveLocalShopLoginInfo(); // 店铺保存到本地 ShopListForm.UpdateServerShopCookies(shop); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie + if (!IsAdsLogin) + { + OnSaveComplete(shop); + if (this.Created && this.chkCloseAfterLogin.Checked) + Invoke(new Action(() => { this.Close(); })); + else + break; + } + } + + + if (IsAdsLogin && !string.IsNullOrEmpty(shop.ad_seller_unique_id) && 1==2) + { + var obtainCodeRst = ShopListForm.GetObtainCode(shop); + var obtainCode = BaseRegex.GetStringJson(ref obtainCodeRst, "code"); + //https://ads.temu.com/login.html? + //redirectUrl=https%3A%2F%2Fads.temu.com%2Findex.html%3FadAreaOverride%3D2&userType=1&mallType=0 + //&ticket=Zjze2NHyZFaGP88ROyjN19a47ae59611391a296ae6403bbbfa39e9046ceba744aafe8227fd6 + //&adSellerUniqueId=eyJ1IjoiTVF3NFRGVmN2ZUVyZG1USDdOQ2o5dz09IiwidiI6MX0%3D&source=2&seller_source=11&adAreaOverride=2 + string url = "https://ads.temu.com/login.html?" + + "redirectUrl=https%3A%2F%2Fads.temu.com%2Findex.html%3FadAreaOverride%3D2&userType=1&mallType=0&ticket=" + obtainCode + + "&adSellerUniqueId=" + shop.ad_seller_unique_id + "&source=2&seller_source=11&adAreaOverride=2"; + cefWebBrowser.Load(url); + } + else if (IsAdsLogin) + { + cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sGetElementWithText); + + //点击商品推广按钮 + var adsJsStr = "window.scrollTo(0, document.body.scrollHeight);"; + var adsResponse = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(adsJsStr); + adsResponse.Wait(1000); + Thread.Sleep(Randomx.GetId(500, 1000)); + + adsJsStr = "var clickItem = getElementWithText('商品推广'); " + + "clickItem.click()"; + adsResponse = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(adsJsStr); + adsResponse.Wait(1000); + Thread.Sleep(Randomx.GetId(500, 1000)); + + // 模拟人为点击一次,否则窗口不跳转 + var host = cefWebBrowser.GetBrowser().GetHost(); + int x = Randomx.GetId(50, 200); + int y = Randomx.GetId(1, 10); + // 按下鼠标左键 + host.SendMouseClickEvent(x, y, MouseButtonType.Left, false, 1, CefEventFlags.None); + Thread.Sleep(50 + Randomx.GetId(200)); + host.SendMouseClickEvent(x, y, MouseButtonType.Left, true, 1, CefEventFlags.None); + Thread.Sleep(Randomx.GetId(100, 500)); + + //点击确认授权并前往按钮 + adsJsStr = "var clickItem = getElementWithText('确认授权并前往'); " + + "clickItem.parentElement.click();"; + adsResponse = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(adsJsStr); + adsResponse.Wait(1000); + Thread.Sleep(Randomx.GetId(300, 800)); + } + } + + if (1 == 1 && this.shop != null && currentUrl.StartsWith("https://ads.temu.com/index.html?adAreaOverride=")) + { + if (!cefWebBrowser.GetBrowser().MainFrame.IsValid) + continue; + + if (openType != EnumOpenType.login) + continue; + + if (!lstShopCompany.Any(c => c.AccountId == shop.ShopId)) + continue; + + shop.ad_url = txtAddress.Text; + string cookiesAds = ""; + List cookieAdsList = CEFBrowser.GetCookieList("ads.temu.com", cefWebBrowser.GetCookieManager(null)); + if (cookieAdsList != null && cookieAdsList.Count > 0) + { + for (int i = 0; i < cookieAdsList.Count; i++) + { + var cookie = cookieAdsList[i]; + cookiesAds += cookie.Name + "=" + cookie.Value + "; "; + } + cookiesAds = cookiesAds.Trim().TrimEnd(';'); + } + + if (!string.IsNullOrEmpty(cookiesAds)) + { + shop.ad_login_status = "在线"; + shop.ad_cookie = cookiesAds; + StartUp.SaveLocalShopLoginInfo(); // 店铺保存到本地 + ShopListForm.UpdateServerShopAdsCookies(shop); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie OnSaveComplete(shop); if (this.Created && this.chkCloseAfterLogin.Checked) { Invoke(new Action(() => { this.Close(); })); } else + { break; + } } + } } }); @@ -443,6 +560,14 @@ namespace TemuKJD.KJDForms.ShopForms t2.Wait(5000); } + if (this.openType == EnumOpenType.ads) + { + var cookieAds = shop.ad_cookie; + var t2 = CEFBrowser.SetCookieAsync(shopCookieHead3, cookieAds, cefWebBrowser.GetCookieManager(null)); + t2.Wait(5000); + cefWebBrowser.Load(InitUrl); + } + //根据登录的具体店铺设置local storage if (!string.IsNullOrEmpty(shop.ShopId)) { @@ -510,11 +635,13 @@ namespace TemuKJD.KJDForms.ShopForms private void CefWebBrowser_AddressChanged(object sender, CefSharp.AddressChangedEventArgs e) { if (this.Created) + { Invoke(new Action(() => { currentUrl = e.Address; txtAddress.Text = e.Address; })); + } } private void CefWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEndEventArgs e) @@ -1102,5 +1229,14 @@ function getElementWithText(sText) ReturnPackageDetailForm form = new ReturnPackageDetailForm(this.shop); form.ShowDialog(); } + + private void txtAddress_TextChanged(object sender, EventArgs e) + { + if (txtAddress.Text.Contains("&adSellerUniqueId=")) + { + string address = txtAddress.Text.Trim(); + shop.ad_seller_unique_id = BaseRegex.GetStringQuery(ref address, "adSellerUniqueId"); + } + } } } diff --git a/TEMUKJD/KJDForms/ShopForms/Statistics/ShopOrderStatisticsForm.cs b/TEMUKJD/KJDForms/ShopForms/Statistics/ShopOrderStatisticsForm.cs index 47e5c3d..17120e7 100644 --- a/TEMUKJD/KJDForms/ShopForms/Statistics/ShopOrderStatisticsForm.cs +++ b/TEMUKJD/KJDForms/ShopForms/Statistics/ShopOrderStatisticsForm.cs @@ -627,13 +627,14 @@ namespace TemuKJD.KJDForms.ShopForms.Statistics } //--------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------- + //kjd库,获取商品进货价 var purchasePriceList = GetPurchasePrice(subOrderInfoLstTmp.Select(o => o.productId.ParseToString()).ToList()); - foreach (var pPrice in purchasePriceList) - { - pPrice.dbSkuPurchasePriceList = JsonHelper.DeserializeJsonToList(pPrice.sku_purchase_price_json); - if (pPrice.dbSkuPurchasePriceList == null) - pPrice.dbSkuPurchasePriceList = new List(); - } + //foreach (var pPrice in purchasePriceList) + //{ + // pPrice.dbSkuPurchasePriceList = JsonHelper.DeserializeJsonToList(pPrice.sku_purchase_price_json); + // if (pPrice.dbSkuPurchasePriceList == null) + // pPrice.dbSkuPurchasePriceList = new List(); + //} foreach (var purchasePrice in purchasePriceList) { var order = subOrderInfoLstTmp.FirstOrDefault(o => o.productId.ParseToString() == purchasePrice.spu_id); @@ -874,7 +875,19 @@ namespace TemuKJD.KJDForms.ShopForms.Statistics if (jArr.Count() == 0) return list; - return JsonHelper.DeserializeJsonToList(jArr.ToString()); + list = JsonHelper.DeserializeJsonToList(jArr.ToString()); + foreach (var pPrice in list) + { + pPrice.dbSkuPurchasePriceList = JsonHelper.DeserializeJsonToList(pPrice.sku_purchase_price_json); + if (pPrice.dbSkuPurchasePriceList == null) + pPrice.dbSkuPurchasePriceList = new List(); + else + { + pPrice.price_text = "¥" + (pPrice.dbSkuPurchasePriceList.Min(s => s.purchasePriceValue) * 0.01).ParseToDecimal().ToString("0.00") + "~" + + "¥" + (pPrice.dbSkuPurchasePriceList.Max(s => s.purchasePriceValue) * 0.01).ParseToDecimal().ToString("0.00"); + } + } + return list; } private void btnSetColumn_Click(object sender, EventArgs e) diff --git a/TEMUKJD/StartUp.cs b/TEMUKJD/StartUp.cs index 4c7734b..938c956 100644 --- a/TEMUKJD/StartUp.cs +++ b/TEMUKJD/StartUp.cs @@ -137,9 +137,9 @@ namespace TemuKJD } #endif #if DEBUG - for (int i = 0; i < 3600; i++) + for (int i = 0; i < 360; i++) { - Thread.Sleep(1000); + Thread.Sleep(10000); } #else Thread.Sleep(1000 * 3600);