diff --git a/AllBase/AllBase.csproj b/AllBase/AllBase.csproj index 38de1f3..a0c9706 100644 --- a/AllBase/AllBase.csproj +++ b/AllBase/AllBase.csproj @@ -189,6 +189,7 @@ + diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs index f5e4347..bad4028 100644 --- a/AllBase/BaseClass.cs +++ b/AllBase/BaseClass.cs @@ -27,7 +27,7 @@ namespace AllBase /// /// 版本ID /// - public static int VersionCount = 691; + public static int VersionCount = 696; //public static int VersionCount = 613; /// diff --git a/AllBase/Model/Result/JitCardCodeInfo.cs b/AllBase/Model/Result/JitCardCodeInfo.cs new file mode 100644 index 0000000..3b75547 --- /dev/null +++ b/AllBase/Model/Result/JitCardCodeInfo.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AllBase.Model.Result +{ + public class JitCardCodeInfo + { + public int id { get; set; } + public string card_code_id { get; set; } + /// + /// 创建时间 + /// + public DateTime add_time { get; set; } + /// + /// 激活时间 + /// + public DateTime? active_time { get; set; } + /// + /// 过期时间 + /// + public DateTime? expire_time { get; set; } + public string shop_id { get; set; } + public string shop_account { get; set; } + public string notes { get; set; } + + } +} diff --git a/AllBase/Model/Result/KJDDBProduct.cs b/AllBase/Model/Result/KJDDBProduct.cs index 27f30ea..bb51b86 100644 --- a/AllBase/Model/Result/KJDDBProduct.cs +++ b/AllBase/Model/Result/KJDDBProduct.cs @@ -19,6 +19,9 @@ namespace AllBase.Model.Result public string cat_id { get; set; } public string main_cat_name { get; set; } public string cat_name { get; set; } + /// + /// 拼多多母店价格 + /// public string price_text { get; set; } public string ext_code { get; set; } public string product_name { get; set; } @@ -38,11 +41,15 @@ namespace AllBase.Model.Result public int select_count { get; set; } public int select_total_count { get; set; } /// - /// 采集来源 0母店采集 1前端直采 + /// Temu 采集来源 0母店采集 1前端直采 /// public int product_get_type { get; set; } public string head_words { get; set; } public string end_words { get; set; } + /// + /// temu 成本价 + /// + public string cost_price { get; set; } public string fission_words { get; set; } // 是否拼多多上传成功 diff --git a/AllBase/Model/Result/ShopLoginInfo.cs b/AllBase/Model/Result/ShopLoginInfo.cs index c7dea57..6bae6fd 100644 --- a/AllBase/Model/Result/ShopLoginInfo.cs +++ b/AllBase/Model/Result/ShopLoginInfo.cs @@ -185,6 +185,8 @@ namespace AllBase.Model.Result /// temu推广直通车登录状态 /// public string ad_login_status { get; set; } + + public DateTime? jit_expire_time { get; set; } } public class AuthInfo diff --git a/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs b/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs index f367604..91c561e 100644 --- a/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs +++ b/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs @@ -197,31 +197,32 @@ namespace KJD_Web.BLL else { if (isDetail) - sql = "select * from kjd.product p where p.is_del=0"; + sql = "SELECT * from kjd.product p where p.is_del=0"; else if (string.IsNullOrEmpty(get_select_count)) - sql = "select p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes,p.group," + - "p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words," + - "p.product_get_type from kjd.product p where p.is_del=0"; - else sql = "SELECT p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes,p.group," + - "p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.product_get_type" + - ",COUNT(s.id) AS select_count " + - "FROM kjd.product p LEFT JOIN kjd.product_select s ON p.id=s.out_product_id AND s.shop_id='" + select_shop_id + "' " + - "WHERE p.is_del=0"; + "p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.cost_price,p.product_get_type" + + " FROM kjd.product p" + + " WHERE p.is_del=0"; + else // 统计单店认领次数 + sql = "SELECT p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes,p.group," + + "p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.cost_price,p.product_get_type" + + ",COUNT(s.id) AS select_count" + + " FROM kjd.product p LEFT JOIN kjd.product_select s ON p.id=s.out_product_id AND s.shop_id='" + select_shop_id + "'" + + " WHERE p.is_del=0"; if (!isDetail && product_get_type != "all") // 详情必须从列表页面进入,不用限制 - sql += " and p.product_get_type=" + product_get_type; + sql += " AND p.product_get_type=" + product_get_type; //where子句 sql += where; if (!isDetail && !string.IsNullOrEmpty(get_select_count)) - sql += " group by p.id"; + sql += " GROUP BY p.id"; if (sort_field == "select_total_count") - sql += " order by p.select_total_count desc, p.id desc"; + sql += " ORDER BY p.select_total_count desc, p.id desc"; else - sql += " order by p.id desc"; - sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + sql += " ORDER BY p.id desc"; + sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size; dt = mySql.ExecuteDataTable(sql); } @@ -250,9 +251,10 @@ namespace KJD_Web.BLL notes = row["notes"].ToString(), group = row["group"].ToString(), select_total_count = row["select_total_count"].ParseToInt(), - end_words = row["end_words"].ParseToString(), fission_words = row["fission_words"].ParseToString(), head_words = row["head_words"].ParseToString(), + end_words = row["end_words"].ParseToString(), + cost_price = row["cost_price"].ParseToString(), product_get_type = row["product_get_type"].ParseToInt(), //0母店采集 1前端直采 }; if (isDetail) @@ -369,6 +371,7 @@ namespace KJD_Web.BLL string fission_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_words"))?.Replace("'", "\\'"); string head_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "head_words"))?.Replace("'", "\\'"); string end_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "end_words"))?.Replace("'", "\\'"); + string cost_price = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cost_price"))?.Replace("'", "\\'"); string product_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_json"))?.Replace("'", "\\'"); string size_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "size_json"))?.Replace("'", "\\'"); string original_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "original_json"))?.Replace("'", "\\'"); @@ -395,6 +398,8 @@ namespace KJD_Web.BLL sql += " head_words='" + head_words + "',"; if (end_words != null) sql += " end_words='" + end_words + "',"; + if (cost_price != null) + sql += " cost_price='" + cost_price + "',"; if (product_json != null) sql += " product_json='" + product_json + "',"; if (size_json != null) @@ -1096,14 +1101,22 @@ namespace KJD_Web.BLL string sql = "select count(id) from kjd.sku_img s where 1=1"; string where = ""; + //if (!string.IsNullOrWhiteSpace(search_db_id)) + // where += " and s.id like '%" + search_db_id + "%'"; + //if (!string.IsNullOrWhiteSpace(search_product_id)) + // where += " and s.product_id like '%" + search_product_id + "%'"; + //if (!string.IsNullOrWhiteSpace(search_spec_id)) + // where += " and s.spec_id like '%" + search_spec_id + "%'"; + //if (!string.IsNullOrWhiteSpace(search_original_img_url)) + // where += " and s.original_img_url like '%" + search_original_img_url + "%'"; if (!string.IsNullOrWhiteSpace(search_db_id)) - where += " and s.id like '%" + search_db_id + "%'"; + where += " and s.id = '" + search_db_id + "'"; if (!string.IsNullOrWhiteSpace(search_product_id)) - where += " and s.product_id like '%" + search_product_id + "%'"; + where += " and s.product_id = '" + search_product_id + "'"; if (!string.IsNullOrWhiteSpace(search_spec_id)) - where += " and s.spec_id like '%" + search_spec_id + "%'"; + where += " and s.spec_id = '" + search_spec_id + "'"; if (!string.IsNullOrWhiteSpace(search_original_img_url)) - where += " and s.original_img_url like '%" + search_original_img_url + "%'"; + where += " and s.original_img_url = '" + search_original_img_url + "'"; if (!string.IsNullOrEmpty(search_db_ids)) where += " and s.id in (" + search_db_ids + ")"; sql += where; diff --git a/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs b/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs index e40caf9..6d98c0a 100644 --- a/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs +++ b/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Data; using System.Drawing; using System.Linq; +using System.Text; using System.Web; using System.Web.Security; @@ -94,7 +95,10 @@ namespace KJD_Web.BLL } else { - sql = "SELECT s.*,c.add_product_remaining add_remaining,c.add_product_month add_month 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.*,c.add_product_remaining add_remaining,c.add_product_month add_month,cc.jit_expire_time FROM kjd.shop s" + + " LEFT JOIN kjd.shop_add_prod_count c ON s.shop_id=c.shop_id" + + " LEFT JOIN (SELECT shop_id, MAX(expire_time) as jit_expire_time FROM kjd.card_code GROUP BY shop_id) cc ON s.shop_id=cc.shop_id" + + " WHERE 1=1"; sql += where; // where 子句 @@ -131,6 +135,7 @@ namespace KJD_Web.BLL ad_login_status = row["ad_login_status"].ParseToString(), ad_seller_unique_id = row["ad_seller_unique_id"].ParseToString(), ad_url = row["ad_url"].ParseToString(), + jit_expire_time = row["jit_expire_time"].IsNullOrEmpty() ? new DateTime?() : Convert.ToDateTime(row["jit_expire_time"]), }; shopList.Add(shop); } @@ -807,5 +812,220 @@ namespace KJD_Web.BLL } return "{\"code\":19999,\"msg\":\"输入为空\"}"; } + + public string GetShopCardCodeList(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + var search_card_code_id = RegexUtils.GetStringQuery(ref inputData, "search_card_code_id"); + var search_shop_id = RegexUtils.GetStringQuery(ref inputData, "search_shop_id"); + var search_shop_name = RegexUtils.GetStringQuery(ref inputData, "search_shop_name"); + var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes"); + var card_code_ids = RegexUtils.GetStringQuery(ref inputData, "card_code_ids")?.Replace("'", ""); + var sort_field = RegexUtils.GetStringQuery(ref inputData, "sort_field")?.Replace("'", ""); + if (!string.IsNullOrWhiteSpace(card_code_ids)) + { + List shopIdLst = card_code_ids.Split(',').ToList(); + card_code_ids = "'" + string.Join("','", shopIdLst) + "'"; + } + var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", ""); + if (!string.IsNullOrWhiteSpace(shop_ids)) + { + List shopIdLst = shop_ids.Split(',').ToList(); + shop_ids = "'" + string.Join("','", shopIdLst) + "'"; + } + var shop_names = RegexUtils.GetStringQuery(ref inputData, "shop_names"); + if (!string.IsNullOrWhiteSpace(shop_names)) + { + List shopNameLst = shop_names.Split(',').ToList(); + shop_names = "'" + string.Join("','", shopNameLst) + "'"; + } + var list_notes = RegexUtils.GetStringQuery(ref inputData, "list_notes"); + if (!string.IsNullOrWhiteSpace(list_notes)) + { + List notesLst = list_notes.Split(',').ToList(); + list_notes = "'" + string.Join("','", notesLst) + "'"; + } + + var page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + var page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(); + + if (page_size == 0) + page_size = 50; + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "SELECT COUNT(s.id) FROM kjd.card_code s WHERE 1=1"; + + //where子句 + string where = ""; + if (!string.IsNullOrWhiteSpace(search_card_code_id)) + where += " and s.card_code_id like '%" + search_card_code_id + "%'"; + if (!string.IsNullOrWhiteSpace(search_shop_id)) + where += " and s.shop_id like '%" + search_shop_id + "%'"; + if (!string.IsNullOrWhiteSpace(search_shop_name)) + where += " and s.shop_account like '%" + search_shop_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_notes)) + where += " and s.notes like '%" + search_notes + "%'"; + if (!string.IsNullOrWhiteSpace(card_code_ids)) + where += " and s.card_code_id in (" + card_code_ids + ")"; + if (!string.IsNullOrWhiteSpace(shop_ids)) + where += " and s.shop_id in (" + shop_ids + ")"; + if (!string.IsNullOrWhiteSpace(shop_names)) + where += " and s.shop_account in (" + shop_names + ")"; + if (!string.IsNullOrWhiteSpace(list_notes)) + where += " and s.notes in (" + list_notes + ")"; + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + sql = "SELECT s.* FROM kjd.card_code s WHERE 1=1"; + + sql += where; // where 子句 + + // 排序 + if (sort_field == "expire_time") + sql += " ORDER BY s.expire_time DESC"; + else + sql += " ORDER BY s.id DESC"; + sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + if (dt != null) + { + List cardCodeList = new List(); + foreach (DataRow row in dt.Rows) + { + JitCardCodeParam cardCode = new JitCardCodeParam + { + id = Convert.ToInt32(row["id"]), + shop_id = row["shop_id"].ToString(), + shop_account = row["shop_account"].ToString(), + add_time = (DateTime)row["add_time"], + active_time = row["active_time"].IsNullOrEmpty() ? new DateTime?() : Convert.ToDateTime(row["active_time"]), + expire_time = row["expire_time"].IsNullOrEmpty() ? new DateTime?() : Convert.ToDateTime(row["expire_time"]), + card_code_id = row["card_code_id"].ToString(), + notes = row["notes"].ToString(), + }; + cardCodeList.Add(cardCode); + } + var data = JsonUtils.SerializerObjectToString(cardCodeList); + + + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + public string CreateShopCardCode(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":50001,\"msg\":\"没有用户名\"}"; + } + + var create_count = RegexUtils.GetStringQuery(ref inputData, "create_count")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(create_count)) + { + return "{\"code\":50002,\"msg\":\"未选择生成数量\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "insert into kjd.card_code (card_code_id) values "; + Random random = new Random(Guid.NewGuid().GetHashCode()); + for (int i = 0; i < create_count.ParseToInt(); i++) + { + sql += "('" + GenerateCardCode(random, 16) + "'),"; + } + sql = sql.TrimEnd(',') + ";"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string DelShopCardCode(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":50001,\"msg\":\"没有用户名\"}"; + } + + var del_ids = RegexUtils.GetStringQuery(ref inputData, "del_ids")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(del_ids)) + { + return "{\"code\":50002,\"msg\":\"未选择删除数据\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from kjd.card_code where id in (" + del_ids + ");"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + private static readonly char[] chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".ToCharArray(); // 增加特殊字符 + + public static string GenerateCardCode(Random random, int length) + { + StringBuilder result = new StringBuilder(length); + for (int i = 0; i < length; i++) + { + result.Append(chars[random.Next(chars.Length)]); + } + return result.ToString(); + } } } \ No newline at end of file diff --git a/KJDService/KJD_WebService/KJD_WebService.csproj b/KJDService/KJD_WebService/KJD_WebService.csproj index d7af145..c48d36e 100644 --- a/KJDService/KJD_WebService/KJD_WebService.csproj +++ b/KJDService/KJD_WebService/KJD_WebService.csproj @@ -112,6 +112,7 @@ + diff --git a/KJDService/KJD_WebService/KJD_WebService.csproj.user b/KJDService/KJD_WebService/KJD_WebService.csproj.user index a48a5b1..4bcdc04 100644 --- a/KJDService/KJD_WebService/KJD_WebService.csproj.user +++ b/KJDService/KJD_WebService/KJD_WebService.csproj.user @@ -1,4 +1,4 @@ - + true @@ -8,7 +8,7 @@ - Debug|Any CPU + Release|Any CPU ShowAllFiles diff --git a/KJDService/KJD_WebService/Model/DBProductResultParam.cs b/KJDService/KJD_WebService/Model/DBProductResultParam.cs index 0652682..48c49be 100644 --- a/KJDService/KJD_WebService/Model/DBProductResultParam.cs +++ b/KJDService/KJD_WebService/Model/DBProductResultParam.cs @@ -18,7 +18,14 @@ namespace KJD_Web.Model public string cat_id { get; set; } public string main_cat_name { get; set; } public string cat_name { get; set; } + /// + /// 母店价格 + /// public string price_text { get; set; } + /// + /// 成本价格 + /// + public string cost_price { get; set; } public string change_cat_id { get; set; } public string change_cat_name { get; set; } public string ext_code { get; set; } diff --git a/KJDService/KJD_WebService/Model/ShopModel/JitCardCodeParam.cs b/KJDService/KJD_WebService/Model/ShopModel/JitCardCodeParam.cs new file mode 100644 index 0000000..3ac743d --- /dev/null +++ b/KJDService/KJD_WebService/Model/ShopModel/JitCardCodeParam.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace KJD_Web.Model.ShopModel +{ + public class JitCardCodeParam + { + public int id { get; set; } + public string card_code_id { get; set; } + /// + /// 创建时间 + /// + public DateTime add_time { get; set; } + /// + /// 激活时间 + /// + public DateTime? active_time { get; set; } + /// + /// 过期时间 + /// + public DateTime? expire_time { get; set; } + public string shop_id { get; set; } + public string shop_account { get; set; } + public string notes { get; set; } + } +} \ No newline at end of file diff --git a/KJDService/KJD_WebService/Model/ShopModel/ShopParam.cs b/KJDService/KJD_WebService/Model/ShopModel/ShopParam.cs index 52dfd90..7e81ebe 100644 --- a/KJDService/KJD_WebService/Model/ShopModel/ShopParam.cs +++ b/KJDService/KJD_WebService/Model/ShopModel/ShopParam.cs @@ -52,5 +52,6 @@ namespace KJD_Web.Model.ShopModel /// temu推广直通车登录状态 /// public string ad_login_status { get; set; } + public DateTime? jit_expire_time { 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 9dbd786..6c56c87 100644 --- a/KJDService/KJD_WebService/ShopService.asmx.cs +++ b/KJDService/KJD_WebService/ShopService.asmx.cs @@ -216,5 +216,43 @@ namespace KJD_Web Context.Response.Write(result); Context.Response.End(); } + + + + [WebMethod] + public void get_shop_card_code_list() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new ShopManage().GetShopCardCodeList(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void create_shop_card_code() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new ShopManage().CreateShopCardCode(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void del_shop_card_code() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new ShopManage().DelShopCardCode(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } } } diff --git a/TEMUKJD/BLL/HttpResponseBLL.cs b/TEMUKJD/BLL/HttpResponseBLL.cs index 80fcdc8..1072ef2 100644 --- a/TEMUKJD/BLL/HttpResponseBLL.cs +++ b/TEMUKJD/BLL/HttpResponseBLL.cs @@ -319,19 +319,22 @@ namespace TemuKJD.BLL } 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 (_url.Contains("https://ads.temu.com/api/v1/coconut/ad/ads_detail")) + { + 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 + "; "; - //} + 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 @@ -352,6 +355,41 @@ namespace TemuKJD.BLL request.ContentType = "application/json;charset=UTF-8"; request.Headers.Add("Origin", @"https://ads.temu.com"); request.Headers.Set(HttpRequestHeader.Cookie, cookies); +///region=0; +///ad_timezone=Asia%2FShanghai; +///img_sup=avif%2Cwebp; +///auth_token=eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiZGlyIn0..doZoU-mjwDJ1VRHT.C3eSZAHigXzfDqOwrkxjdUC6YWDjo16HhkgkJ63LqJZFGtiY2M7YlBFA5d_AH1oVUQXOXUhmoLYSENuPCbwjIidnIMfzAI0AQXH93s6YjptbhgDu8b3VFxWa6MJ7k0ueONwvbNml8m3q9QUR3E8apnoSzGR7i7HPqwm4IqdATOhvEWKAI2iemEsyCPjUvWt8bwCd2kJtCxeQxcvfsIxrEqxnp2IcitlL5dr3sSKL-zkQTsDHUOKSHZDs2o2e3LTNriVKQPxEUnUeM0bMWeS0LK5K5DLv2KtK15eRij8IzKiOo6LcUIU8H2JCVsWij7h9zaEKysbeJ2m4lvGPUHaQjiFGVBkLjERGpdeBrsL25SdNXa-ewYV3G3hZhYIkqwLraq_6FeFXEly1beNArRqvLtKk8F8XuJcV73I84dpqtPoNf0qNQ4xHWAxu9W221Np8cyzoFYirmUnSiVcXUIX4Frw1PCQNQlGLk9YiDu4yGg1c.GadaUU1hhCNgybc3hhq5HA; +///ad_uin=pRKR5htgF5Llfwm8g8ItiQ; +///ad_site=""; +///MALL_ID=634418217169109; +///ad_area=2; +///ad_language=zh-Hans; +///mall_ad_timezone=Asia%2FShanghai; +///ad_currency=CNY +// request.Headers.Set(HttpRequestHeader.Cookie, @" +//api_uid=CtxlFWkmf8WybOWFCAnAAg==; +//_nano_fp=Xpmjn0gqX0myn0TJlT_YvYLohdDCmG9aYkjPjQBU; +//_bee=a2ZiO8rno4RSC5pTp0Xvb3xZ7WNVrapJ; +//njrpl=a2ZiO8rno4RSC5pTp0Xvb3xZ7WNVrapJ; +//dilx=1e46HQzMd-trn9bElW4ly; +//hfsc=L3yPcIsw7Trw05LIeA==; +//seller_temp=N_eyJ0Ijoic2hjYUcrZ1VkVkYweEVIYVIvRHFzOVlkMDViUzdxK2xUam5IY3BUMzU2bkZscFN5Q1dUT3VxQzFaUHJEZTFKNiIsInYiOjEsInMiOjEwMDAxLCJ1IjoyNDg3NDUxOTIxNzE0fQ==; +//mallid=634418217169109; +//region=0; +//ad_timezone=Asia%2FShanghai; +//img_sup=avif%2Cwebp; +//auth_token=eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiZGlyIn0..doZoU-mjwDJ1VRHT.C3eSZAHigXzfDqOwrkxjdUC6YWDjo16HhkgkJ63LqJZFGtiY2M7YlBFA5d_AH1oVUQXOXUhmoLYSENuPCbwjIidnIMfzAI0AQXH93s6YjptbhgDu8b3VFxWa6MJ7k0ueONwvbNml8m3q9QUR3E8apnoSzGR7i7HPqwm4IqdATOhvEWKAI2iemEsyCPjUvWt8bwCd2kJtCxeQxcvfsIxrEqxnp2IcitlL5dr3sSKL-zkQTsDHUOKSHZDs2o2e3LTNriVKQPxEUnUeM0bMWeS0LK5K5DLv2KtK15eRij8IzKiOo6LcUIU8H2JCVsWij7h9zaEKysbeJ2m4lvGPUHaQjiFGVBkLjERGpdeBrsL25SdNXa-ewYV3G3hZhYIkqwLraq_6FeFXEly1beNArRqvLtKk8F8XuJcV73I84dpqtPoNf0qNQ4xHWAxu9W221Np8cyzoFYirmUnSiVcXUIX4Frw1PCQNQlGLk9YiDu4yGg1c.GadaUU1hhCNgybc3hhq5HA; +//ad_uin=pRKR5htgF5Llfwm8g8ItiQ; +//ad_site=""""; +//MALL_ID=634418217169109; +//ad_area=2; +//ad_language=zh-Hans; +//mall_ad_timezone=Asia%2FShanghai; +//ad_currency=CNY; +//region=0; +//ad_timezone=Asia%2FShanghai; +//img_sup=avif%2Cwebp"); + request.Headers.Add("Sec-Fetch-Site", @"same-origin"); request.Headers.Add("Sec-Fetch-Mode", @"cors"); request.Headers.Add("Sec-Fetch-Dest", @"empty"); diff --git a/TEMUKJD/BLL/ShopBLL.cs b/TEMUKJD/BLL/ShopBLL.cs index bf17726..f14a3f7 100644 --- a/TEMUKJD/BLL/ShopBLL.cs +++ b/TEMUKJD/BLL/ShopBLL.cs @@ -244,6 +244,7 @@ namespace TemuKJD.BLL 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"); + shop.jit_expire_time = BaseRegex.GetStringJson(ref shopStr, "jit_expire_time") == null ? new DateTime?() : Convert.ToDateTime(BaseRegex.GetStringJson(ref shopStr, "jit_expire_time")); if (BaseClass.MainPath == "binxixi") { diff --git a/TEMUKJD/BaseForms/LRBaseForm.cs b/TEMUKJD/BaseForms/LRBaseForm.cs index 4e62dae..3612e79 100644 --- a/TEMUKJD/BaseForms/LRBaseForm.cs +++ b/TEMUKJD/BaseForms/LRBaseForm.cs @@ -52,7 +52,13 @@ namespace TemuKJD.BaseForms m.Result = (IntPtr)HTBOTTOM; break; default: - base.WndProc(ref m); + try + { + base.WndProc(ref m); + } + catch + { + } break; } diff --git a/TEMUKJD/KJD.csproj b/TEMUKJD/KJD.csproj index df41d05..948facf 100644 --- a/TEMUKJD/KJD.csproj +++ b/TEMUKJD/KJD.csproj @@ -140,12 +140,30 @@ AdminAccountForm.cs + + Form + + + AdminCardCodeForm.cs + Form AdminForm.cs + + Form + + + JITForm.cs + + + Form + + + JitShopActiveForm.cs + Form @@ -884,9 +902,15 @@ AdminAccountForm.cs + + AdminCardCodeForm.cs + AdminForm.cs + + JITForm.cs + Fission.cs @@ -1245,6 +1269,8 @@ + + diff --git a/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.Designer.cs b/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.Designer.cs new file mode 100644 index 0000000..b42d40c --- /dev/null +++ b/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.Designer.cs @@ -0,0 +1,554 @@ + +namespace TemuKJD.KJDForms.AdminForms +{ + partial class AdminCardCodeForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.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(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.txtCreateCount = new System.Windows.Forms.TextBox(); + this.btnCreate = new DevComponents.DotNetBar.PanelEx(); + this.cmbCardCodeStatus = new System.Windows.Forms.ComboBox(); + this.label6 = new System.Windows.Forms.Label(); + this.txtShopId = new System.Windows.Forms.TextBox(); + this.txtShopName = new System.Windows.Forms.TextBox(); + this.btnSearch = new DevComponents.DotNetBar.PanelEx(); + this.btnBatchDel = new DevComponents.DotNetBar.PanelEx(); + this.pnlEmpty = new DevComponents.DotNetBar.PanelEx(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.txtNotes = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.pbLoading = new System.Windows.Forms.PictureBox(); + this.dgvCardCode = new TemuKJD.UserComponent.DataGridViewEx(); + this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.colId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colCardCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colAddTime = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colActiveTime = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colExpires = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colShopAccount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.conNotes = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colEdit = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colDelete = new System.Windows.Forms.DataGridViewLinkColumn(); + this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage(); + this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); + this.txtCardCode = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgvCardCode)).BeginInit(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.BackColor = System.Drawing.Color.White; + 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.txtCardCode); + this.splitContainer1.Panel1.Controls.Add(this.label1); + this.splitContainer1.Panel1.Controls.Add(this.txtCreateCount); + this.splitContainer1.Panel1.Controls.Add(this.btnCreate); + this.splitContainer1.Panel1.Controls.Add(this.cmbCardCodeStatus); + this.splitContainer1.Panel1.Controls.Add(this.label6); + this.splitContainer1.Panel1.Controls.Add(this.txtShopId); + this.splitContainer1.Panel1.Controls.Add(this.txtShopName); + this.splitContainer1.Panel1.Controls.Add(this.btnSearch); + this.splitContainer1.Panel1.Controls.Add(this.btnBatchDel); + this.splitContainer1.Panel1.Controls.Add(this.pnlEmpty); + this.splitContainer1.Panel1.Controls.Add(this.label2); + this.splitContainer1.Panel1.Controls.Add(this.label3); + this.splitContainer1.Panel1.Controls.Add(this.txtNotes); + this.splitContainer1.Panel1.Controls.Add(this.label4); + this.splitContainer1.Panel1.Controls.Add(this.label5); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.splitContainer2); + this.splitContainer1.Panel2.Margin = new System.Windows.Forms.Padding(4); + this.splitContainer1.Size = new System.Drawing.Size(1221, 530); + this.splitContainer1.TabIndex = 35; + // + // txtCreateCount + // + this.txtCreateCount.Location = new System.Drawing.Point(949, 14); + this.txtCreateCount.Name = "txtCreateCount"; + this.txtCreateCount.Size = new System.Drawing.Size(47, 23); + this.txtCreateCount.TabIndex = 455; + this.txtCreateCount.Text = "1"; + // + // btnCreate + // + this.btnCreate.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnCreate.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnCreate.DisabledBackColor = System.Drawing.Color.Empty; + this.btnCreate.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnCreate.Location = new System.Drawing.Point(1002, 14); + this.btnCreate.Name = "btnCreate"; + this.btnCreate.Size = new System.Drawing.Size(80, 23); + this.btnCreate.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnCreate.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnCreate.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnCreate.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnCreate.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnCreate.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnCreate.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnCreate.Style.GradientAngle = 90; + this.btnCreate.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnCreate.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnCreate.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnCreate.TabIndex = 454; + this.btnCreate.Text = "生成卡密"; + this.btnCreate.Click += new System.EventHandler(this.btnCreate_Click); + // + // cmbCardCodeStatus + // + this.cmbCardCodeStatus.FormattingEnabled = true; + this.cmbCardCodeStatus.Items.AddRange(new object[] { + "全部", + "未激活", + "已激活", + "已过期"}); + this.cmbCardCodeStatus.Location = new System.Drawing.Point(606, 13); + this.cmbCardCodeStatus.Name = "cmbCardCodeStatus"; + this.cmbCardCodeStatus.Size = new System.Drawing.Size(90, 25); + this.cmbCardCodeStatus.TabIndex = 441; + this.cmbCardCodeStatus.Text = "未激活"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(549, 17); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(68, 17); + this.label6.TabIndex = 440; + this.label6.Text = "卡密状态:"; + // + // txtShopId + // + this.txtShopId.Location = new System.Drawing.Point(180, 14); + this.txtShopId.Name = "txtShopId"; + this.txtShopId.Size = new System.Drawing.Size(90, 23); + this.txtShopId.TabIndex = 372; + // + // txtShopName + // + this.txtShopName.Location = new System.Drawing.Point(330, 14); + this.txtShopName.Name = "txtShopName"; + this.txtShopName.Size = new System.Drawing.Size(90, 23); + this.txtShopName.TabIndex = 374; + // + // 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(715, 14); + this.btnSearch.Name = "btnSearch"; + this.btnSearch.Size = new System.Drawing.Size(58, 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 = 435; + this.btnSearch.Text = "查询卡密"; + this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click); + // + // btnBatchDel + // + this.btnBatchDel.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnBatchDel.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnBatchDel.DisabledBackColor = System.Drawing.Color.Empty; + this.btnBatchDel.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnBatchDel.Location = new System.Drawing.Point(1151, 14); + this.btnBatchDel.Name = "btnBatchDel"; + this.btnBatchDel.Size = new System.Drawing.Size(58, 23); + this.btnBatchDel.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnBatchDel.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnBatchDel.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnBatchDel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnBatchDel.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnBatchDel.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnBatchDel.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnBatchDel.Style.GradientAngle = 90; + this.btnBatchDel.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnBatchDel.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnBatchDel.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnBatchDel.TabIndex = 439; + this.btnBatchDel.Text = "批量删除"; + this.btnBatchDel.Click += new System.EventHandler(this.btnBatchDel_Click); + // + // pnlEmpty + // + 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(779, 14); + this.pnlEmpty.Name = "pnlEmpty"; + this.pnlEmpty.Size = new System.Drawing.Size(58, 23); + this.pnlEmpty.Style.Alignment = System.Drawing.StringAlignment.Center; + this.pnlEmpty.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); + this.pnlEmpty.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); + this.pnlEmpty.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; + this.pnlEmpty.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.pnlEmpty.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; + this.pnlEmpty.Style.GradientAngle = 90; + this.pnlEmpty.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center; + this.pnlEmpty.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.pnlEmpty.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.pnlEmpty.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.pnlEmpty.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White; + this.pnlEmpty.TabIndex = 413; + this.pnlEmpty.Text = "清空条件"; + this.pnlEmpty.Click += new System.EventHandler(this.pnlEmpty_Click); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(134, 17); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(57, 17); + this.label2.TabIndex = 373; + this.label2.Text = "店铺ID:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(273, 17); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(68, 17); + this.label3.TabIndex = 375; + this.label3.Text = "店铺名称:"; + // + // txtNotes + // + this.txtNotes.Location = new System.Drawing.Point(456, 14); + this.txtNotes.Name = "txtNotes"; + this.txtNotes.Size = new System.Drawing.Size(90, 23); + this.txtNotes.TabIndex = 376; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(423, 17); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(44, 17); + this.label4.TabIndex = 377; + this.label4.Text = "备注:"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(892, 17); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(68, 17); + this.label5.TabIndex = 456; + this.label5.Text = "生成数量:"; + // + // splitContainer2 + // + this.splitContainer2.BackColor = System.Drawing.Color.White; + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Name = "splitContainer2"; + this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.BackColor = System.Drawing.Color.White; + this.splitContainer2.Panel1.Controls.Add(this.pbLoading); + this.splitContainer2.Panel1.Controls.Add(this.dgvCardCode); + this.splitContainer2.Panel1.Padding = new System.Windows.Forms.Padding(4, 0, 4, 0); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.ucSplitPage1); + this.splitContainer2.Panel2.Controls.Add(this.statusBar); + this.splitContainer2.Size = new System.Drawing.Size(1221, 476); + this.splitContainer2.SplitterDistance = 447; + this.splitContainer2.TabIndex = 0; + // + // 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(585, 198); + this.pbLoading.Name = "pbLoading"; + this.pbLoading.Size = new System.Drawing.Size(50, 50); + this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbLoading.TabIndex = 6; + this.pbLoading.TabStop = false; + // + // dgvCardCode + // + this.dgvCardCode.AllowUserToAddRows = false; + this.dgvCardCode.AllowUserToDeleteRows = false; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke; + this.dgvCardCode.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + this.dgvCardCode.AutoRowNumber = true; + this.dgvCardCode.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dgvCardCode.BackgroundColor = System.Drawing.Color.White; + this.dgvCardCode.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.dgvCardCode.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + this.dgvCardCode.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgvCardCode.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.colSelect, + this.colId, + this.colCardCode, + this.colAddTime, + this.colActiveTime, + this.colExpires, + this.colShopId, + this.colShopAccount, + this.conNotes, + this.colEdit, + this.colDelete}); + this.dgvCardCode.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgvCardCode.Location = new System.Drawing.Point(4, 0); + this.dgvCardCode.Name = "dgvCardCode"; + this.dgvCardCode.ReadOnly = true; + this.dgvCardCode.RowTemplate.Height = 23; + this.dgvCardCode.ShowCellErrors = false; + this.dgvCardCode.Size = new System.Drawing.Size(1213, 447); + this.dgvCardCode.TabIndex = 5; + this.dgvCardCode.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvCardCode_CellContentClick); + // + // colSelect + // + this.colSelect.FillWeight = 26F; + 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; + // + // colId + // + this.colId.HeaderText = "数据库ID"; + this.colId.Name = "colId"; + this.colId.ReadOnly = true; + this.colId.Visible = false; + // + // colCardCode + // + dataGridViewCellStyle3.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.colCardCode.DefaultCellStyle = dataGridViewCellStyle3; + this.colCardCode.HeaderText = "卡密"; + this.colCardCode.Name = "colCardCode"; + this.colCardCode.ReadOnly = true; + // + // colAddTime + // + this.colAddTime.HeaderText = "生成时间"; + this.colAddTime.Name = "colAddTime"; + this.colAddTime.ReadOnly = true; + // + // colActiveTime + // + this.colActiveTime.HeaderText = "激活时间"; + this.colActiveTime.Name = "colActiveTime"; + this.colActiveTime.ReadOnly = true; + // + // colExpires + // + this.colExpires.HeaderText = "到期时间"; + this.colExpires.Name = "colExpires"; + this.colExpires.ReadOnly = true; + // + // colShopId + // + this.colShopId.HeaderText = "店铺ID"; + this.colShopId.Name = "colShopId"; + this.colShopId.ReadOnly = true; + // + // colShopAccount + // + this.colShopAccount.HeaderText = "店铺账号"; + this.colShopAccount.Name = "colShopAccount"; + this.colShopAccount.ReadOnly = true; + // + // conNotes + // + this.conNotes.HeaderText = "备注"; + this.conNotes.Name = "conNotes"; + this.conNotes.ReadOnly = true; + // + // colEdit + // + this.colEdit.FillWeight = 46F; + this.colEdit.HeaderText = "编辑备注"; + this.colEdit.Name = "colEdit"; + this.colEdit.ReadOnly = true; + this.colEdit.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colEdit.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + // + // colDelete + // + this.colDelete.FillWeight = 46F; + this.colDelete.HeaderText = "删除"; + this.colDelete.Name = "colDelete"; + this.colDelete.ReadOnly = true; + // + // ucSplitPage1 + // + this.ucSplitPage1.CurrentPage = 1; + this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right; + this.ucSplitPage1.IsShowPageSize = false; + this.ucSplitPage1.Location = new System.Drawing.Point(859, 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(362, 25); + this.ucSplitPage1.TabIndex = 4; + this.ucSplitPage1.TotalPage = 1; + this.ucSplitPage1.PageChange += new System.Action(this.ucSplitPage1_PageChange); + // + // 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(1221, 25); + this.statusBar.TabIndex = 1; + this.statusBar.Visible = false; + // + // txtCardCode + // + this.txtCardCode.Location = new System.Drawing.Point(41, 14); + this.txtCardCode.Name = "txtCardCode"; + this.txtCardCode.Size = new System.Drawing.Size(90, 23); + this.txtCardCode.TabIndex = 468; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(8, 17); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(44, 17); + this.label1.TabIndex = 469; + this.label1.Text = "卡密:"; + // + // AdminCardCodeForm + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.ClientSize = new System.Drawing.Size(1221, 530); + this.Controls.Add(this.splitContainer1); + this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Name = "AdminCardCodeForm"; + this.Text = "AdminCardCodeForm"; + this.Load += new System.EventHandler(this.AdminCardCodeForm_Load); + this.VisibleChanged += new System.EventHandler(this.AdminCardCodeForm_VisibleChanged); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel1.PerformLayout(); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); + this.splitContainer2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgvCardCode)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer1; + private DevComponents.DotNetBar.PanelEx pnlEmpty; + private System.Windows.Forms.TextBox txtNotes; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox txtShopName; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox txtShopId; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.SplitContainer splitContainer2; + private System.Windows.Forms.PictureBox pbLoading; + private UserComponent.DataGridViewEx dgvCardCode; + private UserControls.UcSplitPage ucSplitPage1; + private UserControls.StatusBarUserControl statusBar; + private DevComponents.DotNetBar.PanelEx btnSearch; + private DevComponents.DotNetBar.PanelEx btnBatchDel; + private System.Windows.Forms.ComboBox cmbCardCodeStatus; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox txtCreateCount; + private DevComponents.DotNetBar.PanelEx btnCreate; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect; + private System.Windows.Forms.DataGridViewTextBoxColumn colId; + private System.Windows.Forms.DataGridViewTextBoxColumn colCardCode; + private System.Windows.Forms.DataGridViewTextBoxColumn colAddTime; + private System.Windows.Forms.DataGridViewTextBoxColumn colActiveTime; + private System.Windows.Forms.DataGridViewTextBoxColumn colExpires; + private System.Windows.Forms.DataGridViewTextBoxColumn colShopId; + private System.Windows.Forms.DataGridViewTextBoxColumn colShopAccount; + private System.Windows.Forms.DataGridViewTextBoxColumn conNotes; + private System.Windows.Forms.DataGridViewLinkColumn colEdit; + private System.Windows.Forms.DataGridViewLinkColumn colDelete; + private System.Windows.Forms.TextBox txtCardCode; + private System.Windows.Forms.Label label1; + } +} \ No newline at end of file diff --git a/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.cs b/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.cs new file mode 100644 index 0000000..3f22c4d --- /dev/null +++ b/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.cs @@ -0,0 +1,233 @@ +using AllBase; +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.Tasks; +using System.Windows.Forms; +using TemuKJD.BaseForms; +using TemuKJD.Extension; +using Work; + +namespace TemuKJD.KJDForms.AdminForms +{ + public partial class AdminCardCodeForm : Form + { + public List lstCardCodeInfo = new List(); + public AdminCardCodeForm() + { + InitializeComponent(); + } + + private void AdminCardCodeForm_Load(object sender, EventArgs e) + { + this.dgvCardCode.AddSelectorColumn("colSelect"); + } + + bool firstLoad = true; + private void AdminCardCodeForm_VisibleChanged(object sender, EventArgs e) + { + if (this.Visible == true && firstLoad) + { + firstLoad = false; + this.pbLoading.Visible = true; + SearchCardCode(this.ucSplitPage1.CurrentPage); + } + } + private void btnSearch_Click(object sender, EventArgs e) + { + if (this.ucSplitPage1.CurrentPage != 1) + this.ucSplitPage1.CurrentPage = 1; + else + SearchCardCode(1); + } + + public void SearchCardCode(int page) + { + List IdList = GetCheckedIdList(); + if (InvokeRequired) + { + Invoke(new Action(() => + { + this.pbLoading.Visible = true; + this.dgvCardCode.Rows.Clear(); + lstCardCodeInfo.Clear(); + })); + } + else + { + this.pbLoading.Visible = true; + this.dgvCardCode.Rows.Clear(); + lstCardCodeInfo.Clear(); + } + Task.Run(() => + { + int pageCount; + var list = GetJitCardCodeLst(out pageCount, page); + lstCardCodeInfo.AddRange(list); + this.ucSplitPage1.TotalPage = pageCount; + + foreach (var cardCode in lstCardCodeInfo) + { + Invoke(new Action(() => + { + int rowIndex = this.dgvCardCode.Rows.Add( + IdList.Contains(cardCode.id.ToString()), + cardCode.id, + cardCode.card_code_id, + cardCode.add_time, + cardCode.active_time, + cardCode.expire_time, + cardCode.shop_id, + cardCode.shop_account, + cardCode.notes, + "编辑", + "删除"); + })); + } + + Invoke(new Action(() => + { + this.pbLoading.Visible = false; + })); + }); + } + + public List GetJitCardCodeLst(out int pageCount, int page = 1, int pageSize = 50) + { + return GetJitCardCodeLst(out pageCount, txtCardCode.Text.Trim(), txtNotes.Text.Trim(), + txtShopId.Text.Trim(), txtShopName.Text.Trim(), page, pageSize); + } + + public List GetJitCardCodeLst(out int pageCount, string search_card_code, string search_notes, + string search_shop_id, string search_shop_name, int page = 1, int pageSize = 50) + { + List list = new List(); + pageCount = 1; + + var url = BaseClass.BuildObjString("shop/get_shop_card_code_list"); + var data = UserLogin.GetSignaturex() + + "&page=" + page + + "&page_size=" + pageSize + + "&search_card_code_id=" + search_card_code + + "&search_notes=" + search_notes + + "&search_shop_id=" + search_shop_id + + "&search_shop_name=" + search_shop_name; + 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")) + { + return list; + } + + int count = BaseRegex.GetIntJson(ref html, "count"); + pageCount = Math.Ceiling(1.0 * count / pageSize).ParseToInt(); + pageCount = Math.Max(pageCount, 1); + + JObject jObj = JObject.Parse(html); + return JsonHelper.DeserializeJsonToList(jObj["data"].ToString()); + } + + List GetCheckedIdList() + { + List idList = new List(); + for (int i = 0; i < dgvCardCode.Rows.Count; i++) + { + if (dgvCardCode.Rows[i].Cells["colSelect"].Value.ParseToBool()) + { + string id = dgvCardCode.Rows[i].Cells["colId"].Value.ParseToString(); + idList.Add(id); + } + } + return idList; + } + + private void pnlEmpty_Click(object sender, EventArgs e) + { + txtCardCode.Text = txtShopId.Text = txtNotes.Text = txtShopName.Text = ""; + } + + private void btnCreate_Click(object sender, EventArgs e) + { + StringBuilder data = new StringBuilder(); + data.Append(UserLogin.GetSignaturex()); + data.Append("&create_count=" + txtCreateCount.Text.Trim()); + string url = BaseClass.BuildObjString("shop/create_shop_card_code"); + string html = GetHtml.PostUtf8(url, data.ToString()).Trim(); + if (string.IsNullOrEmpty(html)) + { + BaseMsgForm.ShowError("未知错误,请重试!", "错误"); + return; + } + if (html.Contains("\"code\":200")) + { + BaseMsgForm.ShowInfo("生成成功!"); + SearchCardCode(this.ucSplitPage1.CurrentPage); + } + else + { + var msg = BaseRegex.GetStringJson(ref html, "msg"); + if (string.IsNullOrEmpty(msg)) + msg = html; + BaseMsgForm.ShowError(msg, "错误"); + } + } + + private void dgvCardCode_CellContentClick(object sender, DataGridViewCellEventArgs e) + { + if (e.ColumnIndex < 0 || e.RowIndex < 0) + return; + string headerText = dgvCardCode.Columns[e.ColumnIndex].HeaderText; + string dbId = dgvCardCode.Rows[e.RowIndex].Cells["colId"].Value.ParseToString(); + string shopId = dgvCardCode.Rows[e.RowIndex].Cells["colShopId"].Value.ParseToString(); + + switch (headerText) + { + case "删除": + DelCardCode(dbId); + break; + case "": + dgvCardCode.Rows[e.RowIndex].Cells["colSelect"].Value = !(bool)dgvCardCode.Rows[e.RowIndex].Cells["colSelect"].Value; + break; + default: + break; + } + } + + private void ucSplitPage1_PageChange(object obj) + { + SearchCardCode(this.ucSplitPage1.CurrentPage); + } + + private void btnBatchDel_Click(object sender, EventArgs e) + { + var idLst = this.dgvCardCode.Rows.Cast().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true).Select(r => r.Cells["colId"].Value.ParseToString()); + string ids = string.Join(",", idLst); + DelCardCode(ids); + } + + void DelCardCode(string ids) + { + var url = BaseClass.BuildObjString("shop/del_shop_card_code"); + var data = UserLogin.GetSignaturex(); + data += "&del_ids=" + ids; + var result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200")) + { + BaseMsgForm.ShowError("删除失败:" + BaseRegex.GetStringJson(ref result, "msg")); + } + else + { + BaseMsgForm.ShowInfo("删除成功!"); + SearchCardCode(this.ucSplitPage1.CurrentPage); + } + } + } +} diff --git a/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.resx b/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.resx new file mode 100644 index 0000000..8f6dea0 --- /dev/null +++ b/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/TEMUKJD/KJDForms/AdminForms/AdminForm.Designer.cs b/TEMUKJD/KJDForms/AdminForms/AdminForm.Designer.cs index 85de1d6..17c66c8 100644 --- a/TEMUKJD/KJDForms/AdminForms/AdminForm.Designer.cs +++ b/TEMUKJD/KJDForms/AdminForms/AdminForm.Designer.cs @@ -36,8 +36,9 @@ 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("加入发货台"); - System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("开通Jit"); - System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("超级权限管理", new System.Windows.Forms.TreeNode[] { + System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("JIT卡密管理"); + System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("开通JIT"); + System.Windows.Forms.TreeNode treeNode11 = new System.Windows.Forms.TreeNode("超级权限管理", new System.Windows.Forms.TreeNode[] { treeNode1, treeNode2, treeNode3, @@ -46,7 +47,8 @@ treeNode6, treeNode7, treeNode8, - treeNode9}); + treeNode9, + treeNode10}); this.panel1 = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel(); @@ -153,12 +155,14 @@ treeNode7.Text = "商品核价"; treeNode8.Name = "加入发货台"; treeNode8.Text = "加入发货台"; - treeNode9.Name = "开通Jit"; - treeNode9.Text = "开通Jit"; - treeNode10.Name = "超级权限管理"; - treeNode10.Text = "超级权限管理"; + treeNode9.Name = "JIT卡密管理"; + treeNode9.Text = "JIT卡密管理"; + treeNode10.Name = "开通JIT"; + treeNode10.Text = "开通JIT"; + treeNode11.Name = "超级权限管理"; + treeNode11.Text = "超级权限管理"; this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { - treeNode10}); + treeNode11}); 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 a181beb..22ce179 100644 --- a/TEMUKJD/KJDForms/AdminForms/AdminForm.cs +++ b/TEMUKJD/KJDForms/AdminForms/AdminForm.cs @@ -28,6 +28,7 @@ namespace TemuKJD.KJDForms.AdminForms public Lazy adminProductPriceCheckForm = new Lazy(); public Lazy joinDeliveryFrom = new Lazy(); public Lazy jitForm = new Lazy(); + public Lazy adminCardCodeFrom = new Lazy(); public AdminForm() { @@ -39,7 +40,7 @@ namespace TemuKJD.KJDForms.AdminForms tv.ExpandGroup(tv.Nodes[0].Name); List hideName = new List() { "超级用户管理", "超级店铺管理", "选品数据库", "选品加价管理", "认领待上传", "库存上传", "商品核价", - "加入发货台", "开通Jit" }; + "加入发货台", "开通JIT", "JIT卡密管理" }; if (BaseClass.GroupId == 3) { @@ -54,7 +55,8 @@ namespace TemuKJD.KJDForms.AdminForms hideName.Remove("库存上传"); hideName.Remove("商品核价"); hideName.Remove("加入发货台"); - hideName.Remove("开通Jit"); + //hideName.Remove("JIT卡密管理"); + hideName.Remove("开通JIT"); } if (BaseClass.SaLevel==2) { @@ -63,7 +65,7 @@ namespace TemuKJD.KJDForms.AdminForms hideName.Remove("库存上传"); hideName.Remove("商品核价"); hideName.Remove("加入发货台"); - hideName.Remove("开通Jit"); + hideName.Remove("开通JIT"); } } @@ -115,10 +117,13 @@ namespace TemuKJD.KJDForms.AdminForms joinDeliveryFrom.Value.IsAdmin = true; SetForm(joinDeliveryFrom.Value); break; - case "开通Jit": + case "开通JIT": jitForm.Value.IsAdmin = true; SetForm(jitForm.Value); break; + case "JIT卡密管理": + SetForm(adminCardCodeFrom.Value); + break; } })); }).Start(); diff --git a/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.Designer.cs b/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.Designer.cs index 5d31652..464c5ae 100644 --- a/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.Designer.cs +++ b/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.Designer.cs @@ -41,6 +41,8 @@ namespace TemuKJD.KJDForms.AdminForms System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); + this.numSleep = new System.Windows.Forms.NumericUpDown(); + this.lblSleep = new System.Windows.Forms.Label(); this.btnRestoreFilterParams = new DevComponents.DotNetBar.PanelEx(); this.btnSaveFilterParams = new DevComponents.DotNetBar.PanelEx(); this.txtPrice2 = new System.Windows.Forms.TextBox(); @@ -68,7 +70,6 @@ namespace TemuKJD.KJDForms.AdminForms this.numHeight1 = new System.Windows.Forms.NumericUpDown(); this.numWidth1 = new System.Windows.Forms.NumericUpDown(); this.btnMutliOk = new DevComponents.DotNetBar.PanelEx(); - this.chkSearchTime = new TemuKJD.UserComponent.UcCheckBox(this.components); this.dtpEndTime = new System.Windows.Forms.DateTimePicker(); this.numLen2 = new System.Windows.Forms.NumericUpDown(); this.dtpStartTime = new System.Windows.Forms.DateTimePicker(); @@ -104,6 +105,7 @@ namespace TemuKJD.KJDForms.AdminForms this.label11 = new System.Windows.Forms.Label(); this.chkSearchAllShop = new TemuKJD.UserComponent.UcCheckBox(this.components); this.chkFilterSize = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.chkSearchTime = new TemuKJD.UserComponent.UcCheckBox(this.components); this.splitContainer3 = new System.Windows.Forms.SplitContainer(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.pbShopLoading = new System.Windows.Forms.PictureBox(); @@ -154,6 +156,7 @@ namespace TemuKJD.KJDForms.AdminForms this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.ucGroupBoxEx1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numSleep)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvExtCode)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numJudgeWeight)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numJudgeLen)).BeginInit(); @@ -212,6 +215,8 @@ namespace TemuKJD.KJDForms.AdminForms | System.Windows.Forms.AnchorStyles.Right))); 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.numSleep); + this.ucGroupBoxEx1.Controls.Add(this.lblSleep); this.ucGroupBoxEx1.Controls.Add(this.btnRestoreFilterParams); this.ucGroupBoxEx1.Controls.Add(this.btnSaveFilterParams); this.ucGroupBoxEx1.Controls.Add(this.txtPrice2); @@ -274,6 +279,35 @@ namespace TemuKJD.KJDForms.AdminForms this.ucGroupBoxEx1.TabStop = false; this.ucGroupBoxEx1.Text = "参数设置"; // + // numSleep + // + this.numSleep.DecimalPlaces = 2; + this.numSleep.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + this.numSleep.Location = new System.Drawing.Point(1409, 108); + this.numSleep.Name = "numSleep"; + this.numSleep.Size = new System.Drawing.Size(44, 23); + this.numSleep.TabIndex = 1077; + this.numSleep.Value = new decimal(new int[] { + 3, + 0, + 0, + 65536}); + this.numSleep.ValueChanged += new System.EventHandler(this.numSleep_ValueChanged); + // + // lblSleep + // + this.lblSleep.AutoSize = true; + this.lblSleep.Location = new System.Drawing.Point(1361, 111); + this.lblSleep.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); + this.lblSleep.Name = "lblSleep"; + this.lblSleep.Size = new System.Drawing.Size(52, 17); + this.lblSleep.TabIndex = 1078; + this.lblSleep.Text = "休眠(秒)"; + // // btnRestoreFilterParams // this.btnRestoreFilterParams.CanvasColor = System.Drawing.SystemColors.Control; @@ -372,6 +406,7 @@ namespace TemuKJD.KJDForms.AdminForms this.cmbSymbol.Name = "cmbSymbol"; this.cmbSymbol.Size = new System.Drawing.Size(50, 23); this.cmbSymbol.TabIndex = 1023; + this.cmbSymbol.Text = "≥"; this.cmbSymbol.TextChanged += new System.EventHandler(this.cmbSymbol_TextChanged); // // label13 @@ -714,18 +749,6 @@ namespace TemuKJD.KJDForms.AdminForms this.btnMutliOk.Text = "批量同意报价"; this.btnMutliOk.Click += new System.EventHandler(this.btnMutliOk_Click); // - // chkSearchTime - // - this.chkSearchTime.AutoSize = true; - this.chkSearchTime.Checked = true; - this.chkSearchTime.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkSearchTime.Location = new System.Drawing.Point(280, 63); - this.chkSearchTime.Name = "chkSearchTime"; - this.chkSearchTime.Size = new System.Drawing.Size(63, 21); - this.chkSearchTime.TabIndex = 827; - this.chkSearchTime.Text = "日期:"; - this.chkSearchTime.UseVisualStyleBackColor = true; - // // dtpEndTime // this.dtpEndTime.Location = new System.Drawing.Point(326, 86); @@ -1008,20 +1031,20 @@ namespace TemuKJD.KJDForms.AdminForms // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(29, 17); + this.label2.Location = new System.Drawing.Point(27, 17); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(55, 17); + this.label2.Size = new System.Drawing.Size(57, 17); this.label2.TabIndex = 379; - this.label2.Text = "店铺id:"; + this.label2.Text = "店铺ID:"; // // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(28, 41); + this.label3.Location = new System.Drawing.Point(16, 41); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(56, 17); + this.label3.Size = new System.Drawing.Size(68, 17); this.label3.TabIndex = 381; - this.label3.Text = "店铺名:"; + this.label3.Text = "店铺名称:"; // // label7 // @@ -1179,6 +1202,18 @@ namespace TemuKJD.KJDForms.AdminForms this.chkFilterSize.UseVisualStyleBackColor = true; this.chkFilterSize.CheckedChanged += new System.EventHandler(this.chkFilterSize_CheckedChanged); // + // chkSearchTime + // + this.chkSearchTime.AutoSize = true; + this.chkSearchTime.Checked = true; + this.chkSearchTime.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkSearchTime.Location = new System.Drawing.Point(280, 63); + this.chkSearchTime.Name = "chkSearchTime"; + this.chkSearchTime.Size = new System.Drawing.Size(63, 21); + this.chkSearchTime.TabIndex = 827; + this.chkSearchTime.Text = "日期:"; + this.chkSearchTime.UseVisualStyleBackColor = true; + // // splitContainer3 // this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; @@ -1750,6 +1785,7 @@ namespace TemuKJD.KJDForms.AdminForms this.splitContainer1.ResumeLayout(false); this.ucGroupBoxEx1.ResumeLayout(false); this.ucGroupBoxEx1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numSleep)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvExtCode)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numJudgeWeight)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numJudgeLen)).EndInit(); @@ -1897,5 +1933,7 @@ namespace TemuKJD.KJDForms.AdminForms private System.Windows.Forms.DataGridViewTextBoxColumn colFilterExtCode; private System.Windows.Forms.DataGridViewTextBoxColumn colFilterRule; private UserComponent.UcCheckBox chkFilterSize; + private System.Windows.Forms.NumericUpDown numSleep; + private System.Windows.Forms.Label lblSleep; } } \ No newline at end of file diff --git a/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.cs b/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.cs index 8c3c7bf..9145487 100644 --- a/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.cs +++ b/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.cs @@ -236,10 +236,26 @@ namespace TemuKJD.KJDForms.AdminForms case "登录": case "状态": { - AdminShopLoginForm shopLoginForm = new AdminShopLoginForm(shop); - shopLoginForm.openType = EnumOpenType.login; - shopLoginForm.SaveComplete += shopLoginForm_SaveComplete; - shopLoginForm.ShowDialog(); + //AdminShopLoginForm shopLoginForm = new AdminShopLoginForm(shop); + //shopLoginForm.openType = EnumOpenType.login; + //shopLoginForm.SaveComplete += shopLoginForm_SaveComplete; + //shopLoginForm.ShowDialog(); + AdminShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false); + if (shop.LoginStatus2 == "国际版在线") + { + AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop); + adminLoginForm.openType = EnumOpenType.manage; + adminLoginForm.WindowState = FormWindowState.Maximized; + adminLoginForm.InitUrl = "https://agentseller.temu.com"; + adminLoginForm.Show(); + } + else + { + AdminShopLoginForm shopLoginForm = new AdminShopLoginForm(shop); + shopLoginForm.openType = EnumOpenType.login; + shopLoginForm.SaveComplete += shopLoginForm_SaveComplete; + shopLoginForm.ShowDialog(); + } } break; default: @@ -603,6 +619,7 @@ namespace TemuKJD.KJDForms.AdminForms endTime = BaseClass.DateTimeToTimestampMilliseconds(dtpEndTime.Value.Date.AddDays(1).AddMilliseconds(-1)); } var searchRst = this.SearchForChainSupplier(shop, page, txtSkcId.Text.Trim().Trim(','), type, startTime, endTime); + commonSleep(); if (searchRst.Contains("登录过期") || searchRst.Contains("Invalid Login State")) { AdminShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false); @@ -725,7 +742,7 @@ namespace TemuKJD.KJDForms.AdminForms skuName, reviewExtCode, extCodePrice?.original_price / 100m, //extCodePrice == null ? "-" : (extCodePrice.original_price / 100m).ParseToString(), - reviewInfo.supplyPrice / 100m, //reviewInfo.productSkuList.FirstOrDefault()?.supplierPrice, //priceInfo.supplierPrice // sku不同价的会被分成多个review,priceInfo此时为价格范围 + reviewInfo.productSkuList.FirstOrDefault()?.supplierPriceValue / 100m, //reviewInfo.supplyPrice / 100m,(这个数值temu接口返回的是错的,改价不会改变) //priceInfo.supplierPrice // sku不同价的会被分成多个review,priceInfo此时为价格范围 reviewInfo.suggestSupplyPrice / 100m, //suggestSupplyPrice.ParseToDecimal(),//核价 //reviewInfo.suggestSupplyPrice == null ? "-" : reviewInfo.suggestSupplyPrice.ParseToString(), "", //新报价 reviewInfo.times, // 修改报价次数 @@ -787,6 +804,19 @@ namespace TemuKJD.KJDForms.AdminForms ext, filterConfig == null ? "" : GetConfigDesStr(filterConfig.Symbol, filterConfig.Price1, filterConfig.Price2) ); + var row = dgvExtCode.Rows[pos]; + if ((filterConfig?.Symbol).ParseToString().StartsWith("≥")) + { + row.Cells["colFilterRule"].Style.ForeColor = Color.Green; + } + else if ((filterConfig?.Symbol).ParseToString().StartsWith("≤")) + { + row.Cells["colFilterRule"].Style.ForeColor = Color.Red; + } + else + { + row.Cells["colFilterRule"].Style.ForeColor = Color.Black; + } } this.pbLoading.Visible = false; string sRst = type + " 查询结束!"; @@ -1032,6 +1062,7 @@ namespace TemuKJD.KJDForms.AdminForms html = editPriceProductName(shop, item.ParseToString(), price.productId.ParseToString(), newPName); Thread.Sleep(Randomx.GetId(25, 75)); + commonSleep(); if (html.Contains("\"success\":true")) { Invoke(new Action(() => @@ -1103,6 +1134,7 @@ namespace TemuKJD.KJDForms.AdminForms continue; this.rePrice(shop, orderId, row); + commonSleep(); } Invoke(new Action(() => @@ -1134,6 +1166,7 @@ namespace TemuKJD.KJDForms.AdminForms continue; this.applyHighPrice(shop, orderId, row); + commonSleep(); } Invoke(new Action(() => @@ -1165,6 +1198,7 @@ namespace TemuKJD.KJDForms.AdminForms continue; this.cancelLowPrice(shop, orderId, row); + commonSleep(); } Invoke(new Action(() => @@ -1238,6 +1272,7 @@ namespace TemuKJD.KJDForms.AdminForms continue; this.cancelTitleWrongPrice(shop, prodId); + commonSleep(); } Invoke(new Action(() => @@ -1630,6 +1665,7 @@ namespace TemuKJD.KJDForms.AdminForms html = editPriceProductSizeAndNumber(shop, taskUid.ParseToString(), price.productId.ParseToString(), jStr); Thread.Sleep(Randomx.GetId(25, 75)); + commonSleep(); if (html.Contains("\"success\":true")) { Invoke(new Action(() => @@ -1837,7 +1873,7 @@ namespace TemuKJD.KJDForms.AdminForms var priceParam = new PriceCheckFilterConfig() { ExtCode = extCode, - Symbol = cmbSymbol.Text, + Symbol = cmbSymbol.Text.Trim().IsNullOrEmpty() ? "≥" : cmbSymbol.Text.Trim(), Price1 = txtPrice1.Text.Trim().ParseToDecimal(), Price2 = txtPrice2.Text.Trim().ParseToDecimal(), }; @@ -1847,7 +1883,21 @@ namespace TemuKJD.KJDForms.AdminForms BaseMsgForm.ShowInfo("选中货号的价格过滤配置已保存!"); foreach (var row in rows) { - row.Cells["colFilterRule"].Value = GetConfigDesStr(cmbSymbol.Text.Trim(), txtPrice1.Text.Trim().ParseToDecimal(), txtPrice2.Text.Trim().ParseToDecimal()); + var ext = row.Cells["colFilterExtCode"].Value.ParseToString(); + var filterConfig = lstPriceCheckFilterConfig.FirstOrDefault(c => c.ExtCode == ext); + row.Cells["colFilterRule"].Value = filterConfig == null ? null : GetConfigDesStr(filterConfig.Symbol, filterConfig.Price1, filterConfig.Price2); + if ((filterConfig?.Symbol).ParseToString().StartsWith("≥")) + { + row.Cells["colFilterRule"].Style.ForeColor = Color.Green; + } + else if ((filterConfig?.Symbol).ParseToString().StartsWith("≤")) + { + row.Cells["colFilterRule"].Style.ForeColor = Color.Red; + } + else + { + row.Cells["colFilterRule"].Style.ForeColor = Color.Black; + } } FilterRows(); @@ -1911,6 +1961,17 @@ namespace TemuKJD.KJDForms.AdminForms { FilterRows(); } + + public static int sleepTime = 100; + void commonSleep() + { + Thread.Sleep(sleepTime); + } + + private void numSleep_ValueChanged(object sender, EventArgs e) + { + sleepTime = (this.numSleep.Value * 1000).ParseToInt(); + } } public class PriceCheckConfig diff --git a/TEMUKJD/KJDForms/AdminForms/AdminShopListForm.cs b/TEMUKJD/KJDForms/AdminForms/AdminShopListForm.cs index 0d58c9f..4ae4fde 100644 --- a/TEMUKJD/KJDForms/AdminForms/AdminShopListForm.cs +++ b/TEMUKJD/KJDForms/AdminForms/AdminShopListForm.cs @@ -50,7 +50,6 @@ namespace TemuKJD.KJDForms.AdminForms this.dgvShop.AddMergeColumn(new List() { /*"colMinus",*/ "colProductRemaining", "colPlus" }); this.dgvShop.Columns["colMinus"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; this.dgvShop.Columns["colPlus"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; - this.dgvShop.Columns["colPlus"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; if (BaseClass.SaLevel != 1) diff --git a/TEMUKJD/KJDForms/JITForms/JITForm.Designer.cs b/TEMUKJD/KJDForms/JITForms/JITForm.Designer.cs new file mode 100644 index 0000000..6594038 --- /dev/null +++ b/TEMUKJD/KJDForms/JITForms/JITForm.Designer.cs @@ -0,0 +1,181 @@ + +namespace TemuKJD.KJDForms.JITForms +{ + partial class JITForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("JIT卡密激活"); + System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("JIT商品选品"); + System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("JIT商品上传"); + System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("JIT商品核价"); + System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("开通JIT"); + System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("JIT", new System.Windows.Forms.TreeNode[] { + treeNode1, + treeNode2, + treeNode3, + treeNode4, + treeNode5}); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.tv = new TemuKJD.UserComponent.UcTreeView(); + this.panel1 = new System.Windows.Forms.Panel(); + this.panel3 = new System.Windows.Forms.Panel(); + this.panel2 = new System.Windows.Forms.Panel(); + this.lblName = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + 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"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.tv); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.panel1); + this.splitContainer1.Size = new System.Drawing.Size(800, 450); + this.splitContainer1.SplitterDistance = 140; + this.splitContainer1.SplitterWidth = 1; + this.splitContainer1.TabIndex = 9; + // + // tv + // + this.tv.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(251)))), ((int)(((byte)(251))))); + this.tv.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.tv.ChildNodeSelectedBgColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.tv.Cursor = System.Windows.Forms.Cursors.Hand; + this.tv.Dock = System.Windows.Forms.DockStyle.Fill; + this.tv.DrawMode = System.Windows.Forms.TreeViewDrawMode.OwnerDrawAll; + this.tv.ExpandButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.tv.FullRowSelect = true; + this.tv.GroupBgColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249))))); + this.tv.GroupFont = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.tv.GroupTitleColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))); + this.tv.HideCollapsedGroup = false; + this.tv.ItemHeight = 32; + this.tv.Location = new System.Drawing.Point(0, 0); + this.tv.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.tv.Name = "tv"; + treeNode1.Name = "JIT卡密激活"; + treeNode1.Text = "JIT卡密激活"; + treeNode2.Name = "JIT商品选品"; + treeNode2.Text = "JIT商品选品"; + treeNode3.Name = "JIT商品上传"; + treeNode3.Text = "JIT商品上传"; + treeNode4.Name = "JIT商品核价"; + treeNode4.Text = "JIT商品核价"; + treeNode5.Name = "开通JIT"; + treeNode5.Text = "开通JIT"; + treeNode6.Name = "JIT"; + treeNode6.Text = "JIT"; + this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { + treeNode6}); + this.tv.OverForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.tv.Size = new System.Drawing.Size(140, 450); + this.tv.TabIndex = 4; + this.tv.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tv_AfterSelect); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.White; + this.panel1.Controls.Add(this.panel3); + this.panel1.Controls.Add(this.panel2); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(659, 450); + this.panel1.TabIndex = 5; + // + // panel3 + // + this.panel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel3.Location = new System.Drawing.Point(0, 28); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(659, 422); + this.panel3.TabIndex = 1; + // + // panel2 + // + this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(244)))), ((int)(((byte)(244))))); + this.panel2.Controls.Add(this.lblName); + this.panel2.Dock = System.Windows.Forms.DockStyle.Top; + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(659, 28); + this.panel2.TabIndex = 0; + // + // lblName + // + this.lblName.AutoSize = true; + this.lblName.Location = new System.Drawing.Point(5, 6); + this.lblName.Name = "lblName"; + this.lblName.Size = new System.Drawing.Size(57, 17); + this.lblName.TabIndex = 0; + this.lblName.Text = "lblName"; + // + // JITForm + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.splitContainer1); + this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Name = "JITForm"; + this.Text = "JITForm"; + this.Load += new System.EventHandler(this.JITForm_Load); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.panel1.ResumeLayout(false); + this.panel2.ResumeLayout(false); + this.panel2.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer1; + private UserComponent.UcTreeView tv; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Label lblName; + } +} \ No newline at end of file diff --git a/TEMUKJD/KJDForms/JITForms/JITForm.cs b/TEMUKJD/KJDForms/JITForms/JITForm.cs new file mode 100644 index 0000000..4a766d5 --- /dev/null +++ b/TEMUKJD/KJDForms/JITForms/JITForm.cs @@ -0,0 +1,129 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using TemuKJD.BaseForms; +using TemuKJD.KJDForms.AdminForms; +using TemuKJD.KJDForms.ProductForms; +using TemuKJD.KJDForms.ProductSelectForms; + +namespace TemuKJD.KJDForms.JITForms +{ + public partial class JITForm : BaseForm + { + public Lazy jitShopActiveForm = new Lazy(); // jit卡密激活 + public Lazy dbProductListForm = new Lazy(); // jit选品库 + public Lazy dDbProductSelectListManageForm = new Lazy(); // jit商品上传 + public Lazy productPriceCheckForm = new Lazy(); // jit商品核价 + public Lazy temuJitForm = new Lazy(); + public JITForm() + { + InitializeComponent(); + + try + { + tv.SelectedNode = tv.Nodes[0].Nodes[0]; + tv.ExpandGroup(tv.Nodes[0].Name); + + List hideName = new List() { "请在列表中填写要隐藏的Tab页面" }; + + foreach (var item in hideName) + { + var n = tv.Nodes[0].Nodes.Find(item, true); + if (n.Count() > 0) + n[0].Remove(); + } + } + catch { } + } + + private void tv_AfterSelect(object sender, TreeViewEventArgs e) + { + MainForm.sCurrentModule = e.Node.Name; + this.lblName.Text = e.Node.Text; + // 如果是一级菜单,不做任何动作 + if (e.Node.Parent == null) return; + switch (e.Node.Name) + { + case "JIT卡密激活": + SetForm(jitShopActiveForm.Value); + break; + case "JIT商品选品": + SetForm(dbProductListForm.Value); + break; + case "JIT商品上传": + SetForm(dDbProductSelectListManageForm.Value); + break; + case "JIT商品核价": + SetForm(productPriceCheckForm.Value); + break; + case "开通JIT": + SetForm(temuJitForm.Value); + break; + } + } + + /// + /// 显示隐藏层 + /// + /// + private void SetForm(Form f) + { + if (f == null) + { + foreach (Control form in panel3.Controls) + { + form.Visible = false; + if (form is Form) + { + panel3.Controls.Remove(form as Form); + } + } + return; + } + + bool had = false; + string sCurrentFormName = f.Name; + for (int i = 0; i < panel3.Controls.Count; i++) + { + if (sCurrentFormName == panel3.Controls[i].Name) + { + had = true; + panel3.Controls[i].Visible = true; + } + else + { + panel3.Controls[i].Visible = false; + } + } + if (had) + { + f = null; + return; + } + f.TopLevel = false; + f.Left = 0; + f.Top = 0; + f.FormBorderStyle = FormBorderStyle.None; + panel3.Controls.Add(f); + f.AutoSize = true; + f.Dock = DockStyle.Fill; + f.Show(); + } + + private void JITForm_Load(object sender, EventArgs e) + { + try + { + tv.SelectedNode = tv.Nodes[0].Nodes[0]; + tv.ExpandGroup(tv.Nodes[0].Name); + } + catch { } + } + } +} diff --git a/TEMUKJD/KJDForms/JITForms/JITForm.resx b/TEMUKJD/KJDForms/JITForms/JITForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/TEMUKJD/KJDForms/JITForms/JITForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/TEMUKJD/KJDForms/JITForms/JitShopActiveForm.Designer.cs b/TEMUKJD/KJDForms/JITForms/JitShopActiveForm.Designer.cs new file mode 100644 index 0000000..1beb593 --- /dev/null +++ b/TEMUKJD/KJDForms/JITForms/JitShopActiveForm.Designer.cs @@ -0,0 +1,40 @@ + +namespace TemuKJD.KJDForms.JITForms +{ + partial class JitShopActiveForm + { + /// + /// 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(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "JitShopActiveForm"; + } + + #endregion + } +} \ No newline at end of file diff --git a/TEMUKJD/KJDForms/JITForms/JitShopActiveForm.cs b/TEMUKJD/KJDForms/JITForms/JitShopActiveForm.cs new file mode 100644 index 0000000..5a3b4df --- /dev/null +++ b/TEMUKJD/KJDForms/JITForms/JitShopActiveForm.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace TemuKJD.KJDForms.JITForms +{ + public partial class JitShopActiveForm : Form + { + public JitShopActiveForm() + { + InitializeComponent(); + } + } +} diff --git a/TEMUKJD/KJDForms/ProductForms/ProductForm.Designer.cs b/TEMUKJD/KJDForms/ProductForms/ProductForm.Designer.cs index 9ef5959..ea5606f 100644 --- a/TEMUKJD/KJDForms/ProductForms/ProductForm.Designer.cs +++ b/TEMUKJD/KJDForms/ProductForms/ProductForm.Designer.cs @@ -33,11 +33,10 @@ 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("开通Jit"); - System.Windows.Forms.TreeNode treeNode7 = 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("库存上传"); - System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("商品管理", 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("库存上传"); + System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("商品管理", new System.Windows.Forms.TreeNode[] { treeNode1, treeNode2, treeNode3, @@ -45,8 +44,7 @@ treeNode5, treeNode6, treeNode7, - treeNode8, - treeNode9}); + treeNode8}); this.panel1 = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel(); @@ -147,18 +145,16 @@ treeNode4.Text = "推广直通车"; treeNode5.Name = "加入发货台"; treeNode5.Text = "加入发货台"; - treeNode6.Name = "开通Jit"; - treeNode6.Text = "开通Jit"; - treeNode7.Name = "设置进货价"; - treeNode7.Text = "设置进货价"; - treeNode8.Name = "商品认领"; - treeNode8.Text = "商品认领"; - treeNode9.Name = "库存上传"; - treeNode9.Text = "库存上传"; - treeNode10.Name = "商品管理"; - treeNode10.Text = "商品管理"; + treeNode6.Name = "设置进货价"; + treeNode6.Text = "设置进货价"; + treeNode7.Name = "商品认领"; + treeNode7.Text = "商品认领"; + treeNode8.Name = "库存上传"; + treeNode8.Text = "库存上传"; + treeNode9.Name = "商品管理"; + treeNode9.Text = "商品管理"; this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { - treeNode10}); + 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, 521); this.tv.TabIndex = 1; diff --git a/TEMUKJD/KJDForms/ProductForms/ProductForm.cs b/TEMUKJD/KJDForms/ProductForms/ProductForm.cs index a786acc..a2c9fc0 100644 --- a/TEMUKJD/KJDForms/ProductForms/ProductForm.cs +++ b/TEMUKJD/KJDForms/ProductForms/ProductForm.cs @@ -28,7 +28,6 @@ namespace TemuKJD.KJDForms.ProductForms public Lazy purchasePriceForm = new Lazy(); public Lazy temuAdsForm = new Lazy(); public Lazy joinDeliveryFrom = new Lazy(); - public Lazy temuJitForm = new Lazy(); public ProductForm() { @@ -98,9 +97,6 @@ namespace TemuKJD.KJDForms.ProductForms case "加入发货台": SetForm(joinDeliveryFrom.Value); break; - case "开通Jit": - SetForm(temuJitForm.Value); - break; case "设置进货价": SetForm(purchasePriceForm.Value); break; diff --git a/TEMUKJD/KJDForms/ProductSelectForms/DbProductEditNotesForm.Designer.cs b/TEMUKJD/KJDForms/ProductSelectForms/DbProductEditNotesForm.Designer.cs index 73e0493..24abe41 100644 --- a/TEMUKJD/KJDForms/ProductSelectForms/DbProductEditNotesForm.Designer.cs +++ b/TEMUKJD/KJDForms/ProductSelectForms/DbProductEditNotesForm.Designer.cs @@ -30,9 +30,10 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DbProductEditNotesForm)); this.panel2 = new System.Windows.Forms.Panel(); + this.label9 = new System.Windows.Forms.Label(); + this.txtGroup = new System.Windows.Forms.TextBox(); this.btnAuto = new DevComponents.DotNetBar.PanelEx(); this.pnlRestore = new DevComponents.DotNetBar.PanelEx(); - this.btnSkuAi = new TemuKJD.UserControls.ButtonEx(); this.label7 = new System.Windows.Forms.Label(); this.txtFissionWords = new DevComponents.DotNetBar.Controls.TextBoxX(); this.txtEndWords = new System.Windows.Forms.TextBox(); @@ -50,9 +51,10 @@ this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.label8 = new System.Windows.Forms.Label(); this.txtNotes = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.btnOk = new TemuKJD.UserControls.ButtonEx(); - this.txtGroup = new System.Windows.Forms.TextBox(); - this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.txtCostPrice = new System.Windows.Forms.TextBox(); + this.btnOk = new DevComponents.DotNetBar.PanelEx(); + this.btnSkuAi = new DevComponents.DotNetBar.PanelEx(); this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -60,11 +62,14 @@ // panel2 // this.panel2.BackColor = System.Drawing.Color.White; + this.panel2.Controls.Add(this.btnSkuAi); + this.panel2.Controls.Add(this.btnOk); + this.panel2.Controls.Add(this.txtCostPrice); + this.panel2.Controls.Add(this.label10); this.panel2.Controls.Add(this.label9); this.panel2.Controls.Add(this.txtGroup); this.panel2.Controls.Add(this.btnAuto); this.panel2.Controls.Add(this.pnlRestore); - this.panel2.Controls.Add(this.btnSkuAi); this.panel2.Controls.Add(this.label7); this.panel2.Controls.Add(this.txtFissionWords); this.panel2.Controls.Add(this.txtEndWords); @@ -82,13 +87,28 @@ this.panel2.Controls.Add(this.pictureBox1); this.panel2.Controls.Add(this.label8); this.panel2.Controls.Add(this.txtNotes); - this.panel2.Controls.Add(this.btnOk); this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; this.panel2.Location = new System.Drawing.Point(1, 33); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(464, 686); this.panel2.TabIndex = 1; // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(31, 333); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(56, 17); + this.label9.TabIndex = 447; + this.label9.Text = " 分组"; + // + // txtGroup + // + this.txtGroup.Location = new System.Drawing.Point(90, 330); + this.txtGroup.Name = "txtGroup"; + this.txtGroup.Size = new System.Drawing.Size(136, 23); + this.txtGroup.TabIndex = 446; + // // btnAuto // this.btnAuto.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -138,23 +158,6 @@ this.pnlRestore.Text = "还原"; this.pnlRestore.Click += new System.EventHandler(this.pnlRestore_Click); // - // btnSkuAi - // - this.btnSkuAi.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnSkuAi.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - this.btnSkuAi.Cursor = System.Windows.Forms.Cursors.Hand; - this.btnSkuAi.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnSkuAi.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnSkuAi.ForeColor = System.Drawing.Color.White; - this.btnSkuAi.Location = new System.Drawing.Point(90, 640); - this.btnSkuAi.Margin = new System.Windows.Forms.Padding(2); - this.btnSkuAi.Name = "btnSkuAi"; - this.btnSkuAi.Size = new System.Drawing.Size(77, 26); - this.btnSkuAi.TabIndex = 404; - this.btnSkuAi.Text = "SKU AI图"; - this.btnSkuAi.UseVisualStyleBackColor = false; - this.btnSkuAi.Click += new System.EventHandler(this.btnSkuAi_Click); - // // label7 // this.label7.AutoSize = true; @@ -256,7 +259,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.txtExtCode.Location = new System.Drawing.Point(90, 246); this.txtExtCode.Name = "txtExtCode"; - this.txtExtCode.Size = new System.Drawing.Size(337, 23); + this.txtExtCode.Size = new System.Drawing.Size(336, 23); this.txtExtCode.TabIndex = 394; // // label4 @@ -337,38 +340,71 @@ this.txtNotes.Size = new System.Drawing.Size(337, 47); this.txtNotes.TabIndex = 385; // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(233, 333); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(56, 17); + this.label10.TabIndex = 454; + this.label10.Text = " 成本价"; + // + // txtCostPrice + // + this.txtCostPrice.Location = new System.Drawing.Point(291, 330); + this.txtCostPrice.Name = "txtCostPrice"; + this.txtCostPrice.Size = new System.Drawing.Size(136, 23); + this.txtCostPrice.TabIndex = 455; + // // btnOk // - this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnOk.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnOk.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnOk.Cursor = System.Windows.Forms.Cursors.Hand; - this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnOk.DisabledBackColor = System.Drawing.Color.Empty; this.btnOk.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnOk.ForeColor = System.Drawing.Color.White; this.btnOk.Location = new System.Drawing.Point(372, 640); - this.btnOk.Margin = new System.Windows.Forms.Padding(2); this.btnOk.Name = "btnOk"; this.btnOk.Size = new System.Drawing.Size(55, 26); - this.btnOk.TabIndex = 372; + this.btnOk.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnOk.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnOk.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnOk.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnOk.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnOk.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnOk.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnOk.Style.GradientAngle = 90; + this.btnOk.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnOk.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnOk.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnOk.TabIndex = 459; this.btnOk.Text = "提交"; - this.btnOk.UseVisualStyleBackColor = false; this.btnOk.Click += new System.EventHandler(this.btnOk_Click); // - // txtGroup + // btnSkuAi // - this.txtGroup.Location = new System.Drawing.Point(90, 330); - this.txtGroup.Name = "txtGroup"; - this.txtGroup.Size = new System.Drawing.Size(337, 23); - this.txtGroup.TabIndex = 446; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(31, 333); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(56, 17); - this.label9.TabIndex = 447; - this.label9.Text = " 分组"; + this.btnSkuAi.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnSkuAi.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnSkuAi.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnSkuAi.DisabledBackColor = System.Drawing.Color.Empty; + this.btnSkuAi.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSkuAi.Location = new System.Drawing.Point(90, 640); + this.btnSkuAi.Name = "btnSkuAi"; + this.btnSkuAi.Size = new System.Drawing.Size(77, 26); + this.btnSkuAi.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnSkuAi.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSkuAi.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSkuAi.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnSkuAi.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnSkuAi.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnSkuAi.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnSkuAi.Style.GradientAngle = 90; + this.btnSkuAi.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnSkuAi.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnSkuAi.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnSkuAi.TabIndex = 463; + this.btnSkuAi.Text = "SKU AI图"; + this.btnSkuAi.Click += new System.EventHandler(this.btnSkuAi_Click); // // DbProductEditNotesForm // @@ -392,7 +428,6 @@ #endregion private System.Windows.Forms.Panel panel2; - private UserControls.ButtonEx btnOk; private System.Windows.Forms.Label label8; private DevComponents.DotNetBar.Controls.TextBoxX txtNotes; private System.Windows.Forms.Label label3; @@ -410,10 +445,13 @@ private System.Windows.Forms.Label label6; private System.Windows.Forms.TextBox txtHeadWords; private System.Windows.Forms.Label label5; - private UserControls.ButtonEx btnSkuAi; private DevComponents.DotNetBar.PanelEx pnlRestore; private DevComponents.DotNetBar.PanelEx btnAuto; private System.Windows.Forms.Label label9; private System.Windows.Forms.TextBox txtGroup; + private System.Windows.Forms.TextBox txtCostPrice; + private System.Windows.Forms.Label label10; + private DevComponents.DotNetBar.PanelEx btnSkuAi; + private DevComponents.DotNetBar.PanelEx btnOk; } } \ No newline at end of file diff --git a/TEMUKJD/KJDForms/ProductSelectForms/DbProductEditNotesForm.cs b/TEMUKJD/KJDForms/ProductSelectForms/DbProductEditNotesForm.cs index 09b71dc..c791ccd 100644 --- a/TEMUKJD/KJDForms/ProductSelectForms/DbProductEditNotesForm.cs +++ b/TEMUKJD/KJDForms/ProductSelectForms/DbProductEditNotesForm.cs @@ -13,6 +13,7 @@ using System.Windows.Forms; using AllBase; using Work; using TemuKJD.ToolForms; +using NaiBa.Util.Extension; namespace TemuKJD.KJDForms.ProductSelectForms { @@ -43,21 +44,31 @@ namespace TemuKJD.KJDForms.ProductSelectForms //this.txtEndWords.Text = string.IsNullOrWhiteSpace(dbProd.end_words) ? "适合不同的搭配风格" : dbProd.end_words; this.txtHeadWords.Text = dbProd.head_words; this.txtEndWords.Text = dbProd.end_words; + this.txtCostPrice.Text = dbProd.cost_price; } } private void btnOk_Click(object sender, EventArgs e) { + if (!string.IsNullOrEmpty(this.txtCostPrice.Text.Trim()) && this.txtCostPrice.Text.Trim().ParseToDecimal() == 0) + { + BaseMsgForm.ShowError("请输入正确的成本价,必须大于0,整数或者两位以内小数。"); + return; + } + //var url = BaseClass.BuildObjString("product/mdy_product_notes"); var url = BaseClass.BuildObjString("product/mdy_db_product"); var data = UserLogin.GetSignaturex() + "&db_id=" + dbProd.id + "¬es=" + this.txtNotes.Text.Trim(); data += "&group=" + this.txtGroup.Text.Trim(); data += "&product_name=" + this.txtProductName.Text.Trim(); + data += "&product_name=" + this.txtProductName.Text.Trim(); data += "&ext_code=" + this.txtExtCode.Text.Trim(); data += "&fission_words=" + this.txtFissionWords.Text.Trim(); data += "&head_words=" + this.txtHeadWords.Text.Trim(); data += "&end_words=" + this.txtEndWords.Text.Trim(); + if (!string.IsNullOrEmpty(this.txtCostPrice.Text.Trim())) + data += "&cost_price=" + this.txtCostPrice.Text.Trim(); var html = GetHtml.PostUtf8(url, data); if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) html = GetHtml.PostUtf8(url, data); diff --git a/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.Designer.cs b/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.Designer.cs index 47a8be3..bef30d9 100644 --- a/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.Designer.cs +++ b/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.Designer.cs @@ -38,6 +38,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DbProductListForm)); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.btnBatchSelect = new DevComponents.DotNetBar.PanelEx(); @@ -68,6 +69,12 @@ namespace TemuKJD.KJDForms.ProductSelectForms this.lblProdName = new System.Windows.Forms.Label(); this.numCount = new System.Windows.Forms.NumericUpDown(); this.dgvSelectShop = new TemuKJD.UserComponent.DataGridViewEx(); + this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.colUserName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colSubUserName = 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.btnCancel = new DevComponents.DotNetBar.PanelEx(); this.btnAddToSelectDb = new DevComponents.DotNetBar.PanelEx(); this.btnGetShop = new DevComponents.DotNetBar.PanelEx(); @@ -78,34 +85,29 @@ namespace TemuKJD.KJDForms.ProductSelectForms this.dgvDbProduct = new TemuKJD.UserComponent.DataGridViewEx(); this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.col_db_id = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.col_product_name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colMainImg = new System.Windows.Forms.DataGridViewImageColumn(); this.col_spu_id = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.col_skc_id = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colMainImg = new System.Windows.Forms.DataGridViewImageColumn(); + this.col_product_name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.col_cat_name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.col_ext_code = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colAddTimes = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colSelectTotalCount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colCostPrice = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colProdGetType = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.col_notes = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colGroup = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.col_notes = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colHeadWords = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colEndWords = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colFissionWords = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colAddTime = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colAddTimes = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colSelectTotalCount = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colSelectProd = new System.Windows.Forms.DataGridViewLinkColumn(); this.col_edit = new System.Windows.Forms.DataGridViewLinkColumn(); this.col_delete = new System.Windows.Forms.DataGridViewLinkColumn(); this.col_select_product = new System.Windows.Forms.DataGridViewLinkColumn(); this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage(); this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); - this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.colUserName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colSubUserName = 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(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -238,7 +240,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms // cmbGroup // this.cmbGroup.FormattingEnabled = true; - this.cmbGroup.Location = new System.Drawing.Point(361, 37); + this.cmbGroup.Location = new System.Drawing.Point(520, 37); this.cmbGroup.Name = "cmbGroup"; this.cmbGroup.Size = new System.Drawing.Size(121, 25); this.cmbGroup.TabIndex = 500; @@ -246,7 +248,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms // lblGroup // this.lblGroup.AutoSize = true; - this.lblGroup.Location = new System.Drawing.Point(327, 41); + this.lblGroup.Location = new System.Drawing.Point(486, 41); this.lblGroup.Name = "lblGroup"; this.lblGroup.Size = new System.Drawing.Size(44, 17); this.lblGroup.TabIndex = 499; @@ -282,7 +284,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms this.cmbSort.Items.AddRange(new object[] { "入库时间", "认领总数"}); - this.cmbSort.Location = new System.Drawing.Point(520, 37); + this.cmbSort.Location = new System.Drawing.Point(361, 37); this.cmbSort.Name = "cmbSort"; this.cmbSort.Size = new System.Drawing.Size(121, 25); this.cmbSort.TabIndex = 448; @@ -370,7 +372,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms // label6 // this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(486, 41); + this.label6.Location = new System.Drawing.Point(327, 41); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(44, 17); this.label6.TabIndex = 449; @@ -541,6 +543,50 @@ namespace TemuKJD.KJDForms.ProductSelectForms this.dgvSelectShop.TabIndex = 504; this.dgvSelectShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvSelectShop_CellContentClick); // + // colCheck + // + this.colCheck.HeaderText = "选择"; + this.colCheck.MinimumWidth = 6; + 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; + // + // colUserName + // + this.colUserName.HeaderText = "用户名称"; + this.colUserName.MinimumWidth = 6; + this.colUserName.Name = "colUserName"; + this.colUserName.ReadOnly = true; + this.colUserName.Width = 90; + // + // colSubUserName + // + this.colSubUserName.HeaderText = "子账户名称"; + this.colSubUserName.Name = "colSubUserName"; + this.colSubUserName.ReadOnly = true; + this.colSubUserName.Visible = false; + this.colSubUserName.Width = 150; + // + // colShopId + // + this.colShopId.HeaderText = "店铺Id"; + this.colShopId.Name = "colShopId"; + this.colShopId.ReadOnly = true; + // + // colShopName + // + this.colShopName.HeaderText = "店铺名称"; + this.colShopName.Name = "colShopName"; + this.colShopName.ReadOnly = true; + // + // colShopNotes + // + this.colShopNotes.HeaderText = "店铺备注"; + this.colShopNotes.Name = "colShopNotes"; + this.colShopNotes.ReadOnly = true; + // // btnCancel // this.btnCancel.CanvasColor = System.Drawing.SystemColors.Control; @@ -667,22 +713,23 @@ namespace TemuKJD.KJDForms.ProductSelectForms this.dgvDbProduct.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.colSelect, this.col_db_id, - this.col_product_name, - this.colImgUrl, - this.colMainImg, this.col_spu_id, this.col_skc_id, + this.colImgUrl, + this.colMainImg, + this.col_product_name, this.col_cat_name, this.col_ext_code, - this.colAddTimes, - this.colSelectTotalCount, + this.colCostPrice, this.colProdGetType, - this.col_notes, this.colGroup, + this.col_notes, this.colHeadWords, this.colEndWords, this.colFissionWords, this.colAddTime, + this.colAddTimes, + this.colSelectTotalCount, this.colSelectProd, this.col_edit, this.col_delete, @@ -713,14 +760,19 @@ namespace TemuKJD.KJDForms.ProductSelectForms this.col_db_id.ReadOnly = true; this.col_db_id.Visible = false; // - // col_product_name + // col_spu_id // - dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.col_product_name.DefaultCellStyle = dataGridViewCellStyle5; - this.col_product_name.FillWeight = 160F; - this.col_product_name.HeaderText = "标题"; - this.col_product_name.Name = "col_product_name"; - this.col_product_name.ReadOnly = true; + this.col_spu_id.FillWeight = 90F; + this.col_spu_id.HeaderText = "SPU Id"; + this.col_spu_id.Name = "col_spu_id"; + this.col_spu_id.ReadOnly = true; + // + // col_skc_id + // + this.col_skc_id.FillWeight = 90F; + this.col_skc_id.HeaderText = "SKC Id"; + this.col_skc_id.Name = "col_skc_id"; + this.col_skc_id.ReadOnly = true; // // colImgUrl // @@ -739,19 +791,14 @@ namespace TemuKJD.KJDForms.ProductSelectForms this.colMainImg.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.colMainImg.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; // - // col_spu_id + // col_product_name // - this.col_spu_id.FillWeight = 90F; - this.col_spu_id.HeaderText = "SPU Id"; - this.col_spu_id.Name = "col_spu_id"; - this.col_spu_id.ReadOnly = true; - // - // col_skc_id - // - this.col_skc_id.FillWeight = 90F; - this.col_skc_id.HeaderText = "SKC Id"; - this.col_skc_id.Name = "col_skc_id"; - this.col_skc_id.ReadOnly = true; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.col_product_name.DefaultCellStyle = dataGridViewCellStyle5; + this.col_product_name.FillWeight = 150F; + this.col_product_name.HeaderText = "标题"; + this.col_product_name.Name = "col_product_name"; + this.col_product_name.ReadOnly = true; // // col_cat_name // @@ -765,19 +812,12 @@ namespace TemuKJD.KJDForms.ProductSelectForms this.col_ext_code.Name = "col_ext_code"; this.col_ext_code.ReadOnly = true; // - // colAddTimes + // colCostPrice // - this.colAddTimes.FillWeight = 52F; - this.colAddTimes.HeaderText = "单店认领次数"; - this.colAddTimes.Name = "colAddTimes"; - this.colAddTimes.ReadOnly = true; - // - // colSelectTotalCount - // - this.colSelectTotalCount.FillWeight = 52F; - this.colSelectTotalCount.HeaderText = "认领总数"; - this.colSelectTotalCount.Name = "colSelectTotalCount"; - this.colSelectTotalCount.ReadOnly = true; + this.colCostPrice.FillWeight = 50F; + this.colCostPrice.HeaderText = "成本价"; + this.colCostPrice.Name = "colCostPrice"; + this.colCostPrice.ReadOnly = true; // // colProdGetType // @@ -786,6 +826,13 @@ namespace TemuKJD.KJDForms.ProductSelectForms this.colProdGetType.Name = "colProdGetType"; this.colProdGetType.ReadOnly = true; // + // colGroup + // + this.colGroup.FillWeight = 58F; + this.colGroup.HeaderText = "分组"; + this.colGroup.Name = "colGroup"; + this.colGroup.ReadOnly = true; + // // col_notes // dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; @@ -795,13 +842,6 @@ namespace TemuKJD.KJDForms.ProductSelectForms this.col_notes.Name = "col_notes"; this.col_notes.ReadOnly = true; // - // colGroup - // - this.colGroup.FillWeight = 58F; - this.colGroup.HeaderText = "分组"; - this.colGroup.Name = "colGroup"; - this.colGroup.ReadOnly = true; - // // colHeadWords // dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; @@ -831,10 +871,27 @@ namespace TemuKJD.KJDForms.ProductSelectForms // // colAddTime // + dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colAddTime.DefaultCellStyle = dataGridViewCellStyle10; + this.colAddTime.FillWeight = 60F; this.colAddTime.HeaderText = "入库时间"; this.colAddTime.Name = "colAddTime"; this.colAddTime.ReadOnly = true; // + // colAddTimes + // + this.colAddTimes.FillWeight = 52F; + this.colAddTimes.HeaderText = "单店认领次数"; + this.colAddTimes.Name = "colAddTimes"; + this.colAddTimes.ReadOnly = true; + // + // colSelectTotalCount + // + this.colSelectTotalCount.FillWeight = 52F; + this.colSelectTotalCount.HeaderText = "认领总数"; + this.colSelectTotalCount.Name = "colSelectTotalCount"; + this.colSelectTotalCount.ReadOnly = true; + // // colSelectProd // this.colSelectProd.FillWeight = 60F; @@ -894,50 +951,6 @@ namespace TemuKJD.KJDForms.ProductSelectForms this.statusBar.Size = new System.Drawing.Size(1278, 25); this.statusBar.TabIndex = 5; // - // colCheck - // - this.colCheck.HeaderText = "选择"; - this.colCheck.MinimumWidth = 6; - 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; - // - // colUserName - // - this.colUserName.HeaderText = "用户名称"; - this.colUserName.MinimumWidth = 6; - this.colUserName.Name = "colUserName"; - this.colUserName.ReadOnly = true; - this.colUserName.Width = 90; - // - // colSubUserName - // - this.colSubUserName.HeaderText = "子账户名称"; - this.colSubUserName.Name = "colSubUserName"; - this.colSubUserName.ReadOnly = true; - this.colSubUserName.Visible = false; - this.colSubUserName.Width = 150; - // - // colShopId - // - this.colShopId.HeaderText = "店铺Id"; - this.colShopId.Name = "colShopId"; - this.colShopId.ReadOnly = true; - // - // colShopName - // - this.colShopName.HeaderText = "店铺名称"; - this.colShopName.Name = "colShopName"; - this.colShopName.ReadOnly = true; - // - // colShopNotes - // - this.colShopNotes.HeaderText = "店铺备注"; - this.colShopNotes.Name = "colShopNotes"; - this.colShopNotes.ReadOnly = true; - // // DbProductListForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -1006,28 +1019,6 @@ namespace TemuKJD.KJDForms.ProductSelectForms private System.Windows.Forms.NumericUpDown numCount; private System.Windows.Forms.Label lblProdName; private System.Windows.Forms.Label lblGroup; - private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect; - private System.Windows.Forms.DataGridViewTextBoxColumn col_db_id; - private System.Windows.Forms.DataGridViewTextBoxColumn col_product_name; - private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl; - private System.Windows.Forms.DataGridViewImageColumn colMainImg; - private System.Windows.Forms.DataGridViewTextBoxColumn col_spu_id; - private System.Windows.Forms.DataGridViewTextBoxColumn col_skc_id; - private System.Windows.Forms.DataGridViewTextBoxColumn col_cat_name; - private System.Windows.Forms.DataGridViewTextBoxColumn col_ext_code; - private System.Windows.Forms.DataGridViewTextBoxColumn colAddTimes; - private System.Windows.Forms.DataGridViewTextBoxColumn colSelectTotalCount; - private System.Windows.Forms.DataGridViewTextBoxColumn colProdGetType; - private System.Windows.Forms.DataGridViewTextBoxColumn col_notes; - private System.Windows.Forms.DataGridViewTextBoxColumn colGroup; - private System.Windows.Forms.DataGridViewTextBoxColumn colHeadWords; - private System.Windows.Forms.DataGridViewTextBoxColumn colEndWords; - private System.Windows.Forms.DataGridViewTextBoxColumn colFissionWords; - private System.Windows.Forms.DataGridViewTextBoxColumn colAddTime; - private System.Windows.Forms.DataGridViewLinkColumn colSelectProd; - private System.Windows.Forms.DataGridViewLinkColumn col_edit; - private System.Windows.Forms.DataGridViewLinkColumn col_delete; - private System.Windows.Forms.DataGridViewLinkColumn col_select_product; private System.Windows.Forms.ComboBox cmbGroup; private System.Windows.Forms.ListBox lbxProdName; private DevComponents.DotNetBar.PanelEx btnBatchSelect; @@ -1039,5 +1030,28 @@ namespace TemuKJD.KJDForms.ProductSelectForms private System.Windows.Forms.DataGridViewTextBoxColumn colShopId; private System.Windows.Forms.DataGridViewTextBoxColumn colShopName; private System.Windows.Forms.DataGridViewTextBoxColumn colShopNotes; + private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect; + private System.Windows.Forms.DataGridViewTextBoxColumn col_db_id; + private System.Windows.Forms.DataGridViewTextBoxColumn col_spu_id; + private System.Windows.Forms.DataGridViewTextBoxColumn col_skc_id; + private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl; + private System.Windows.Forms.DataGridViewImageColumn colMainImg; + private System.Windows.Forms.DataGridViewTextBoxColumn col_product_name; + private System.Windows.Forms.DataGridViewTextBoxColumn col_cat_name; + private System.Windows.Forms.DataGridViewTextBoxColumn col_ext_code; + private System.Windows.Forms.DataGridViewTextBoxColumn colCostPrice; + private System.Windows.Forms.DataGridViewTextBoxColumn colProdGetType; + private System.Windows.Forms.DataGridViewTextBoxColumn colGroup; + private System.Windows.Forms.DataGridViewTextBoxColumn col_notes; + private System.Windows.Forms.DataGridViewTextBoxColumn colHeadWords; + private System.Windows.Forms.DataGridViewTextBoxColumn colEndWords; + private System.Windows.Forms.DataGridViewTextBoxColumn colFissionWords; + private System.Windows.Forms.DataGridViewTextBoxColumn colAddTime; + private System.Windows.Forms.DataGridViewTextBoxColumn colAddTimes; + private System.Windows.Forms.DataGridViewTextBoxColumn colSelectTotalCount; + private System.Windows.Forms.DataGridViewLinkColumn colSelectProd; + private System.Windows.Forms.DataGridViewLinkColumn col_edit; + private System.Windows.Forms.DataGridViewLinkColumn col_delete; + private System.Windows.Forms.DataGridViewLinkColumn col_select_product; } } \ No newline at end of file diff --git a/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.cs b/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.cs index 9970591..e026e88 100644 --- a/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.cs +++ b/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.cs @@ -1,4 +1,5 @@ using AllBase; +using AllBase.Helper; using AllBase.Model.Result; using AllBase.Model.Result.TemuResult; using NaiBa.Util.Extension; @@ -29,6 +30,8 @@ namespace TemuKJD.KJDForms.ProductSelectForms ShopLoginInfo shop = null; // 单店认领 List lstAdminShopInfo = new List(); // 服务端直传店铺列表 List lstTemuDbProduct = new List(); + public bool IsAdmin { get; set; } = false; + public bool IsClientJit { get; set; } = false; public DbProductListForm() { @@ -43,41 +46,46 @@ namespace TemuKJD.KJDForms.ProductSelectForms private void ProductListForm_Load(object sender, EventArgs e) { + this.dgvDbProduct.Columns["col_delete"].Visible = false; + this.dgvDbProduct.Columns["col_edit"].Visible = false; + this.dgvDbProduct.Columns["colHeadWords"].Visible = false; + this.dgvDbProduct.Columns["colEndWords"].Visible = false; + this.dgvDbProduct.Columns["colFissionWords"].Visible = false; + this.dgvDbProduct.Columns["colSelectProd"].Visible = false; + this.dgvDbProduct.Columns["colProdGetType"].Visible = false; + this.dgvDbProduct.Columns["colGroup"].Visible = false; + this.dgvDbProduct.Columns["colCostPrice"].Visible = false; + this.lblGroup.Visible = false; + this.cmbGroup.Visible = false; + this.btnImportHtml.Visible = false; + this.btnBatchSelect.Visible = false; + if (BaseClass.SaLevel == 1 && shop == null) // 一级管理员且不是选品状态 { - this.dgvDbProduct.Columns["col_delete"].Visible = true; - this.dgvDbProduct.Columns["col_edit"].Visible = true; - this.dgvDbProduct.Columns["colHeadWords"].Visible = true; - this.dgvDbProduct.Columns["colEndWords"].Visible = true; - this.dgvDbProduct.Columns["colFissionWords"].Visible = true; - this.dgvDbProduct.Columns["colSelectProd"].Visible = true; - this.dgvDbProduct.Columns["colProdGetType"].Visible = true; - this.dgvDbProduct.Columns["colGroup"].Visible = true; - //this.dgvDbProduct.Columns["col_notes"].Visible = true; - //this.lblNotes.Visible = true; - //this.txtNotes.Visible = true; - this.lblGroup.Visible = true; - this.cmbGroup.Visible = true; - this.btnImportHtml.Visible = true; - this.btnBatchSelect.Visible = true; + this.dgvDbProduct.Columns["col_delete"].Visible = true; // 删除 + this.dgvDbProduct.Columns["col_edit"].Visible = true; // 编辑 + this.dgvDbProduct.Columns["colHeadWords"].Visible = true; // 头词 + this.dgvDbProduct.Columns["colEndWords"].Visible = true; // 尾词 + this.dgvDbProduct.Columns["colFissionWords"].Visible = true; // 分裂词 + this.dgvDbProduct.Columns["colSelectProd"].Visible = true; // 商品直传(不经过客户选品) + this.dgvDbProduct.Columns["colProdGetType"].Visible = true; // 采集来源 母店采集 前端直采 + this.dgvDbProduct.Columns["colGroup"].Visible = true; // 分组 + this.dgvDbProduct.Columns["colCostPrice"].Visible = true; // 成本价 + this.lblGroup.Visible = true; // 分组 + this.cmbGroup.Visible = true; // 分组 + this.btnImportHtml.Visible = true; // 导入前端直采商品 + this.btnBatchSelect.Visible = true; // 批量直传 } - else + else if (BaseClass.SaLevel > 1 && shop == null) { - this.dgvDbProduct.Columns["col_delete"].Visible = false; - this.dgvDbProduct.Columns["col_edit"].Visible = false; - this.dgvDbProduct.Columns["colHeadWords"].Visible = false; - this.dgvDbProduct.Columns["colEndWords"].Visible = false; - this.dgvDbProduct.Columns["colFissionWords"].Visible = false; - this.dgvDbProduct.Columns["colSelectProd"].Visible = false; - this.dgvDbProduct.Columns["colProdGetType"].Visible = false; - this.dgvDbProduct.Columns["colGroup"].Visible = false; - //this.dgvDbProduct.Columns["col_notes"].Visible = false; - //this.lblNotes.Visible = false; - //this.txtNotes.Visible = false; - this.lblGroup.Visible = false; - this.cmbGroup.Visible = false; - this.btnImportHtml.Visible = false; - this.btnBatchSelect.Visible = false; + this.dgvDbProduct.Columns["colHeadWords"].Visible = true; // 头词 + this.dgvDbProduct.Columns["colEndWords"].Visible = true; // 尾词 + this.dgvDbProduct.Columns["colFissionWords"].Visible = true; // 分裂词 + this.dgvDbProduct.Columns["colProdGetType"].Visible = true; // 采集来源 母店采集 前端直采 + this.dgvDbProduct.Columns["colGroup"].Visible = true; // 分组 + this.dgvDbProduct.Columns["colCostPrice"].Visible = true; // 成本价 + this.lblGroup.Visible = true; // 分组 + this.cmbGroup.Visible = true; // 分组 } btnSelect.Visible = false; @@ -156,22 +164,23 @@ namespace TemuKJD.KJDForms.ProductSelectForms int rowIndex = this.dgvDbProduct.Rows.Add( false, prod.id, - prod.product_name, - prod?.main_img?.Replace("https://", "http://").Replace("img.kwcdn.com", "img.cdnfe.com"), - DataGridViewExtension.defaultBitmap, // prod.main_img, prod.spu_id, prod.skc_id, + prod?.main_img?.Replace("https://", "http://").Replace("img.kwcdn.com", "img.cdnfe.com"), + DataGridViewExtension.defaultBitmap, // prod.main_img, + prod.product_name, prod.cat_name, prod.ext_code, - prod.select_count, - prod.select_total_count, + prod.cost_price, prod.product_get_type == 0 ? "母店采集" : "前端直采", - prod.notes, prod.group, + prod.notes, prod.head_words, prod.end_words, prod.fission_words, - prod.add_time, + prod.add_time.ToString("yy/MM/dd HH:mm:ss"), + prod.select_count, + prod.select_total_count, "商品直传", "编辑", "删除", @@ -255,7 +264,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms data += "&get_select_count=true"; data += "&select_shop_id=" + shop.ShopId; } - else if (BaseClass.SaLevel == 1) // 店铺非空管理状态允许查看后台采集和前端采集的所有商品 + else if (BaseClass.SaLevel > 0) // 店铺非空管理状态允许查看后台采集和前端采集的所有商品 { data += "&product_get_type=all"; } @@ -1141,16 +1150,51 @@ namespace TemuKJD.KJDForms.ProductSelectForms private void btnGetShop_Click(object sender, EventArgs e) { + if (IsClientJit) + { + GetShop(); + } + else + { + GetServerShop(); + } + } + + void GetShop() + { + this.pbLoading.Visible = true; + this.dgvSelectShop.Rows.Clear(); + var list = GlobalConfig.ShopLoginList.Where(s => s.ShopId.Contains(txtShopId.Text.Trim()) && s.ShopAccount.Contains(txtShopName.Text.Trim())).Take(10).ToList(); + foreach (var shop in lstAdminShopInfo) + { + Invoke(new Action(() => + { + int rowIndex = this.dgvSelectShop.Rows.Add( + false, + shop.UserName, + shop.SubUserName, + shop.ShopId, + shop.ShopAccount, + shop.Notes); + if (rowIndex == 0) + { + this.dgvSelectShop.Rows[rowIndex].Cells["colCheck"].Value = true; + } + })); + } + } + + void GetServerShop() + { this.pbLoading.Visible = true; this.dgvSelectShop.Rows.Clear(); this.lstAdminShopInfo.Clear(); Task.Run(() => { int pageCount; - var list = AdminForms.AdminShopListForm.Instance.AdminGetServerShopLst(out pageCount, "", "", "", + var list = AdminForms.AdminShopListForm.Instance.AdminGetServerShopLst(out pageCount, "", "", "", txtShopId.Text.Trim(), txtShopName.Text.Trim(), 1, 10); lstAdminShopInfo.AddRange(list); - this.ucSplitPage1.TotalPage = pageCount; foreach (var shop in lstAdminShopInfo) { diff --git a/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.resx b/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.resx index b09767c..69534d6 100644 --- a/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.resx +++ b/TEMUKJD/KJDForms/ProductSelectForms/DbProductListForm.resx @@ -141,7 +141,10 @@ True - + + True + + True @@ -150,10 +153,7 @@ True - - True - - + True @@ -162,19 +162,16 @@ True - - True - - + True True - + True - + True @@ -189,6 +186,12 @@ True + + True + + + True + True diff --git a/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs b/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs index ab865a0..25d978a 100644 --- a/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs +++ b/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs @@ -2167,9 +2167,13 @@ namespace TemuKJD.KJDForms.ProductSelectForms language = "en", productName = prodParam.productName, }; - if (CountChineseCharacters(productI18nEn.productName) > 0) + if (CountChineseCharacters(productI18nEn.productName) > 0 && !string.IsNullOrEmpty(headWords)) { - productI18nEn.productName = productI18nEn.productName.Replace(headWords, "").Replace(endWords, ""); + productI18nEn.productName = productI18nEn.productName.Replace(headWords, ""); + } + if (CountChineseCharacters(productI18nEn.productName) > 0 && !string.IsNullOrEmpty(endWords)) + { + productI18nEn.productName = productI18nEn.productName.Replace(endWords, ""); } if (CountChineseCharacters(productI18nEn.productName) > 0) { @@ -2181,7 +2185,10 @@ namespace TemuKJD.KJDForms.ProductSelectForms Task.Run(() => { Thread.Sleep(5000); - this.pnlError.Visible = false; + Invoke(new Action(() => + { + this.pnlError.Visible = false; + })); }); } else diff --git a/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.Designer.cs b/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.Designer.cs index 0c22a57..0206e1d 100644 --- a/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.Designer.cs +++ b/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.Designer.cs @@ -73,14 +73,6 @@ namespace TemuKJD.KJDForms.SalesCenterForms this.splitContainer3 = new System.Windows.Forms.SplitContainer(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx(); - this.colSelect = new TemuKJD.UserComponent.UcDataGridViewCheckBoxColumn(this.components); - 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.splitContainer5 = new System.Windows.Forms.SplitContainer(); this.actDiscountLess60 = new TemuKJD.KJDForms.SalesCenterForms.UcActivityDiscountCtrl(); this.chkIfLowCancel = new TemuKJD.UserComponent.UcCheckBox(this.components); @@ -117,6 +109,14 @@ namespace TemuKJD.KJDForms.SalesCenterForms this.panelEx1 = new DevComponents.DotNetBar.PanelEx(); this.btnClear = new DevComponents.DotNetBar.PanelEx(); this.panel1 = new System.Windows.Forms.Panel(); + this.colSelect = new TemuKJD.UserComponent.UcDataGridViewCheckBoxColumn(this.components); + 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(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -687,72 +687,6 @@ namespace TemuKJD.KJDForms.SalesCenterForms 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.FillWeight = 150F; - 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.colMessage.Width = 120; - // // splitContainer5 // this.splitContainer5.Dock = System.Windows.Forms.DockStyle.Fill; @@ -1161,6 +1095,72 @@ namespace TemuKJD.KJDForms.SalesCenterForms this.panel1.Size = new System.Drawing.Size(1438, 566); this.panel1.TabIndex = 12; // + // 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.FillWeight = 150F; + 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.colMessage.Width = 120; + // // MarketingActivityForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -1284,6 +1284,13 @@ namespace TemuKJD.KJDForms.SalesCenterForms private System.Windows.Forms.DataGridViewTextBoxColumn colDiscountTenth; private System.Windows.Forms.DataGridViewTextBoxColumn colDiscount; private System.Windows.Forms.DataGridViewTextBoxColumn colActivityMsg; + private DevComponents.DotNetBar.PanelEx btnEmpty; + private System.Windows.Forms.TextBox txtNotes; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.TextBox txtShopName; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.TextBox txtShopId; + private System.Windows.Forms.Label label22; private UserComponent.UcDataGridViewCheckBoxColumn colSelect; private System.Windows.Forms.DataGridViewTextBoxColumn colShopLoginName; private System.Windows.Forms.DataGridViewTextBoxColumn colShopId; @@ -1292,12 +1299,5 @@ namespace TemuKJD.KJDForms.SalesCenterForms private System.Windows.Forms.DataGridViewLinkColumn colLoginStatus; private System.Windows.Forms.DataGridViewCheckBoxColumn colCanUse; private System.Windows.Forms.DataGridViewTextBoxColumn colMessage; - private DevComponents.DotNetBar.PanelEx btnEmpty; - private System.Windows.Forms.TextBox txtNotes; - private System.Windows.Forms.Label label14; - private System.Windows.Forms.TextBox txtShopName; - private System.Windows.Forms.Label label21; - private System.Windows.Forms.TextBox txtShopId; - private System.Windows.Forms.Label label22; } } \ No newline at end of file diff --git a/TEMUKJD/MainForm.cs b/TEMUKJD/MainForm.cs index ed3356c..b1b7e2b 100644 --- a/TEMUKJD/MainForm.cs +++ b/TEMUKJD/MainForm.cs @@ -42,6 +42,7 @@ using NaiBa.CefHelper.Handler; using TemuKJD.PDDForms.AdminForms; using TemuKJD.PDDForms.ShopForms; using TemuKJD.PDDForms.ProductForms; +using TemuKJD.KJDForms.JITForms; namespace TemuKJD { @@ -248,7 +249,7 @@ namespace TemuKJD Icon = BaseClass.Ico; SetTitle(); - PanelEx[] ps = { pnlMarket, pnlOrder, pnlShop, pnlUpload, pnlTools, pnlCollect, pnlSA }; + PanelEx[] ps = { pnlMarket, pnlOrder, pnlShop, pnlUpload, pnlTools, pnlCollect, pnlSA, pnlJit}; foreach (PanelEx p in ps) p.BackgroundImage = p.Style.BackgroundImage; @@ -432,6 +433,7 @@ namespace TemuKJD /// private void InitialAllModules() { + pnlJit_Click(null, null); pnlUpload_Click(null, null); PnlSystem_Click(null, null); pnlMarket_Click(null, null); @@ -614,7 +616,7 @@ namespace TemuKJD } if (p == null) return; - PanelEx[] ps = { pnlMarket, pnlOrder, pnlShop, pnlUpload, pnlTools, pnlCollect, pnlSA }; + PanelEx[] ps = { pnlMarket, pnlOrder, pnlShop, pnlUpload, pnlTools, pnlCollect, pnlSA, pnlJit }; foreach (var panel in ps) { if (p.Name == panel.Name) @@ -636,6 +638,16 @@ namespace TemuKJD ShowMainPanel(salesCenterForm, sender as Panel); } + private JITForm jitForm; + private void pnlJit_Click(object sender, EventArgs e) + { + if (jitForm == null) + { + jitForm = new JITForm(); + } + ShowMainPanel(jitForm, sender as Panel); + } + //internal GoodsCollectForm gcf; private object shopForm; private void pnlShop_Click(object sender, EventArgs e) diff --git a/TEMUKJD/MainForm.designer.cs b/TEMUKJD/MainForm.designer.cs index 6bd5ed8..c15e851 100644 --- a/TEMUKJD/MainForm.designer.cs +++ b/TEMUKJD/MainForm.designer.cs @@ -39,6 +39,7 @@ namespace TemuKJD this.pnlShop = new DevComponents.DotNetBar.PanelEx(); this.pnlUpload = new DevComponents.DotNetBar.PanelEx(); this.pnlMarket = new DevComponents.DotNetBar.PanelEx(); + this.pnlJit = new DevComponents.DotNetBar.PanelEx(); this.pnlCollect = new DevComponents.DotNetBar.PanelEx(); this.pnlTools = new DevComponents.DotNetBar.PanelEx(); this.pnlOrder = new DevComponents.DotNetBar.PanelEx(); @@ -101,19 +102,22 @@ namespace TemuKJD // // flowLayoutPanel1 // + this.flowLayoutPanel1.AutoSize = true; + this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.flowLayoutPanel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(34)))), ((int)(((byte)(143)))), ((int)(((byte)(255))))); this.flowLayoutPanel1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("flowLayoutPanel1.BackgroundImage"))); this.flowLayoutPanel1.Controls.Add(this.pnlSA); this.flowLayoutPanel1.Controls.Add(this.pnlShop); this.flowLayoutPanel1.Controls.Add(this.pnlUpload); this.flowLayoutPanel1.Controls.Add(this.pnlMarket); + this.flowLayoutPanel1.Controls.Add(this.pnlJit); this.flowLayoutPanel1.Controls.Add(this.pnlCollect); this.flowLayoutPanel1.Controls.Add(this.pnlTools); this.flowLayoutPanel1.Controls.Add(this.pnlOrder); this.flowLayoutPanel1.Location = new System.Drawing.Point(196, 0); this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(701, 91); + this.flowLayoutPanel1.Size = new System.Drawing.Size(640, 91); this.flowLayoutPanel1.TabIndex = 131; // // pnlSA @@ -250,13 +254,47 @@ namespace TemuKJD this.pnlMarket.Visible = false; this.pnlMarket.Click += new System.EventHandler(this.pnlMarket_Click); // + // pnlJit + // + this.pnlJit.CanvasColor = System.Drawing.SystemColors.Control; + this.pnlJit.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.pnlJit.Cursor = System.Windows.Forms.Cursors.Hand; + this.pnlJit.DisabledBackColor = System.Drawing.Color.Empty; + this.pnlJit.Location = new System.Drawing.Point(320, 0); + this.pnlJit.Margin = new System.Windows.Forms.Padding(0); + this.pnlJit.Name = "pnlJit"; + this.pnlJit.Size = new System.Drawing.Size(80, 91); + this.pnlJit.Style.Alignment = System.Drawing.StringAlignment.Center; + this.pnlJit.Style.BackColor1.Alpha = ((byte)(0)); + this.pnlJit.Style.BackColor1.Color = System.Drawing.Color.Transparent; + this.pnlJit.Style.BackColor2.Alpha = ((byte)(0)); + this.pnlJit.Style.BackColor2.Color = System.Drawing.Color.Transparent; + this.pnlJit.Style.BackgroundImage = global::TemuKJD.Properties.Resources.main_menu_jit; + this.pnlJit.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; + this.pnlJit.Style.BorderColor.Color = System.Drawing.Color.Transparent; + this.pnlJit.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.pnlJit.Style.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.pnlJit.Style.ForeColor.Color = System.Drawing.Color.White; + this.pnlJit.Style.GradientAngle = 90; + this.pnlJit.Style.LineAlignment = System.Drawing.StringAlignment.Near; + this.pnlJit.Style.MarginTop = 63; + this.pnlJit.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.pnlJit.StyleMouseOver.BackgroundImage = global::TemuKJD.Properties.Resources.main_menu_jit_select; + this.pnlJit.StyleMouseOver.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.pnlJit.StyleMouseOver.LineAlignment = System.Drawing.StringAlignment.Near; + this.pnlJit.StyleMouseOver.MarginTop = 63; + this.pnlJit.TabIndex = 7; + this.pnlJit.Text = "JIT"; + this.pnlJit.Visible = false; + this.pnlJit.Click += new System.EventHandler(this.pnlJit_Click); + // // pnlCollect // this.pnlCollect.CanvasColor = System.Drawing.SystemColors.Control; this.pnlCollect.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.pnlCollect.Cursor = System.Windows.Forms.Cursors.Hand; this.pnlCollect.DisabledBackColor = System.Drawing.Color.Empty; - this.pnlCollect.Location = new System.Drawing.Point(320, 0); + this.pnlCollect.Location = new System.Drawing.Point(400, 0); this.pnlCollect.Margin = new System.Windows.Forms.Padding(0); this.pnlCollect.Name = "pnlCollect"; this.pnlCollect.Size = new System.Drawing.Size(80, 91); @@ -290,7 +328,7 @@ namespace TemuKJD this.pnlTools.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.pnlTools.Cursor = System.Windows.Forms.Cursors.Hand; this.pnlTools.DisabledBackColor = System.Drawing.Color.Empty; - this.pnlTools.Location = new System.Drawing.Point(400, 0); + this.pnlTools.Location = new System.Drawing.Point(480, 0); this.pnlTools.Margin = new System.Windows.Forms.Padding(0); this.pnlTools.Name = "pnlTools"; this.pnlTools.Size = new System.Drawing.Size(80, 91); @@ -323,7 +361,7 @@ namespace TemuKJD this.pnlOrder.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.pnlOrder.Cursor = System.Windows.Forms.Cursors.Hand; this.pnlOrder.DisabledBackColor = System.Drawing.Color.Empty; - this.pnlOrder.Location = new System.Drawing.Point(480, 0); + this.pnlOrder.Location = new System.Drawing.Point(560, 0); this.pnlOrder.Margin = new System.Windows.Forms.Padding(0); this.pnlOrder.Name = "pnlOrder"; this.pnlOrder.Size = new System.Drawing.Size(80, 91); @@ -726,6 +764,7 @@ namespace TemuKJD private DevComponents.DotNetBar.PanelEx pnlSA; private System.Windows.Forms.Label lblVersionName; private System.Windows.Forms.Label lblVersionInfo; + public DevComponents.DotNetBar.PanelEx pnlJit; } } diff --git a/TEMUKJD/Properties/Resources.Designer.cs b/TEMUKJD/Properties/Resources.Designer.cs index c94b84f..0a7e0f9 100644 --- a/TEMUKJD/Properties/Resources.Designer.cs +++ b/TEMUKJD/Properties/Resources.Designer.cs @@ -373,6 +373,26 @@ namespace TemuKJD.Properties { } } + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap main_menu_jit { + get { + object obj = ResourceManager.GetObject("main_menu_jit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap main_menu_jit_select { + get { + object obj = ResourceManager.GetObject("main_menu_jit_select", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// diff --git a/TEMUKJD/Properties/Resources.resx b/TEMUKJD/Properties/Resources.resx index 8b3e995..8bcc176 100644 --- a/TEMUKJD/Properties/Resources.resx +++ b/TEMUKJD/Properties/Resources.resx @@ -202,6 +202,12 @@ ..\Resources\main_menu_collect_select.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\main_menu_jit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\main_menu_jit_select.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\main_menu_sa.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/TEMUKJD/Resources/main_menu_jit.png b/TEMUKJD/Resources/main_menu_jit.png new file mode 100644 index 0000000..0713bc3 Binary files /dev/null and b/TEMUKJD/Resources/main_menu_jit.png differ diff --git a/TEMUKJD/Resources/main_menu_jit_select.png b/TEMUKJD/Resources/main_menu_jit_select.png new file mode 100644 index 0000000..f4e8ea8 Binary files /dev/null and b/TEMUKJD/Resources/main_menu_jit_select.png differ diff --git a/TEMUKJD/StartUp.cs b/TEMUKJD/StartUp.cs index cf6cf4d..012e895 100644 --- a/TEMUKJD/StartUp.cs +++ b/TEMUKJD/StartUp.cs @@ -121,8 +121,8 @@ namespace TemuKJD while (true) { -//#if DEBUG -//#else +#if DEBUG +#else var url = BaseClass.BuildObjString("user/is_get_return_package"); var data = Work.UserLogin.GetSignaturex(); @@ -150,7 +150,7 @@ namespace TemuKJD NaiBa.Util.Helper.ConfigHelper.SaveConfig>("get_return_package_date", dicGetReturnPackDate); } } -//#endif +#endif #if DEBUG for (int i = 0; i < 360; i++) { diff --git a/TEMUKJD/ToolForms/DouBaoImgCefForm.cs b/TEMUKJD/ToolForms/DouBaoImgCefForm.cs index efa1682..b65f7b1 100644 --- a/TEMUKJD/ToolForms/DouBaoImgCefForm.cs +++ b/TEMUKJD/ToolForms/DouBaoImgCefForm.cs @@ -91,7 +91,7 @@ namespace TemuKJD.ToolForms ",\"specId\":" + sku.productSkuSpecList[0].specId + ",\"specName\":\"" + sku.productSkuSpecList[0].specName + "\"}"; skuImgItem.pbSkuOriginalImg.Name = sku.productSkuId.ToString(); - skuImgItem.chkSpecName.Text = sku.productSkuSpecList[0].specName; + skuImgItem.chkSpecName.Text = sku.productSkuSpecList[0].specName + " " + sku.productSkuSpecList[0].specId; skuImgItem.chkSpecName.Tag = skuImgItem; skuImgItem.chkSpecName.CheckedChanged += ChkSpecName_CheckedChanged; skuImgItem.btnGetOriginalImg.Tag = skuImgItem; @@ -120,7 +120,18 @@ namespace TemuKJD.ToolForms if (skuImgItem == null) continue; - var skuImgLst = GetSkuImgList(skuImgItem.ProdId.ParseToString(), skuImgItem.SpecId.ParseToString()); + List skuImgLst = new List(); + int page = 1; + int pageSize = 5; + var skuImgLstTmp = GetSkuImgList(skuImgItem.ProdId.ParseToString(), skuImgItem.SpecId.ParseToString(), pageSize, false, page); + skuImgLst.AddRange(skuImgLstTmp); + while (skuImgLstTmp.Count >= pageSize) + { + page++; + skuImgLstTmp = GetSkuImgList(skuImgItem.ProdId.ParseToString(), skuImgItem.SpecId.ParseToString(), pageSize, false, page); + skuImgLst.AddRange(skuImgLstTmp); + } + skuImgItem.LstSkuImgInfo = skuImgLst; if (skuImgLst.Count > 0) { @@ -199,13 +210,14 @@ namespace TemuKJD.ToolForms } - public static List GetSkuImgList(string prodId, string specId, int pageSize = 50, bool isRandom = false) + public static List GetSkuImgList(string prodId, string specId, int pageSize = 50, bool isRandom = false, int page = 1) { var url = BaseClass.BuildObjString("product/get_sku_image_list"); var data = UserLogin.GetSignaturex(); data += "&search_product_id=" + prodId; data += "&search_spec_id=" + specId; data += "&page_size=" + pageSize; + data += "&page=" + page; if (isRandom) { data += "&is_random=true"; @@ -444,6 +456,7 @@ namespace TemuKJD.ToolForms } } skuImgItem.BackColor = Color.DodgerBlue; + skuImgItem.BackColor = Color.Red; } } diff --git a/TEMUKJD/ToolForms/DouBaoImgListForm.cs b/TEMUKJD/ToolForms/DouBaoImgListForm.cs index e7f8418..accc155 100644 --- a/TEMUKJD/ToolForms/DouBaoImgListForm.cs +++ b/TEMUKJD/ToolForms/DouBaoImgListForm.cs @@ -28,6 +28,7 @@ namespace TemuKJD.ToolForms private void DouBaoImgListForm_Load(object sender, EventArgs e) { LoadSkuImgList(); + this.TitleText = "图片列表 " + LstSkuImgInfo.FirstOrDefault()?.spec_id + " " + LstSkuImgInfo.FirstOrDefault()?.spec_name; } void LoadSkuImgList() diff --git a/TEMUKJD/UserControls/UcSplitPage.Designer.cs b/TEMUKJD/UserControls/UcSplitPage.Designer.cs index d8f3191..c66ba87 100644 --- a/TEMUKJD/UserControls/UcSplitPage.Designer.cs +++ b/TEMUKJD/UserControls/UcSplitPage.Designer.cs @@ -248,6 +248,7 @@ namespace TemuKJD.UserControls "200", "500", "1000", + "2000", "5000"}); this.cmbPageSize.Location = new System.Drawing.Point(132, 0); this.cmbPageSize.Margin = new System.Windows.Forms.Padding(0);