From 025c21343587d472af2aa905232f9874ecf2586d Mon Sep 17 00:00:00 2001 From: wule Date: Tue, 9 Sep 2025 19:07:57 +0800 Subject: [PATCH] =?UTF-8?q?bxx=20=E7=9B=B8=E5=85=B3=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../KJD_WebService/BLL/BXX/BXXPriceManage.cs | 600 +++++++++ .../BLL/BXX/BXXProductManage.cs | 790 +++++++++++ .../BLL/BXX/BXXProductThirdManage.cs | 775 +++++++++++ .../KJD_WebService/BLL/BXX/BXXShopManage.cs | 771 +++++++++++ .../KJD_WebService/BLL/BXX/BXXUserManage.cs | 470 +++++++ .../KJD_WebService/BLL/KJD/PriceManage.cs | 600 +++++++++ .../KJD_WebService/BLL/KJD/ProductManage.cs | 790 +++++++++++ .../BLL/KJD/ProductThirdManage.cs | 775 +++++++++++ .../KJD_WebService/BLL/KJD/ShopManage.cs | 771 +++++++++++ .../KJD_WebService/BLL/KJD/ToolManage.cs | 60 + .../KJD_WebService/BLL/KJD/UpadteManage.cs | 49 + .../KJD_WebService/BLL/KJD/UserManage.cs | 470 +++++++ .../KJD_WebService/BXXPriceService.asmx | 1 + .../KJD_WebService/BXXPriceService.asmx.cs | 149 +++ .../KJD_WebService/BXXProductService.asmx | 1 + .../KJD_WebService/BXXProductService.asmx.cs | 221 ++++ .../BXXProductThirdService.asmx | 1 + .../BXXProductThirdService.asmx.cs | 221 ++++ KJDService/KJD_WebService/BXXShopService.asmx | 1 + .../KJD_WebService/BXXShopService.asmx.cs | 207 +++ KJDService/KJD_WebService/BXXUserService.asmx | 1 + .../KJD_WebService/BXXUserService.asmx.cs | 177 +++ TEMUKJD/BLL/ShopBLL.cs | 175 +++ .../ShopForms/MPddShopForm.Designer.cs | 189 +++ TEMUKJD/PDDForms/ShopForms/MPddShopForm.cs | 151 +++ TEMUKJD/PDDForms/ShopForms/MPddShopForm.resx | 120 ++ .../ShopForms/PDDShopAddEditForm.Designer.cs | 321 +++++ .../PDDForms/ShopForms/PDDShopAddEditForm.cs | 134 ++ .../ShopForms/PDDShopAddEditForm.resx | 120 ++ .../ShopForms/PDDShopListForm.Designer.cs | 737 +++++++++++ TEMUKJD/PDDForms/ShopForms/PDDShopListForm.cs | 1163 +++++++++++++++++ .../PDDForms/ShopForms/PDDShopListForm.resx | 189 +++ .../ShopForms/PDDShopLoginForm.Designer.cs | 379 ++++++ .../PDDForms/ShopForms/PDDShopLoginForm.cs | 1001 ++++++++++++++ .../PDDForms/ShopForms/PDDShopLoginForm.resx | 298 +++++ .../PDDShopUpdateCookieForm.Designer.cs | 321 +++++ .../ShopForms/PDDShopUpdateCookieForm.cs | 338 +++++ .../ShopForms/PDDShopUpdateCookieForm.resx | 298 +++++ .../PDDSubAccountListForm.Designer.cs | 477 +++++++ .../ShopForms/PDDSubAccountListForm.cs | 220 ++++ .../ShopForms/PDDSubAccountListForm.resx | 144 ++ .../PDDSubAccountShopEditForm.Designer.cs | 259 ++++ .../ShopForms/PDDSubAccountShopEditForm.cs | 194 +++ .../ShopForms/PDDSubAccountShopEditForm.resx | 298 +++++ .../PDDForms/ShopForms/ShopBrowserObject.cs | 320 +++++ .../ShopForms/UcSubAccount.Designer.cs | 136 ++ TEMUKJD/PDDForms/ShopForms/UcSubAccount.cs | 72 + TEMUKJD/PDDForms/ShopForms/UcSubAccount.resx | 120 ++ TEMUKJD/Resources/login_bg_pdd.png | Bin 0 -> 41277 bytes TEMUKJD/Resources/main_form_logo_pdd.png | Bin 0 -> 28068 bytes 50 files changed, 16075 insertions(+) create mode 100644 KJDService/KJD_WebService/BLL/BXX/BXXPriceManage.cs create mode 100644 KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs create mode 100644 KJDService/KJD_WebService/BLL/BXX/BXXProductThirdManage.cs create mode 100644 KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs create mode 100644 KJDService/KJD_WebService/BLL/BXX/BXXUserManage.cs create mode 100644 KJDService/KJD_WebService/BLL/KJD/PriceManage.cs create mode 100644 KJDService/KJD_WebService/BLL/KJD/ProductManage.cs create mode 100644 KJDService/KJD_WebService/BLL/KJD/ProductThirdManage.cs create mode 100644 KJDService/KJD_WebService/BLL/KJD/ShopManage.cs create mode 100644 KJDService/KJD_WebService/BLL/KJD/ToolManage.cs create mode 100644 KJDService/KJD_WebService/BLL/KJD/UpadteManage.cs create mode 100644 KJDService/KJD_WebService/BLL/KJD/UserManage.cs create mode 100644 KJDService/KJD_WebService/BXXPriceService.asmx create mode 100644 KJDService/KJD_WebService/BXXPriceService.asmx.cs create mode 100644 KJDService/KJD_WebService/BXXProductService.asmx create mode 100644 KJDService/KJD_WebService/BXXProductService.asmx.cs create mode 100644 KJDService/KJD_WebService/BXXProductThirdService.asmx create mode 100644 KJDService/KJD_WebService/BXXProductThirdService.asmx.cs create mode 100644 KJDService/KJD_WebService/BXXShopService.asmx create mode 100644 KJDService/KJD_WebService/BXXShopService.asmx.cs create mode 100644 KJDService/KJD_WebService/BXXUserService.asmx create mode 100644 KJDService/KJD_WebService/BXXUserService.asmx.cs create mode 100644 TEMUKJD/BLL/ShopBLL.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/MPddShopForm.Designer.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/MPddShopForm.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/MPddShopForm.resx create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDShopAddEditForm.Designer.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDShopAddEditForm.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDShopAddEditForm.resx create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDShopListForm.Designer.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDShopListForm.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDShopListForm.resx create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.Designer.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.resx create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDShopUpdateCookieForm.Designer.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDShopUpdateCookieForm.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDShopUpdateCookieForm.resx create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDSubAccountListForm.Designer.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDSubAccountListForm.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDSubAccountListForm.resx create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDSubAccountShopEditForm.Designer.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDSubAccountShopEditForm.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/PDDSubAccountShopEditForm.resx create mode 100644 TEMUKJD/PDDForms/ShopForms/ShopBrowserObject.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/UcSubAccount.Designer.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/UcSubAccount.cs create mode 100644 TEMUKJD/PDDForms/ShopForms/UcSubAccount.resx create mode 100644 TEMUKJD/Resources/login_bg_pdd.png create mode 100644 TEMUKJD/Resources/main_form_logo_pdd.png diff --git a/KJDService/KJD_WebService/BLL/BXX/BXXPriceManage.cs b/KJDService/KJD_WebService/BLL/BXX/BXXPriceManage.cs new file mode 100644 index 0000000..67e249b --- /dev/null +++ b/KJDService/KJD_WebService/BLL/BXX/BXXPriceManage.cs @@ -0,0 +1,600 @@ +using KJD_Web.Model; +using KJD_Web.Utils; +using MySql.Data.MySqlClient; +using NaiBa.Util.Extension; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.Security; + +namespace KJD_Web.BLL.BXX +{ + public class BXXPriceManage + { + public string AddPrice(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\":\"校验失败\"}"; + + string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString(); + int original_price = RegexUtils.GetStringQuery(ref inputData, "original_price").ParseToInt(); + int markup_times = RegexUtils.GetStringQuery(ref inputData, "markup_times").ParseToInt(); + int extra_price = RegexUtils.GetStringQuery(ref inputData, "extra_price").ParseToInt(); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString(); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sqlExist = "select count(ext_code) from bxx.price_markup where ext_code=@ext_code"; + string sql = "insert into bxx.price_markup " + + "(ext_code,original_price,markup_times,extra_price,notes) " + + "values (@ext_code,@original_price,@markup_times,@extra_price,@notes);"; + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@original_price", Value = original_price, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@markup_times", Value = markup_times, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@extra_price", Value = extra_price, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, }); + + var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray()); + if (has != "0") + { + mySql.Close(); + return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}"; + } + + var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray()); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":502,\"msg\":\"" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetPriceList(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"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + + string start_original_price = RegexUtils.GetStringQuery(ref inputData, "start_original_price"); + string end_original_price = RegexUtils.GetStringQuery(ref inputData, "end_original_price"); + string start_markup_times = RegexUtils.GetStringQuery(ref inputData, "start_markup_times"); + string end_markup_times = RegexUtils.GetStringQuery(ref inputData, "end_markup_times"); + string start_extra_price = RegexUtils.GetStringQuery(ref inputData, "start_extra_price"); + string end_extra_price = RegexUtils.GetStringQuery(ref inputData, "end_extra_price"); + var search_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_ext_code")); + var search_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_notes")); + var in_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "in_ext_code")); + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_ext_code", Value = "%" + search_ext_code + "%", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_notes", Value = "%" + search_notes + "%", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@start_original_price", Value = start_original_price.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@end_original_price", Value = end_original_price.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@start_markup_times", Value = start_markup_times.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@end_markup_times", Value = end_markup_times.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@start_extra_price", Value = start_extra_price.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@end_extra_price", Value = end_extra_price.ParseToInt(), }); + //paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@in_ext_code", Value = "'" + in_ext_code?.Replace(",", "','") + "'", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@in_ext_code", Value = in_ext_code.ParseToString() }); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(id) from bxx.price_markup p where 1=1"; + + string where = ""; + if (!string.IsNullOrWhiteSpace(search_ext_code)) + where += " and p.ext_code like @search_ext_code"; + if (!string.IsNullOrWhiteSpace(search_notes)) + where += " and p.notes like @search_notes"; + if (!string.IsNullOrWhiteSpace(start_original_price)) + where += " and p.original_price >= @start_original_price"; + if (!string.IsNullOrWhiteSpace(end_original_price)) + where += " and p.original_price <= @end_original_price"; + if (!string.IsNullOrWhiteSpace(start_markup_times)) + where += " and p.markup_times >= @start_markup_times"; + if (!string.IsNullOrWhiteSpace(end_markup_times)) + where += " and p.markup_times <= @end_markup_times"; + if (!string.IsNullOrWhiteSpace(start_extra_price)) + where += " and p.extra_price >= @start_extra_price"; + if (!string.IsNullOrWhiteSpace(end_extra_price)) + where += " and p.extra_price <= @end_extra_price"; + if (!string.IsNullOrEmpty(in_ext_code)) + where += " and p.ext_code in ('" + in_ext_code?.Replace(",", "','") + "')"; + sql += where; + + var count = mySql.ExecuteRowCount(sql, paramLst.ToArray()); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + sql = "select * from bxx.price_markup p where 1=1"; + + //where子句 + sql += where; + + sql += " order by p.id desc"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql, paramLst.ToArray()); + } + + mySql.Close(); + if (dt != null) + { + try + { + List priceList = new List(); + foreach (DataRow row in dt.Rows) + { + DBPriceResultParam price = new DBPriceResultParam + { + id = row["id"].ParseToInt(), + extra_price = row["extra_price"].ParseToInt(), + markup_times = row["markup_times"].ParseToInt(), + original_price = row["original_price"].ParseToInt(), + notes = row["notes"].ParseToString(), + ext_code = row["ext_code"].ParseToString(), + add_time = Convert.ToDateTime(row["add_time"]), + mdy_time = Convert.ToDateTime(row["mdy_time"]), + }; + priceList.Add(price); + } + var data = JsonUtils.SerializerObjectToString(priceList); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string DelDbPrice(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from bxx.price_markup where id='" + id + "'"; + + 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 MdyDBPrice(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var db_id = RegexUtils.GetStringQuery(ref inputData, "db_id"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")); + string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")); + string original_price = RegexUtils.GetStringQuery(ref inputData, "original_price"); + string markup_times = RegexUtils.GetStringQuery(ref inputData, "markup_times"); + string extra_price = RegexUtils.GetStringQuery(ref inputData, "extra_price"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@original_price", Value = original_price.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@markup_times", Value = markup_times.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@extra_price", Value = extra_price.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@db_id", Value = db_id, }); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sqlExist = "select count(ext_code) from bxx.price_markup where ext_code=@ext_code and id!=@db_id"; + var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray()); + if (has != "0") + { + mySql.Close(); + return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}"; + } + + string sql = "update bxx.price_markup set"; + if (notes != null) + sql += " notes=@notes,"; + if (ext_code != null) + sql += " ext_code=@ext_code,"; + if (original_price != null) + sql += " original_price=@original_price,"; + if (markup_times != null) + sql += " markup_times=@markup_times,"; + if (extra_price != null) + sql += " extra_price=@extra_price,"; + sql = sql.TrimEnd(','); + sql += " where id=@db_id;"; + + var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray()); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string AddPurchasePrice(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\":\"校验失败\"}"; + + string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + string shop_name = RegexUtils.GetStringQuery(ref inputData, "shop_name"); + string spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "spu_id")).ParseToString(); + string skc_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "skc_id")).ParseToString(); + string cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_id")).ParseToString(); + string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name")).ParseToString(); + string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString(); + string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name")).ParseToString(); + string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img")).ParseToString(); + string discount = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "discount")).ParseToString(); + string price_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "price_text")).ParseToString(); + string sku_purchase_price_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_purchase_price_json")).ParseToString(); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString(); + + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sqlExist = "select count(spu_id) from bxx.product_purchase_price where spu_id=@spu_id"; + string sql = "insert into bxx.product_purchase_price " + + "(shop_id,shop_name,spu_id,skc_id,cat_id,cat_name,ext_code,product_name,main_img,discount,price_text,sku_purchase_price_json,notes) " + + "values (@shop_id,@shop_name,@spu_id,@skc_id,@cat_id,@cat_name,@ext_code,@product_name,@main_img,@discount,@price_text,@sku_purchase_price_json,@notes);"; + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_id", Value = shop_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_name", Value = shop_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@spu_id", Value = spu_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@skc_id", Value = skc_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@discount", Value = discount.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@price_text", Value = price_text, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@sku_purchase_price_json", Value = sku_purchase_price_json, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, }); + + var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray()); + if (has != "0") + { + mySql.Close(); + return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}"; + } + + var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray()); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":502,\"msg\":\"" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string MdyPurchasePrice(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + var db_id = RegexUtils.GetStringQuery(ref inputData, "db_id"); + string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + string shop_name = RegexUtils.GetStringQuery(ref inputData, "shop_name"); + string cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_id")).ParseToString(); + string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name")).ParseToString(); + string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString(); + string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name")).ParseToString(); + string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img")).ParseToString(); + string discount = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "discount")).ParseToString(); + string price_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "price_text")).ParseToString(); + string sku_purchase_price_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_purchase_price_json")).ParseToString(); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString(); + + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@db_id", Value = db_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_id", Value = shop_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_name", Value = shop_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@discount", Value = discount.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@price_text", Value = price_text, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@sku_purchase_price_json", Value = sku_purchase_price_json, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, }); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "update bxx.product_purchase_price set"; + if (shop_id != null) + sql += " shop_id=@shop_id,"; + if (shop_name != null) + sql += " shop_name=@shop_name,"; + if (cat_id != null) + sql += " cat_id=@cat_id,"; + if (cat_name != null) + sql += " cat_name=@cat_name,"; + if (ext_code != null) + sql += " ext_code=@ext_code,"; + if (product_name != null) + sql += " product_name=@product_name,"; + if (main_img != null) + sql += " main_img=@main_img,"; + if (discount != null) + sql += " discount=@discount,"; + if (price_text != null) + sql += " price_text=@price_text,"; + if (sku_purchase_price_json != null) + sql += " sku_purchase_price_json=@sku_purchase_price_json,"; + if (notes != null) + sql += " notes=@notes,"; + sql = sql.TrimEnd(','); + sql += " where id=@db_id;"; + + var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray()); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetPurchasePriceList(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"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + + var search_spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_spu_id")); + var search_skc_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_skc_id")); + var search_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_ext_code")); + var search_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_notes")); + var in_spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "in_spu_id")); + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_spu_id", Value = "%" + search_spu_id + "%", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_skc_id", Value = "%" + search_skc_id + "%", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_ext_code", Value = "%" + search_ext_code + "%", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_notes", Value = "%" + search_notes + "%", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@in_spu_id", Value = in_spu_id.ParseToString() }); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(id) from bxx.product_purchase_price p where 1=1"; + + string where = ""; + if (!string.IsNullOrWhiteSpace(search_spu_id)) + where += " and p.spu_id like @search_spu_id"; + if (!string.IsNullOrWhiteSpace(search_skc_id)) + where += " and p.skc_id like @search_skc_id"; + if (!string.IsNullOrWhiteSpace(search_ext_code)) + where += " and p.ext_code like @search_ext_code"; + if (!string.IsNullOrWhiteSpace(search_notes)) + where += " and p.notes like @search_notes"; + if (!string.IsNullOrEmpty(in_spu_id)) + where += " and p.spu_id in ('" + in_spu_id?.Replace(",", "','") + "')"; + sql += where; + + var count = mySql.ExecuteRowCount(sql, paramLst.ToArray()); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + sql = "select * from bxx.product_purchase_price p where 1=1"; + + //where子句 + sql += where; + + sql += " order by p.id desc"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql, paramLst.ToArray()); + } + + mySql.Close(); + if (dt != null) + { + try + { + List purchasePriceList = new List(); + foreach (DataRow row in dt.Rows) + { + ProductPurchasePriceResultParam price = new ProductPurchasePriceResultParam + { + id = row["id"].ParseToInt(), + shop_id = row["shop_id"].ParseToString(), + shop_name = row["shop_name"].ParseToString(), + cat_id = row["cat_id"].ParseToString(), + cat_name = row["cat_name"].ParseToString(), + main_img = row["main_img"].ParseToString(), + discount = row["discount"].ParseToInt(), + price_text = row["price_text"].ParseToString(), + product_name = row["product_name"].ParseToString(), + skc_id = row["skc_id"].ParseToString(), + sku_purchase_price_json = row["sku_purchase_price_json"].ParseToString(), + spu_id = row["spu_id"].ParseToString(), + notes = row["notes"].ParseToString(), + ext_code = row["ext_code"].ParseToString(), + add_time = Convert.ToDateTime(row["add_time"]), + mdy_time = Convert.ToDateTime(row["mdy_time"]), + }; + purchasePriceList.Add(price); + } + var data = JsonUtils.SerializerObjectToString(purchasePriceList); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string DelPurchasePrice(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from bxx.product_purchase_price where id='" + id + "'"; + + 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\":\"输入为空\"}"; + } + } +} \ No newline at end of file diff --git a/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs b/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs new file mode 100644 index 0000000..e373766 --- /dev/null +++ b/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs @@ -0,0 +1,790 @@ +using KJD_Web.Model; +using KJD_Web.Utils; +using MySql.Data.MySqlClient; +using NaiBa.Util.Extension; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.Security; + +namespace KJD_Web.BLL.BXX +{ + public class BXXProductManage + { + public string AddProduct(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + string spu_id = RegexUtils.GetStringQuery(ref inputData, "spu_id"); + string skc_id = RegexUtils.GetStringQuery(ref inputData, "skc_id"); + string cat_id = RegexUtils.GetStringQuery(ref inputData, "cat_id"); + string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name"))?.Replace("'", "\\'"); + string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"))?.Replace("'", "\\'"); + string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name"))?.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 main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img"))?.Replace("'", "\\'"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = ""; + + sql = "insert into bxx.product (spu_id,skc_id,cat_id,cat_name,product_name,ext_code,main_img,product_json,size_json,notes,add_time,mdy_time) " + + "values ('" + spu_id + "','" + skc_id + "','" + cat_id + "','" + cat_name + "','" + product_name + "','" + + ext_code + "','" + main_img + "','" + product_json + "','" + size_json + "','" + notes + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetProductList(string inputData, bool isDetail = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'","\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'"); + var search_spu = RegexUtils.GetStringQuery(ref inputData, "search_spu")?.Replace("'", "\\'"); + var search_skc = RegexUtils.GetStringQuery(ref inputData, "search_skc")?.Replace("'", "\\'"); + var search_cat = RegexUtils.GetStringQuery(ref inputData, "search_cat")?.Replace("'", "\\'"); + var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'"); + var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'"); + var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'"); + var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'"); + var get_select_count = RegexUtils.GetStringQuery(ref inputData, "get_select_count")?.Replace("'", "\\'"); + var select_shop_id = RegexUtils.GetStringQuery(ref inputData, "select_shop_id")?.Replace("'", "\\'"); + var sort_field = RegexUtils.GetStringQuery(ref inputData, "sort_field")?.Replace("'", "\\'"); + + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(id) from bxx.product p where 1=1"; + + string where = ""; + if (!string.IsNullOrWhiteSpace(search_spu)) + where += " and p.spu_id like '%" + search_spu + "%'"; + if (!string.IsNullOrWhiteSpace(search_skc)) + where += " and p.skc_id like '%" + search_skc + "%'"; + if (!string.IsNullOrWhiteSpace(search_cat)) + where += " and p.cat_name like '%" + search_cat + "%'"; + if (!string.IsNullOrWhiteSpace(search_ext_code)) + where += " and p.ext_code like '%" + search_ext_code + "%'"; + if (!string.IsNullOrWhiteSpace(search_prod_name)) + where += " and p.product_name like '%" + search_prod_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_notes)) + where += " and p.notes like '%" + search_notes + "%'"; + if (!string.IsNullOrEmpty(search_db_ids)) + where += " and p.id in (" + search_db_ids + ")"; + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + if (isDetail) + sql = "select * from bxx.product p where 1=1"; + else if (string.IsNullOrEmpty(get_select_count)) + sql = "select p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes," + + "p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words from bxx.product p where 1=1"; + else + sql = "SELECT p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes," + + "p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,COUNT(s.id) AS select_count " + + "FROM bxx.product p LEFT JOIN bxx.product_select s ON p.id=s.out_product_id AND s.shop_id='" + select_shop_id + "' " + + "WHERE 1=1"; + + //where子句 + sql += where; + + sql += " group by p.id"; + if (sort_field == "select_total_count") + sql += " order by p.select_total_count desc, p.id desc"; + else + sql += " order by p.id desc"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + if (dt != null) + { + try + { + List productLst = new List(); + foreach (DataRow row in dt.Rows) + { + DBProductResultParam prod = new DBProductResultParam + { + id = Convert.ToInt32(row["id"]), + skc_id = row["skc_id"].ToString(), + spu_id = row["spu_id"].ToString(), + cat_id = row["cat_id"].ToString(), + cat_name = row["cat_name"].ToString(), + product_name = row["product_name"].ToString(), + main_img = row["main_img"].ToString(), + ext_code = row["ext_code"].ToString(), + //product_json = row["product_json"].ToString(), + //size_json = row["size_json"].ToString(), + add_time = Convert.ToDateTime(row["add_time"]), + mdy_time = Convert.ToDateTime(row["mdy_time"]), + notes = row["notes"].ToString(), + select_total_count = row["select_total_count"].ParseToInt(), + end_words = row["end_words"].ParseToString(), + fission_words = row["fission_words"].ParseToString(), + head_words = row["head_words"].ParseToString(), + }; + if (isDetail) + { + prod.product_json = row["product_json"].ToString(); + prod.size_json = row["size_json"].ToString(); + } + if (!string.IsNullOrEmpty(get_select_count)) + { + prod.select_count = row["select_count"].ParseToInt(); + } + productLst.Add(prod); + } + var data = JsonUtils.SerializerObjectToString(productLst); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string DelDbProd(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from bxx.product where id='" + + id + "'"; + + 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 MdyProductNotes(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update bxx.product set"; + if (notes != null) + sql += " notes='" + notes + "',"; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ";"; + + 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 MdyDBProduct(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + var product_name = RegexUtils.GetStringQuery(ref inputData, "product_name")?.Replace("'", "\\'"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'"); + string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"))?.Replace("'", "\\'"); + 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("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update bxx.product set"; + if (product_name != null) + sql += " product_name='" + product_name + "',"; + if (notes != null) + sql += " notes='" + notes + "',"; + if (ext_code != null) + sql += " ext_code='" + ext_code + "',"; + if (fission_words != null) + sql += " fission_words='" + fission_words + "',"; + if (head_words != null) + sql += " head_words='" + head_words + "',"; + if (end_words != null) + sql += " end_words='" + end_words + "',"; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ";"; + + 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 AddUserSelectProduct(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var out_product_Id = RegexUtils.GetStringQuery(ref inputData, "out_product_id")?.Replace("'", "\\'"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'"); + var shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account")?.Replace("'", "\\'"); + var user_name = RegexUtils.GetStringQuery(ref inputData, "main_user_name")?.Replace("'", "\\'"); + var sub_user_name = RegexUtils.GetStringQuery(ref inputData, "sub_user_name")?.Replace("'", "\\'"); + var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + var add_product_remaining = RegexUtils.GetStringQuery(ref inputData, "add_product_remaining").ParseToInt(); + var add_fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_fission_product_name").ParseToString())?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + if (string.IsNullOrEmpty(shop_id)) + { + return "{\"code\":500,\"msg\":\"没有店铺信息\"}"; + } + + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "insert into bxx.product_select " + + "(out_product_Id,shop_id,shop_account,user_name,sub_user_name,notes,status,fission_product_name,add_time,mdy_time) values " + + "('" + out_product_Id + "','" + shop_id + "','" + shop_account + "','" + user_name + "','" + sub_user_name + "','" + + notes + "','" + status + "','" + add_fission_product_name + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + if (add_product_remaining > 0) + { + add_product_remaining = add_product_remaining - 1; + sql += "\r\n"; + sql += "update bxx.shop set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";"; + sql += "update bxx.product set select_total_count=select_total_count+1 where id=" + out_product_Id + ";"; + //sql += "update bxx.shop_add_prod_count set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";"; + sql += "INSERT INTO bxx.shop_add_prod_count(shop_id, add_product_remaining) VALUES('" + shop_id + "'," + add_product_remaining + ")" + + "ON DUPLICATE KEY UPDATE add_product_remaining=VALUES(add_product_remaining)"; + } + 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 MdyUserSelectProductStatus(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + var draft_id = RegexUtils.GetStringQuery(ref inputData, "draft_id")?.Replace("'", "\\'"); + var up_spu_id = RegexUtils.GetStringQuery(ref inputData, "up_spu_id")?.Replace("'", "\\'"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + var add_times = RegexUtils.GetStringQuery(ref inputData, "add_times")?.Replace("'", "\\'"); + + long l_draft_id = draft_id.ParseToLong(); + long l_spu_map_table_id = l_draft_id % 128; + long l_select_map_table_id = id.ParseToLong() % 64; + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = ""; + // 使用事务一次提交多个sql操作 + //sql += "set @@autocommit=0;\r\n"; + sql += "START TRANSACTION;\r\n"; + if (!string.IsNullOrEmpty(up_spu_id) && !string.IsNullOrEmpty(draft_id)) + { + sql += "insert into kjd_map.spu_map_" + l_spu_map_table_id + + " (draft_id,from_spu_id,shop_id) values(" + draft_id + "," + up_spu_id + ",'" + shop_id + "');\r\n"; + sql += "insert into kjd_map.product_select_map_" + l_select_map_table_id + + " (product_id,product_select_db_id,shop_id) values(" + draft_id + "," + id + ",'" + shop_id + "');\r\n"; + } + sql += "update bxx.product_select set"; + if (draft_id != null) + sql += " draft_id='" + draft_id + "',"; + if (status != null) + sql += " status='" + status + "',"; + if (status == "已上传") + sql += " add_times=add_times+1,"; + sql += " mdy_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',"; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ";\r\n"; + var rst = mySql.ExecuteNonQuery(sql); + string errMsg = mySql.Message; + if (string.IsNullOrEmpty(errMsg)) + sql = "COMMIT;"; + else + sql = "ROLLBACK;"; + mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"" + errMsg + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetUserSelectProductList(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "\\'"); + var search_shop_id = RegexUtils.GetStringQuery(ref inputData, "search_shop_id")?.Replace("'", "\\'"); + var search_shop_account = RegexUtils.GetStringQuery(ref inputData, "search_shop_account")?.Replace("'", "\\'"); + var search_spu = RegexUtils.GetStringQuery(ref inputData, "search_spu")?.Replace("'", "\\'"); + var search_skc = RegexUtils.GetStringQuery(ref inputData, "search_skc")?.Replace("'", "\\'"); + var search_cat = RegexUtils.GetStringQuery(ref inputData, "search_cat")?.Replace("'", "\\'"); + var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'"); + var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'"); + var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'"); + var search_user_notes = RegexUtils.GetStringQuery(ref inputData, "search_user_notes")?.Replace("'", "\\'"); + var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'"); + var search_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "search_sub_sa_name")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + + var no_sub_sa = RegexUtils.GetStringQuery(ref inputData, "no_sub_sa")?.Replace("'", "\\'"); + + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(s.id) from bxx.product_select s " + + "left join bxx.product p on s.out_product_id=p.id " + + "left join bxx.user u on s.operate_sub_sa_name=u.user_name " + + "where 1=1"; + + string where = ""; + if (!isAdmin) + where += " and (s.user_name='" + user_name + "' or s.sub_user_name like'%" + user_name + "%')"; + if (!string.IsNullOrEmpty(operate_sub_sa_name)) + { + where += " and s.operate_sub_sa_name = '" + operate_sub_sa_name + "'"; + } + if (no_sub_sa == "true") + where += " and s.operate_sub_sa_name is null"; + if (!string.IsNullOrEmpty(search_db_ids)) + where += " and s.id in (" + search_db_ids + ")"; + if (!string.IsNullOrEmpty(shop_ids)) + where += " and s.shop_id in (" + shop_ids + ")"; + if (!string.IsNullOrWhiteSpace(status)) + where += " and s.status = '" + status + "'"; + if (!string.IsNullOrWhiteSpace(search_shop_id)) + where += " and s.shop_id like '%" + search_shop_id + "%'"; + if (!string.IsNullOrWhiteSpace(search_shop_account)) + where += " and s.shop_account like '%" + search_shop_account + "%'"; + if (!string.IsNullOrWhiteSpace(search_notes)) + { + //核价成功 重复 核价成功(重复) + if (search_notes == "无备注") + where += " and s.notes = ''"; + else if (search_notes == "重复") + where += " and s.notes like '%重复%' and s.notes not like '%核价成功%' and s.notes not like '%核价通过%'"; + else if (search_notes == "核价成功") + where += " and (s.notes like '%核价成功%' or s.notes like '%核价通过%') and s.notes not like '%重复%'"; + else if (search_notes == "核价成功(重复)") + where += " and (s.notes like '%核价成功%' or s.notes like '%核价通过%') and s.notes like '%重复%'"; + else + where += " and s.notes like '%" + search_notes + "%'"; + } + if (!string.IsNullOrWhiteSpace(search_user_notes)) + where += " and s.user_notes like '%" + search_user_notes + "%'"; + if (!string.IsNullOrWhiteSpace(search_spu)) + where += " and p.spu_id like '%" + search_spu + "%'"; + if (!string.IsNullOrWhiteSpace(search_skc)) + where += " and p.skc_id like '%" + search_skc + "%'"; + if (!string.IsNullOrWhiteSpace(search_cat)) + where += " and p.cat_name like '%" + search_cat + "%'"; + if (!string.IsNullOrWhiteSpace(search_ext_code)) + where += " and p.ext_code like '%" + search_ext_code + "%'"; + if (!string.IsNullOrWhiteSpace(search_prod_name)) + where += " and p.product_name like '%" + search_prod_name + "%'"; + if (!string.IsNullOrEmpty(search_sub_sa_name)) + { + where += " and (s.operate_sub_sa_name like '%" + search_sub_sa_name + "%'"; + where += " or u.nick_name like '%" + operate_sub_sa_name + "%')"; + } + + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + //if (isDetail) + //sql = "select * from bxx.product_select where 1=1"; + //else + sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," + + "s.sub_user_name,s.notes,s.user_notes,s.status,s.draft_id,s.add_times,s.add_time,s.mdy_time," + + "s.fission_product_name,s.operate_sub_sa_name,s.add_sub_sa_time," + + "p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img," + + "u.nick_name as operate_sub_sa_nick " + + "from bxx.product_select s left join bxx.product p on s.out_product_id=p.id " + + "left join bxx.user u on u.user_name=s.operate_sub_sa_name " + + "where 1=1"; + + sql += where; // where子句 + + sql += " order by id desc"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + if (dt != null) + { + try + { + List productLst = new List(); + foreach (DataRow row in dt.Rows) + { + ProductSelectResultParam prodSelect = new ProductSelectResultParam() + { + id = row["id"].ParseToInt(), + out_product_Id = row["out_product_Id"].ParseToString(), + shop_account = row["shop_account"].ParseToString(), + shop_id = row["shop_id"].ParseToString(), + status = row["status"].ParseToString(), + sub_user_name = row["sub_user_name"].ParseToString(), + user_name = row["user_name"].ParseToString(), + cat_id = row["cat_id"].ParseToString(), + cat_name = row["cat_name"].ParseToString(), + product_name = row["product_name"].ParseToString(), + main_img = row["main_img"].ParseToString(), + ext_code = row["ext_code"].ParseToString(), + add_time = Convert.ToDateTime(row["add_time"]), + mdy_time = Convert.ToDateTime(row["mdy_time"]), + notes = row["notes"].ParseToString(), + draft_id = row["draft_id"].ParseToString(), + add_times = row["add_times"].ParseToInt(), + skc_id = row["skc_id"].ToString(), + spu_id = row["spu_id"].ToString(), + operate_sub_sa_name = row["operate_sub_sa_name"].ToString(), + operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString(), + fission_product_name = row["fission_product_name"].ToString(), + user_notes = row["user_notes"].ToString(), + //product_json = row["product_json"].ToString(), + //size_json = row["size_json"].ToString(), + }; + prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?; + productLst.Add(prodSelect); + } + var data = JsonUtils.SerializerObjectToString(productLst); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string DelSelectProd(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from bxx.product_select where id='" + + id + "'"; + + 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 SetSelectProductSubSa(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 id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(id) && string.IsNullOrEmpty(shop_id)) + { + return "{\"code\":50002,\"msg\":\"未选择任何待上传\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update bxx.product_select set"; + if (operate_sub_sa_name != null) + sql += " operate_sub_sa_name='" + operate_sub_sa_name + "',"; + sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',"; + sql = sql.TrimEnd(','); + if (!string.IsNullOrEmpty(id)) + sql += " where id in (" + id + ")"; + else if (!string.IsNullOrEmpty(shop_id)) + sql += " where shop_id in ('" + shop_id.Replace(",","','") + "')"; + else + sql += " where 1=2"; + if(!string.IsNullOrEmpty(status)) + sql += " and status='" + status + "';"; + 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 MdyProductSelectNotes(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")); + string user_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_notes")); + string fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_product_name")); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update bxx.product_select set"; + if (notes != null) + sql += " notes=@notes,"; + if (user_notes != null) + sql += " user_notes=@user_notes,"; + if (fission_product_name != null) + sql += " fission_product_name=@fission_product_name,"; + sql = sql.TrimEnd(','); + sql += " where id=@id;"; + + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@id", Value = id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@fission_product_name", Value = fission_product_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@user_notes", Value = user_notes, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, }); + + var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray()); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + } +} + + +/* + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "spu_id", Value = spu_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "skc_id", Value = skc_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "cat_id", Value = cat_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "cat_name", Value = cat_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_name", Value = product_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "ext_code", Value = ext_code, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "main_img", Value = main_img, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_json", Value = product_json, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "size_json", Value = size_json, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "notes", Value = notes.ParseToString(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_md5", Value = product_md5, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "add_time", Value = add_time, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "mdy_time", Value = mdy_time, }); + rst = mySql.ExecuteInsertId(sql, paramLst.ToArray());*/ \ No newline at end of file diff --git a/KJDService/KJD_WebService/BLL/BXX/BXXProductThirdManage.cs b/KJDService/KJD_WebService/BLL/BXX/BXXProductThirdManage.cs new file mode 100644 index 0000000..ae1e9c0 --- /dev/null +++ b/KJDService/KJD_WebService/BLL/BXX/BXXProductThirdManage.cs @@ -0,0 +1,775 @@ +using KJD_Web.Model; +using KJD_Web.Utils; +using MySql.Data.MySqlClient; +using MySqlX.XDevAPI.Common; +using NaiBa.Util.Extension; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.Security; + +namespace KJD_Web.BLL.BXX +{ + public class BXXProductThirdManage + { + public string AddProduct(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + string spu_id = RegexUtils.GetStringQuery(ref inputData, "spu_id"); + string skc_id = RegexUtils.GetStringQuery(ref inputData, "skc_id"); + string cat_id = RegexUtils.GetStringQuery(ref inputData, "cat_id"); + string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name")); + string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")); + string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name")); + string product_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_json")); + string size_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "size_json")); + string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img")); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = ""; + var json_sign = RegexUtils.GetStringJson(ref product_json, "signedImageUrl"); // 取商品json数据里不同签名的部分 + var product_md5 = EncrypUtil.GetMd5(product_json?.Replace(json_sign, "") + size_json); + var product_md5_2 = EncrypUtil.GetMd5(product_json?.Replace("'", "\\'").Replace(json_sign, "") + size_json); + sql = "select id from bxx.third_product where product_md5='" + product_md5 + "' or product_md5='" + product_md5_2 + "';"; + var rst = mySql.ExecuteFirstInt(sql).ParseToLong(); + if (rst <= 0) + { + //sql = "insert into bxx.third_product (spu_id,skc_id,cat_id,cat_name,product_name,ext_code,main_img,product_json,size_json,notes,product_md5,add_time,mdy_time) " + + // "values ('" + spu_id + "','" + skc_id + "','" + cat_id + "','" + cat_name + "','" + product_name + "','" + + // ext_code + "','" + main_img + "','" + product_json + "','" + size_json + "','" + notes + "','" + product_md5 + "','" + + // DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + // DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + //rst = mySql.ExecuteInsertId(sql); + + sql = "insert into bxx.third_product (spu_id,skc_id,cat_id,cat_name,product_name," + + "ext_code,main_img,product_json,size_json,notes,product_md5,add_time,mdy_time) " + + "values (@spu_id,@skc_id,@cat_id,@cat_name,@product_name," + + "@ext_code,@main_img,@product_json,@size_json,@notes,@product_md5," + + "@add_time,@mdy_time);"; + string add_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + string mdy_time = add_time; + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@spu_id", Value = spu_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@skc_id", Value = skc_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_json", Value = product_json, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@size_json", Value = size_json, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes.ParseToString(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_md5", Value = product_md5, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@add_time", Value = add_time, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@mdy_time", Value = mdy_time, }); + rst = mySql.ExecuteInsertId(sql, paramLst.ToArray()); + mySql.Close(); + } + if (rst > 0) + { + return "{\"code\":200,\"msg\":\"success\",\"id\":" + rst + "}"; + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetProductList(string inputData, bool isDetail = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'","\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'"); + var search_spu = RegexUtils.GetStringQuery(ref inputData, "search_spu")?.Replace("'", "\\'"); + var search_skc = RegexUtils.GetStringQuery(ref inputData, "search_skc")?.Replace("'", "\\'"); + var search_cat = RegexUtils.GetStringQuery(ref inputData, "search_cat")?.Replace("'", "\\'"); + var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'"); + var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'"); + var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'"); + var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'"); + + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(id) from bxx.third_product where 1=1"; + + string where = ""; + if (!string.IsNullOrWhiteSpace(search_spu)) + where += " and spu_id like '%" + search_spu + "%'"; + if (!string.IsNullOrWhiteSpace(search_skc)) + where += " and skc_id like '%" + search_skc + "%'"; + if (!string.IsNullOrWhiteSpace(search_cat)) + where += " and cat_name like '%" + search_cat + "%'"; + if (!string.IsNullOrWhiteSpace(search_ext_code)) + where += " and ext_code like '%" + search_ext_code + "%'"; + if (!string.IsNullOrWhiteSpace(search_prod_name)) + where += " and product_name like '%" + search_prod_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_notes)) + where += " and notes like '%" + search_notes + "%'"; + if (!string.IsNullOrEmpty(search_db_ids)) + where += " and id in (" + search_db_ids + ")"; + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + if (isDetail) + sql = "select * from bxx.third_product where 1=1"; + else + sql = "select id,spu_id,skc_id,cat_id,cat_name,change_cat_id,change_cat_name,ext_code,product_name,main_img,notes," + + "add_time,mdy_time from bxx.third_product where 1=1"; + + sql += where; + + sql += " order by id desc"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + if (dt != null) + { + try + { + List productLst = new List(); + foreach (DataRow row in dt.Rows) + { + DBProductResultParam prod = new DBProductResultParam + { + id = Convert.ToInt32(row["id"]), + skc_id = row["skc_id"].ToString(), + spu_id = row["spu_id"].ToString(), + cat_id = row["cat_id"].ToString(), + cat_name = row["cat_name"].ToString(), + change_cat_id = row["change_cat_id"].ToString(), + change_cat_name = row["change_cat_name"].ToString(), + product_name = row["product_name"].ToString(), + main_img = row["main_img"].ToString(), + ext_code = row["ext_code"].ToString(), + //product_json = row["product_json"].ToString(), + //size_json = row["size_json"].ToString(), + add_time = Convert.ToDateTime(row["add_time"]), + mdy_time = Convert.ToDateTime(row["mdy_time"]), + notes = row["notes"].ToString(), + }; + if (isDetail) + { + prod.product_json = row["product_json"].ToString(); + prod.size_json = row["size_json"].ToString(); + } + productLst.Add(prod); + } + var data = JsonUtils.SerializerObjectToString(productLst); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string DelDbProd(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from bxx.third_product where id='" + + id + "'"; + + 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 MdyProductNotes(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update bxx.third_product set"; + if (notes != null) + sql += " notes='" + notes + "',"; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ";"; + + 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 MdyProductCategory(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + string change_cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "change_cat_id"))?.Replace("'", "\\'"); + string change_cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "change_cat_name"))?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update bxx.third_product set"; + if (change_cat_id != null) + sql += " change_cat_id='" + change_cat_id + "',"; + if (change_cat_name != null) + sql += " change_cat_name='" + change_cat_name + "',"; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ";"; + + 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 AddUserSelectProduct(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var out_product_Id = RegexUtils.GetStringQuery(ref inputData, "out_product_id")?.Replace("'", "\\'"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'"); + var shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account")?.Replace("'", "\\'"); + var user_name = RegexUtils.GetStringQuery(ref inputData, "main_user_name")?.Replace("'", "\\'"); + var sub_user_name = RegexUtils.GetStringQuery(ref inputData, "sub_user_name")?.Replace("'", "\\'"); + var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + var add_product_remaining = RegexUtils.GetStringQuery(ref inputData, "add_product_remaining").ParseToInt(); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + if (string.IsNullOrEmpty(shop_id)) + { + return "{\"code\":500,\"msg\":\"没有店铺信息\"}"; + } + + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "insert into bxx.third_product_select (out_product_Id,shop_id,shop_account,user_name,sub_user_name,notes,status,add_time,mdy_time) " + + "values ('" + out_product_Id + "','" + shop_id + "','" + shop_account + "','" + user_name + "','" + sub_user_name + "','" + + notes + "','" + status + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + if (add_product_remaining > 0) + { + add_product_remaining = add_product_remaining - 1; + sql += "\r\n"; + sql += "update bxx.shop set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";"; + //sql += "update bxx.shop_add_prod_count set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";"; + sql += "INSERT INTO bxx.shop_add_prod_count(shop_id, add_product_remaining) VALUES('" + shop_id + "'," + add_product_remaining + ")" + + "ON DUPLICATE KEY UPDATE add_product_remaining=VALUES(add_product_remaining)"; + } + 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 MdyUserSelectProductStatus(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + var draft_id = RegexUtils.GetStringQuery(ref inputData, "draft_id")?.Replace("'", "\\'"); + var up_spu_id = RegexUtils.GetStringQuery(ref inputData, "up_spu_id")?.Replace("'", "\\'"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + var add_times = RegexUtils.GetStringQuery(ref inputData, "add_times")?.Replace("'", "\\'"); + + long l_draft_id = draft_id.ParseToLong(); + long l_spu_map_table_id = l_draft_id % 128; + long l_select_map_table_id = id.ParseToLong() % 64; + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = ""; + // 使用事务一次提交多个sql操作 + //sql += "set @@autocommit=0;\r\n"; + sql += "START TRANSACTION;\r\n"; + if (!string.IsNullOrEmpty(up_spu_id) && !string.IsNullOrEmpty(draft_id)) + { + sql += "insert into kjd_map.spu_map_" + l_spu_map_table_id + + " (draft_id,from_spu_id,shop_id) values(" + draft_id + "," + up_spu_id + ",'" + shop_id + "');\r\n"; + sql += "insert into kjd_map.product_third_select_map_" + l_select_map_table_id + + " (product_id,product_select_db_id,shop_id) values(" + draft_id + "," + id + ",'" + shop_id + "');\r\n"; + } + sql += "update bxx.third_product_select set"; + if (draft_id != null) + sql += " draft_id='" + draft_id + "',"; + if (status != null) + sql += " status='" + status + "',"; + if (status == "已上传") + sql += " add_times=add_times+1,"; + sql += " mdy_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',"; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ";\r\n"; + var rst = mySql.ExecuteNonQuery(sql); + string errMsg = mySql.Message; + if (string.IsNullOrEmpty(errMsg)) + sql = "COMMIT;"; + else + sql = "ROLLBACK;"; + mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"" + errMsg + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetUserSelectProductList(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "\\'"); + var search_shop_id = RegexUtils.GetStringQuery(ref inputData, "search_shop_id")?.Replace("'", "\\'"); + var search_shop_account = RegexUtils.GetStringQuery(ref inputData, "search_shop_account"); + var search_spu = RegexUtils.GetStringQuery(ref inputData, "search_spu")?.Replace("'", "\\'"); + var search_skc = RegexUtils.GetStringQuery(ref inputData, "search_skc")?.Replace("'", "\\'"); + var search_cat = RegexUtils.GetStringQuery(ref inputData, "search_cat")?.Replace("'", "\\'"); + var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'"); + var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name"); + var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'"); + var search_user_notes = RegexUtils.GetStringQuery(ref inputData, "search_user_notes")?.Replace("'", "\\'"); + var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'"); + var search_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "search_sub_sa_name")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + + var no_sub_sa = RegexUtils.GetStringQuery(ref inputData, "no_sub_sa")?.Replace("'", "\\'"); + + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(s.id) from bxx.third_product_select s " + + "left join bxx.third_product p on s.out_product_id=p.id " + + "left join bxx.user u on s.operate_sub_sa_name=u.user_name " + + "where 1=1"; + + string where = ""; + if (!isAdmin) + where += " and (s.user_name='" + user_name + "' or s.sub_user_name like'%" + user_name + "%')"; + if (!string.IsNullOrEmpty(operate_sub_sa_name)) + { + where += " and s.operate_sub_sa_name = '" + operate_sub_sa_name + "'"; + } + if (no_sub_sa == "true") + where += " and s.operate_sub_sa_name is null"; + if (!string.IsNullOrEmpty(search_db_ids)) + where += " and s.id in (" + search_db_ids + ")"; + if (!string.IsNullOrEmpty(shop_ids)) + where += " and s.shop_id in (" + shop_ids + ")"; + if (!string.IsNullOrWhiteSpace(status)) + where += " and s.status = '" + status + "'"; + if (!string.IsNullOrWhiteSpace(search_shop_id)) + where += " and s.shop_id like '%" + search_shop_id + "%'"; + if (!string.IsNullOrWhiteSpace(search_shop_account)) + where += " and s.shop_account like @search_shop_account"; + if (!string.IsNullOrWhiteSpace(search_notes)) + { + //核价成功 重复 核价成功(重复) + if (search_notes == "无备注") + where += " and s.notes = ''"; + else if (search_notes == "重复") + where += " and s.notes like '%重复%' and s.notes not like '%核价成功%' and s.notes not like '%核价通过%'"; + else if (search_notes == "核价成功") + where += " and (s.notes like '%核价成功%' or s.notes like '%核价通过%') and s.notes not like '%重复%'"; + else if (search_notes == "核价成功(重复)") + where += " and (s.notes like '%核价成功%' or s.notes like '%核价通过%') and s.notes like '%重复%'"; + else + where += " and s.notes like '%" + search_notes + "%'"; + } + if (!string.IsNullOrWhiteSpace(search_user_notes)) + where += " and s.user_notes like '%" + search_user_notes + "%'"; + if (!string.IsNullOrWhiteSpace(search_spu)) + where += " and p.spu_id like '%" + search_spu + "%'"; + if (!string.IsNullOrWhiteSpace(search_skc)) + where += " and p.skc_id like '%" + search_skc + "%'"; + if (!string.IsNullOrWhiteSpace(search_cat)) + where += " and p.cat_name like '%" + search_cat + "%'"; + if (!string.IsNullOrWhiteSpace(search_ext_code)) + where += " and p.ext_code like '%" + search_ext_code + "%'"; + if (!string.IsNullOrWhiteSpace(search_prod_name)) + where += " and p.product_name like @search_prod_name"; + if (!string.IsNullOrEmpty(search_sub_sa_name)) + { + where += " and (s.operate_sub_sa_name like '%" + search_sub_sa_name + "%'"; + where += " or u.nick_name like '%" + operate_sub_sa_name + "%')"; + } + + sql += where; + + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_shop_account", Value = "%" + search_shop_account + "%", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_prod_name", Value = "%" + search_prod_name + "%", }); + + var count = mySql.ExecuteRowCount(sql, paramLst.ToArray()); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + //if (isDetail) + //sql = "select * from bxx.third_product_select where 1=1"; + //else + sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," + + "s.sub_user_name,s.notes,s.user_notes,s.status,s.draft_id,s.add_times,s.add_time,s.mdy_time," + + "s.fission_product_name,s.operate_sub_sa_name,s.add_sub_sa_time," + + "p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.change_cat_id,p.change_cat_name,p.ext_code,p.product_name,p.main_img," + + "u.nick_name as operate_sub_sa_nick " + + "from bxx.third_product_select s left join bxx.third_product p on s.out_product_id=p.id " + + "left join bxx.user u on u.user_name=s.operate_sub_sa_name " + + "where 1=1"; + + sql += where; // where子句 + + sql += " order by id desc"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql, paramLst.ToArray()); + } + + mySql.Close(); + if (dt != null) + { + try + { + List productLst = new List(); + foreach (DataRow row in dt.Rows) + { + ProductSelectResultParam prodSelect = new ProductSelectResultParam() + { + id = row["id"].ParseToInt(), + out_product_Id = row["out_product_Id"].ParseToString(), + shop_account = row["shop_account"].ParseToString(), + shop_id = row["shop_id"].ParseToString(), + status = row["status"].ParseToString(), + sub_user_name = row["sub_user_name"].ParseToString(), + user_name = row["user_name"].ParseToString(), + cat_id = row["cat_id"].ParseToString(), + cat_name = row["cat_name"].ParseToString(), + change_cat_id = row["change_cat_id"].ParseToString(), + change_cat_name = row["change_cat_name"].ParseToString(), + product_name = row["product_name"].ParseToString(), + main_img = row["main_img"].ParseToString(), + ext_code = row["ext_code"].ParseToString(), + add_time = Convert.ToDateTime(row["add_time"]), + mdy_time = Convert.ToDateTime(row["mdy_time"]), + notes = row["notes"].ParseToString(), + draft_id = row["draft_id"].ParseToString(), + add_times = row["add_times"].ParseToInt(), + skc_id = row["skc_id"].ToString(), + spu_id = row["spu_id"].ToString(), + operate_sub_sa_name = row["operate_sub_sa_name"].ToString(), + operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString(), + fission_product_name = row["fission_product_name"].ToString(), + user_notes = row["user_notes"].ToString(), + //product_json = row["product_json"].ToString(), + //size_json = row["size_json"].ToString(), + }; + prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?; + productLst.Add(prodSelect); + } + var data = JsonUtils.SerializerObjectToString(productLst); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string DelSelectProd(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from bxx.third_product_select where id='" + + id + "'"; + + 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 SetSelectProductSubSa(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 id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(id) && string.IsNullOrEmpty(shop_id)) + { + return "{\"code\":50002,\"msg\":\"未选择任何待上传\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update bxx.third_product_select set"; + if (operate_sub_sa_name != null) + sql += " operate_sub_sa_name='" + operate_sub_sa_name + "',"; + sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',"; + sql = sql.TrimEnd(','); + if (!string.IsNullOrEmpty(id)) + sql += " where id in (" + id + ")"; + else if (!string.IsNullOrEmpty(shop_id)) + sql += " where shop_id in ('" + shop_id.Replace(",","','") + "')"; + else + sql += " where 1=2"; + if(!string.IsNullOrEmpty(status)) + sql += " and status='" + status + "';"; + 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 MdyProductSelectNotes(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")); + string user_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_notes")); + string fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_product_name")); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update bxx.third_product_select set"; + if (notes != null) + sql += " notes=@notes,"; + if (user_notes != null) + sql += " user_notes=@user_notes,"; + if (fission_product_name != null) + sql += " fission_product_name=@fission_product_name,"; + sql = sql.TrimEnd(','); + sql += " where id=@id;"; + + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@id", Value = id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@fission_product_name", Value = fission_product_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@user_notes", Value = user_notes, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, }); + + var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray()); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + } +} \ No newline at end of file diff --git a/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs b/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs new file mode 100644 index 0000000..b2794b6 --- /dev/null +++ b/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs @@ -0,0 +1,771 @@ +using KJD_Web.Model; +using KJD_Web.Model.ShopModel; +using KJD_Web.Utils; +using MySqlX.XDevAPI; +using NaiBa.Util.Extension; +using System; +using System.Collections.Generic; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Web; +using System.Web.Security; + +namespace KJD_Web.BLL.BXX +{ + public class BXXShopManage + { + public string GetShop(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + var search_id = RegexUtils.GetStringQuery(ref inputData, "search_id"); + var search_user_name = RegexUtils.GetStringQuery(ref inputData, "search_user_name"); + var search_login_name = RegexUtils.GetStringQuery(ref inputData, "search_login_name"); + var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes"); + var search_name = RegexUtils.GetStringQuery(ref inputData, "search_name"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + 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 shop_notes = RegexUtils.GetStringQuery(ref inputData, "shop_notes"); + if (!string.IsNullOrWhiteSpace(shop_notes)) + { + List shopNotesLst = shop_notes.Split(',').ToList(); + shop_notes = "'" + string.Join("','", shopNotesLst) + "'"; + } + + var page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + var page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(); + + if (page_size == 0) + page_size = 50; + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "SELECT COUNT(s.id) FROM bxx.shop s WHERE 1=1"; + + //where子句 + string where = ""; + if (isAdmin) + where += " and (s.cookie='' or s.shop_id!='')"; + if (!isAdmin) + where += " and (s.user_name='" + user_name + "' or s.sub_user_name like '%" + user_name + "%')"; + if (!string.IsNullOrWhiteSpace(operate_sub_sa_name)) + where += " and s.operate_sub_sa_name='" + operate_sub_sa_name + "'"; + if (!string.IsNullOrWhiteSpace(search_user_name)) + where += " and s.user_name like '%" + search_user_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_login_name)) + where += " and s.login_name like '%" + search_login_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_notes)) + where += " and s.notes like '%" + search_notes + "%'"; + if (!string.IsNullOrWhiteSpace(search_id)) + where += " and s.shop_id like '%" + search_id + "%'"; + if (!string.IsNullOrWhiteSpace(search_name)) + where += " and s.shop_account like '%" + search_name + "%'"; + if (!string.IsNullOrWhiteSpace(shop_ids)) + where += " and s.shop_id in (" + shop_ids + ")"; + if (!string.IsNullOrWhiteSpace(shop_names)) + where += " and s.shop_account in (" + shop_names + ")"; + if (!string.IsNullOrWhiteSpace(shop_notes)) + where += " and s.notes in (" + shop_notes + ")"; + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.shop_id,s.shop_account,s.sub_user_name,s.user_name," + + "s.company_name,s.notes,s.login_status,s.login_status2,c.add_product_remaining,c.add_product_month,s.add_time,s.mdy_time," + + "s.add_sub_sa_time,s.operate_sub_sa_name"; + //sql += " FROM bxx.shop s WHERE 1=1"; + sql += " FROM bxx.shop s LEFT JOIN bxx.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1"; + + sql += where; // where 子句 + + sql += " ORDER BY s.id DESC"; + sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + if (dt != null) + { + List shopList=new List(); + foreach (DataRow row in dt.Rows) + { + ShopParam shop = new ShopParam + { + id = Convert.ToInt32(row["id"]), + login_name = row["login_name"].ToString(), + login_pass = row["login_pass"].ToString(), + cookie = row["cookie"].ToString(), + cookie2 = row["cookie2"].ToString(), + shop_id = row["shop_id"].ToString(), + shop_account = row["shop_account"].ToString(), + sub_user_name = row["sub_user_name"].ToString(), + user_name = row["user_name"].ToString(), + company_name = row["company_name"].ToString(), + notes = row["notes"].ToString(), + login_status = row["login_status"].ToString(), + login_status2 = row["login_status2"].ToString(), + add_product_remaining = row["add_product_remaining"].ParseToInt(), + add_product_month = row["add_product_month"].ParseToInt(), + operate_sub_sa_name = row["operate_sub_sa_name"] as string, + + }; + shopList.Add(shop); + } + + //sql = "\r\nINSERT INTO bxx.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES "; + //foreach (var shop in shopList) + //{ + // sql += "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + shop.add_product_remaining + "," + shop.add_product_month + "),"; + //} + //sql = sql.TrimEnd(',') + " \r\n"; + //sql += "ON DUPLICATE KEY UPDATE " + + // "shop_account=VALUES(shop_account)," + + // "add_product_remaining=VALUES(add_product_remaining)," + + // "add_product_month=VALUES(add_product_month);"; + //var result = mySql.ExecuteNonQuery(sql); + //mySql.Close(); + + int month = DateTime.Now.Month; + var shopMonthList = shopList.Where(s => s.add_product_month != month); + if (shopMonthList.Count() > 0) + { + int remainCount = 100; + var shopMonthIdList = shopMonthList.Select(s => s.id); + mySql = new MysqlUtils(conn); + string ids = string.Join(",", shopMonthIdList); + sql = ""; + sql += "update bxx.shop set add_product_remaining=" + remainCount + ", add_product_month=" + month + + " where 1=1 and id in (" + ids + ");"; + + sql += "\r\nINSERT INTO bxx.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES "; + foreach (var shop in shopMonthList) + { + sql+= "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + remainCount + "," + month + "),"; + } + sql = sql.TrimEnd(',') + " \r\n"; + sql += "ON DUPLICATE KEY UPDATE " + + "shop_account=VALUES(shop_account)," + + "add_product_remaining=VALUES(add_product_remaining)," + + "add_product_month=VALUES(add_product_month);"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + + if (rst) + { + foreach (var shop in shopMonthList) + { + shop.add_product_month = month; + shop.add_product_remaining = remainCount; + } + } + } + var data = JsonUtils.SerializerObjectToString(shopList); + + + //return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + public string SubSaGetSelectProdShop(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + var search_id = RegexUtils.GetStringQuery(ref inputData, "search_id"); + var search_user_name = RegexUtils.GetStringQuery(ref inputData, "search_user_name"); + var search_login_name = RegexUtils.GetStringQuery(ref inputData, "search_login_name"); + var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes"); + var search_name = RegexUtils.GetStringQuery(ref inputData, "search_name"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + 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 shop_notes = RegexUtils.GetStringQuery(ref inputData, "shop_notes"); + if (!string.IsNullOrWhiteSpace(shop_notes)) + { + List shopNotesLst = shop_notes.Split(',').ToList(); + shop_notes = "'" + string.Join("','", shopNotesLst) + "'"; + } + + var page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + var page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(); + + if (page_size == 0) + page_size = 50; + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "SELECT COUNT(s.id) FROM bxx.shop s WHERE 1=1"; + + //where子句 + string where = ""; + if (!string.IsNullOrWhiteSpace(operate_sub_sa_name)) + where += " and (s.shop_id in (SELECT DISTINCT shop_id From bxx.product_select WHERE operate_sub_sa_name='" + operate_sub_sa_name + "') or " + + "s.shop_id in (SELECT DISTINCT shop_id From bxx.third_product_select WHERE operate_sub_sa_name='" + operate_sub_sa_name + "'))"; + where += " and (s.cookie='' or s.shop_id!='')"; + //if (!string.IsNullOrWhiteSpace(operate_sub_sa_name)) + // where += " and s.operate_sub_sa_name='" + operate_sub_sa_name + "'"; + if (!string.IsNullOrWhiteSpace(search_user_name)) + where += " and s.user_name like '%" + search_user_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_login_name)) + where += " and s.login_name like '%" + search_login_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_notes)) + where += " and s.notes like '%" + search_notes + "%'"; + if (!string.IsNullOrWhiteSpace(search_id)) + where += " and s.shop_id like '%" + search_id + "%'"; + if (!string.IsNullOrWhiteSpace(search_name)) + where += " and s.shop_account like '%" + search_name + "%'"; + if (!string.IsNullOrWhiteSpace(shop_ids)) + where += " and s.shop_id in (" + shop_ids + ")"; + if (!string.IsNullOrWhiteSpace(shop_names)) + where += " and s.shop_account in (" + shop_names + ")"; + if (!string.IsNullOrWhiteSpace(shop_notes)) + where += " and s.notes in (" + shop_notes + ")"; + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.shop_id,s.shop_account,s.sub_user_name,s.user_name," + + "s.company_name,s.notes,s.login_status,s.login_status2,c.add_product_remaining,c.add_product_month,s.add_time,s.mdy_time," + + "s.add_sub_sa_time,s.operate_sub_sa_name"; + sql += " FROM bxx.shop s LEFT JOIN bxx.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1"; + + sql += where; // where 子句 + + sql += " ORDER BY s.id DESC"; + sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + if (dt != null) + { + List shopList = new List(); + foreach (DataRow row in dt.Rows) + { + ShopParam shop = new ShopParam + { + id = Convert.ToInt32(row["id"]), + login_name = row["login_name"].ToString(), + login_pass = row["login_pass"].ToString(), + cookie = row["cookie"].ToString(), + cookie2 = row["cookie2"].ToString(), + shop_id = row["shop_id"].ToString(), + shop_account = row["shop_account"].ToString(), + sub_user_name = row["sub_user_name"].ToString(), + user_name = row["user_name"].ToString(), + company_name = row["company_name"].ToString(), + notes = row["notes"].ToString(), + login_status = row["login_status"].ToString(), + login_status2 = row["login_status2"].ToString(), + add_product_remaining = row["add_product_remaining"].ParseToInt(), + add_product_month = row["add_product_month"].ParseToInt(), + operate_sub_sa_name = row["operate_sub_sa_name"] as string, + + }; + shopList.Add(shop); + } + + //sql = "\r\nINSERT INTO bxx.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES "; + //foreach (var shop in shopList) + //{ + // sql += "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + shop.add_product_remaining + "," + shop.add_product_month + "),"; + //} + //sql = sql.TrimEnd(',') + " \r\n"; + //sql += "ON DUPLICATE KEY UPDATE " + + // "shop_account=VALUES(shop_account)," + + // "add_product_remaining=VALUES(add_product_remaining)," + + // "add_product_month=VALUES(add_product_month);"; + //var result = mySql.ExecuteNonQuery(sql); + //mySql.Close(); + + int month = DateTime.Now.Month; + var shopMonthList = shopList.Where(s => s.add_product_month != month); + if (shopMonthList.Count() > 0) + { + int remainCount = 100; + var shopMonthIdList = shopMonthList.Select(s => s.id); + mySql = new MysqlUtils(conn); + string ids = string.Join(",", shopMonthIdList); + sql = ""; + sql += "update bxx.shop set add_product_remaining=" + remainCount + ", add_product_month=" + month + + " where 1=1 and id in (" + ids + ");"; + + sql += "\r\nINSERT INTO bxx.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES "; + foreach (var shop in shopMonthList) + { + sql += "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + remainCount + "," + month + "),"; + } + sql = sql.TrimEnd(',') + " \r\n"; + sql += "ON DUPLICATE KEY UPDATE " + + "shop_account=VALUES(shop_account)," + + "add_product_remaining=VALUES(add_product_remaining)," + + "add_product_month=VALUES(add_product_month);"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + + if (rst) + { + foreach (var shop in shopMonthList) + { + shop.add_product_month = month; + shop.add_product_remaining = remainCount; + } + } + } + var data = JsonUtils.SerializerObjectToString(shopList); + + + //return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + + + public string UpdateAddProdRemaining(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"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + var remainCount = RegexUtils.GetStringQuery(ref inputData, "remain_count"); + 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) + "'"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = ""; + sql += "update bxx.shop_add_prod_count set add_product_remaining=" + remainCount + + " where 1=1 and shop_id in (" + shop_ids + ");"; + + var rst = mySql.ExecuteNonQuery(sql); + var msg = mySql.Message; + mySql.Close(); + + if (rst) + return "{\"code\":200,\"msg\":\"success\"}"; + else + return "{\"code\":50000,\"msg\":\"" + msg + "\"}"; + } + else + { + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + } + + //获取一个手机登录号码下的所有店铺(以便有则更新,无则新增) + public string GetOneLoginNameShop(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + 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 id,login_name,login_pass,cookie,cookie2,shop_id,shop_account,sub_user_name,user_name from bxx.shop where user_name='" + + user_name + "' and login_name='" + login_name + "'"; + + var dt = mySql.ExecuteDataTable(sql); + mySql.Close(); + if (dt != null) + { + List shopList = new List(); + foreach (DataRow row in dt.Rows) + { + ShopParam shop = new ShopParam + { + id = Convert.ToInt32(row["id"]), + login_name = row["login_name"].ToString(), + login_pass = row["login_pass"].ToString(), + cookie = row["cookie"].ToString(), + cookie2 = row["cookie2"].ToString(), + shop_id = row["shop_id"].ToString(), + shop_account = row["shop_account"].ToString(), + sub_user_name = row["sub_user_name"].ToString(), + user_name = row["user_name"].ToString(), + company_name = row["company_name"].ToString(), + notes = row["notes"].ToString(), + login_status = row["login_status"].ToString(), + }; + shopList.Add(shop); + } + var data = JsonUtils.SerializerObjectToString(shopList); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + //获取一个手机登录号码下特定ID的店铺 + public string GetOneIdShop(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "select id,login_name,login_pass,cookie,cookie2,shop_id,shop_account,sub_user_name,user_name from bxx.shop where user_name='" + + user_name + "' and login_name='" + login_name + "' and shop_id='" + shop_id + "'"; + + var dt = mySql.ExecuteDataTable(sql); + mySql.Close(); + if (dt != null) + { + List shopList = new List(); + foreach (DataRow row in dt.Rows) + { + ShopParam shop = new ShopParam + { + id = Convert.ToInt32(row["id"]), + login_name = row["login_name"].ToString(), + login_pass = row["login_pass"].ToString(), + cookie = row["cookie"].ToString(), + cookie2 = row["cookie2"].ToString(), + shop_id = row["shop_id"].ToString(), + shop_account = row["shop_account"].ToString(), + sub_user_name = row["sub_user_name"].ToString(), + user_name = row["user_name"].ToString(), + company_name = row["company_name"].ToString(), + notes = row["notes"].ToString(), + login_status = row["login_status"].ToString(), + }; + shopList.Add(shop); + } + var data = JsonUtils.SerializerObjectToString(shopList); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + public string AddShop(string inputData, bool isAdmin=false) + { + if (!string.IsNullOrEmpty(inputData)) + { + string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + if (isAdmin) + user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name"); + string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + string login_pass = RegexUtils.GetStringQuery(ref inputData, "login_pass"); + string sub_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_user_name")); + string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie"); + string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2"); + string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + string shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account"); + string group_name = RegexUtils.GetStringQuery(ref inputData, "group_name"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")); + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + if (string.IsNullOrEmpty(login_name)) + { + return "{\"code\":501,\"msg\":\"没有店铺登录名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = ""; + if (string.IsNullOrEmpty(shop_id)) + sql = "select exists (select 1 from bxx.shop where login_name='" + login_name + "' and user_name='" + user_name + "')"; + else + sql = "select exists (select 1 from bxx.shop where login_name='" + login_name + "' and user_name='" + user_name + + "' and shop_id='" + shop_id + "')"; + var exist = mySql.ExecuteFirstInt(sql); + if (exist>0) + { + mySql.Close(); + return "{\"code\":500,\"msg\":\"店铺" + login_name +" " + shop_account + "已存在\"}"; + } + + sql = "insert into bxx.shop (login_name,login_pass,cookie,cookie2,shop_account,shop_id,sub_user_name,user_name,group_name,notes,add_time,mdy_time) " + + "values ('" + login_name + "','" + login_pass + "','" + cookie + "','" + cookie2 + "','" + shop_account + "','" + shop_id + "','" + + sub_user_name + "','" + user_name + "','" + group_name + "','" + notes + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + public string MdyShop(string inputData, bool isAdmin=false) + { + if (!string.IsNullOrEmpty(inputData)) + { + string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + if (isAdmin) + user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name"); + string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + string login_pass = RegexUtils.GetStringQuery(ref inputData, "login_pass"); + string sub_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_user_name")); + string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie"); + string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2"); + string new_shop_id = RegexUtils.GetStringQuery(ref inputData, "new_shop_id"); + string old_shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + string shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account"); + string group_name = RegexUtils.GetStringQuery(ref inputData, "group_name"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")); + string login_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status")); + + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + if (string.IsNullOrEmpty(login_name)) + { + return "{\"code\":501,\"msg\":\"没有店铺登录名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update bxx.shop set"; + if (login_pass != null) + sql += " login_pass='" + login_pass + "',"; + if (cookie != null) + sql += " cookie='" + cookie + "',"; + if (cookie2 != null) + sql += " cookie2='" + cookie2 + "',"; + if (new_shop_id != null) + sql += " shop_id='" + new_shop_id + "',"; + if (shop_account != null) + sql += " shop_account='" + shop_account + "',"; + if (sub_user_name != null) + sql += " sub_user_name='" + sub_user_name + "',"; + if (group_name != null) + sql += " group_name='" + group_name + "',"; + if (notes != null) + sql += " notes='" + notes + "',"; + if (login_status != null) + sql += " login_status='" + login_status + "',"; + sql = sql.TrimEnd(','); + sql += " where login_name='" + login_name + "' and (user_name='" + user_name + "' or sub_user_name like '%" + user_name + "%')"; + if (!string.IsNullOrEmpty(old_shop_id)) + sql += " and shop_id='" + old_shop_id + "'"; + + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + public string MdyCookieAndLoginStatus(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie"); + string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2"); + string login_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status")); + string login_status2 = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status2")); + + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + if (string.IsNullOrEmpty(login_name)) + { + return "{\"code\":500,\"msg\":\"店铺没有登录名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update bxx.shop set"; + if (cookie != null) + sql += " cookie='" + cookie + "',"; + if (cookie2 != null) + sql += " cookie2='" + cookie2 + "',"; + if (login_status != null) + sql += " login_status='" + login_status + "',"; + if (login_status2 != null) + sql += " login_status2='" + login_status2 + "',"; + sql = sql.TrimEnd(','); + sql += " where login_name='" + login_name + "'"; + + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + + public string DelShop(string inputData, bool isAdmin=false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + if (isAdmin) + user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + if (string.IsNullOrEmpty(login_name)) + { + return "{\"code\":501,\"msg\":\"没有店铺登录名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from bxx.shop where user_name='" + user_name + "' and login_name='" + login_name + "'"; + if (!string.IsNullOrEmpty(shop_id)) + sql += " and shop_id='" + shop_id + "'"; + + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + /// + /// 设置店铺的二级超管 + /// + /// + public string SetShopSubSa(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 id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + var login_name = RegexUtils.GetStringQuery(ref inputData, "shop_login_name")?.Replace("'", "\\'"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(id) && string.IsNullOrEmpty(login_name)) + { + return "{\"code\":50002,\"msg\":\"未选择任何待上传\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update bxx.shop set"; + if (operate_sub_sa_name != null) + sql += " operate_sub_sa_name='" + operate_sub_sa_name + "',"; + sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',"; + sql = sql.TrimEnd(','); + if (!string.IsNullOrEmpty(id)) + sql += " where id in (" + id + ")"; + else if (!string.IsNullOrEmpty(login_name)) + sql += " where login_name in ('" + login_name.Replace(",", "','") + "')"; + else + sql += " where 1=2"; + 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\":\"输入为空\"}"; + } + } +} \ No newline at end of file diff --git a/KJDService/KJD_WebService/BLL/BXX/BXXUserManage.cs b/KJDService/KJD_WebService/BLL/BXX/BXXUserManage.cs new file mode 100644 index 0000000..083ffbb --- /dev/null +++ b/KJDService/KJD_WebService/BLL/BXX/BXXUserManage.cs @@ -0,0 +1,470 @@ +using KJD_Web.Model; +using KJD_Web.Utils; +using NaiBa.Util.Extension; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Web; +using System.Web.UI.WebControls; + +namespace KJD_Web.BLL.BXX +{ + public class BXXUserManage + { + public string CheckUserLogin(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var mobile = RegexUtils.GetStringQuery(ref inputData, "mobile")?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'"); + 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 * from bxx.user where user_name='" + + mobile + "' and password='" + password + "'"; + + var dt = mySql.ExecuteDataTable(sql); + mySql.Close(); + if (dt != null) + { + foreach (DataRow row in dt.Rows) + { + UserLoginResultParam user = new UserLoginResultParam + { + id = Convert.ToInt32(row["id"]), + user_name = row["user_name"].ToString(), + nick_name = row["nick_name"].ToString(), + mobile = row["user_name"].ToString(), + password = row["password"].ToString(), + group_id = row["group_id"].ToString(), + card_id = row["card_id"].ToString(), + company_name = row["company_name"].ToString(), + is_sa = row.Table.Columns.Contains("is_sa") ? row["is_sa"].ParseToInt() : 0, + sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0, + }; + + if (string.IsNullOrEmpty(user.company_name)) + { + user.company_name = "-"; + } + var data = JsonUtils.SerializerObjectToString(user); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + } + return "{\"code\":1,\"msg\":\"用户名或密码错误\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string AddSubUser(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var parent_user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_nick_name"))?.Replace("'", "\\'"); + var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_name"))?.Replace("'", "\\'"); + var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_mobile"))?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "sub_password")?.Replace("'", "\\'"); + var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'"); + var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'"); + var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "company"))?.Replace("'", "\\'"); + var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'"); + 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 = ""; + sql = "select exists (select 1 from bxx.user where user_name='" + user_name + "')"; + var exist = mySql.ExecuteFirstInt(sql); + if (exist > 0) + { + mySql.Close(); + return "{\"code\":500,\"msg\":\"用户名已存在\"}"; + } + + sql = "insert into bxx.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,parent_user_name,add_time,mdy_time) " + + "values ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" + + group_id + "','" + company_name + "','" + notes + "','" + parent_user_name + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (!rst) + return "{\"code\":501,\"msg\":\""+ mySql.Message + "\"}"; + else + return "{\"code\":200,\"msg\":\"子账户创建成功!\"}"; + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetSubUser(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + var group = RegexUtils.GetStringQuery(ref inputData, "group"); + 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 * from bxx.user where parent_user_name='" + + user_name + "'"; + + var dt = mySql.ExecuteDataTable(sql); + mySql.Close(); + if (dt != null) + { + List userList = new List(); + foreach (DataRow row in dt.Rows) + { + + UserLoginResultParam user = new UserLoginResultParam + { + id = Convert.ToInt32(row["id"]), + user_name = row["user_name"].ToString(), + nick_name = row["nick_name"].ToString(), + mobile = row["mobile"].ToString(), + password = row["password"].ToString(), + group_id = row["group_id"].ToString(), + card_id = row["card_id"].ToString(), + parent_user_name = row["parent_user_name"].ToString(), + company_name = row["company_name"].ToString(), + notes = row["notes"].ToString(), + }; + if (string.IsNullOrEmpty(user.mobile)) + { + user.mobile = row["user_name"].ToString(); + } + userList.Add(user); + } + var data = JsonUtils.SerializerObjectToString(userList); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string UpdateSubUser(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var id = RegexUtils.GetStringQuery(ref inputData, "id")?.Replace("'", "\\'"); + var parent_user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_nick_name"))?.Replace("'", "\\'"); + var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_name"))?.Replace("'", "\\'"); + var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_mobile"))?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "sub_password")?.Replace("'", "\\'"); + var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'"); + var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'"); + var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'"); + 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 = ""; + //sql = "select * from bxx.user where parent_user_name='" + // + user_name + "'"; + sql = "update bxx.user set"; + if (!string.IsNullOrEmpty(nick_name)) + sql += " nick_name='" + nick_name + "',"; + if (!string.IsNullOrEmpty(user_name)) + sql += " user_name='" + user_name + "',"; + if (!string.IsNullOrEmpty(mobile)) + sql += " mobile='" + mobile + "',"; + if (!string.IsNullOrEmpty(password)) + sql += " password='" + password + "',"; + if (!string.IsNullOrEmpty(group_id)) + sql += " group_id=" + group_id + ","; + if (!string.IsNullOrEmpty(card_id)) + sql += " card_id='" + card_id + "',"; + if (!string.IsNullOrEmpty(notes)) + sql += " notes='" + notes + "',"; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ""; + + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + + public string DelUser(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var id = RegexUtils.GetStringQuery(ref inputData, "id"); + 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 = "delete from bxx.user where id='" + + id + "'"; + + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + return "{\"code\":500,\"msg\":\"删除失败,请稍后重试\"}"; + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetAllUser(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'"); + var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'"); + var search = RegexUtils.GetStringQuery(ref inputData, "search")?.Replace("'", "\\'"); + var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'"); + 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 * from bxx.user where group_id=3"; + string sql = "select * from bxx.user where 1=1"; + if (!string.IsNullOrEmpty(group_id)) + sql += " and group_id=" + group_id; + if (!string.IsNullOrEmpty(sa_level)) + sql += " and sa_level=" + sa_level; + if (!string.IsNullOrEmpty(search)) + sql += " and (user_name like '%" + search + + "%' or nick_name like '%" + search + + "%' or company_name like '%" + search + "%')"; + sql += " order by id desc"; + + var dt = mySql.ExecuteDataTable(sql); + mySql.Close(); + if (dt != null) + { + List userList = new List(); + foreach (DataRow row in dt.Rows) + { + + UserLoginResultParam user = new UserLoginResultParam + { + id = Convert.ToInt32(row["id"]), + user_name = row["user_name"].ToString(), + nick_name = row["nick_name"].ToString(), + mobile = row["mobile"].ToString(), + password = row["password"].ToString(), + group_id = row["group_id"].ToString(), + card_id = row["card_id"].ToString(), + parent_user_name = row["parent_user_name"].ToString(), + company_name = row["company_name"].ToString(), + notes = row["notes"].ToString(), + is_sa = row.Table.Columns.Contains("is_sa") ? row["is_sa"].ParseToInt() : 0, + sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0, + }; + if (string.IsNullOrEmpty(user.mobile)) + { + user.mobile = row["user_name"].ToString(); + } + userList.Add(user); + } + var data = JsonUtils.SerializerObjectToString(userList); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string AddUser(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_nick_name"))?.Replace("'", "\\'"); + var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'"); + var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_mobile"))?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "add_password")?.Replace("'", "\\'"); + var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_company"))?.Replace("'", "\\'"); + var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'"); ; + var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'"); + var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'"); + var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'"); + 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 = ""; + sql = "select exists (select 1 from bxx.user where user_name='" + user_name + "')"; + var exist = mySql.ExecuteFirstInt(sql); + if (exist > 0) + { + mySql.Close(); + return "{\"code\":500,\"msg\":\"用户名已存在\"}"; + } + + sql = "insert into bxx.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,sa_level,add_time,mdy_time) " + + "values ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" + + group_id + "','" + company_name + "','" + notes + "'," + sa_level + ",'" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (!rst) + return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}"; + else + return "{\"code\":200,\"msg\":\"success\"}"; + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string UpdateUser(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var id = RegexUtils.GetStringQuery(ref inputData, "id")?.Replace("'", "\\'"); + var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_nick_name"))?.Replace("'", "\\'"); + var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'"); + var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_mobile"))?.Replace("'", "\\'"); + var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_company"))?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "add_password")?.Replace("'", "\\'"); + var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'"); + var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'"); + var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'"); + var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'"); + 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 = ""; + //sql = "select * from bxx.user where parent_user_name='" + // + user_name + "'"; + sql = "update bxx.user set"; + if (!string.IsNullOrEmpty(nick_name)) + sql += " nick_name='" + nick_name + "',"; + if (!string.IsNullOrEmpty(user_name)) + sql += " user_name='" + user_name + "',"; + if (!string.IsNullOrEmpty(mobile)) + sql += " mobile='" + mobile + "',"; + if (!string.IsNullOrEmpty(company_name)) + sql += " company_name='" + company_name + "',"; + if (!string.IsNullOrEmpty(password)) + sql += " password='" + password + "',"; + if (!string.IsNullOrEmpty(group_id)) + sql += " group_id=" + group_id + ","; + if (!string.IsNullOrEmpty(card_id)) + sql += " card_id='" + card_id + "',"; + if (!string.IsNullOrEmpty(notes)) + sql += " notes='" + notes + "',"; + if (!string.IsNullOrEmpty(sa_level)) + sql += " sa_level=" + sa_level + ","; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ""; + + 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 ChangePassword(string inputData) + { + var userName = RegexUtils.GetStringJson(ref inputData, "user_name")?.Replace("'", "\\'"); + var password = RegexUtils.GetStringJson(ref inputData, "password")?.Replace("'", "\\'"); + var newPassword = RegexUtils.GetStringJson(ref inputData, "new_password")?.Replace("'", "\\'"); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["Conn"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "select user_id,password from pepdtp.user where user_id='" + + userName + "' and password='" + password + "'"; + + var dw = mySql.ExecuteDataTableRow(sql); + if (dw != null) + { + UserLoginResultParam user = new UserLoginResultParam + { + user_name = dw["user_id"].ToString(), + password = dw["password"].ToString(), + }; + sql = "update pepdtp.user set password = '" + newPassword + "' where user_id='" + userName + "'"; + var result = mySql.ExecuteNonQuery(sql); + mySql.Close(); + + if (result) + { + return "{\"code\":0,\"msg\":\"密码修改成功!\"}"; + } + else + return "{\"code\":19999,\"msg\":\"密码修改失败!请稍后再试。\"}"; + } + else + { + mySql.Close(); + return "{\"code\":1,\"msg\":\"原密码错误。\"}"; + } + } + + public string return_package_secret_key { get; set; } = "aaMETt2bPe6YHzZ1ojbC+6wOvgtwehqc6A+/Rz+pCUU="; + + public string GetPackageSign(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var mobile = RegexUtils.GetStringQuery(ref inputData, "mobile")?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'"); + var timestamp = RegexUtils.GetStringQuery(ref inputData, "timestamp")?.Replace("'", "\\'"); + var mallId = RegexUtils.GetStringQuery(ref inputData, "mallId")?.Replace("'", "\\'"); + var returnPackageNo = RegexUtils.GetStringQuery(ref inputData, "returnPackageNo")?.Replace("'", "\\'"); + int r2 = RegexUtils.GetStringQuery(ref inputData, "r2").ParseToInt(); + string c2 = RegexUtils.GetStringQuery(ref inputData, "c2"); + + if (EncrypUtil.Encryption(r2) != c2) + return "{\"code\":2,\"msg\":\"不合法的输入内容\"}"; + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "select * from bxx.user where user_name='" + + mobile + "' and password='" + password + "'"; + + sql = "select * from bxx.user where user_name='" + mobile + "'"; + + var dt = mySql.ExecuteDataTable(sql); + mySql.Close(); + if (dt == null || dt.Rows.Count <=0) + { + return "{\"code\":1,\"msg\":\"用户不存在\"}"; + } + + string sign = EncrypUtil.GetMd5(timestamp + return_package_secret_key + mallId + returnPackageNo).ToLower(); + + return "{\"code\":200, \"sign\":\"" + sign + "\", \"msg\":\"\"}"; + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + } +} \ No newline at end of file diff --git a/KJDService/KJD_WebService/BLL/KJD/PriceManage.cs b/KJDService/KJD_WebService/BLL/KJD/PriceManage.cs new file mode 100644 index 0000000..60cabbc --- /dev/null +++ b/KJDService/KJD_WebService/BLL/KJD/PriceManage.cs @@ -0,0 +1,600 @@ +using KJD_Web.Model; +using KJD_Web.Utils; +using MySql.Data.MySqlClient; +using NaiBa.Util.Extension; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.Security; + +namespace KJD_Web.BLL +{ + public class PriceManage + { + public string AddPrice(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\":\"校验失败\"}"; + + string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString(); + int original_price = RegexUtils.GetStringQuery(ref inputData, "original_price").ParseToInt(); + int markup_times = RegexUtils.GetStringQuery(ref inputData, "markup_times").ParseToInt(); + int extra_price = RegexUtils.GetStringQuery(ref inputData, "extra_price").ParseToInt(); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString(); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sqlExist = "select count(ext_code) from kjd.price_markup where ext_code=@ext_code"; + string sql = "insert into kjd.price_markup " + + "(ext_code,original_price,markup_times,extra_price,notes) " + + "values (@ext_code,@original_price,@markup_times,@extra_price,@notes);"; + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@original_price", Value = original_price, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@markup_times", Value = markup_times, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@extra_price", Value = extra_price, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, }); + + var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray()); + if (has != "0") + { + mySql.Close(); + return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}"; + } + + var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray()); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":502,\"msg\":\"" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetPriceList(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"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + + string start_original_price = RegexUtils.GetStringQuery(ref inputData, "start_original_price"); + string end_original_price = RegexUtils.GetStringQuery(ref inputData, "end_original_price"); + string start_markup_times = RegexUtils.GetStringQuery(ref inputData, "start_markup_times"); + string end_markup_times = RegexUtils.GetStringQuery(ref inputData, "end_markup_times"); + string start_extra_price = RegexUtils.GetStringQuery(ref inputData, "start_extra_price"); + string end_extra_price = RegexUtils.GetStringQuery(ref inputData, "end_extra_price"); + var search_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_ext_code")); + var search_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_notes")); + var in_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "in_ext_code")); + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_ext_code", Value = "%" + search_ext_code + "%", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_notes", Value = "%" + search_notes + "%", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@start_original_price", Value = start_original_price.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@end_original_price", Value = end_original_price.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@start_markup_times", Value = start_markup_times.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@end_markup_times", Value = end_markup_times.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@start_extra_price", Value = start_extra_price.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@end_extra_price", Value = end_extra_price.ParseToInt(), }); + //paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@in_ext_code", Value = "'" + in_ext_code?.Replace(",", "','") + "'", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@in_ext_code", Value = in_ext_code.ParseToString() }); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(id) from kjd.price_markup p where 1=1"; + + string where = ""; + if (!string.IsNullOrWhiteSpace(search_ext_code)) + where += " and p.ext_code like @search_ext_code"; + if (!string.IsNullOrWhiteSpace(search_notes)) + where += " and p.notes like @search_notes"; + if (!string.IsNullOrWhiteSpace(start_original_price)) + where += " and p.original_price >= @start_original_price"; + if (!string.IsNullOrWhiteSpace(end_original_price)) + where += " and p.original_price <= @end_original_price"; + if (!string.IsNullOrWhiteSpace(start_markup_times)) + where += " and p.markup_times >= @start_markup_times"; + if (!string.IsNullOrWhiteSpace(end_markup_times)) + where += " and p.markup_times <= @end_markup_times"; + if (!string.IsNullOrWhiteSpace(start_extra_price)) + where += " and p.extra_price >= @start_extra_price"; + if (!string.IsNullOrWhiteSpace(end_extra_price)) + where += " and p.extra_price <= @end_extra_price"; + if (!string.IsNullOrEmpty(in_ext_code)) + where += " and p.ext_code in ('" + in_ext_code?.Replace(",", "','") + "')"; + sql += where; + + var count = mySql.ExecuteRowCount(sql, paramLst.ToArray()); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + sql = "select * from kjd.price_markup p where 1=1"; + + //where子句 + sql += where; + + sql += " order by p.id desc"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql, paramLst.ToArray()); + } + + mySql.Close(); + if (dt != null) + { + try + { + List priceList = new List(); + foreach (DataRow row in dt.Rows) + { + DBPriceResultParam price = new DBPriceResultParam + { + id = row["id"].ParseToInt(), + extra_price = row["extra_price"].ParseToInt(), + markup_times = row["markup_times"].ParseToInt(), + original_price = row["original_price"].ParseToInt(), + notes = row["notes"].ParseToString(), + ext_code = row["ext_code"].ParseToString(), + add_time = Convert.ToDateTime(row["add_time"]), + mdy_time = Convert.ToDateTime(row["mdy_time"]), + }; + priceList.Add(price); + } + var data = JsonUtils.SerializerObjectToString(priceList); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string DelDbPrice(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from kjd.price_markup where id='" + id + "'"; + + 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 MdyDBPrice(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var db_id = RegexUtils.GetStringQuery(ref inputData, "db_id"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")); + string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")); + string original_price = RegexUtils.GetStringQuery(ref inputData, "original_price"); + string markup_times = RegexUtils.GetStringQuery(ref inputData, "markup_times"); + string extra_price = RegexUtils.GetStringQuery(ref inputData, "extra_price"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@original_price", Value = original_price.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@markup_times", Value = markup_times.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@extra_price", Value = extra_price.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@db_id", Value = db_id, }); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sqlExist = "select count(ext_code) from kjd.price_markup where ext_code=@ext_code and id!=@db_id"; + var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray()); + if (has != "0") + { + mySql.Close(); + return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}"; + } + + string sql = "update kjd.price_markup set"; + if (notes != null) + sql += " notes=@notes,"; + if (ext_code != null) + sql += " ext_code=@ext_code,"; + if (original_price != null) + sql += " original_price=@original_price,"; + if (markup_times != null) + sql += " markup_times=@markup_times,"; + if (extra_price != null) + sql += " extra_price=@extra_price,"; + sql = sql.TrimEnd(','); + sql += " where id=@db_id;"; + + var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray()); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string AddPurchasePrice(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\":\"校验失败\"}"; + + string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + string shop_name = RegexUtils.GetStringQuery(ref inputData, "shop_name"); + string spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "spu_id")).ParseToString(); + string skc_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "skc_id")).ParseToString(); + string cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_id")).ParseToString(); + string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name")).ParseToString(); + string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString(); + string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name")).ParseToString(); + string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img")).ParseToString(); + string discount = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "discount")).ParseToString(); + string price_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "price_text")).ParseToString(); + string sku_purchase_price_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_purchase_price_json")).ParseToString(); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString(); + + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sqlExist = "select count(spu_id) from kjd.product_purchase_price where spu_id=@spu_id"; + string sql = "insert into kjd.product_purchase_price " + + "(shop_id,shop_name,spu_id,skc_id,cat_id,cat_name,ext_code,product_name,main_img,discount,price_text,sku_purchase_price_json,notes) " + + "values (@shop_id,@shop_name,@spu_id,@skc_id,@cat_id,@cat_name,@ext_code,@product_name,@main_img,@discount,@price_text,@sku_purchase_price_json,@notes);"; + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_id", Value = shop_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_name", Value = shop_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@spu_id", Value = spu_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@skc_id", Value = skc_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@discount", Value = discount.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@price_text", Value = price_text, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@sku_purchase_price_json", Value = sku_purchase_price_json, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, }); + + var has = mySql.ExecuteFirst(sqlExist, paramLst.ToArray()); + if (has != "0") + { + mySql.Close(); + return "{\"code\":501,\"msg\":\"货号 " + ext_code + " 价格数据已存在\"}"; + } + + var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray()); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":502,\"msg\":\"" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string MdyPurchasePrice(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + var db_id = RegexUtils.GetStringQuery(ref inputData, "db_id"); + string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + string shop_name = RegexUtils.GetStringQuery(ref inputData, "shop_name"); + string cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_id")).ParseToString(); + string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name")).ParseToString(); + string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString(); + string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name")).ParseToString(); + string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img")).ParseToString(); + string discount = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "discount")).ParseToString(); + string price_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "price_text")).ParseToString(); + string sku_purchase_price_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_purchase_price_json")).ParseToString(); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")).ParseToString(); + + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@db_id", Value = db_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_id", Value = shop_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@shop_name", Value = shop_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@discount", Value = discount.ParseToInt(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@price_text", Value = price_text, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@sku_purchase_price_json", Value = sku_purchase_price_json, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, }); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "update kjd.product_purchase_price set"; + if (shop_id != null) + sql += " shop_id=@shop_id,"; + if (shop_name != null) + sql += " shop_name=@shop_name,"; + if (cat_id != null) + sql += " cat_id=@cat_id,"; + if (cat_name != null) + sql += " cat_name=@cat_name,"; + if (ext_code != null) + sql += " ext_code=@ext_code,"; + if (product_name != null) + sql += " product_name=@product_name,"; + if (main_img != null) + sql += " main_img=@main_img,"; + if (discount != null) + sql += " discount=@discount,"; + if (price_text != null) + sql += " price_text=@price_text,"; + if (sku_purchase_price_json != null) + sql += " sku_purchase_price_json=@sku_purchase_price_json,"; + if (notes != null) + sql += " notes=@notes,"; + sql = sql.TrimEnd(','); + sql += " where id=@db_id;"; + + var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray()); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetPurchasePriceList(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"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + + var search_spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_spu_id")); + var search_skc_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_skc_id")); + var search_ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_ext_code")); + var search_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_notes")); + var in_spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "in_spu_id")); + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_spu_id", Value = "%" + search_spu_id + "%", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_skc_id", Value = "%" + search_skc_id + "%", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_ext_code", Value = "%" + search_ext_code + "%", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_notes", Value = "%" + search_notes + "%", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@in_spu_id", Value = in_spu_id.ParseToString() }); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(id) from kjd.product_purchase_price p where 1=1"; + + string where = ""; + if (!string.IsNullOrWhiteSpace(search_spu_id)) + where += " and p.spu_id like @search_spu_id"; + if (!string.IsNullOrWhiteSpace(search_skc_id)) + where += " and p.skc_id like @search_skc_id"; + if (!string.IsNullOrWhiteSpace(search_ext_code)) + where += " and p.ext_code like @search_ext_code"; + if (!string.IsNullOrWhiteSpace(search_notes)) + where += " and p.notes like @search_notes"; + if (!string.IsNullOrEmpty(in_spu_id)) + where += " and p.spu_id in ('" + in_spu_id?.Replace(",", "','") + "')"; + sql += where; + + var count = mySql.ExecuteRowCount(sql, paramLst.ToArray()); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + sql = "select * from kjd.product_purchase_price p where 1=1"; + + //where子句 + sql += where; + + sql += " order by p.id desc"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql, paramLst.ToArray()); + } + + mySql.Close(); + if (dt != null) + { + try + { + List purchasePriceList = new List(); + foreach (DataRow row in dt.Rows) + { + ProductPurchasePriceResultParam price = new ProductPurchasePriceResultParam + { + id = row["id"].ParseToInt(), + shop_id = row["shop_id"].ParseToString(), + shop_name = row["shop_name"].ParseToString(), + cat_id = row["cat_id"].ParseToString(), + cat_name = row["cat_name"].ParseToString(), + main_img = row["main_img"].ParseToString(), + discount = row["discount"].ParseToInt(), + price_text = row["price_text"].ParseToString(), + product_name = row["product_name"].ParseToString(), + skc_id = row["skc_id"].ParseToString(), + sku_purchase_price_json = row["sku_purchase_price_json"].ParseToString(), + spu_id = row["spu_id"].ParseToString(), + notes = row["notes"].ParseToString(), + ext_code = row["ext_code"].ParseToString(), + add_time = Convert.ToDateTime(row["add_time"]), + mdy_time = Convert.ToDateTime(row["mdy_time"]), + }; + purchasePriceList.Add(price); + } + var data = JsonUtils.SerializerObjectToString(purchasePriceList); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string DelPurchasePrice(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from kjd.product_purchase_price where id='" + id + "'"; + + 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\":\"输入为空\"}"; + } + } +} \ No newline at end of file diff --git a/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs b/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs new file mode 100644 index 0000000..98472ea --- /dev/null +++ b/KJDService/KJD_WebService/BLL/KJD/ProductManage.cs @@ -0,0 +1,790 @@ +using KJD_Web.Model; +using KJD_Web.Utils; +using MySql.Data.MySqlClient; +using NaiBa.Util.Extension; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.Security; + +namespace KJD_Web.BLL +{ + public class ProductManage + { + public string AddProduct(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + string spu_id = RegexUtils.GetStringQuery(ref inputData, "spu_id"); + string skc_id = RegexUtils.GetStringQuery(ref inputData, "skc_id"); + string cat_id = RegexUtils.GetStringQuery(ref inputData, "cat_id"); + string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name"))?.Replace("'", "\\'"); + string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"))?.Replace("'", "\\'"); + string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name"))?.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 main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img"))?.Replace("'", "\\'"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = ""; + + sql = "insert into kjd.product (spu_id,skc_id,cat_id,cat_name,product_name,ext_code,main_img,product_json,size_json,notes,add_time,mdy_time) " + + "values ('" + spu_id + "','" + skc_id + "','" + cat_id + "','" + cat_name + "','" + product_name + "','" + + ext_code + "','" + main_img + "','" + product_json + "','" + size_json + "','" + notes + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetProductList(string inputData, bool isDetail = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'","\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'"); + var search_spu = RegexUtils.GetStringQuery(ref inputData, "search_spu")?.Replace("'", "\\'"); + var search_skc = RegexUtils.GetStringQuery(ref inputData, "search_skc")?.Replace("'", "\\'"); + var search_cat = RegexUtils.GetStringQuery(ref inputData, "search_cat")?.Replace("'", "\\'"); + var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'"); + var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'"); + var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'"); + var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'"); + var get_select_count = RegexUtils.GetStringQuery(ref inputData, "get_select_count")?.Replace("'", "\\'"); + var select_shop_id = RegexUtils.GetStringQuery(ref inputData, "select_shop_id")?.Replace("'", "\\'"); + var sort_field = RegexUtils.GetStringQuery(ref inputData, "sort_field")?.Replace("'", "\\'"); + + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(id) from kjd.product p where 1=1"; + + string where = ""; + if (!string.IsNullOrWhiteSpace(search_spu)) + where += " and p.spu_id like '%" + search_spu + "%'"; + if (!string.IsNullOrWhiteSpace(search_skc)) + where += " and p.skc_id like '%" + search_skc + "%'"; + if (!string.IsNullOrWhiteSpace(search_cat)) + where += " and p.cat_name like '%" + search_cat + "%'"; + if (!string.IsNullOrWhiteSpace(search_ext_code)) + where += " and p.ext_code like '%" + search_ext_code + "%'"; + if (!string.IsNullOrWhiteSpace(search_prod_name)) + where += " and p.product_name like '%" + search_prod_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_notes)) + where += " and p.notes like '%" + search_notes + "%'"; + if (!string.IsNullOrEmpty(search_db_ids)) + where += " and p.id in (" + search_db_ids + ")"; + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + if (isDetail) + sql = "select * from kjd.product p where 1=1"; + else if (string.IsNullOrEmpty(get_select_count)) + sql = "select p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes," + + "p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words from kjd.product p where 1=1"; + else + sql = "SELECT p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes," + + "p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,COUNT(s.id) AS select_count " + + "FROM kjd.product p LEFT JOIN kjd.product_select s ON p.id=s.out_product_id AND s.shop_id='" + select_shop_id + "' " + + "WHERE 1=1"; + + //where子句 + sql += where; + + sql += " group by p.id"; + if (sort_field == "select_total_count") + sql += " order by p.select_total_count desc, p.id desc"; + else + sql += " order by p.id desc"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + if (dt != null) + { + try + { + List productLst = new List(); + foreach (DataRow row in dt.Rows) + { + DBProductResultParam prod = new DBProductResultParam + { + id = Convert.ToInt32(row["id"]), + skc_id = row["skc_id"].ToString(), + spu_id = row["spu_id"].ToString(), + cat_id = row["cat_id"].ToString(), + cat_name = row["cat_name"].ToString(), + product_name = row["product_name"].ToString(), + main_img = row["main_img"].ToString(), + ext_code = row["ext_code"].ToString(), + //product_json = row["product_json"].ToString(), + //size_json = row["size_json"].ToString(), + add_time = Convert.ToDateTime(row["add_time"]), + mdy_time = Convert.ToDateTime(row["mdy_time"]), + notes = row["notes"].ToString(), + select_total_count = row["select_total_count"].ParseToInt(), + end_words = row["end_words"].ParseToString(), + fission_words = row["fission_words"].ParseToString(), + head_words = row["head_words"].ParseToString(), + }; + if (isDetail) + { + prod.product_json = row["product_json"].ToString(); + prod.size_json = row["size_json"].ToString(); + } + if (!string.IsNullOrEmpty(get_select_count)) + { + prod.select_count = row["select_count"].ParseToInt(); + } + productLst.Add(prod); + } + var data = JsonUtils.SerializerObjectToString(productLst); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string DelDbProd(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from kjd.product where id='" + + id + "'"; + + 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 MdyProductNotes(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update kjd.product set"; + if (notes != null) + sql += " notes='" + notes + "',"; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ";"; + + 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 MdyDBProduct(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + var product_name = RegexUtils.GetStringQuery(ref inputData, "product_name")?.Replace("'", "\\'"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'"); + string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"))?.Replace("'", "\\'"); + 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("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update kjd.product set"; + if (product_name != null) + sql += " product_name='" + product_name + "',"; + if (notes != null) + sql += " notes='" + notes + "',"; + if (ext_code != null) + sql += " ext_code='" + ext_code + "',"; + if (fission_words != null) + sql += " fission_words='" + fission_words + "',"; + if (head_words != null) + sql += " head_words='" + head_words + "',"; + if (end_words != null) + sql += " end_words='" + end_words + "',"; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ";"; + + 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 AddUserSelectProduct(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var out_product_Id = RegexUtils.GetStringQuery(ref inputData, "out_product_id")?.Replace("'", "\\'"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'"); + var shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account")?.Replace("'", "\\'"); + var user_name = RegexUtils.GetStringQuery(ref inputData, "main_user_name")?.Replace("'", "\\'"); + var sub_user_name = RegexUtils.GetStringQuery(ref inputData, "sub_user_name")?.Replace("'", "\\'"); + var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + var add_product_remaining = RegexUtils.GetStringQuery(ref inputData, "add_product_remaining").ParseToInt(); + var add_fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_fission_product_name").ParseToString())?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + if (string.IsNullOrEmpty(shop_id)) + { + return "{\"code\":500,\"msg\":\"没有店铺信息\"}"; + } + + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "insert into kjd.product_select " + + "(out_product_Id,shop_id,shop_account,user_name,sub_user_name,notes,status,fission_product_name,add_time,mdy_time) values " + + "('" + out_product_Id + "','" + shop_id + "','" + shop_account + "','" + user_name + "','" + sub_user_name + "','" + + notes + "','" + status + "','" + add_fission_product_name + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + if (add_product_remaining > 0) + { + add_product_remaining = add_product_remaining - 1; + sql += "\r\n"; + sql += "update kjd.shop set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";"; + sql += "update kjd.product set select_total_count=select_total_count+1 where id=" + out_product_Id + ";"; + //sql += "update kjd.shop_add_prod_count set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";"; + sql += "INSERT INTO kjd.shop_add_prod_count(shop_id, add_product_remaining) VALUES('" + shop_id + "'," + add_product_remaining + ")" + + "ON DUPLICATE KEY UPDATE add_product_remaining=VALUES(add_product_remaining)"; + } + 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 MdyUserSelectProductStatus(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + var draft_id = RegexUtils.GetStringQuery(ref inputData, "draft_id")?.Replace("'", "\\'"); + var up_spu_id = RegexUtils.GetStringQuery(ref inputData, "up_spu_id")?.Replace("'", "\\'"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + var add_times = RegexUtils.GetStringQuery(ref inputData, "add_times")?.Replace("'", "\\'"); + + long l_draft_id = draft_id.ParseToLong(); + long l_spu_map_table_id = l_draft_id % 128; + long l_select_map_table_id = id.ParseToLong() % 64; + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = ""; + // 使用事务一次提交多个sql操作 + //sql += "set @@autocommit=0;\r\n"; + sql += "START TRANSACTION;\r\n"; + if (!string.IsNullOrEmpty(up_spu_id) && !string.IsNullOrEmpty(draft_id)) + { + sql += "insert into kjd_map.spu_map_" + l_spu_map_table_id + + " (draft_id,from_spu_id,shop_id) values(" + draft_id + "," + up_spu_id + ",'" + shop_id + "');\r\n"; + sql += "insert into kjd_map.product_select_map_" + l_select_map_table_id + + " (product_id,product_select_db_id,shop_id) values(" + draft_id + "," + id + ",'" + shop_id + "');\r\n"; + } + sql += "update kjd.product_select set"; + if (draft_id != null) + sql += " draft_id='" + draft_id + "',"; + if (status != null) + sql += " status='" + status + "',"; + if (status == "已上传") + sql += " add_times=add_times+1,"; + sql += " mdy_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',"; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ";\r\n"; + var rst = mySql.ExecuteNonQuery(sql); + string errMsg = mySql.Message; + if (string.IsNullOrEmpty(errMsg)) + sql = "COMMIT;"; + else + sql = "ROLLBACK;"; + mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"" + errMsg + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetUserSelectProductList(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "\\'"); + var search_shop_id = RegexUtils.GetStringQuery(ref inputData, "search_shop_id")?.Replace("'", "\\'"); + var search_shop_account = RegexUtils.GetStringQuery(ref inputData, "search_shop_account")?.Replace("'", "\\'"); + var search_spu = RegexUtils.GetStringQuery(ref inputData, "search_spu")?.Replace("'", "\\'"); + var search_skc = RegexUtils.GetStringQuery(ref inputData, "search_skc")?.Replace("'", "\\'"); + var search_cat = RegexUtils.GetStringQuery(ref inputData, "search_cat")?.Replace("'", "\\'"); + var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'"); + var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'"); + var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'"); + var search_user_notes = RegexUtils.GetStringQuery(ref inputData, "search_user_notes")?.Replace("'", "\\'"); + var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'"); + var search_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "search_sub_sa_name")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + + var no_sub_sa = RegexUtils.GetStringQuery(ref inputData, "no_sub_sa")?.Replace("'", "\\'"); + + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(s.id) from kjd.product_select s " + + "left join kjd.product p on s.out_product_id=p.id " + + "left join kjd.user u on s.operate_sub_sa_name=u.user_name " + + "where 1=1"; + + string where = ""; + if (!isAdmin) + where += " and (s.user_name='" + user_name + "' or s.sub_user_name like'%" + user_name + "%')"; + if (!string.IsNullOrEmpty(operate_sub_sa_name)) + { + where += " and s.operate_sub_sa_name = '" + operate_sub_sa_name + "'"; + } + if (no_sub_sa == "true") + where += " and s.operate_sub_sa_name is null"; + if (!string.IsNullOrEmpty(search_db_ids)) + where += " and s.id in (" + search_db_ids + ")"; + if (!string.IsNullOrEmpty(shop_ids)) + where += " and s.shop_id in (" + shop_ids + ")"; + if (!string.IsNullOrWhiteSpace(status)) + where += " and s.status = '" + status + "'"; + if (!string.IsNullOrWhiteSpace(search_shop_id)) + where += " and s.shop_id like '%" + search_shop_id + "%'"; + if (!string.IsNullOrWhiteSpace(search_shop_account)) + where += " and s.shop_account like '%" + search_shop_account + "%'"; + if (!string.IsNullOrWhiteSpace(search_notes)) + { + //核价成功 重复 核价成功(重复) + if (search_notes == "无备注") + where += " and s.notes = ''"; + else if (search_notes == "重复") + where += " and s.notes like '%重复%' and s.notes not like '%核价成功%' and s.notes not like '%核价通过%'"; + else if (search_notes == "核价成功") + where += " and (s.notes like '%核价成功%' or s.notes like '%核价通过%') and s.notes not like '%重复%'"; + else if (search_notes == "核价成功(重复)") + where += " and (s.notes like '%核价成功%' or s.notes like '%核价通过%') and s.notes like '%重复%'"; + else + where += " and s.notes like '%" + search_notes + "%'"; + } + if (!string.IsNullOrWhiteSpace(search_user_notes)) + where += " and s.user_notes like '%" + search_user_notes + "%'"; + if (!string.IsNullOrWhiteSpace(search_spu)) + where += " and p.spu_id like '%" + search_spu + "%'"; + if (!string.IsNullOrWhiteSpace(search_skc)) + where += " and p.skc_id like '%" + search_skc + "%'"; + if (!string.IsNullOrWhiteSpace(search_cat)) + where += " and p.cat_name like '%" + search_cat + "%'"; + if (!string.IsNullOrWhiteSpace(search_ext_code)) + where += " and p.ext_code like '%" + search_ext_code + "%'"; + if (!string.IsNullOrWhiteSpace(search_prod_name)) + where += " and p.product_name like '%" + search_prod_name + "%'"; + if (!string.IsNullOrEmpty(search_sub_sa_name)) + { + where += " and (s.operate_sub_sa_name like '%" + search_sub_sa_name + "%'"; + where += " or u.nick_name like '%" + operate_sub_sa_name + "%')"; + } + + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + //if (isDetail) + //sql = "select * from kjd.product_select where 1=1"; + //else + sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," + + "s.sub_user_name,s.notes,s.user_notes,s.status,s.draft_id,s.add_times,s.add_time,s.mdy_time," + + "s.fission_product_name,s.operate_sub_sa_name,s.add_sub_sa_time," + + "p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img," + + "u.nick_name as operate_sub_sa_nick " + + "from kjd.product_select s left join kjd.product p on s.out_product_id=p.id " + + "left join kjd.user u on u.user_name=s.operate_sub_sa_name " + + "where 1=1"; + + sql += where; // where子句 + + sql += " order by id desc"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + if (dt != null) + { + try + { + List productLst = new List(); + foreach (DataRow row in dt.Rows) + { + ProductSelectResultParam prodSelect = new ProductSelectResultParam() + { + id = row["id"].ParseToInt(), + out_product_Id = row["out_product_Id"].ParseToString(), + shop_account = row["shop_account"].ParseToString(), + shop_id = row["shop_id"].ParseToString(), + status = row["status"].ParseToString(), + sub_user_name = row["sub_user_name"].ParseToString(), + user_name = row["user_name"].ParseToString(), + cat_id = row["cat_id"].ParseToString(), + cat_name = row["cat_name"].ParseToString(), + product_name = row["product_name"].ParseToString(), + main_img = row["main_img"].ParseToString(), + ext_code = row["ext_code"].ParseToString(), + add_time = Convert.ToDateTime(row["add_time"]), + mdy_time = Convert.ToDateTime(row["mdy_time"]), + notes = row["notes"].ParseToString(), + draft_id = row["draft_id"].ParseToString(), + add_times = row["add_times"].ParseToInt(), + skc_id = row["skc_id"].ToString(), + spu_id = row["spu_id"].ToString(), + operate_sub_sa_name = row["operate_sub_sa_name"].ToString(), + operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString(), + fission_product_name = row["fission_product_name"].ToString(), + user_notes = row["user_notes"].ToString(), + //product_json = row["product_json"].ToString(), + //size_json = row["size_json"].ToString(), + }; + prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?; + productLst.Add(prodSelect); + } + var data = JsonUtils.SerializerObjectToString(productLst); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string DelSelectProd(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from kjd.product_select where id='" + + id + "'"; + + 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 SetSelectProductSubSa(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 id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(id) && string.IsNullOrEmpty(shop_id)) + { + return "{\"code\":50002,\"msg\":\"未选择任何待上传\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update kjd.product_select set"; + if (operate_sub_sa_name != null) + sql += " operate_sub_sa_name='" + operate_sub_sa_name + "',"; + sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',"; + sql = sql.TrimEnd(','); + if (!string.IsNullOrEmpty(id)) + sql += " where id in (" + id + ")"; + else if (!string.IsNullOrEmpty(shop_id)) + sql += " where shop_id in ('" + shop_id.Replace(",","','") + "')"; + else + sql += " where 1=2"; + if(!string.IsNullOrEmpty(status)) + sql += " and status='" + status + "';"; + 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 MdyProductSelectNotes(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")); + string user_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_notes")); + string fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_product_name")); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update kjd.product_select set"; + if (notes != null) + sql += " notes=@notes,"; + if (user_notes != null) + sql += " user_notes=@user_notes,"; + if (fission_product_name != null) + sql += " fission_product_name=@fission_product_name,"; + sql = sql.TrimEnd(','); + sql += " where id=@id;"; + + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@id", Value = id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@fission_product_name", Value = fission_product_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@user_notes", Value = user_notes, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, }); + + var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray()); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + } +} + + +/* + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "spu_id", Value = spu_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "skc_id", Value = skc_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "cat_id", Value = cat_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "cat_name", Value = cat_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_name", Value = product_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "ext_code", Value = ext_code, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "main_img", Value = main_img, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_json", Value = product_json, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "size_json", Value = size_json, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "notes", Value = notes.ParseToString(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_md5", Value = product_md5, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "add_time", Value = add_time, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "mdy_time", Value = mdy_time, }); + rst = mySql.ExecuteInsertId(sql, paramLst.ToArray());*/ \ No newline at end of file diff --git a/KJDService/KJD_WebService/BLL/KJD/ProductThirdManage.cs b/KJDService/KJD_WebService/BLL/KJD/ProductThirdManage.cs new file mode 100644 index 0000000..2779a79 --- /dev/null +++ b/KJDService/KJD_WebService/BLL/KJD/ProductThirdManage.cs @@ -0,0 +1,775 @@ +using KJD_Web.Model; +using KJD_Web.Utils; +using MySql.Data.MySqlClient; +using MySqlX.XDevAPI.Common; +using NaiBa.Util.Extension; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.Security; + +namespace KJD_Web.BLL +{ + public class ProductThirdManage + { + public string AddProduct(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + string spu_id = RegexUtils.GetStringQuery(ref inputData, "spu_id"); + string skc_id = RegexUtils.GetStringQuery(ref inputData, "skc_id"); + string cat_id = RegexUtils.GetStringQuery(ref inputData, "cat_id"); + string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name")); + string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")); + string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name")); + string product_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_json")); + string size_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "size_json")); + string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img")); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = ""; + var json_sign = RegexUtils.GetStringJson(ref product_json, "signedImageUrl"); // 取商品json数据里不同签名的部分 + var product_md5 = EncrypUtil.GetMd5(product_json?.Replace(json_sign, "") + size_json); + var product_md5_2 = EncrypUtil.GetMd5(product_json?.Replace("'", "\\'").Replace(json_sign, "") + size_json); + sql = "select id from kjd.third_product where product_md5='" + product_md5 + "' or product_md5='" + product_md5_2 + "';"; + var rst = mySql.ExecuteFirstInt(sql).ParseToLong(); + if (rst <= 0) + { + //sql = "insert into kjd.third_product (spu_id,skc_id,cat_id,cat_name,product_name,ext_code,main_img,product_json,size_json,notes,product_md5,add_time,mdy_time) " + + // "values ('" + spu_id + "','" + skc_id + "','" + cat_id + "','" + cat_name + "','" + product_name + "','" + + // ext_code + "','" + main_img + "','" + product_json + "','" + size_json + "','" + notes + "','" + product_md5 + "','" + + // DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + // DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + //rst = mySql.ExecuteInsertId(sql); + + sql = "insert into kjd.third_product (spu_id,skc_id,cat_id,cat_name,product_name," + + "ext_code,main_img,product_json,size_json,notes,product_md5,add_time,mdy_time) " + + "values (@spu_id,@skc_id,@cat_id,@cat_name,@product_name," + + "@ext_code,@main_img,@product_json,@size_json,@notes,@product_md5," + + "@add_time,@mdy_time);"; + string add_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + string mdy_time = add_time; + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@spu_id", Value = spu_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@skc_id", Value = skc_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_json", Value = product_json, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@size_json", Value = size_json, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes.ParseToString(), }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_md5", Value = product_md5, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@add_time", Value = add_time, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@mdy_time", Value = mdy_time, }); + rst = mySql.ExecuteInsertId(sql, paramLst.ToArray()); + mySql.Close(); + } + if (rst > 0) + { + return "{\"code\":200,\"msg\":\"success\",\"id\":" + rst + "}"; + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetProductList(string inputData, bool isDetail = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'","\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'"); + var search_spu = RegexUtils.GetStringQuery(ref inputData, "search_spu")?.Replace("'", "\\'"); + var search_skc = RegexUtils.GetStringQuery(ref inputData, "search_skc")?.Replace("'", "\\'"); + var search_cat = RegexUtils.GetStringQuery(ref inputData, "search_cat")?.Replace("'", "\\'"); + var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'"); + var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'"); + var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'"); + var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'"); + + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(id) from kjd.third_product where 1=1"; + + string where = ""; + if (!string.IsNullOrWhiteSpace(search_spu)) + where += " and spu_id like '%" + search_spu + "%'"; + if (!string.IsNullOrWhiteSpace(search_skc)) + where += " and skc_id like '%" + search_skc + "%'"; + if (!string.IsNullOrWhiteSpace(search_cat)) + where += " and cat_name like '%" + search_cat + "%'"; + if (!string.IsNullOrWhiteSpace(search_ext_code)) + where += " and ext_code like '%" + search_ext_code + "%'"; + if (!string.IsNullOrWhiteSpace(search_prod_name)) + where += " and product_name like '%" + search_prod_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_notes)) + where += " and notes like '%" + search_notes + "%'"; + if (!string.IsNullOrEmpty(search_db_ids)) + where += " and id in (" + search_db_ids + ")"; + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + if (isDetail) + sql = "select * from kjd.third_product where 1=1"; + else + sql = "select id,spu_id,skc_id,cat_id,cat_name,change_cat_id,change_cat_name,ext_code,product_name,main_img,notes," + + "add_time,mdy_time from kjd.third_product where 1=1"; + + sql += where; + + sql += " order by id desc"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + if (dt != null) + { + try + { + List productLst = new List(); + foreach (DataRow row in dt.Rows) + { + DBProductResultParam prod = new DBProductResultParam + { + id = Convert.ToInt32(row["id"]), + skc_id = row["skc_id"].ToString(), + spu_id = row["spu_id"].ToString(), + cat_id = row["cat_id"].ToString(), + cat_name = row["cat_name"].ToString(), + change_cat_id = row["change_cat_id"].ToString(), + change_cat_name = row["change_cat_name"].ToString(), + product_name = row["product_name"].ToString(), + main_img = row["main_img"].ToString(), + ext_code = row["ext_code"].ToString(), + //product_json = row["product_json"].ToString(), + //size_json = row["size_json"].ToString(), + add_time = Convert.ToDateTime(row["add_time"]), + mdy_time = Convert.ToDateTime(row["mdy_time"]), + notes = row["notes"].ToString(), + }; + if (isDetail) + { + prod.product_json = row["product_json"].ToString(); + prod.size_json = row["size_json"].ToString(); + } + productLst.Add(prod); + } + var data = JsonUtils.SerializerObjectToString(productLst); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string DelDbProd(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from kjd.third_product where id='" + + id + "'"; + + 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 MdyProductNotes(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update kjd.third_product set"; + if (notes != null) + sql += " notes='" + notes + "',"; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ";"; + + 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 MdyProductCategory(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + string change_cat_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "change_cat_id"))?.Replace("'", "\\'"); + string change_cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "change_cat_name"))?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update kjd.third_product set"; + if (change_cat_id != null) + sql += " change_cat_id='" + change_cat_id + "',"; + if (change_cat_name != null) + sql += " change_cat_name='" + change_cat_name + "',"; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ";"; + + 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 AddUserSelectProduct(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var out_product_Id = RegexUtils.GetStringQuery(ref inputData, "out_product_id")?.Replace("'", "\\'"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'"); + var shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account")?.Replace("'", "\\'"); + var user_name = RegexUtils.GetStringQuery(ref inputData, "main_user_name")?.Replace("'", "\\'"); + var sub_user_name = RegexUtils.GetStringQuery(ref inputData, "sub_user_name")?.Replace("'", "\\'"); + var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + var add_product_remaining = RegexUtils.GetStringQuery(ref inputData, "add_product_remaining").ParseToInt(); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + if (string.IsNullOrEmpty(shop_id)) + { + return "{\"code\":500,\"msg\":\"没有店铺信息\"}"; + } + + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "insert into kjd.third_product_select (out_product_Id,shop_id,shop_account,user_name,sub_user_name,notes,status,add_time,mdy_time) " + + "values ('" + out_product_Id + "','" + shop_id + "','" + shop_account + "','" + user_name + "','" + sub_user_name + "','" + + notes + "','" + status + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + if (add_product_remaining > 0) + { + add_product_remaining = add_product_remaining - 1; + sql += "\r\n"; + sql += "update kjd.shop set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";"; + //sql += "update kjd.shop_add_prod_count set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";"; + sql += "INSERT INTO kjd.shop_add_prod_count(shop_id, add_product_remaining) VALUES('" + shop_id + "'," + add_product_remaining + ")" + + "ON DUPLICATE KEY UPDATE add_product_remaining=VALUES(add_product_remaining)"; + } + 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 MdyUserSelectProductStatus(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + var draft_id = RegexUtils.GetStringQuery(ref inputData, "draft_id")?.Replace("'", "\\'"); + var up_spu_id = RegexUtils.GetStringQuery(ref inputData, "up_spu_id")?.Replace("'", "\\'"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + var add_times = RegexUtils.GetStringQuery(ref inputData, "add_times")?.Replace("'", "\\'"); + + long l_draft_id = draft_id.ParseToLong(); + long l_spu_map_table_id = l_draft_id % 128; + long l_select_map_table_id = id.ParseToLong() % 64; + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = ""; + // 使用事务一次提交多个sql操作 + //sql += "set @@autocommit=0;\r\n"; + sql += "START TRANSACTION;\r\n"; + if (!string.IsNullOrEmpty(up_spu_id) && !string.IsNullOrEmpty(draft_id)) + { + sql += "insert into kjd_map.spu_map_" + l_spu_map_table_id + + " (draft_id,from_spu_id,shop_id) values(" + draft_id + "," + up_spu_id + ",'" + shop_id + "');\r\n"; + sql += "insert into kjd_map.product_third_select_map_" + l_select_map_table_id + + " (product_id,product_select_db_id,shop_id) values(" + draft_id + "," + id + ",'" + shop_id + "');\r\n"; + } + sql += "update kjd.third_product_select set"; + if (draft_id != null) + sql += " draft_id='" + draft_id + "',"; + if (status != null) + sql += " status='" + status + "',"; + if (status == "已上传") + sql += " add_times=add_times+1,"; + sql += " mdy_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',"; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ";\r\n"; + var rst = mySql.ExecuteNonQuery(sql); + string errMsg = mySql.Message; + if (string.IsNullOrEmpty(errMsg)) + sql = "COMMIT;"; + else + sql = "ROLLBACK;"; + mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"" + errMsg + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetUserSelectProductList(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "\\'"); + var search_shop_id = RegexUtils.GetStringQuery(ref inputData, "search_shop_id")?.Replace("'", "\\'"); + var search_shop_account = RegexUtils.GetStringQuery(ref inputData, "search_shop_account"); + var search_spu = RegexUtils.GetStringQuery(ref inputData, "search_spu")?.Replace("'", "\\'"); + var search_skc = RegexUtils.GetStringQuery(ref inputData, "search_skc")?.Replace("'", "\\'"); + var search_cat = RegexUtils.GetStringQuery(ref inputData, "search_cat")?.Replace("'", "\\'"); + var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'"); + var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name"); + var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'"); + var search_user_notes = RegexUtils.GetStringQuery(ref inputData, "search_user_notes")?.Replace("'", "\\'"); + var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'"); + var search_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "search_sub_sa_name")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + + var no_sub_sa = RegexUtils.GetStringQuery(ref inputData, "no_sub_sa")?.Replace("'", "\\'"); + + int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "select count(s.id) from kjd.third_product_select s " + + "left join kjd.third_product p on s.out_product_id=p.id " + + "left join kjd.user u on s.operate_sub_sa_name=u.user_name " + + "where 1=1"; + + string where = ""; + if (!isAdmin) + where += " and (s.user_name='" + user_name + "' or s.sub_user_name like'%" + user_name + "%')"; + if (!string.IsNullOrEmpty(operate_sub_sa_name)) + { + where += " and s.operate_sub_sa_name = '" + operate_sub_sa_name + "'"; + } + if (no_sub_sa == "true") + where += " and s.operate_sub_sa_name is null"; + if (!string.IsNullOrEmpty(search_db_ids)) + where += " and s.id in (" + search_db_ids + ")"; + if (!string.IsNullOrEmpty(shop_ids)) + where += " and s.shop_id in (" + shop_ids + ")"; + if (!string.IsNullOrWhiteSpace(status)) + where += " and s.status = '" + status + "'"; + if (!string.IsNullOrWhiteSpace(search_shop_id)) + where += " and s.shop_id like '%" + search_shop_id + "%'"; + if (!string.IsNullOrWhiteSpace(search_shop_account)) + where += " and s.shop_account like @search_shop_account"; + if (!string.IsNullOrWhiteSpace(search_notes)) + { + //核价成功 重复 核价成功(重复) + if (search_notes == "无备注") + where += " and s.notes = ''"; + else if (search_notes == "重复") + where += " and s.notes like '%重复%' and s.notes not like '%核价成功%' and s.notes not like '%核价通过%'"; + else if (search_notes == "核价成功") + where += " and (s.notes like '%核价成功%' or s.notes like '%核价通过%') and s.notes not like '%重复%'"; + else if (search_notes == "核价成功(重复)") + where += " and (s.notes like '%核价成功%' or s.notes like '%核价通过%') and s.notes like '%重复%'"; + else + where += " and s.notes like '%" + search_notes + "%'"; + } + if (!string.IsNullOrWhiteSpace(search_user_notes)) + where += " and s.user_notes like '%" + search_user_notes + "%'"; + if (!string.IsNullOrWhiteSpace(search_spu)) + where += " and p.spu_id like '%" + search_spu + "%'"; + if (!string.IsNullOrWhiteSpace(search_skc)) + where += " and p.skc_id like '%" + search_skc + "%'"; + if (!string.IsNullOrWhiteSpace(search_cat)) + where += " and p.cat_name like '%" + search_cat + "%'"; + if (!string.IsNullOrWhiteSpace(search_ext_code)) + where += " and p.ext_code like '%" + search_ext_code + "%'"; + if (!string.IsNullOrWhiteSpace(search_prod_name)) + where += " and p.product_name like @search_prod_name"; + if (!string.IsNullOrEmpty(search_sub_sa_name)) + { + where += " and (s.operate_sub_sa_name like '%" + search_sub_sa_name + "%'"; + where += " or u.nick_name like '%" + operate_sub_sa_name + "%')"; + } + + sql += where; + + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_shop_account", Value = "%" + search_shop_account + "%", }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_prod_name", Value = "%" + search_prod_name + "%", }); + + var count = mySql.ExecuteRowCount(sql, paramLst.ToArray()); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + //if (isDetail) + //sql = "select * from kjd.third_product_select where 1=1"; + //else + sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," + + "s.sub_user_name,s.notes,s.user_notes,s.status,s.draft_id,s.add_times,s.add_time,s.mdy_time," + + "s.fission_product_name,s.operate_sub_sa_name,s.add_sub_sa_time," + + "p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.change_cat_id,p.change_cat_name,p.ext_code,p.product_name,p.main_img," + + "u.nick_name as operate_sub_sa_nick " + + "from kjd.third_product_select s left join kjd.third_product p on s.out_product_id=p.id " + + "left join kjd.user u on u.user_name=s.operate_sub_sa_name " + + "where 1=1"; + + sql += where; // where子句 + + sql += " order by id desc"; + sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql, paramLst.ToArray()); + } + + mySql.Close(); + if (dt != null) + { + try + { + List productLst = new List(); + foreach (DataRow row in dt.Rows) + { + ProductSelectResultParam prodSelect = new ProductSelectResultParam() + { + id = row["id"].ParseToInt(), + out_product_Id = row["out_product_Id"].ParseToString(), + shop_account = row["shop_account"].ParseToString(), + shop_id = row["shop_id"].ParseToString(), + status = row["status"].ParseToString(), + sub_user_name = row["sub_user_name"].ParseToString(), + user_name = row["user_name"].ParseToString(), + cat_id = row["cat_id"].ParseToString(), + cat_name = row["cat_name"].ParseToString(), + change_cat_id = row["change_cat_id"].ParseToString(), + change_cat_name = row["change_cat_name"].ParseToString(), + product_name = row["product_name"].ParseToString(), + main_img = row["main_img"].ParseToString(), + ext_code = row["ext_code"].ParseToString(), + add_time = Convert.ToDateTime(row["add_time"]), + mdy_time = Convert.ToDateTime(row["mdy_time"]), + notes = row["notes"].ParseToString(), + draft_id = row["draft_id"].ParseToString(), + add_times = row["add_times"].ParseToInt(), + skc_id = row["skc_id"].ToString(), + spu_id = row["spu_id"].ToString(), + operate_sub_sa_name = row["operate_sub_sa_name"].ToString(), + operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString(), + fission_product_name = row["fission_product_name"].ToString(), + user_notes = row["user_notes"].ToString(), + //product_json = row["product_json"].ToString(), + //size_json = row["size_json"].ToString(), + }; + prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?; + productLst.Add(prodSelect); + } + var data = JsonUtils.SerializerObjectToString(productLst); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + catch (Exception ex) + { + return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + else + { + return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string DelSelectProd(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from kjd.third_product_select where id='" + + id + "'"; + + 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 SetSelectProductSubSa(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 id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(id) && string.IsNullOrEmpty(shop_id)) + { + return "{\"code\":50002,\"msg\":\"未选择任何待上传\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update kjd.third_product_select set"; + if (operate_sub_sa_name != null) + sql += " operate_sub_sa_name='" + operate_sub_sa_name + "',"; + sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',"; + sql = sql.TrimEnd(','); + if (!string.IsNullOrEmpty(id)) + sql += " where id in (" + id + ")"; + else if (!string.IsNullOrEmpty(shop_id)) + sql += " where shop_id in ('" + shop_id.Replace(",","','") + "')"; + else + sql += " where 1=2"; + if(!string.IsNullOrEmpty(status)) + sql += " and status='" + status + "';"; + 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 MdyProductSelectNotes(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt(); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var id = RegexUtils.GetStringQuery(ref inputData, "db_id"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")); + string user_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_notes")); + string fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_product_name")); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update kjd.third_product_select set"; + if (notes != null) + sql += " notes=@notes,"; + if (user_notes != null) + sql += " user_notes=@user_notes,"; + if (fission_product_name != null) + sql += " fission_product_name=@fission_product_name,"; + sql = sql.TrimEnd(','); + sql += " where id=@id;"; + + List paramLst = new List(); + paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@id", Value = id, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@fission_product_name", Value = fission_product_name, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@user_notes", Value = user_notes, }); + paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, }); + + var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray()); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + { + return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + } +} \ No newline at end of file diff --git a/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs b/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs new file mode 100644 index 0000000..10be36f --- /dev/null +++ b/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs @@ -0,0 +1,771 @@ +using KJD_Web.Model; +using KJD_Web.Model.ShopModel; +using KJD_Web.Utils; +using MySqlX.XDevAPI; +using NaiBa.Util.Extension; +using System; +using System.Collections.Generic; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Web; +using System.Web.Security; + +namespace KJD_Web.BLL +{ + public class ShopManage + { + public string GetShop(string inputData, bool isAdmin = false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + var search_id = RegexUtils.GetStringQuery(ref inputData, "search_id"); + var search_user_name = RegexUtils.GetStringQuery(ref inputData, "search_user_name"); + var search_login_name = RegexUtils.GetStringQuery(ref inputData, "search_login_name"); + var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes"); + var search_name = RegexUtils.GetStringQuery(ref inputData, "search_name"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + 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 shop_notes = RegexUtils.GetStringQuery(ref inputData, "shop_notes"); + if (!string.IsNullOrWhiteSpace(shop_notes)) + { + List shopNotesLst = shop_notes.Split(',').ToList(); + shop_notes = "'" + string.Join("','", shopNotesLst) + "'"; + } + + var page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + var page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(); + + if (page_size == 0) + page_size = 50; + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "SELECT COUNT(s.id) FROM kjd.shop s WHERE 1=1"; + + //where子句 + string where = ""; + if (isAdmin) + where += " and (s.cookie='' or s.shop_id!='')"; + if (!isAdmin) + where += " and (s.user_name='" + user_name + "' or s.sub_user_name like '%" + user_name + "%')"; + if (!string.IsNullOrWhiteSpace(operate_sub_sa_name)) + where += " and s.operate_sub_sa_name='" + operate_sub_sa_name + "'"; + if (!string.IsNullOrWhiteSpace(search_user_name)) + where += " and s.user_name like '%" + search_user_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_login_name)) + where += " and s.login_name like '%" + search_login_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_notes)) + where += " and s.notes like '%" + search_notes + "%'"; + if (!string.IsNullOrWhiteSpace(search_id)) + where += " and s.shop_id like '%" + search_id + "%'"; + if (!string.IsNullOrWhiteSpace(search_name)) + where += " and s.shop_account like '%" + search_name + "%'"; + if (!string.IsNullOrWhiteSpace(shop_ids)) + where += " and s.shop_id in (" + shop_ids + ")"; + if (!string.IsNullOrWhiteSpace(shop_names)) + where += " and s.shop_account in (" + shop_names + ")"; + if (!string.IsNullOrWhiteSpace(shop_notes)) + where += " and s.notes in (" + shop_notes + ")"; + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.shop_id,s.shop_account,s.sub_user_name,s.user_name," + + "s.company_name,s.notes,s.login_status,s.login_status2,c.add_product_remaining,c.add_product_month,s.add_time,s.mdy_time," + + "s.add_sub_sa_time,s.operate_sub_sa_name"; + //sql += " FROM kjd.shop s WHERE 1=1"; + sql += " FROM kjd.shop s LEFT JOIN kjd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1"; + + sql += where; // where 子句 + + sql += " ORDER BY s.id DESC"; + sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + if (dt != null) + { + List shopList=new List(); + foreach (DataRow row in dt.Rows) + { + ShopParam shop = new ShopParam + { + id = Convert.ToInt32(row["id"]), + login_name = row["login_name"].ToString(), + login_pass = row["login_pass"].ToString(), + cookie = row["cookie"].ToString(), + cookie2 = row["cookie2"].ToString(), + shop_id = row["shop_id"].ToString(), + shop_account = row["shop_account"].ToString(), + sub_user_name = row["sub_user_name"].ToString(), + user_name = row["user_name"].ToString(), + company_name = row["company_name"].ToString(), + notes = row["notes"].ToString(), + login_status = row["login_status"].ToString(), + login_status2 = row["login_status2"].ToString(), + add_product_remaining = row["add_product_remaining"].ParseToInt(), + add_product_month = row["add_product_month"].ParseToInt(), + operate_sub_sa_name = row["operate_sub_sa_name"] as string, + + }; + shopList.Add(shop); + } + + //sql = "\r\nINSERT INTO kjd.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES "; + //foreach (var shop in shopList) + //{ + // sql += "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + shop.add_product_remaining + "," + shop.add_product_month + "),"; + //} + //sql = sql.TrimEnd(',') + " \r\n"; + //sql += "ON DUPLICATE KEY UPDATE " + + // "shop_account=VALUES(shop_account)," + + // "add_product_remaining=VALUES(add_product_remaining)," + + // "add_product_month=VALUES(add_product_month);"; + //var result = mySql.ExecuteNonQuery(sql); + //mySql.Close(); + + int month = DateTime.Now.Month; + var shopMonthList = shopList.Where(s => s.add_product_month != month); + if (shopMonthList.Count() > 0) + { + int remainCount = 100; + var shopMonthIdList = shopMonthList.Select(s => s.id); + mySql = new MysqlUtils(conn); + string ids = string.Join(",", shopMonthIdList); + sql = ""; + sql += "update kjd.shop set add_product_remaining=" + remainCount + ", add_product_month=" + month + + " where 1=1 and id in (" + ids + ");"; + + sql += "\r\nINSERT INTO kjd.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES "; + foreach (var shop in shopMonthList) + { + sql+= "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + remainCount + "," + month + "),"; + } + sql = sql.TrimEnd(',') + " \r\n"; + sql += "ON DUPLICATE KEY UPDATE " + + "shop_account=VALUES(shop_account)," + + "add_product_remaining=VALUES(add_product_remaining)," + + "add_product_month=VALUES(add_product_month);"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + + if (rst) + { + foreach (var shop in shopMonthList) + { + shop.add_product_month = month; + shop.add_product_remaining = remainCount; + } + } + } + var data = JsonUtils.SerializerObjectToString(shopList); + + + //return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + public string SubSaGetSelectProdShop(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + var search_id = RegexUtils.GetStringQuery(ref inputData, "search_id"); + var search_user_name = RegexUtils.GetStringQuery(ref inputData, "search_user_name"); + var search_login_name = RegexUtils.GetStringQuery(ref inputData, "search_login_name"); + var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes"); + var search_name = RegexUtils.GetStringQuery(ref inputData, "search_name"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + 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 shop_notes = RegexUtils.GetStringQuery(ref inputData, "shop_notes"); + if (!string.IsNullOrWhiteSpace(shop_notes)) + { + List shopNotesLst = shop_notes.Split(',').ToList(); + shop_notes = "'" + string.Join("','", shopNotesLst) + "'"; + } + + var page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(); + var page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(); + + if (page_size == 0) + page_size = 50; + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + + string sql = "SELECT COUNT(s.id) FROM kjd.shop s WHERE 1=1"; + + //where子句 + string where = ""; + if (!string.IsNullOrWhiteSpace(operate_sub_sa_name)) + where += " and (s.shop_id in (SELECT DISTINCT shop_id From kjd.product_select WHERE operate_sub_sa_name='" + operate_sub_sa_name + "') or " + + "s.shop_id in (SELECT DISTINCT shop_id From kjd.third_product_select WHERE operate_sub_sa_name='" + operate_sub_sa_name + "'))"; + where += " and (s.cookie='' or s.shop_id!='')"; + //if (!string.IsNullOrWhiteSpace(operate_sub_sa_name)) + // where += " and s.operate_sub_sa_name='" + operate_sub_sa_name + "'"; + if (!string.IsNullOrWhiteSpace(search_user_name)) + where += " and s.user_name like '%" + search_user_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_login_name)) + where += " and s.login_name like '%" + search_login_name + "%'"; + if (!string.IsNullOrWhiteSpace(search_notes)) + where += " and s.notes like '%" + search_notes + "%'"; + if (!string.IsNullOrWhiteSpace(search_id)) + where += " and s.shop_id like '%" + search_id + "%'"; + if (!string.IsNullOrWhiteSpace(search_name)) + where += " and s.shop_account like '%" + search_name + "%'"; + if (!string.IsNullOrWhiteSpace(shop_ids)) + where += " and s.shop_id in (" + shop_ids + ")"; + if (!string.IsNullOrWhiteSpace(shop_names)) + where += " and s.shop_account in (" + shop_names + ")"; + if (!string.IsNullOrWhiteSpace(shop_notes)) + where += " and s.notes in (" + shop_notes + ")"; + sql += where; + + var count = mySql.ExecuteRowCount(sql); + + DataTable dt; + if (count == 0) + { + dt = new DataTable(); + } + else + { + sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.shop_id,s.shop_account,s.sub_user_name,s.user_name," + + "s.company_name,s.notes,s.login_status,s.login_status2,c.add_product_remaining,c.add_product_month,s.add_time,s.mdy_time," + + "s.add_sub_sa_time,s.operate_sub_sa_name"; + sql += " FROM kjd.shop s LEFT JOIN kjd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1"; + + sql += where; // where 子句 + + sql += " ORDER BY s.id DESC"; + sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size; + dt = mySql.ExecuteDataTable(sql); + } + + mySql.Close(); + if (dt != null) + { + List shopList = new List(); + foreach (DataRow row in dt.Rows) + { + ShopParam shop = new ShopParam + { + id = Convert.ToInt32(row["id"]), + login_name = row["login_name"].ToString(), + login_pass = row["login_pass"].ToString(), + cookie = row["cookie"].ToString(), + cookie2 = row["cookie2"].ToString(), + shop_id = row["shop_id"].ToString(), + shop_account = row["shop_account"].ToString(), + sub_user_name = row["sub_user_name"].ToString(), + user_name = row["user_name"].ToString(), + company_name = row["company_name"].ToString(), + notes = row["notes"].ToString(), + login_status = row["login_status"].ToString(), + login_status2 = row["login_status2"].ToString(), + add_product_remaining = row["add_product_remaining"].ParseToInt(), + add_product_month = row["add_product_month"].ParseToInt(), + operate_sub_sa_name = row["operate_sub_sa_name"] as string, + + }; + shopList.Add(shop); + } + + //sql = "\r\nINSERT INTO kjd.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES "; + //foreach (var shop in shopList) + //{ + // sql += "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + shop.add_product_remaining + "," + shop.add_product_month + "),"; + //} + //sql = sql.TrimEnd(',') + " \r\n"; + //sql += "ON DUPLICATE KEY UPDATE " + + // "shop_account=VALUES(shop_account)," + + // "add_product_remaining=VALUES(add_product_remaining)," + + // "add_product_month=VALUES(add_product_month);"; + //var result = mySql.ExecuteNonQuery(sql); + //mySql.Close(); + + int month = DateTime.Now.Month; + var shopMonthList = shopList.Where(s => s.add_product_month != month); + if (shopMonthList.Count() > 0) + { + int remainCount = 100; + var shopMonthIdList = shopMonthList.Select(s => s.id); + mySql = new MysqlUtils(conn); + string ids = string.Join(",", shopMonthIdList); + sql = ""; + sql += "update kjd.shop set add_product_remaining=" + remainCount + ", add_product_month=" + month + + " where 1=1 and id in (" + ids + ");"; + + sql += "\r\nINSERT INTO kjd.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES "; + foreach (var shop in shopMonthList) + { + sql += "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + remainCount + "," + month + "),"; + } + sql = sql.TrimEnd(',') + " \r\n"; + sql += "ON DUPLICATE KEY UPDATE " + + "shop_account=VALUES(shop_account)," + + "add_product_remaining=VALUES(add_product_remaining)," + + "add_product_month=VALUES(add_product_month);"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + + if (rst) + { + foreach (var shop in shopMonthList) + { + shop.add_product_month = month; + shop.add_product_remaining = remainCount; + } + } + } + var data = JsonUtils.SerializerObjectToString(shopList); + + + //return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + + + public string UpdateAddProdRemaining(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"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + var remainCount = RegexUtils.GetStringQuery(ref inputData, "remain_count"); + 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) + "'"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = ""; + sql += "update kjd.shop_add_prod_count set add_product_remaining=" + remainCount + + " where 1=1 and shop_id in (" + shop_ids + ");"; + + var rst = mySql.ExecuteNonQuery(sql); + var msg = mySql.Message; + mySql.Close(); + + if (rst) + return "{\"code\":200,\"msg\":\"success\"}"; + else + return "{\"code\":50000,\"msg\":\"" + msg + "\"}"; + } + else + { + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + } + + //获取一个手机登录号码下的所有店铺(以便有则更新,无则新增) + public string GetOneLoginNameShop(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + 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 id,login_name,login_pass,cookie,cookie2,shop_id,shop_account,sub_user_name,user_name from kjd.shop where user_name='" + + user_name + "' and login_name='" + login_name + "'"; + + var dt = mySql.ExecuteDataTable(sql); + mySql.Close(); + if (dt != null) + { + List shopList = new List(); + foreach (DataRow row in dt.Rows) + { + ShopParam shop = new ShopParam + { + id = Convert.ToInt32(row["id"]), + login_name = row["login_name"].ToString(), + login_pass = row["login_pass"].ToString(), + cookie = row["cookie"].ToString(), + cookie2 = row["cookie2"].ToString(), + shop_id = row["shop_id"].ToString(), + shop_account = row["shop_account"].ToString(), + sub_user_name = row["sub_user_name"].ToString(), + user_name = row["user_name"].ToString(), + company_name = row["company_name"].ToString(), + notes = row["notes"].ToString(), + login_status = row["login_status"].ToString(), + }; + shopList.Add(shop); + } + var data = JsonUtils.SerializerObjectToString(shopList); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + //获取一个手机登录号码下特定ID的店铺 + public string GetOneIdShop(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "select id,login_name,login_pass,cookie,cookie2,shop_id,shop_account,sub_user_name,user_name from kjd.shop where user_name='" + + user_name + "' and login_name='" + login_name + "' and shop_id='" + shop_id + "'"; + + var dt = mySql.ExecuteDataTable(sql); + mySql.Close(); + if (dt != null) + { + List shopList = new List(); + foreach (DataRow row in dt.Rows) + { + ShopParam shop = new ShopParam + { + id = Convert.ToInt32(row["id"]), + login_name = row["login_name"].ToString(), + login_pass = row["login_pass"].ToString(), + cookie = row["cookie"].ToString(), + cookie2 = row["cookie2"].ToString(), + shop_id = row["shop_id"].ToString(), + shop_account = row["shop_account"].ToString(), + sub_user_name = row["sub_user_name"].ToString(), + user_name = row["user_name"].ToString(), + company_name = row["company_name"].ToString(), + notes = row["notes"].ToString(), + login_status = row["login_status"].ToString(), + }; + shopList.Add(shop); + } + var data = JsonUtils.SerializerObjectToString(shopList); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + public string AddShop(string inputData, bool isAdmin=false) + { + if (!string.IsNullOrEmpty(inputData)) + { + string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + if (isAdmin) + user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name"); + string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + string login_pass = RegexUtils.GetStringQuery(ref inputData, "login_pass"); + string sub_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_user_name")); + string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie"); + string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2"); + string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + string shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account"); + string group_name = RegexUtils.GetStringQuery(ref inputData, "group_name"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")); + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + if (string.IsNullOrEmpty(login_name)) + { + return "{\"code\":501,\"msg\":\"没有店铺登录名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = ""; + if (string.IsNullOrEmpty(shop_id)) + sql = "select exists (select 1 from kjd.shop where login_name='" + login_name + "' and user_name='" + user_name + "')"; + else + sql = "select exists (select 1 from kjd.shop where login_name='" + login_name + "' and user_name='" + user_name + + "' and shop_id='" + shop_id + "')"; + var exist = mySql.ExecuteFirstInt(sql); + if (exist>0) + { + mySql.Close(); + return "{\"code\":500,\"msg\":\"店铺" + login_name +" " + shop_account + "已存在\"}"; + } + + sql = "insert into kjd.shop (login_name,login_pass,cookie,cookie2,shop_account,shop_id,sub_user_name,user_name,group_name,notes,add_time,mdy_time) " + + "values ('" + login_name + "','" + login_pass + "','" + cookie + "','" + cookie2 + "','" + shop_account + "','" + shop_id + "','" + + sub_user_name + "','" + user_name + "','" + group_name + "','" + notes + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + public string MdyShop(string inputData, bool isAdmin=false) + { + if (!string.IsNullOrEmpty(inputData)) + { + string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + if (isAdmin) + user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name"); + string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + string login_pass = RegexUtils.GetStringQuery(ref inputData, "login_pass"); + string sub_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_user_name")); + string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie"); + string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2"); + string new_shop_id = RegexUtils.GetStringQuery(ref inputData, "new_shop_id"); + string old_shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + string shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account"); + string group_name = RegexUtils.GetStringQuery(ref inputData, "group_name"); + string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes")); + string login_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status")); + + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + if (string.IsNullOrEmpty(login_name)) + { + return "{\"code\":501,\"msg\":\"没有店铺登录名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update kjd.shop set"; + if (login_pass != null) + sql += " login_pass='" + login_pass + "',"; + if (cookie != null) + sql += " cookie='" + cookie + "',"; + if (cookie2 != null) + sql += " cookie2='" + cookie2 + "',"; + if (new_shop_id != null) + sql += " shop_id='" + new_shop_id + "',"; + if (shop_account != null) + sql += " shop_account='" + shop_account + "',"; + if (sub_user_name != null) + sql += " sub_user_name='" + sub_user_name + "',"; + if (group_name != null) + sql += " group_name='" + group_name + "',"; + if (notes != null) + sql += " notes='" + notes + "',"; + if (login_status != null) + sql += " login_status='" + login_status + "',"; + sql = sql.TrimEnd(','); + sql += " where login_name='" + login_name + "' and (user_name='" + user_name + "' or sub_user_name like '%" + user_name + "%')"; + if (!string.IsNullOrEmpty(old_shop_id)) + sql += " and shop_id='" + old_shop_id + "'"; + + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + public string MdyCookieAndLoginStatus(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie"); + string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2"); + string login_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status")); + string login_status2 = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "login_status2")); + + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + if (string.IsNullOrEmpty(login_name)) + { + return "{\"code\":500,\"msg\":\"店铺没有登录名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update kjd.shop set"; + if (cookie != null) + sql += " cookie='" + cookie + "',"; + if (cookie2 != null) + sql += " cookie2='" + cookie2 + "',"; + if (login_status != null) + sql += " login_status='" + login_status + "',"; + if (login_status2 != null) + sql += " login_status2='" + login_status2 + "',"; + sql = sql.TrimEnd(','); + sql += " where login_name='" + login_name + "'"; + + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + + public string DelShop(string inputData, bool isAdmin=false) + { + if (!string.IsNullOrEmpty(inputData)) + { + var login_name = RegexUtils.GetStringQuery(ref inputData, "login_name"); + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + if (isAdmin) + user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + int r2 = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2); + + if (string.IsNullOrEmpty(user_name)) + { + return "{\"code\":500,\"msg\":\"没有用户名\"}"; + } + if (string.IsNullOrEmpty(login_name)) + { + return "{\"code\":501,\"msg\":\"没有店铺登录名\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "delete from kjd.shop where user_name='" + user_name + "' and login_name='" + login_name + "'"; + if (!string.IsNullOrEmpty(shop_id)) + sql += " and shop_id='" + shop_id + "'"; + + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + + /// + /// 设置店铺的二级超管 + /// + /// + public string SetShopSubSa(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 id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); + var login_name = RegexUtils.GetStringQuery(ref inputData, "shop_login_name")?.Replace("'", "\\'"); + var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'"); + + if (string.IsNullOrEmpty(id) && string.IsNullOrEmpty(login_name)) + { + return "{\"code\":50002,\"msg\":\"未选择任何待上传\"}"; + } + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "update kjd.shop set"; + if (operate_sub_sa_name != null) + sql += " operate_sub_sa_name='" + operate_sub_sa_name + "',"; + sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',"; + sql = sql.TrimEnd(','); + if (!string.IsNullOrEmpty(id)) + sql += " where id in (" + id + ")"; + else if (!string.IsNullOrEmpty(login_name)) + sql += " where login_name in ('" + login_name.Replace(",", "','") + "')"; + else + sql += " where 1=2"; + 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\":\"输入为空\"}"; + } + } +} \ No newline at end of file diff --git a/KJDService/KJD_WebService/BLL/KJD/ToolManage.cs b/KJDService/KJD_WebService/BLL/KJD/ToolManage.cs new file mode 100644 index 0000000..20dbc9e --- /dev/null +++ b/KJDService/KJD_WebService/BLL/KJD/ToolManage.cs @@ -0,0 +1,60 @@ +using KJD_Web.Utils; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace KJD_Web.BLL +{ + public class ToolManage + { + //mysql workbench 存储过程,可以使用分隔符重定义 +// string 存储过程1 = @" +//DELIMITER $ +//DROP PROCEDURE IF EXISTS add_spu_map; +//CREATE PROCEDURE add_spu_map() +//BEGIN +//insert into kjd_map.spu_map_0 (draft_id,from_spu_id,shop_id) values(9122600878,727585921,'3049342434562'); +//update kjd.third_product_select set draft_id='9122600878', status='已上传', add_times=add_times+1, mdy_time='2025-08-06 11:54:50' where id=6532; +//END $ +//DELIMITER ; +//CALL add_spu_map();"; + + //腾讯云服务器存储过程,不能使用分隔符重定义 +// string 存储过程2 = @" +//DROP PROCEDURE IF EXISTS add_spu_map; +//CREATE PROCEDURE add_spu_map() +//BEGIN +//insert into kjd_map.spu_map_1 (draft_id,from_spu_id,shop_id) values(9122600878,727585921,'3049342434562'); +//update kjd.third_product_select set draft_id='9122600878', status='已上传', add_times=add_times+1, mdy_time='2025-08-06 11:54:50' where id=6532; +//END ; +//CALL add_spu_map();"; + + public void CreateTable() + { +// string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; +// MysqlUtils mySql = new MysqlUtils(conn); +// string sql = ""; +// string sql1 = ""; +// for (int i = 0; i < 64; i++) +// { +// //sql = @"drop table if exists kjd_map.spu_map_" + i + ";\r\n"; +// sql = @"CREATE TABLE IF NOT EXISTS kjd_map.product_third_select_map_" + i + @" ( +// `id` int NOT NULL AUTO_INCREMENT, +// `product_id` bigint NOT NULL COMMENT '草稿箱/商品Id', +// `product_select_db_id` bigint NOT NULL COMMENT '选品上传数据库Id', +// `shop_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '上传的店铺', +// PRIMARY KEY (`id`) +//) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '上传商品与母店商品spu映射关系';"; + +// sql += @" +//ALTER TABLE +// kjd_map.product_third_select_map_" + i + @" +//ADD +// COLUMN `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP"; +// var rst = mySql.ExecuteNonQuery(sql); +// } +// mySql.Close(); + } + } +} \ No newline at end of file diff --git a/KJDService/KJD_WebService/BLL/KJD/UpadteManage.cs b/KJDService/KJD_WebService/BLL/KJD/UpadteManage.cs new file mode 100644 index 0000000..47383d6 --- /dev/null +++ b/KJDService/KJD_WebService/BLL/KJD/UpadteManage.cs @@ -0,0 +1,49 @@ +using KJD_Web.Utils; +using NaiBa.Util.Extension; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace KJD_Web.BLL +{ + public class UpadteManage + { + public string GetUpdate(string inputData) + { + //string time1 = Encryption(time); + //return "time=" + time + "&code=" + time1 + "&NbCodeVersion=1" + "&version=" + BaseClass.VersionCount + + if (!string.IsNullOrEmpty(inputData)) + { + var time = 0; + int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time); + string time1 = RegexUtils.GetStringQuery(ref inputData, "code"); + if (time1 != EncrypUtil.Encryption(time)) + return "{\"code\":50000,\"msg\":\"校验失败\"}"; + + var version = RegexUtils.GetStringQuery(ref inputData, "version").ParseToInt(); + var serverVersion = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateVersion"].ConnectionString; + var UpdateFiles = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateFiles"].ConnectionString; + var UpdateExe = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExe"].ConnectionString; + var UpdateExeChk = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExeChk"].ConnectionString; + var LowVersion = System.Configuration.ConfigurationManager.ConnectionStrings["LowVersion"].ConnectionString; + + if (version > LowVersion.ParseToInt()) + { + return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk + + "\",\"exe_address\":\"" + UpdateExe + "\",\"file_address\":\"" + UpdateFiles + "\"}"; + } + else if (version > 0) + { + return "{\"code\":501,\"msg\":\"版本过低已无法直接升级,请联系管理员获取最新安装包\"}"; + } + else + { + return "{\"code\":502,\"msg\":\"get update version failed\"}"; + } + } + return "{\"code\":19999,\"msg\":\"未知错误\"}"; + } + } +} \ No newline at end of file diff --git a/KJDService/KJD_WebService/BLL/KJD/UserManage.cs b/KJDService/KJD_WebService/BLL/KJD/UserManage.cs new file mode 100644 index 0000000..d37f504 --- /dev/null +++ b/KJDService/KJD_WebService/BLL/KJD/UserManage.cs @@ -0,0 +1,470 @@ +using KJD_Web.Model; +using KJD_Web.Utils; +using NaiBa.Util.Extension; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Web; +using System.Web.UI.WebControls; + +namespace KJD_Web.BLL +{ + public class UserManage + { + public string CheckUserLogin(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var mobile = RegexUtils.GetStringQuery(ref inputData, "mobile")?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'"); + 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 * from kjd.user where user_name='" + + mobile + "' and password='" + password + "'"; + + var dt = mySql.ExecuteDataTable(sql); + mySql.Close(); + if (dt != null) + { + foreach (DataRow row in dt.Rows) + { + UserLoginResultParam user = new UserLoginResultParam + { + id = Convert.ToInt32(row["id"]), + user_name = row["user_name"].ToString(), + nick_name = row["nick_name"].ToString(), + mobile = row["user_name"].ToString(), + password = row["password"].ToString(), + group_id = row["group_id"].ToString(), + card_id = row["card_id"].ToString(), + company_name = row["company_name"].ToString(), + is_sa = row.Table.Columns.Contains("is_sa") ? row["is_sa"].ParseToInt() : 0, + sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0, + }; + + if (string.IsNullOrEmpty(user.company_name)) + { + user.company_name = "-"; + } + var data = JsonUtils.SerializerObjectToString(user); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + } + return "{\"code\":1,\"msg\":\"用户名或密码错误\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string AddSubUser(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var parent_user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_nick_name"))?.Replace("'", "\\'"); + var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_name"))?.Replace("'", "\\'"); + var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_mobile"))?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "sub_password")?.Replace("'", "\\'"); + var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'"); + var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'"); + var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "company"))?.Replace("'", "\\'"); + var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'"); + 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 = ""; + sql = "select exists (select 1 from kjd.user where user_name='" + user_name + "')"; + var exist = mySql.ExecuteFirstInt(sql); + if (exist > 0) + { + mySql.Close(); + return "{\"code\":500,\"msg\":\"用户名已存在\"}"; + } + + sql = "insert into kjd.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,parent_user_name,add_time,mdy_time) " + + "values ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" + + group_id + "','" + company_name + "','" + notes + "','" + parent_user_name + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (!rst) + return "{\"code\":501,\"msg\":\""+ mySql.Message + "\"}"; + else + return "{\"code\":200,\"msg\":\"子账户创建成功!\"}"; + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetSubUser(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var password = RegexUtils.GetStringQuery(ref inputData, "password"); + var group = RegexUtils.GetStringQuery(ref inputData, "group"); + 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 * from kjd.user where parent_user_name='" + + user_name + "'"; + + var dt = mySql.ExecuteDataTable(sql); + mySql.Close(); + if (dt != null) + { + List userList = new List(); + foreach (DataRow row in dt.Rows) + { + + UserLoginResultParam user = new UserLoginResultParam + { + id = Convert.ToInt32(row["id"]), + user_name = row["user_name"].ToString(), + nick_name = row["nick_name"].ToString(), + mobile = row["mobile"].ToString(), + password = row["password"].ToString(), + group_id = row["group_id"].ToString(), + card_id = row["card_id"].ToString(), + parent_user_name = row["parent_user_name"].ToString(), + company_name = row["company_name"].ToString(), + notes = row["notes"].ToString(), + }; + if (string.IsNullOrEmpty(user.mobile)) + { + user.mobile = row["user_name"].ToString(); + } + userList.Add(user); + } + var data = JsonUtils.SerializerObjectToString(userList); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string UpdateSubUser(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var id = RegexUtils.GetStringQuery(ref inputData, "id")?.Replace("'", "\\'"); + var parent_user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_nick_name"))?.Replace("'", "\\'"); + var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_name"))?.Replace("'", "\\'"); + var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_mobile"))?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "sub_password")?.Replace("'", "\\'"); + var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'"); + var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'"); + var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'"); + 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 = ""; + //sql = "select * from kjd.user where parent_user_name='" + // + user_name + "'"; + sql = "update kjd.user set"; + if (!string.IsNullOrEmpty(nick_name)) + sql += " nick_name='" + nick_name + "',"; + if (!string.IsNullOrEmpty(user_name)) + sql += " user_name='" + user_name + "',"; + if (!string.IsNullOrEmpty(mobile)) + sql += " mobile='" + mobile + "',"; + if (!string.IsNullOrEmpty(password)) + sql += " password='" + password + "',"; + if (!string.IsNullOrEmpty(group_id)) + sql += " group_id=" + group_id + ","; + if (!string.IsNullOrEmpty(card_id)) + sql += " card_id='" + card_id + "',"; + if (!string.IsNullOrEmpty(notes)) + sql += " notes='" + notes + "',"; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ""; + + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + + public string DelUser(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name"); + var id = RegexUtils.GetStringQuery(ref inputData, "id"); + 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 = "delete from kjd.user where id='" + + id + "'"; + + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (rst) + { + return "{\"code\":200,\"msg\":\"success\"}"; + } + else + return "{\"code\":500,\"msg\":\"删除失败,请稍后重试\"}"; + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string GetAllUser(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'"); + var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'"); + var search = RegexUtils.GetStringQuery(ref inputData, "search")?.Replace("'", "\\'"); + var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'"); + 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 * from kjd.user where group_id=3"; + string sql = "select * from kjd.user where 1=1"; + if (!string.IsNullOrEmpty(group_id)) + sql += " and group_id=" + group_id; + if (!string.IsNullOrEmpty(sa_level)) + sql += " and sa_level=" + sa_level; + if (!string.IsNullOrEmpty(search)) + sql += " and (user_name like '%" + search + + "%' or nick_name like '%" + search + + "%' or company_name like '%" + search + "%')"; + sql += " order by id desc"; + + var dt = mySql.ExecuteDataTable(sql); + mySql.Close(); + if (dt != null) + { + List userList = new List(); + foreach (DataRow row in dt.Rows) + { + + UserLoginResultParam user = new UserLoginResultParam + { + id = Convert.ToInt32(row["id"]), + user_name = row["user_name"].ToString(), + nick_name = row["nick_name"].ToString(), + mobile = row["mobile"].ToString(), + password = row["password"].ToString(), + group_id = row["group_id"].ToString(), + card_id = row["card_id"].ToString(), + parent_user_name = row["parent_user_name"].ToString(), + company_name = row["company_name"].ToString(), + notes = row["notes"].ToString(), + is_sa = row.Table.Columns.Contains("is_sa") ? row["is_sa"].ParseToInt() : 0, + sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0, + }; + if (string.IsNullOrEmpty(user.mobile)) + { + user.mobile = row["user_name"].ToString(); + } + userList.Add(user); + } + var data = JsonUtils.SerializerObjectToString(userList); + return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}"; + } + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string AddUser(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_nick_name"))?.Replace("'", "\\'"); + var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'"); + var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_mobile"))?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "add_password")?.Replace("'", "\\'"); + var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_company"))?.Replace("'", "\\'"); + var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'"); ; + var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'"); + var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'"); + var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'"); + 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 = ""; + sql = "select exists (select 1 from kjd.user where user_name='" + user_name + "')"; + var exist = mySql.ExecuteFirstInt(sql); + if (exist > 0) + { + mySql.Close(); + return "{\"code\":500,\"msg\":\"用户名已存在\"}"; + } + + sql = "insert into kjd.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,sa_level,add_time,mdy_time) " + + "values ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" + + group_id + "','" + company_name + "','" + notes + "'," + sa_level + ",'" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');"; + var rst = mySql.ExecuteNonQuery(sql); + mySql.Close(); + if (!rst) + return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}"; + else + return "{\"code\":200,\"msg\":\"success\"}"; + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + + public string UpdateUser(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var id = RegexUtils.GetStringQuery(ref inputData, "id")?.Replace("'", "\\'"); + var nick_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_nick_name"))?.Replace("'", "\\'"); + var user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'"); + var mobile = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_mobile"))?.Replace("'", "\\'"); + var company_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_company"))?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "add_password")?.Replace("'", "\\'"); + var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'"); + var card_id = RegexUtils.GetStringQuery(ref inputData, "card_id")?.Replace("'", "\\'"); + var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'"); + var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'"); + 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 = ""; + //sql = "select * from kjd.user where parent_user_name='" + // + user_name + "'"; + sql = "update kjd.user set"; + if (!string.IsNullOrEmpty(nick_name)) + sql += " nick_name='" + nick_name + "',"; + if (!string.IsNullOrEmpty(user_name)) + sql += " user_name='" + user_name + "',"; + if (!string.IsNullOrEmpty(mobile)) + sql += " mobile='" + mobile + "',"; + if (!string.IsNullOrEmpty(company_name)) + sql += " company_name='" + company_name + "',"; + if (!string.IsNullOrEmpty(password)) + sql += " password='" + password + "',"; + if (!string.IsNullOrEmpty(group_id)) + sql += " group_id=" + group_id + ","; + if (!string.IsNullOrEmpty(card_id)) + sql += " card_id='" + card_id + "',"; + if (!string.IsNullOrEmpty(notes)) + sql += " notes='" + notes + "',"; + if (!string.IsNullOrEmpty(sa_level)) + sql += " sa_level=" + sa_level + ","; + sql = sql.TrimEnd(','); + sql += " where id=" + id + ""; + + 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 ChangePassword(string inputData) + { + var userName = RegexUtils.GetStringJson(ref inputData, "user_name")?.Replace("'", "\\'"); + var password = RegexUtils.GetStringJson(ref inputData, "password")?.Replace("'", "\\'"); + var newPassword = RegexUtils.GetStringJson(ref inputData, "new_password")?.Replace("'", "\\'"); + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["Conn"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "select user_id,password from pepdtp.user where user_id='" + + userName + "' and password='" + password + "'"; + + var dw = mySql.ExecuteDataTableRow(sql); + if (dw != null) + { + UserLoginResultParam user = new UserLoginResultParam + { + user_name = dw["user_id"].ToString(), + password = dw["password"].ToString(), + }; + sql = "update pepdtp.user set password = '" + newPassword + "' where user_id='" + userName + "'"; + var result = mySql.ExecuteNonQuery(sql); + mySql.Close(); + + if (result) + { + return "{\"code\":0,\"msg\":\"密码修改成功!\"}"; + } + else + return "{\"code\":19999,\"msg\":\"密码修改失败!请稍后再试。\"}"; + } + else + { + mySql.Close(); + return "{\"code\":1,\"msg\":\"原密码错误。\"}"; + } + } + + public string return_package_secret_key { get; set; } = "aaMETt2bPe6YHzZ1ojbC+6wOvgtwehqc6A+/Rz+pCUU="; + + public string GetPackageSign(string inputData) + { + if (!string.IsNullOrEmpty(inputData)) + { + var mobile = RegexUtils.GetStringQuery(ref inputData, "mobile")?.Replace("'", "\\'"); + var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'"); + var timestamp = RegexUtils.GetStringQuery(ref inputData, "timestamp")?.Replace("'", "\\'"); + var mallId = RegexUtils.GetStringQuery(ref inputData, "mallId")?.Replace("'", "\\'"); + var returnPackageNo = RegexUtils.GetStringQuery(ref inputData, "returnPackageNo")?.Replace("'", "\\'"); + int r2 = RegexUtils.GetStringQuery(ref inputData, "r2").ParseToInt(); + string c2 = RegexUtils.GetStringQuery(ref inputData, "c2"); + + if (EncrypUtil.Encryption(r2) != c2) + return "{\"code\":2,\"msg\":\"不合法的输入内容\"}"; + + string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; + MysqlUtils mySql = new MysqlUtils(conn); + string sql = "select * from kjd.user where user_name='" + + mobile + "' and password='" + password + "'"; + + sql = "select * from kjd.user where user_name='" + mobile + "'"; + + var dt = mySql.ExecuteDataTable(sql); + mySql.Close(); + if (dt == null || dt.Rows.Count <=0) + { + return "{\"code\":1,\"msg\":\"用户不存在\"}"; + } + + string sign = EncrypUtil.GetMd5(timestamp + return_package_secret_key + mallId + returnPackageNo).ToLower(); + + return "{\"code\":200, \"sign\":\"" + sign + "\", \"msg\":\"\"}"; + } + return "{\"code\":19999,\"msg\":\"输入为空\"}"; + } + } +} \ No newline at end of file diff --git a/KJDService/KJD_WebService/BXXPriceService.asmx b/KJDService/KJD_WebService/BXXPriceService.asmx new file mode 100644 index 0000000..90f5330 --- /dev/null +++ b/KJDService/KJD_WebService/BXXPriceService.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="BXXPriceService.asmx.cs" Class="KJD_Web.BXXPriceService" %> diff --git a/KJDService/KJD_WebService/BXXPriceService.asmx.cs b/KJDService/KJD_WebService/BXXPriceService.asmx.cs new file mode 100644 index 0000000..36e5d61 --- /dev/null +++ b/KJDService/KJD_WebService/BXXPriceService.asmx.cs @@ -0,0 +1,149 @@ +using KJD_Web.BLL.BXX; +using KJD_Web.Utils; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.Services; + +namespace KJD_Web +{ + /// + /// PriceService 的摘要说明 + /// + [WebService(Namespace = "http://tempuri.org/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [System.ComponentModel.ToolboxItem(false)] + // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。 + // [System.Web.Script.Services.ScriptService] + public class BXXPriceService : System.Web.Services.WebService + { + private string GetRequestJsonString() + { + Context.Response.ContentType = "text/html;charset=utf-8"; + Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8"); + + using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流 + { + // 还原数据流 + byte[] b = new byte[s.Length]; + s.Read(b, 0, (int)s.Length); + string jsonText = Encoding.UTF8.GetString(b); // JSON字符串 + if (string.IsNullOrEmpty(jsonText)) + { + var qs = HttpContext.Current.Request.QueryString; + if (qs != null && qs.Keys.Count > 0) + { + jsonText = "{"; + foreach (var key in qs.Keys) + { + jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";"; + } + jsonText = jsonText.TrimEnd(';') + "}"; + } + } + return jsonText; + } + } + + [WebMethod] + public void get_price_list() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXPriceManage().GetPriceList(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void add_price() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXPriceManage().AddPrice(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void del_db_price() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXPriceManage().DelDbPrice(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + + [WebMethod] + public void mdy_db_price() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXPriceManage().MdyDBPrice(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + + [WebMethod] + public void mdy_purchase_price() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXPriceManage().MdyPurchasePrice(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void add_purchase_price() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXPriceManage().AddPurchasePrice(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void del_purchase_price() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXPriceManage().DelPurchasePrice(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void get_purchase_price_list() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXPriceManage().GetPurchasePriceList(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + } +} diff --git a/KJDService/KJD_WebService/BXXProductService.asmx b/KJDService/KJD_WebService/BXXProductService.asmx new file mode 100644 index 0000000..3fbe178 --- /dev/null +++ b/KJDService/KJD_WebService/BXXProductService.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="BXXProductService.asmx.cs" Class="KJD_Web.BXXProductService" %> diff --git a/KJDService/KJD_WebService/BXXProductService.asmx.cs b/KJDService/KJD_WebService/BXXProductService.asmx.cs new file mode 100644 index 0000000..c199f76 --- /dev/null +++ b/KJDService/KJD_WebService/BXXProductService.asmx.cs @@ -0,0 +1,221 @@ +using KJD_Web.BLL.BXX; +using KJD_Web.Utils; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.Services; + +namespace KJD_Web +{ + /// + /// ProductService 的摘要说明 + /// + [WebService(Namespace = "http://tempuri.org/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [System.ComponentModel.ToolboxItem(false)] + // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。 + // [System.Web.Script.Services.ScriptService] + public class BXXProductService : System.Web.Services.WebService + { + private string GetRequestJsonString() + { + Context.Response.ContentType = "text/html;charset=utf-8"; + Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8"); + + using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流 + { + // 还原数据流 + byte[] b = new byte[s.Length]; + s.Read(b, 0, (int)s.Length); + string jsonText = Encoding.UTF8.GetString(b); // JSON字符串 + if (string.IsNullOrEmpty(jsonText)) + { + var qs = HttpContext.Current.Request.QueryString; + if (qs != null && qs.Keys.Count > 0) + { + jsonText = "{"; + foreach (var key in qs.Keys) + { + jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";"; + } + jsonText = jsonText.TrimEnd(';') + "}"; + } + } + return jsonText; + } + } + + [WebMethod] + public void get_product_list() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().GetProductList(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void get_product_detail_list() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().GetProductList(jsontext, true); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void add_product() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().AddProduct(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void del_db_product() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().DelDbProd(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + //[WebMethod] + //public void mdy_product() + //{ + // string jsontext = GetRequestJsonString(); + + // var result = jsontext; + // //result = new BXXProductManage().MdyShop(jsontext); + + // Context.Response.Write(result); + // Context.Response.End(); + //} + + [WebMethod] + public void mdy_product_notes() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().MdyProductNotes(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void mdy_db_product() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().MdyDBProduct(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + + [WebMethod] + public void add_user_select_product() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().AddUserSelectProduct(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void mdy_user_select_product_status() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().MdyUserSelectProductStatus(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void get_user_select_product_list() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().GetUserSelectProductList(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + + [WebMethod] + public void admin_get_user_select_product_list() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().GetUserSelectProductList(jsontext, true); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void del_select_product() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().DelSelectProd(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void set_select_product_sub_sa() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().SetSelectProductSubSa(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void mdy_product_select_notes() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductManage().MdyProductSelectNotes(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + } +} diff --git a/KJDService/KJD_WebService/BXXProductThirdService.asmx b/KJDService/KJD_WebService/BXXProductThirdService.asmx new file mode 100644 index 0000000..cb44d7d --- /dev/null +++ b/KJDService/KJD_WebService/BXXProductThirdService.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="BXXProductThirdService.asmx.cs" Class="KJD_Web.BXXProductThirdService" %> diff --git a/KJDService/KJD_WebService/BXXProductThirdService.asmx.cs b/KJDService/KJD_WebService/BXXProductThirdService.asmx.cs new file mode 100644 index 0000000..17a71b9 --- /dev/null +++ b/KJDService/KJD_WebService/BXXProductThirdService.asmx.cs @@ -0,0 +1,221 @@ +using KJD_Web.BLL.BXX; +using KJD_Web.Utils; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.Services; + +namespace KJD_Web +{ + /// + /// ProductThirdService 的摘要说明 + /// + [WebService(Namespace = "http://tempuri.org/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [System.ComponentModel.ToolboxItem(false)] + // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。 + // [System.Web.Script.Services.ScriptService] + public class BXXProductThirdService : System.Web.Services.WebService + { + private string GetRequestJsonString() + { + Context.Response.ContentType = "text/html;charset=utf-8"; + Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8"); + + using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流 + { + // 还原数据流 + byte[] b = new byte[s.Length]; + s.Read(b, 0, (int)s.Length); + string jsonText = Encoding.UTF8.GetString(b); // JSON字符串 + if (string.IsNullOrEmpty(jsonText)) + { + var qs = HttpContext.Current.Request.QueryString; + if (qs != null && qs.Keys.Count > 0) + { + jsonText = "{"; + foreach (var key in qs.Keys) + { + jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";"; + } + jsonText = jsonText.TrimEnd(';') + "}"; + } + } + return jsonText; + } + } + + [WebMethod] + public void get_product_list() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductThirdManage().GetProductList(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void get_product_detail_list() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductThirdManage().GetProductList(jsontext, true); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void add_product() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductThirdManage().AddProduct(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void del_db_product() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductThirdManage().DelDbProd(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + //[WebMethod] + //public void mdy_product() + //{ + // string jsontext = GetRequestJsonString(); + + // var result = jsontext; + // //result = new ProductThridManage().MdyShop(jsontext); + + // Context.Response.Write(result); + // Context.Response.End(); + //} + + [WebMethod] + public void mdy_product_notes() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductThirdManage().MdyProductNotes(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void mdy_product_category() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductThirdManage().MdyProductCategory(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void add_user_select_product() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductThirdManage().AddUserSelectProduct(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void mdy_user_select_product_status() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductThirdManage().MdyUserSelectProductStatus(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void get_user_select_product_list() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductThirdManage().GetUserSelectProductList(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + + [WebMethod] + public void admin_get_user_select_product_list() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductThirdManage().GetUserSelectProductList(jsontext, true); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void del_select_product() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductThirdManage().DelSelectProd(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void set_select_product_sub_sa() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductThirdManage().SetSelectProductSubSa(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + + [WebMethod] + public void mdy_product_select_notes() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXProductThirdManage().MdyProductSelectNotes(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + } +} diff --git a/KJDService/KJD_WebService/BXXShopService.asmx b/KJDService/KJD_WebService/BXXShopService.asmx new file mode 100644 index 0000000..d7c76f1 --- /dev/null +++ b/KJDService/KJD_WebService/BXXShopService.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="BXXShopService.asmx.cs" Class="KJD_Web.BXXShopService" %> diff --git a/KJDService/KJD_WebService/BXXShopService.asmx.cs b/KJDService/KJD_WebService/BXXShopService.asmx.cs new file mode 100644 index 0000000..3ad7ad9 --- /dev/null +++ b/KJDService/KJD_WebService/BXXShopService.asmx.cs @@ -0,0 +1,207 @@ +using KJD_Web.BLL.BXX; +using KJD_Web.Utils; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.Services; + +namespace KJD_Web +{ + /// + /// ShopService 的摘要说明 + /// + [WebService(Namespace = "http://tempuri.org/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [System.ComponentModel.ToolboxItem(false)] + // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。 + // [System.Web.Script.Services.ScriptService] + public class BXXShopService : System.Web.Services.WebService + { + private string GetRequestJsonString() + { + Context.Response.ContentType = "text/html;charset=utf-8"; + Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8"); + + using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流 + { + // 还原数据流 + byte[] b = new byte[s.Length]; + s.Read(b, 0, (int)s.Length); + string jsonText = Encoding.UTF8.GetString(b); // JSON字符串 + if (string.IsNullOrEmpty(jsonText)) + { + var qs = HttpContext.Current.Request.QueryString; + if (qs != null && qs.Keys.Count > 0) + { + jsonText = "{"; + foreach (var key in qs.Keys) + { + jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";"; + } + jsonText = jsonText.TrimEnd(';') + "}"; + } + } + return jsonText; + } + } + + [WebMethod] + public void get_shop_list() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXShopManage().GetShop(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void get_one_login_name_shop() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXShopManage().GetOneLoginNameShop(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void add_shop() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXShopManage().AddShop(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void del_shop() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXShopManage().DelShop(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void mdy_shop() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXShopManage().MdyShop(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void mdy_shop_cookie_and_login_status() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXShopManage().MdyCookieAndLoginStatus(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void admin_get_shop_list() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXShopManage().GetShop(jsontext, true); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void sub_sa_get_select_prod_shop() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXShopManage().SubSaGetSelectProdShop(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void update_add_prod_remaining() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXShopManage().UpdateAddProdRemaining(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void admin_mdy_shop() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXShopManage().MdyShop(jsontext, true); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void admin_add_shop() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXShopManage().AddShop(jsontext, true); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void admin_del_shop() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXShopManage().DelShop(jsontext, true); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void set_shop_sub_sa() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXShopManage().SetShopSubSa(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + } +} diff --git a/KJDService/KJD_WebService/BXXUserService.asmx b/KJDService/KJD_WebService/BXXUserService.asmx new file mode 100644 index 0000000..d5fb7c2 --- /dev/null +++ b/KJDService/KJD_WebService/BXXUserService.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="BXXUserService.asmx.cs" Class="KJD_Web.BXXUserService" %> diff --git a/KJDService/KJD_WebService/BXXUserService.asmx.cs b/KJDService/KJD_WebService/BXXUserService.asmx.cs new file mode 100644 index 0000000..6d1679a --- /dev/null +++ b/KJDService/KJD_WebService/BXXUserService.asmx.cs @@ -0,0 +1,177 @@ +using KJD_Web.BLL.BXX; +using KJD_Web.Utils; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.Services; + +namespace KJD_Web +{ + /// + /// UserService 的摘要说明 + /// + [WebService(Namespace = "http://tempuri.org/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [System.ComponentModel.ToolboxItem(false)] + // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。 + // [System.Web.Script.Services.ScriptService] + public class BXXUserService : System.Web.Services.WebService + { + [WebMethod] + public string hello_world() + { + return "Hello World"; + } + + private string GetRequestJsonString() + { + Context.Response.ContentType = "text/html;charset=utf-8"; + Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8"); + + using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流 + { + // 还原数据流 + byte[] b = new byte[s.Length]; + s.Read(b, 0, (int)s.Length); + string jsonText = Encoding.UTF8.GetString(b); // JSON字符串 + if (string.IsNullOrEmpty(jsonText)) + { + var qs = HttpContext.Current.Request.QueryString; + if (qs != null && qs.Keys.Count > 0) + { + jsonText = "{"; + foreach (var key in qs.Keys) + { + jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";"; + } + jsonText = jsonText.TrimEnd(';') + "}"; + } + } + return jsonText; + } + } + + [WebMethod] + public void user_login() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXUserManage().CheckUserLogin(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void get_package_sign() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXUserManage().GetPackageSign(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void change_password() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXUserManage().ChangePassword(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void get_sub_user() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXUserManage().GetSubUser(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void update_sub_user() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXUserManage().UpdateSubUser(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void add_sub_user() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXUserManage().AddSubUser(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void delete_user() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXUserManage().DelUser(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void get_all_user() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXUserManage().GetAllUser(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void update_user() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXUserManage().UpdateUser(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + + [WebMethod] + public void add_user() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new BXXUserManage().AddUser(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + } +} diff --git a/TEMUKJD/BLL/ShopBLL.cs b/TEMUKJD/BLL/ShopBLL.cs new file mode 100644 index 0000000..57be754 --- /dev/null +++ b/TEMUKJD/BLL/ShopBLL.cs @@ -0,0 +1,175 @@ +using AllBase; +using AllBase.Model.Result; +using NaiBa.Util.Extension; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TemuKJD.KJDForms.BaseForms; +using Work; + +namespace TemuKJD.BLL +{ + public class ShopBLL + { + public static List AdminGetServerShopLstByIds(List shop_ids) + { + List list = new List(); + shop_ids = shop_ids.Where(s => !string.IsNullOrEmpty(s)).ToList(); + + var url = BaseClass.BuildObjString("shop/admin_get_shop_list"); + var data = UserLogin.GetSignaturex() + + "&shop_ids='" + string.Join("','", shop_ids) + "'"; + data += "&page_size=200"; + var html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) + || !html.Contains("shop_id") || !html.Contains("shop_account") || !html.Contains("login_pass")) + { + return new List(); + } + + return ShopBLL.DeserializationShop(html); + } + + public static string AdminGetServerShopLstForSetCookie(ShopLoginInfo loginShop, List lstRst) + { + if (lstRst == null) + lstRst = new List(); + + var url = BaseClass.BuildObjString("shop/admin_get_shop_list"); + var data = UserLogin.GetSignaturex() + + "&search_user_name=" + loginShop.UserName + + "&search_login_name=" + loginShop.LoginName; + var html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) + || !html.Contains("shop_id") || !html.Contains("shop_account") || !html.Contains("login_pass")) + { + return "获取失败:" + BaseRegex.GetStringJson(ref html, "msg"); + } + + lstRst.AddRange(ShopBLL.DeserializationShop(html)); + + return "success"; + } + + public static string AdminAddServerShop(ShopLoginInfo _shop) + { + var url = BaseClass.BuildObjString("shop/admin_add_shop"); + var data = UserLogin.GetSignaturex() + + "&shop_user_name=" + _shop.UserName + + "&login_name=" + _shop.LoginName + + "&login_pass=" + GetHtml.UrlEncodeUtf8(_shop.Password) + + "&shop_id=" + _shop.ShopId + + "&shop_account=" + _shop.ShopAccount + + "&cookie=" + _shop.Cookies + + "&shop_group=" + GetHtml.UrlEncodeUtf8(_shop.GroupName) + + "&sub_user_name=" + GetHtml.UrlEncodeUtf8(_shop.SubUserName) + + "¬es=" + GetHtml.UrlEncodeUtf8(_shop.Notes) + + "&login_status=" + _shop.LoginStatus; + + var result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在")) + result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在")) + result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200")) + { + var msg = BaseRegex.GetStringJson(ref result, "msg"); + if (string.IsNullOrEmpty(msg)) + msg = "店铺保存失败!"; + BaseMsgForm.ShowError(msg); + } + return result; + } + + public static string AdminMdyServerShop(ShopLoginInfo _shop) + { + var url = BaseClass.BuildObjString("shop/admin_mdy_shop"); + var data = UserLogin.GetSignaturex() + + "&shop_user_name=" + _shop.UserName + + "&login_name=" + _shop.LoginName + + "&login_pass=" + GetHtml.UrlEncodeUtf8(_shop.Password) + + "&shop_group=" + GetHtml.UrlEncodeUtf8(_shop.GroupName) + + "&sub_user_name=" + GetHtml.UrlEncodeUtf8(_shop.SubUserName) + + "¬es=" + GetHtml.UrlEncodeUtf8(_shop.Notes); + + var result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在")) + result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在")) + result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200")) + { + var msg = BaseRegex.GetStringJson(ref result, "msg"); + if (string.IsNullOrEmpty(msg)) + msg = "店铺保存失败!"; + BaseMsgForm.ShowError(msg); + } + return result; + } + + public static bool AdminDelServerShop(ShopLoginInfo _shop) + { + var url = BaseClass.BuildObjString("shop/admin_del_shop"); + var data = UserLogin.GetSignaturex() + "&login_name=" + _shop.LoginName + + "&shop_user_name=" + _shop.UserName; + var result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200")) + { + BaseMsgForm.ShowError("删除失败:" + BaseRegex.GetStringJson(ref result, "msg")); + return false; + } + return true; + } + + public static List DeserializationShop(string shopJson) + { + List list = new List(); + if (!shopJson.Contains("data")) + return list; + + var jArr = JObject.Parse(shopJson)["data"]; + if (jArr.Count() == 0) + return list; + + foreach (JObject jObj in jArr) + { + string shopStr = jObj.ToString(); + ShopLoginInfo shop = new ShopLoginInfo(); + shop.DbId = BaseRegex.GetStringJson(ref shopStr, "id"); + if (shop.DbId == null) + continue; + shop.LoginName = BaseRegex.GetStringJson(ref shopStr, "login_name"); + shop.Password = BaseRegex.GetStringJson(ref shopStr, "login_pass"); + shop.ShopId = BaseRegex.GetStringJson(ref shopStr, "shop_id"); + shop.ShopAccount = BaseRegex.GetStringJson(ref shopStr, "shop_account"); + shop.UserName = BaseRegex.GetStringJson(ref shopStr, "user_name"); + shop.SubUserName = BaseRegex.GetStringJson(ref shopStr, "sub_user_name"); + shop.GroupName = BaseRegex.GetStringJson(ref shopStr, "shop_group"); + shop.Cookies = BaseRegex.GetStringJson(ref shopStr, "cookie"); + shop.Cookies = shop.Cookies.Replace("&", "&").Replace("%", "%").Replace("+", "+"); + shop.Cookies2 = BaseRegex.GetStringJson(ref shopStr, "cookie2").ParseToString(); + shop.Cookies2 = shop.Cookies2.Replace("&", "&").Replace("%", "%").Replace("+", "+"); + shop.CompanyName = BaseRegex.GetStringJson(ref shopStr, "company_name"); + shop.Notes = BaseRegex.GetStringJson(ref shopStr, "notes"); + shop.LoginStatus = BaseRegex.GetStringJson(ref shopStr, "login_status"); + shop.LoginStatus2 = BaseRegex.GetStringJson(ref shopStr, "login_status2"); + shop.OperateSubSaName = BaseRegex.GetStringJson(ref shopStr, "operate_sub_sa_name"); + shop.AddProductRemaining = BaseRegex.GetIntJson(ref shopStr, "add_product_remaining"); + + list.Add(shop); + } + return list; + } + } +} diff --git a/TEMUKJD/PDDForms/ShopForms/MPddShopForm.Designer.cs b/TEMUKJD/PDDForms/ShopForms/MPddShopForm.Designer.cs new file mode 100644 index 0000000..ceb5eb1 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/MPddShopForm.Designer.cs @@ -0,0 +1,189 @@ +namespace TemuKJD.PDDForms.ShopForms +{ + partial class MPddShopForm + { + /// + /// 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("店铺列表"); + System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("子账号管理"); + System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("订单金额统计"); + System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("工作明细统计"); + System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("运费模板"); + System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("高级运费模板"); + System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("素材库管理"); + System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("店铺管理", new System.Windows.Forms.TreeNode[] { + treeNode1, + treeNode2, + treeNode3, + treeNode4, + treeNode5, + treeNode6, + treeNode7}); + 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(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.tv = new TemuKJD.UserComponent.UcTreeView(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.SuspendLayout(); + // + // 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(792, 461); + this.panel1.TabIndex = 2; + // + // 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(792, 433); + 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(792, 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"; + // + // 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(933, 461); + this.splitContainer1.SplitterDistance = 140; + this.splitContainer1.SplitterWidth = 1; + this.splitContainer1.TabIndex = 3; + // + // 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 = "店铺列表"; + treeNode1.Text = "店铺列表"; + treeNode2.Name = "子账号管理"; + treeNode2.Text = "子账号管理"; + treeNode3.Name = "订单金额统计"; + treeNode3.Text = "订单金额统计"; + treeNode4.Name = "工作明细统计"; + treeNode4.Text = "工作明细统计"; + treeNode5.Name = "运费模板"; + treeNode5.Text = "运费模板"; + treeNode6.Name = "高级运费模板"; + treeNode6.Text = "高级运费模板"; + treeNode7.Name = "素材库管理"; + treeNode7.Text = "素材库管理"; + treeNode8.Name = "店铺管理"; + treeNode8.Text = "店铺管理"; + this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { + treeNode8}); + this.tv.OverForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.tv.Size = new System.Drawing.Size(140, 461); + this.tv.TabIndex = 1; + this.tv.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tv_AfterSelect); + // + // ShopForm + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.ClientSize = new System.Drawing.Size(933, 461); + this.Controls.Add(this.splitContainer1); + this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Name = "ShopForm"; + this.Text = "ShopForm"; + this.Load += new System.EventHandler(this.ShopForm_Load); + this.panel1.ResumeLayout(false); + this.panel2.ResumeLayout(false); + this.panel2.PerformLayout(); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private UserComponent.UcTreeView tv; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Label lblName; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.SplitContainer splitContainer1; + } +} \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ShopForms/MPddShopForm.cs b/TEMUKJD/PDDForms/ShopForms/MPddShopForm.cs new file mode 100644 index 0000000..8f81b36 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/MPddShopForm.cs @@ -0,0 +1,151 @@ +using AllBase; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using TemuKJD.KJDForms.AdminForms; +using TemuKJD.KJDForms.BaseForms; +using TemuKJD.KJDForms.ProductSelectForms; +using TemuKJD.KJDForms.ProductThirdSelectForms; +using TemuKJD.KJDForms.ShopForms.Statistics; + +namespace TemuKJD.PDDForms.ShopForms +{ + public partial class MPddShopForm : BaseForm + { + public Lazy shopListForm = new Lazy(); + public Lazy sbuAccountForm = new Lazy(); + + + public MPddShopForm() + { + InitializeComponent(); + + try + { + tv.SelectedNode = tv.Nodes[0].Nodes[0]; + tv.ExpandGroup(tv.Nodes[0].Name); + + List hideName = new List() { "子账号管理", "高级运费模板", "运费模板", "素材库管理", "订单金额统计", "工作明细统计" }; + + if (BaseClass.GroupId == 3) + { + hideName.Remove("子账号管理"); + } + + 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; + new Thread(() => + { + Thread.Sleep(200); + Invoke(new Action(() => + { + switch (e.Node.Name) + { + case "店铺列表": + SetForm(shopListForm.Value); + break; + case "子账号管理": + SetForm(sbuAccountForm.Value); + break; + } + })); + }).Start(); + } + + /// + /// 显示隐藏层 + /// + /// + 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; + try + { + f.Show(); + } + catch + { + } + } + + private void ShopForm_Load(object sender, EventArgs e) + { + try + { + var ns = tv.Nodes.Find("运费模板", true); + if (ns.Count() > 0) + { + //foreach (var n in ns) + //{ + // tv.Nodes.Remove(n); + //} + + if (AllBase.BaseClass.IsCloudBuyOrder) + this.tv.Nodes[0].Nodes.Insert(ns[0].Index + 1, new TreeNode() { Text = "高级运费模板", Name = "高级运费模板" }); + } + tv.SelectedNode = tv.Nodes[0].Nodes[0]; + tv.ExpandGroup(tv.Nodes[0].Name); + } + catch { } + } + } +} diff --git a/TEMUKJD/PDDForms/ShopForms/MPddShopForm.resx b/TEMUKJD/PDDForms/ShopForms/MPddShopForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/MPddShopForm.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/PDDForms/ShopForms/PDDShopAddEditForm.Designer.cs b/TEMUKJD/PDDForms/ShopForms/PDDShopAddEditForm.Designer.cs new file mode 100644 index 0000000..e337815 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopAddEditForm.Designer.cs @@ -0,0 +1,321 @@ +namespace TemuKJD.PDDForms.ShopForms +{ + partial class PDDShopAddEditForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDDShopAddEditForm)); + this.panel2 = new System.Windows.Forms.Panel(); + this.label7 = new System.Windows.Forms.Label(); + this.cmbGroup = new System.Windows.Forms.ComboBox(); + this.txtBuyAccount = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label6 = new System.Windows.Forms.Label(); + this.txtChatAccount = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label4 = new System.Windows.Forms.Label(); + this.txtUploadAccount = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label3 = new System.Windows.Forms.Label(); + this.txtShopPassword = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.txtLoginName = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.btnOk = new TemuKJD.UserControls.ButtonEx(); + this.txtNotes = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label8 = new System.Windows.Forms.Label(); + this.panel2.SuspendLayout(); + this.SuspendLayout(); + // + // panel2 + // + this.panel2.BackColor = System.Drawing.Color.White; + this.panel2.Controls.Add(this.label8); + this.panel2.Controls.Add(this.txtNotes); + this.panel2.Controls.Add(this.label7); + this.panel2.Controls.Add(this.cmbGroup); + this.panel2.Controls.Add(this.txtBuyAccount); + this.panel2.Controls.Add(this.label6); + this.panel2.Controls.Add(this.txtChatAccount); + this.panel2.Controls.Add(this.label4); + this.panel2.Controls.Add(this.txtUploadAccount); + this.panel2.Controls.Add(this.label3); + this.panel2.Controls.Add(this.txtShopPassword); + this.panel2.Controls.Add(this.label2); + this.panel2.Controls.Add(this.txtLoginName); + this.panel2.Controls.Add(this.label1); + this.panel2.Controls.Add(this.label5); + 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(295, 285); + this.panel2.TabIndex = 1; + this.panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.panel2_Paint); + // + // label7 + // + this.label7.AutoSize = true; + this.label7.ForeColor = System.Drawing.Color.DarkGray; + this.label7.Location = new System.Drawing.Point(31, 214); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(164, 17); + this.label7.TabIndex = 384; + this.label7.Text = "登录密码为空表示不更新密码"; + this.label7.Visible = false; + // + // cmbGroup + // + this.cmbGroup.FormattingEnabled = true; + this.cmbGroup.Items.AddRange(new object[] { + "客服", + "采购", + "上货", + "数据", + "登录"}); + this.cmbGroup.Location = new System.Drawing.Point(91, 257); + this.cmbGroup.Name = "cmbGroup"; + this.cmbGroup.Size = new System.Drawing.Size(172, 25); + this.cmbGroup.TabIndex = 383; + this.cmbGroup.Visible = false; + // + // txtBuyAccount + // + // + // + // + this.txtBuyAccount.Border.Class = "CrumbBarBackgroundKey"; + this.txtBuyAccount.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.txtBuyAccount.Border.PaddingBottom = 2; + this.txtBuyAccount.Border.PaddingLeft = 2; + this.txtBuyAccount.Border.PaddingRight = 2; + this.txtBuyAccount.Border.PaddingTop = 2; + this.txtBuyAccount.Location = new System.Drawing.Point(91, 240); + this.txtBuyAccount.Name = "txtBuyAccount"; + this.txtBuyAccount.Size = new System.Drawing.Size(172, 23); + this.txtBuyAccount.TabIndex = 382; + this.txtBuyAccount.Visible = false; + this.txtBuyAccount.WatermarkText = "点击添加店铺子账户"; + this.txtBuyAccount.Click += new System.EventHandler(this.txt_Click); + this.txtBuyAccount.TextChanged += new System.EventHandler(this.txtBuyAccount_TextChanged); + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(29, 243); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(56, 17); + this.label6.TabIndex = 381; + this.label6.Text = "采购账户"; + this.label6.Visible = false; + // + // txtChatAccount + // + // + // + // + this.txtChatAccount.Border.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtChatAccount.Border.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtChatAccount.Border.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtChatAccount.Border.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtChatAccount.Border.Class = "CrumbBarBackgroundKey"; + this.txtChatAccount.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.txtChatAccount.Border.PaddingBottom = 2; + this.txtChatAccount.Border.PaddingLeft = 2; + this.txtChatAccount.Border.PaddingRight = 2; + this.txtChatAccount.Border.PaddingTop = 2; + this.txtChatAccount.Location = new System.Drawing.Point(91, 99); + this.txtChatAccount.Name = "txtChatAccount"; + this.txtChatAccount.Size = new System.Drawing.Size(172, 23); + this.txtChatAccount.TabIndex = 380; + this.txtChatAccount.WatermarkText = "点击添加店铺子账户"; + this.txtChatAccount.Click += new System.EventHandler(this.txt_Click); + this.txtChatAccount.TextChanged += new System.EventHandler(this.txtChat_TextChanged); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(29, 102); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(56, 17); + this.label4.TabIndex = 379; + this.label4.Text = " 子账户"; + // + // txtUploadAccount + // + // + // + // + this.txtUploadAccount.Border.Class = "CrumbBarBackgroundKey"; + this.txtUploadAccount.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.txtUploadAccount.Border.PaddingBottom = 2; + this.txtUploadAccount.Border.PaddingLeft = 2; + this.txtUploadAccount.Border.PaddingRight = 2; + this.txtUploadAccount.Border.PaddingTop = 2; + this.txtUploadAccount.Location = new System.Drawing.Point(91, 99); + this.txtUploadAccount.Name = "txtUploadAccount"; + this.txtUploadAccount.Size = new System.Drawing.Size(172, 23); + this.txtUploadAccount.TabIndex = 374; + this.txtUploadAccount.Visible = false; + this.txtUploadAccount.Click += new System.EventHandler(this.txt_Click); + this.txtUploadAccount.TextChanged += new System.EventHandler(this.txtUploadAccount_TextChanged); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(29, 102); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(56, 17); + this.label3.TabIndex = 373; + this.label3.Text = "上货账户"; + this.label3.Visible = false; + // + // txtShopPassword + // + this.txtShopPassword.Location = new System.Drawing.Point(91, 64); + this.txtShopPassword.Name = "txtShopPassword"; + this.txtShopPassword.PasswordChar = '●'; + this.txtShopPassword.Size = new System.Drawing.Size(172, 23); + this.txtShopPassword.TabIndex = 338; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(29, 67); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(56, 17); + this.label2.TabIndex = 337; + this.label2.Text = "登录密码"; + // + // txtLoginName + // + this.txtLoginName.Location = new System.Drawing.Point(91, 29); + this.txtLoginName.Name = "txtLoginName"; + this.txtLoginName.Size = new System.Drawing.Size(172, 23); + this.txtLoginName.TabIndex = 336; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(29, 32); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(56, 17); + this.label1.TabIndex = 0; + this.label1.Text = "登录账号"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(29, 260); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(56, 17); + this.label5.TabIndex = 377; + this.label5.Text = "店铺分组"; + this.label5.Visible = false; + // + // btnOk + // + this.btnOk.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnOk.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnOk.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnOk.ForeColor = System.Drawing.Color.White; + this.btnOk.Location = new System.Drawing.Point(208, 209); + this.btnOk.Margin = new System.Windows.Forms.Padding(2); + this.btnOk.Name = "btnOk"; + this.btnOk.Size = new System.Drawing.Size(55, 26); + this.btnOk.TabIndex = 372; + this.btnOk.Text = "新增"; + this.btnOk.UseVisualStyleBackColor = false; + this.btnOk.Click += new System.EventHandler(this.btnOk_Click); + // + // txtNotes + // + // + // + // + this.txtNotes.Border.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtNotes.Border.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtNotes.Border.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtNotes.Border.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtNotes.Border.Class = "CrumbBarBackgroundKey"; + this.txtNotes.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.txtNotes.Border.PaddingBottom = 2; + this.txtNotes.Border.PaddingLeft = 2; + this.txtNotes.Border.PaddingRight = 2; + this.txtNotes.Border.PaddingTop = 2; + this.txtNotes.Location = new System.Drawing.Point(91, 133); + this.txtNotes.Name = "txtNotes"; + this.txtNotes.Size = new System.Drawing.Size(172, 23); + this.txtNotes.TabIndex = 385; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(29, 135); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(56, 17); + this.label8.TabIndex = 386; + this.label8.Text = " 备注"; + // + // ShopAddEditForm + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.ClientSize = new System.Drawing.Size(297, 319); + this.Controls.Add(this.panel2); + this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "ShopAddEditForm"; + this.Text = "添加店铺"; + this.TitleText = "添加店铺"; + this.Load += new System.EventHandler(this.ShopAddEditForm_Load); + this.Controls.SetChildIndex(this.panel2, 0); + this.panel2.ResumeLayout(false); + this.panel2.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox txtShopPassword; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txtLoginName; + private UserControls.ButtonEx btnOk; + private System.Windows.Forms.Label label5; + private DevComponents.DotNetBar.Controls.TextBoxX txtUploadAccount; + private System.Windows.Forms.Label label3; + private DevComponents.DotNetBar.Controls.TextBoxX txtBuyAccount; + private System.Windows.Forms.Label label6; + private DevComponents.DotNetBar.Controls.TextBoxX txtChatAccount; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.ComboBox cmbGroup; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private DevComponents.DotNetBar.Controls.TextBoxX txtNotes; + } +} \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopAddEditForm.cs b/TEMUKJD/PDDForms/ShopForms/PDDShopAddEditForm.cs new file mode 100644 index 0000000..5e25e32 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopAddEditForm.cs @@ -0,0 +1,134 @@ +using AllBase.Helper; +using AllBase.Model.Result; +using TemuKJD.KJDForms.BaseForms; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace TemuKJD.PDDForms.ShopForms +{ + public partial class PDDShopAddEditForm : LRBaseForm + { + ShopLoginInfo shopLoginInfo = null; + bool isAdd = true; + + public PDDShopAddEditForm(ShopLoginInfo shop = null) + { + InitializeComponent(); + shopLoginInfo = shop; + if (shopLoginInfo != null) + isAdd = false; + } + + private void btnOk_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(this.txtLoginName.Text.Trim())) + { + BaseMsgForm.ShowError("用户名不能为空!"); + return; + } + if (shopLoginInfo == null && string.IsNullOrEmpty(this.txtShopPassword.Text.Trim())) + { + BaseMsgForm.ShowError("密码不能为空!"); + return; + } + + if (shopLoginInfo == null) + shopLoginInfo = new ShopLoginInfo(); + + shopLoginInfo.LoginName = this.txtLoginName.Text.Trim(); + if (!string.IsNullOrEmpty(this.txtShopPassword.Text.Trim())) + shopLoginInfo.Password = DataOpenSSL.EncryptString(this.txtShopPassword.Text.Trim()); + shopLoginInfo.GroupName = this.cmbGroup.Text; + shopLoginInfo.Notes = this.txtNotes.Text; + shopLoginInfo.CompanyName = AllBase.BaseClass.CompanyName; + + // 同一个登录账号下的店铺使用同样的groupName和Notes + var shopLst = GlobalConfig.ShopLoginList.Where(s => s.LoginName == shopLoginInfo.LoginName && s.ShopId != shopLoginInfo.ShopId).ToList(); + foreach (var shop in shopLst) + { + shop.GroupName = shopLoginInfo.GroupName; + shop.Notes = shopLoginInfo.Notes; + } + + this.OnSaveComplete(shopLoginInfo, isAdd); + this.Close(); + } + + private void panel2_Paint(object sender, PaintEventArgs e) + { + + } + + private void ShopAddEditForm_Load(object sender, EventArgs e) + { + this.cmbGroup.Items.Clear(); + this.cmbGroup.Items.Add(string.Empty); + foreach (var shop in GlobalConfig.ShopLoginList) + { + if (!string.IsNullOrEmpty(shop.GroupName) && !this.cmbGroup.Items.Contains(shop.GroupName)) + this.cmbGroup.Items.Add(shop.GroupName); + } + if (shopLoginInfo != null) + { + this.txtLoginName.Text = shopLoginInfo.LoginName; + this.cmbGroup.Text = shopLoginInfo.GroupName; + this.txtNotes.Text = shopLoginInfo.Notes; + this.btnOk.Text = "更新"; + this.TitleText = "编辑店铺 - " + shopLoginInfo.ShopAccount; + this.txtBuyAccount.Text = shopLoginInfo.BuyAccount; + //this.txtChatAccount.Text = shopLoginInfo.ChatAccount; + this.txtChatAccount.Text = shopLoginInfo.SubUserName; + this.txtUploadAccount.Text = shopLoginInfo.UploadAccount; + this.label7.Visible = true; + this.txtLoginName.Enabled = false; + } + else + { + this.txtBuyAccount.Enabled = false; + this.txtChatAccount.Enabled = false; + this.txtUploadAccount.Enabled = false; + this.txtBuyAccount.Text = this.txtChatAccount.Text = this.txtUploadAccount.Text = "请在编辑账户时修改子账户"; + } + } + + private void txtUploadAccount_TextChanged(object sender, EventArgs e) + { + + } + + private void txtChat_TextChanged(object sender, EventArgs e) + { + + } + + private void txtBuyAccount_TextChanged(object sender, EventArgs e) + { + + } + + private void txt_Click(object sender, EventArgs e) + { + PDDSubAccountShopEditForm f = new PDDSubAccountShopEditForm(shopLoginInfo); + f.SaveComplete += F_SaveComplete; + f.ShowDialog(); + } + + private void F_SaveComplete(object obj) + { + var shop = obj as ShopLoginInfo; + if (shop != null) + { + this.txtBuyAccount.Text = shop.BuyAccount; + this.txtChatAccount.Text = shop.ChatAccount; + this.txtUploadAccount.Text = shop.UploadAccount; + } + } + } +} diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopAddEditForm.resx b/TEMUKJD/PDDForms/ShopForms/PDDShopAddEditForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopAddEditForm.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/PDDForms/ShopForms/PDDShopListForm.Designer.cs b/TEMUKJD/PDDForms/ShopForms/PDDShopListForm.Designer.cs new file mode 100644 index 0000000..c529034 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopListForm.Designer.cs @@ -0,0 +1,737 @@ +namespace TemuKJD.PDDForms.ShopForms +{ + partial class PDDShopListForm + { + /// + /// 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(); + this.label1 = new System.Windows.Forms.Label(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.panel5 = new System.Windows.Forms.Panel(); + this.btnRefreshShop = new TemuKJD.UserControls.ButtonEx(); + this.btnLoginSelect = new TemuKJD.UserControls.ButtonEx(); + this.btnCheck = new TemuKJD.UserControls.ButtonEx(); + this.panel4 = new System.Windows.Forms.Panel(); + this.cmbNotes = new System.Windows.Forms.ComboBox(); + this.pnlEmpty = new DevComponents.DotNetBar.PanelEx(); + this.btnSearch = new TemuKJD.UserControls.ButtonEx(); + this.label4 = new System.Windows.Forms.Label(); + this.txtShopName = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.txtShopId = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.btnImport = new TemuKJD.UserControls.ButtonEx(); + this.btnAddShop = new TemuKJD.UserControls.ButtonEx(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.btnRefreshAuth = new TemuKJD.UserControls.ButtonEx(); + this.pbLoading = new System.Windows.Forms.PictureBox(); + this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx(); + this.chkAutoDrag = new System.Windows.Forms.CheckBox(); + this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); + this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.colLoginName = 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.colCookie = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colSubUser = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colGroupName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colUploadAccount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colBuyAccount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colChatAccount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colLoginStatus = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colGotoShop = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colShopOperate = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colRelogin = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colReLogin2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colMultiLogin = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colApiAuth = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colBuyApiAuth = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colUpdateCookies = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colCopyCookies = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colEdit = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colDelete = new System.Windows.Forms.DataGridViewLinkColumn(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.panel5.SuspendLayout(); + this.panel4.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.dgvShop)).BeginInit(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(13, 13); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(201, 17); + this.label1.TabIndex = 0; + this.label1.Text = "这里显示店铺列表 -- ShopListForm"; + // + // 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.tableLayoutPanel2); + // + // 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(1264, 622); + this.splitContainer1.SplitterDistance = 46; + this.splitContainer1.TabIndex = 33; + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.ColumnCount = 2; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel2.Controls.Add(this.panel5, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.panel4, 0, 0); + this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 1; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(1264, 46); + this.tableLayoutPanel2.TabIndex = 37; + // + // panel5 + // + this.panel5.Controls.Add(this.btnRefreshShop); + this.panel5.Controls.Add(this.btnLoginSelect); + this.panel5.Controls.Add(this.btnCheck); + this.panel5.Location = new System.Drawing.Point(1032, 3); + this.panel5.Name = "panel5"; + this.panel5.Size = new System.Drawing.Size(229, 40); + this.panel5.TabIndex = 1; + // + // btnRefreshShop + // + this.btnRefreshShop.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnRefreshShop.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnRefreshShop.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnRefreshShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnRefreshShop.ForeColor = System.Drawing.Color.White; + this.btnRefreshShop.Location = new System.Drawing.Point(21, 9); + this.btnRefreshShop.Margin = new System.Windows.Forms.Padding(2); + this.btnRefreshShop.Name = "btnRefreshShop"; + this.btnRefreshShop.Size = new System.Drawing.Size(66, 26); + this.btnRefreshShop.TabIndex = 375; + this.btnRefreshShop.Text = "刷新店铺"; + this.btnRefreshShop.UseVisualStyleBackColor = false; + this.btnRefreshShop.Click += new System.EventHandler(this.btnRefreshCookie_Click); + // + // btnLoginSelect + // + this.btnLoginSelect.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnLoginSelect.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnLoginSelect.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnLoginSelect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnLoginSelect.ForeColor = System.Drawing.Color.White; + this.btnLoginSelect.Location = new System.Drawing.Point(162, 9); + this.btnLoginSelect.Margin = new System.Windows.Forms.Padding(2); + this.btnLoginSelect.Name = "btnLoginSelect"; + this.btnLoginSelect.Size = new System.Drawing.Size(66, 26); + this.btnLoginSelect.TabIndex = 373; + this.btnLoginSelect.Text = "登录选中"; + this.btnLoginSelect.UseVisualStyleBackColor = false; + this.btnLoginSelect.Click += new System.EventHandler(this.btnLoginSelect_Click); + // + // btnCheck + // + this.btnCheck.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnCheck.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnCheck.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnCheck.ForeColor = System.Drawing.Color.White; + this.btnCheck.Location = new System.Drawing.Point(92, 9); + this.btnCheck.Margin = new System.Windows.Forms.Padding(2); + this.btnCheck.Name = "btnCheck"; + this.btnCheck.Size = new System.Drawing.Size(66, 26); + this.btnCheck.TabIndex = 372; + this.btnCheck.Text = "检测选中"; + this.btnCheck.UseVisualStyleBackColor = false; + this.btnCheck.Click += new System.EventHandler(this.btnCheck_Click); + // + // panel4 + // + this.panel4.Controls.Add(this.cmbNotes); + this.panel4.Controls.Add(this.pnlEmpty); + this.panel4.Controls.Add(this.btnSearch); + this.panel4.Controls.Add(this.label4); + this.panel4.Controls.Add(this.txtShopName); + this.panel4.Controls.Add(this.label3); + this.panel4.Controls.Add(this.txtShopId); + this.panel4.Controls.Add(this.label2); + this.panel4.Controls.Add(this.btnImport); + this.panel4.Controls.Add(this.btnAddShop); + this.panel4.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel4.Location = new System.Drawing.Point(3, 3); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(1023, 40); + this.panel4.TabIndex = 0; + // + // cmbNotes + // + this.cmbNotes.FormattingEnabled = true; + this.cmbNotes.Location = new System.Drawing.Point(597, 10); + this.cmbNotes.Name = "cmbNotes"; + this.cmbNotes.Size = new System.Drawing.Size(120, 25); + this.cmbNotes.TabIndex = 413; + this.cmbNotes.Text = "全部"; + // + // 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(799, 9); + this.pnlEmpty.Name = "pnlEmpty"; + this.pnlEmpty.Size = new System.Drawing.Size(66, 26); + 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 = 409; + this.pnlEmpty.Text = "清空条件"; + this.pnlEmpty.Click += new System.EventHandler(this.btnEmpty_Click); + // + // btnSearch + // + this.btnSearch.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnSearch.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnSearch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSearch.ForeColor = System.Drawing.Color.White; + this.btnSearch.Location = new System.Drawing.Point(728, 9); + this.btnSearch.Margin = new System.Windows.Forms.Padding(2); + this.btnSearch.Name = "btnSearch"; + this.btnSearch.Size = new System.Drawing.Size(66, 26); + this.btnSearch.TabIndex = 372; + this.btnSearch.Text = "搜索"; + this.btnSearch.UseVisualStyleBackColor = false; + this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(538, 14); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(68, 17); + this.label4.TabIndex = 377; + this.label4.Text = "分组备注:"; + // + // txtShopName + // + this.txtShopName.Location = new System.Drawing.Point(415, 11); + this.txtShopName.Name = "txtShopName"; + this.txtShopName.Size = new System.Drawing.Size(110, 23); + this.txtShopName.TabIndex = 374; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(367, 14); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(56, 17); + this.label3.TabIndex = 375; + this.label3.Text = "店铺名:"; + // + // txtShopId + // + this.txtShopId.Location = new System.Drawing.Point(245, 11); + this.txtShopId.Name = "txtShopId"; + this.txtShopId.Size = new System.Drawing.Size(110, 23); + this.txtShopId.TabIndex = 372; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(197, 14); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(55, 17); + this.label2.TabIndex = 373; + this.label2.Text = "店铺id:"; + // + // btnImport + // + this.btnImport.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnImport.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnImport.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnImport.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnImport.ForeColor = System.Drawing.Color.White; + this.btnImport.Location = new System.Drawing.Point(71, 9); + this.btnImport.Margin = new System.Windows.Forms.Padding(2); + this.btnImport.Name = "btnImport"; + this.btnImport.Size = new System.Drawing.Size(66, 26); + this.btnImport.TabIndex = 371; + this.btnImport.Text = "导入店铺"; + this.btnImport.UseVisualStyleBackColor = false; + this.btnImport.Click += new System.EventHandler(this.btnImport_Click); + // + // btnAddShop + // + this.btnAddShop.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnAddShop.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnAddShop.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnAddShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnAddShop.ForeColor = System.Drawing.Color.White; + this.btnAddShop.Location = new System.Drawing.Point(1, 9); + this.btnAddShop.Margin = new System.Windows.Forms.Padding(2); + this.btnAddShop.Name = "btnAddShop"; + this.btnAddShop.Size = new System.Drawing.Size(66, 26); + this.btnAddShop.TabIndex = 370; + this.btnAddShop.Text = "添加店铺"; + this.btnAddShop.UseVisualStyleBackColor = false; + this.btnAddShop.Click += new System.EventHandler(this.btnAddShop_Click); + // + // splitContainer2 + // + this.splitContainer2.BackColor = System.Drawing.Color.White; + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + 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.btnRefreshAuth); + this.splitContainer2.Panel1.Controls.Add(this.pbLoading); + this.splitContainer2.Panel1.Controls.Add(this.dgvShop); + this.splitContainer2.Panel1.Padding = new System.Windows.Forms.Padding(4, 0, 4, 0); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.chkAutoDrag); + this.splitContainer2.Panel2.Controls.Add(this.statusBar); + this.splitContainer2.Size = new System.Drawing.Size(1264, 572); + this.splitContainer2.SplitterDistance = 540; + this.splitContainer2.TabIndex = 0; + // + // btnRefreshAuth + // + this.btnRefreshAuth.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnRefreshAuth.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnRefreshAuth.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnRefreshAuth.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnRefreshAuth.ForeColor = System.Drawing.Color.White; + this.btnRefreshAuth.Location = new System.Drawing.Point(11, 35); + this.btnRefreshAuth.Margin = new System.Windows.Forms.Padding(2); + this.btnRefreshAuth.Name = "btnRefreshAuth"; + this.btnRefreshAuth.Size = new System.Drawing.Size(66, 26); + this.btnRefreshAuth.TabIndex = 374; + this.btnRefreshAuth.Text = "刷新授权"; + this.btnRefreshAuth.UseVisualStyleBackColor = false; + this.btnRefreshAuth.Visible = false; + this.btnRefreshAuth.Click += new System.EventHandler(this.btnRefreshAuth_Click); + // + // 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(607, 245); + 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; + // + // dgvShop + // + this.dgvShop.AllowUserToAddRows = false; + this.dgvShop.AllowUserToDeleteRows = false; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke; + this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + this.dgvShop.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dgvShop.BackgroundColor = System.Drawing.Color.White; + this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.colSelect, + this.colLoginName, + this.colShopId, + this.colShopAccount, + this.conNotes, + this.colCookie, + this.colSubUser, + this.colGroupName, + this.colUploadAccount, + this.colBuyAccount, + this.colChatAccount, + this.colLoginStatus, + this.colGotoShop, + this.colShopOperate, + this.colRelogin, + this.colReLogin2, + this.colMultiLogin, + this.colApiAuth, + this.colBuyApiAuth, + this.colUpdateCookies, + this.colCopyCookies, + this.colEdit, + this.colDelete}); + this.dgvShop.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgvShop.Location = new System.Drawing.Point(4, 0); + this.dgvShop.Name = "dgvShop"; + this.dgvShop.ReadOnly = true; + this.dgvShop.RowTemplate.Height = 23; + this.dgvShop.Size = new System.Drawing.Size(1256, 540); + this.dgvShop.TabIndex = 5; + this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick); + // + // chkAutoDrag + // + this.chkAutoDrag.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.chkAutoDrag.AutoSize = true; + this.chkAutoDrag.BackColor = System.Drawing.Color.White; + this.chkAutoDrag.Location = new System.Drawing.Point(1108, 2); + this.chkAutoDrag.Name = "chkAutoDrag"; + this.chkAutoDrag.Size = new System.Drawing.Size(159, 21); + this.chkAutoDrag.TabIndex = 3; + this.chkAutoDrag.Text = "登录时自动滑动拼图验证"; + this.chkAutoDrag.UseVisualStyleBackColor = false; + this.chkAutoDrag.Visible = false; + this.chkAutoDrag.Click += new System.EventHandler(this.chkAutoDrag_Click); + // + // statusBar + // + this.statusBar.BackColor = System.Drawing.Color.White; + this.statusBar.Dock = System.Windows.Forms.DockStyle.Bottom; + this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.statusBar.Location = new System.Drawing.Point(0, -1); + this.statusBar.Margin = new System.Windows.Forms.Padding(0); + this.statusBar.Name = "statusBar"; + this.statusBar.Size = new System.Drawing.Size(1264, 29); + this.statusBar.TabIndex = 1; + // + // 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; + // + // colLoginName + // + this.colLoginName.FillWeight = 69.42599F; + this.colLoginName.HeaderText = "店铺登录号码"; + this.colLoginName.Name = "colLoginName"; + this.colLoginName.ReadOnly = true; + // + // colShopId + // + this.colShopId.FillWeight = 69.42599F; + 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; + // + // colCookie + // + this.colCookie.HeaderText = "店铺Cookie"; + this.colCookie.Name = "colCookie"; + this.colCookie.ReadOnly = true; + this.colCookie.Visible = false; + // + // colSubUser + // + this.colSubUser.FillWeight = 67F; + this.colSubUser.HeaderText = "子账户"; + this.colSubUser.Name = "colSubUser"; + this.colSubUser.ReadOnly = true; + // + // colGroupName + // + this.colGroupName.FillWeight = 69.42599F; + this.colGroupName.HeaderText = "店铺分组"; + this.colGroupName.Name = "colGroupName"; + this.colGroupName.ReadOnly = true; + this.colGroupName.Visible = false; + // + // colUploadAccount + // + this.colUploadAccount.FillWeight = 69.42599F; + this.colUploadAccount.HeaderText = "上货账户"; + this.colUploadAccount.Name = "colUploadAccount"; + this.colUploadAccount.ReadOnly = true; + this.colUploadAccount.Visible = false; + // + // colBuyAccount + // + this.colBuyAccount.FillWeight = 69.42599F; + this.colBuyAccount.HeaderText = "采购账户"; + this.colBuyAccount.Name = "colBuyAccount"; + this.colBuyAccount.ReadOnly = true; + this.colBuyAccount.Visible = false; + // + // colChatAccount + // + this.colChatAccount.FillWeight = 69.42599F; + this.colChatAccount.HeaderText = "客服账户"; + this.colChatAccount.Name = "colChatAccount"; + this.colChatAccount.ReadOnly = true; + this.colChatAccount.Visible = false; + // + // colLoginStatus + // + this.colLoginStatus.HeaderText = "登录状态"; + this.colLoginStatus.Name = "colLoginStatus"; + this.colLoginStatus.ReadOnly = true; + this.colLoginStatus.Visible = false; + // + // colGotoShop + // + this.colGotoShop.FillWeight = 46F; + this.colGotoShop.HeaderText = "进入店铺"; + this.colGotoShop.Name = "colGotoShop"; + this.colGotoShop.ReadOnly = true; + this.colGotoShop.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colGotoShop.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + // + // colShopOperate + // + this.colShopOperate.FillWeight = 46F; + this.colShopOperate.HeaderText = "检测"; + this.colShopOperate.Name = "colShopOperate"; + this.colShopOperate.ReadOnly = true; + this.colShopOperate.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colShopOperate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colShopOperate.Visible = false; + // + // colRelogin + // + this.colRelogin.FillWeight = 40F; + this.colRelogin.HeaderText = "登录"; + this.colRelogin.Name = "colRelogin"; + this.colRelogin.ReadOnly = true; + this.colRelogin.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colRelogin.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + // + // colReLogin2 + // + this.colReLogin2.FillWeight = 55F; + this.colReLogin2.HeaderText = "国际版状态"; + this.colReLogin2.Name = "colReLogin2"; + this.colReLogin2.ReadOnly = true; + this.colReLogin2.Visible = false; + // + // colMultiLogin + // + this.colMultiLogin.FillWeight = 52F; + this.colMultiLogin.HeaderText = "多重登录"; + this.colMultiLogin.Name = "colMultiLogin"; + this.colMultiLogin.ReadOnly = true; + this.colMultiLogin.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colMultiLogin.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colMultiLogin.Visible = false; + // + // colApiAuth + // + this.colApiAuth.FillWeight = 69.42599F; + this.colApiAuth.HeaderText = "上货授权"; + this.colApiAuth.Name = "colApiAuth"; + this.colApiAuth.ReadOnly = true; + this.colApiAuth.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colApiAuth.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colApiAuth.Visible = false; + // + // colBuyApiAuth + // + this.colBuyApiAuth.FillWeight = 69.42599F; + this.colBuyApiAuth.HeaderText = "拍单授权"; + this.colBuyApiAuth.Name = "colBuyApiAuth"; + this.colBuyApiAuth.ReadOnly = true; + this.colBuyApiAuth.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colBuyApiAuth.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colBuyApiAuth.Visible = false; + // + // colUpdateCookies + // + this.colUpdateCookies.FillWeight = 67F; + this.colUpdateCookies.HeaderText = "导入Cookie"; + this.colUpdateCookies.Name = "colUpdateCookies"; + this.colUpdateCookies.ReadOnly = true; + this.colUpdateCookies.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colUpdateCookies.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + // + // colCopyCookies + // + this.colCopyCookies.FillWeight = 70F; + this.colCopyCookies.HeaderText = "复制Cookie"; + this.colCopyCookies.Name = "colCopyCookies"; + this.colCopyCookies.ReadOnly = true; + this.colCopyCookies.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colCopyCookies.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + // + // 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; + // + // PDDShopListForm + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(1264, 622); + this.Controls.Add(this.splitContainer1); + this.Controls.Add(this.label1); + this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Name = "PDDShopListForm"; + this.Text = "ShopListForm"; + this.Load += new System.EventHandler(this.ShopListForm_Load); + this.VisibleChanged += new System.EventHandler(this.ShopListForm_VisibleChanged); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.tableLayoutPanel2.ResumeLayout(false); + this.panel5.ResumeLayout(false); + this.panel4.ResumeLayout(false); + this.panel4.PerformLayout(); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel2.ResumeLayout(false); + this.splitContainer2.Panel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); + this.splitContainer2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgvShop)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.Panel panel5; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.SplitContainer splitContainer2; + private UserControls.ButtonEx btnAddShop; + private UserControls.ButtonEx btnLoginSelect; + private UserControls.ButtonEx btnCheck; + private UserControls.ButtonEx btnImport; + private UserControls.StatusBarUserControl statusBar; + private UserComponent.DataGridViewEx dgvShop; + private System.Windows.Forms.CheckBox chkAutoDrag; + private UserControls.ButtonEx btnRefreshAuth; + private System.Windows.Forms.PictureBox pbLoading; + 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 UserControls.ButtonEx btnSearch; + private System.Windows.Forms.Label label4; + private DevComponents.DotNetBar.PanelEx pnlEmpty; + private UserControls.ButtonEx btnRefreshShop; + private System.Windows.Forms.ComboBox cmbNotes; + private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect; + private System.Windows.Forms.DataGridViewTextBoxColumn colLoginName; + private System.Windows.Forms.DataGridViewTextBoxColumn colShopId; + private System.Windows.Forms.DataGridViewTextBoxColumn colShopAccount; + private System.Windows.Forms.DataGridViewTextBoxColumn conNotes; + private System.Windows.Forms.DataGridViewTextBoxColumn colCookie; + private System.Windows.Forms.DataGridViewTextBoxColumn colSubUser; + private System.Windows.Forms.DataGridViewTextBoxColumn colGroupName; + private System.Windows.Forms.DataGridViewTextBoxColumn colUploadAccount; + private System.Windows.Forms.DataGridViewTextBoxColumn colBuyAccount; + private System.Windows.Forms.DataGridViewTextBoxColumn colChatAccount; + private System.Windows.Forms.DataGridViewTextBoxColumn colLoginStatus; + private System.Windows.Forms.DataGridViewLinkColumn colGotoShop; + private System.Windows.Forms.DataGridViewLinkColumn colShopOperate; + private System.Windows.Forms.DataGridViewLinkColumn colRelogin; + private System.Windows.Forms.DataGridViewTextBoxColumn colReLogin2; + private System.Windows.Forms.DataGridViewLinkColumn colMultiLogin; + private System.Windows.Forms.DataGridViewLinkColumn colApiAuth; + private System.Windows.Forms.DataGridViewLinkColumn colBuyApiAuth; + private System.Windows.Forms.DataGridViewLinkColumn colUpdateCookies; + private System.Windows.Forms.DataGridViewLinkColumn colCopyCookies; + private System.Windows.Forms.DataGridViewLinkColumn colEdit; + private System.Windows.Forms.DataGridViewLinkColumn colDelete; + } +} \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopListForm.cs b/TEMUKJD/PDDForms/ShopForms/PDDShopListForm.cs new file mode 100644 index 0000000..a17b5a7 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopListForm.cs @@ -0,0 +1,1163 @@ +using AllBase; +using AllBase.Helper; +using AllBase.Model.Result; +using TemuKJD.Extension; +using TemuKJD.KJDForms.BaseForms; +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.IO; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using Work; +using NaiBa.Util; +using System.Globalization; +using TemuKJD.BLL; +//using TemuKJD.PDDForms.AdminForms; + +namespace TemuKJD.PDDForms.ShopForms +{ + public partial class PDDShopListForm : BaseForm + { + public static List LstShopListFormInatance = new List(); + public static PDDShopListForm Instance { get; set; } = null; + public static bool IsOperate { get; set; } = false; + private bool isLoading { get; set; } = false; + + #region 服务端店铺管理 + public static string AddServerDouShop(ShopLoginInfo _shop) + { + var url = BaseClass.BuildObjString("shop/add_shop"); + var data = UserLogin.GetSignaturex() + + "&login_name=" + _shop.LoginName + + "&login_pass=" + GetHtml.UrlEncodeUtf8(_shop.Password) + + "&shop_id=" + _shop.ShopId + + "&shop_account=" + _shop.ShopAccount + + "&cookie=" + _shop.Cookies + + "&cookie2=" + _shop.Cookies2 + + "&shop_group=" + GetHtml.UrlEncodeUtf8(_shop.GroupName) + + "&sub_user_name=" + GetHtml.UrlEncodeUtf8(_shop.SubUserName) + + "¬es=" + GetHtml.UrlEncodeUtf8(_shop.Notes) + + "&login_status=" + _shop.LoginStatus; + + var result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在")) + result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在")) + result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200")) + { + var msg = BaseRegex.GetStringJson(ref result, "msg"); + if (string.IsNullOrEmpty(msg)) + msg = "店铺保存失败!"; + BaseMsgForm.ShowError(msg); + } + return result; + } + + public static string MdyServerDouShop(ShopLoginInfo _shop) + { + var url = BaseClass.BuildObjString("shop/mdy_shop"); + var data = UserLogin.GetSignaturex() + + "&login_name=" + _shop.LoginName + + "&login_pass=" + GetHtml.UrlEncodeUtf8(_shop.Password) + + "&shop_group=" + GetHtml.UrlEncodeUtf8(_shop.GroupName) + + "&sub_user_name=" + _shop.SubUserName + + "¬es=" + GetHtml.UrlEncodeUtf8(_shop.Notes); + + var result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在")) + result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在")) + result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200")) + { + var msg = BaseRegex.GetStringJson(ref result, "msg"); + if (string.IsNullOrEmpty(msg)) + msg = "店铺保存失败!"; + BaseMsgForm.ShowError(msg); + } + return result; + } + + public static void UpdateShop() + { + // 获取本地店铺和服务端店铺。将服务端相关信息与本地店铺合并后暂时存在内存中(不保存敏感信息)。 + GlobalConfig.ShopLoginList = new ConcurrentList(); + // 获取服务端店铺 + var serverShopList = PDDShopListForm.GetServerShop(); + var localShopList = new ConcurrentList(); + localShopList.AddRange(serverShopList); + foreach (var localShop in localShopList) + { + if (GlobalConfig.ShopLoginList.Any(s => s.LoginName == localShop.LoginName && s.ShopId == localShop.ShopId)) + continue; + + var serverShop = serverShopList.FirstOrDefault(s => s.LoginName == localShop.LoginName && s.ShopId == localShop.ShopId); + if (serverShop != null) + { + localShop.ShopAccount = serverShop.ShopAccount; + localShop.LoginName = serverShop.LoginName; + localShop.Password = serverShop.Password; + localShop.Cookies = serverShop.Cookies; + localShop.DbId = serverShop.DbId; + localShop.UserName = serverShop.UserName; + localShop.SubUserName = serverShop.SubUserName; + localShop.ApiAuthInfoList = new List(); + localShop.ApiAuthInfoList.AddRange(serverShop.ApiAuthInfoList); + localShop.BuyApiAuth.AccessToken = serverShop.BuyApiAuth.AccessToken; + localShop.BuyApiAuth.AddTime = serverShop.BuyApiAuth.AddTime; + localShop.BuyApiAuth.AppKey = serverShop.BuyApiAuth.AppKey; + localShop.BuyApiAuth.ExpiresTime = serverShop.BuyApiAuth.ExpiresTime; + localShop.BuyApiAuth.RefreshToken = serverShop.BuyApiAuth.RefreshToken; + localShop.PayStatus = serverShop.PayStatus; + localShop.GroupName = serverShop.GroupName; + localShop.Notes = serverShop.Notes; + localShop.LoginStatus = serverShop.LoginStatus; + localShop.LoginStatus2 = serverShop.LoginStatus2; + localShop.AddProductRemaining = serverShop.AddProductRemaining; + localShop.OperateSubSaName = serverShop.OperateSubSaName; + if (localShop.TrialUploadCount < 0) + localShop.TrialUploadCount = 0; + GlobalConfig.ShopLoginList.Add(localShop); + } + } + GlobalConfig.DouShopLoginOtherUserShopList = new ConcurrentList(); + GlobalConfig.DouShopLoginOtherUserShopList.AddRange(localShopList.Where(l => !GlobalConfig.ShopLoginList.Any(s => s.LoginName == l.LoginName))); + } + + public static List GetServerShop() + { + List list = new List(); + + int page = 0; + while (true) + { + page++; + + var url = BaseClass.BuildObjString("shop/get_shop_list"); + var data = UserLogin.GetSignaturex() + "&page=" + page; + var html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) + || !html.Contains("shop_id") || !html.Contains("shop_account") || !html.Contains("login_pass")) + { + //return list; + break; + } + + var jArr = JObject.Parse(html)["data"]; + if (jArr.Count() == 0) + break; + + list.AddRange(ShopBLL.DeserializationShop(html)); + } + return list; + } + + public static void UpdateShopTokens(List shops) + { + string shopIds = ""; + foreach (var shop in shops) + { + shopIds += shop.ShopId + ","; + } + + var shopTokens = GetServerShopTokens(shopIds); //{"code":200,"msg":"success","data":[{"shop_id":"9050819","app_key":"6876612657718691336","access_token":"fd818b94-b4e7-4707-8073-bebcd81d8e4c","refresh_token":"9a109ef3-2bef-4ca9-8f4e-18369a356255","add_time":"2021-07-09 10:54:56","expires_in":"2021-07-14 18:40:44"}]} + for (int i = 0; i < 10 && (string.IsNullOrEmpty(shopTokens) || !shopTokens.Contains("\"code\":200")); i++) + { + shopTokens = GetServerShopTokens(shopIds); + if (i > 0) + Thread.Sleep(100); + } + if (!string.IsNullOrEmpty(shopTokens) && shopTokens.Contains("\"code\":200")) + { + JObject jShopsObj = JObject.Parse(shopTokens); + foreach (JObject jShop in jShopsObj["data"]) + { + string shopStr = JsonHelper.SerializeObject(jShop); + string shop_id = BaseRegex.GetStringJson(ref shopStr, "shop_id"); + var shop = shops.FirstOrDefault(s => s.ShopId == shop_id); + if (shop != null) + { + var appkey = BaseRegex.GetStringJson(ref shopStr, "app_key"); + // 科尔搬家 + if (appkey == "7023294452517127719") + { + shop.ApiAuthInfoList.RemoveAll(a => a.AppKey == appkey); + shop.ApiAuthInfoList.Add(new AuthInfo + { + AppKey = appkey, + AccessToken = BaseRegex.GetStringJson(ref shopStr, "access_token"), + RefreshToken = BaseRegex.GetStringJson(ref shopStr, "refresh_token"), + AddTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(), + ExpiresTime = BaseRegex.GetStringJson(ref shopStr, "expires_in").ParseToDateTime(), + }); + } + // 小奶兔工具 + else if (appkey == "6876612657718691336") // || shop.ShopName == "权益服务齐全的专营店") // 上货appkey,小奶猫工具 + { + shop.ApiAuthInfoList.RemoveAll(a => a.AppKey == appkey); + shop.ApiAuthInfoList.Add(new AuthInfo + { + AppKey = appkey, + AccessToken = BaseRegex.GetStringJson(ref shopStr, "access_token"), + RefreshToken = BaseRegex.GetStringJson(ref shopStr, "refresh_token"), + AddTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(), + ExpiresTime = BaseRegex.GetStringJson(ref shopStr, "expires_in").ParseToDateTime(), + }); + } + else if (appkey == "7016502755254683171") // 拍单appkey,小奶兔打单 + { + shop.BuyApiAuth.AppKey = appkey; + shop.BuyApiAuth.AccessToken = BaseRegex.GetStringJson(ref shopStr, "access_token"); + shop.BuyApiAuth.RefreshToken = BaseRegex.GetStringJson(ref shopStr, "refresh_token"); + shop.BuyApiAuth.AddTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(); + shop.BuyApiAuth.ExpiresTime = BaseRegex.GetStringJson(ref shopStr, "expires_in").ParseToDateTime(); + } + } + } + } + } + + public static void DelServerDouShop(string shopId) + { + var url = BaseClass.BuildObjString("shop/del_shop"); + var data = UserLogin.GetSignaturex() + "&login_name=" + shopId; + var result = GetHtml.PostUtf8(url, data); + } + #endregion + + #region 服务端店铺Cookie管理 + /// + /// 添加京东店铺Cookies + /// + /// 店铺名称 + /// cookies + /// 工具名称(可不填写) + public static void UpdateServerShopCookies(ShopLoginInfo shop, string fromTool = null) + { + var fTool = string.IsNullOrEmpty(fromTool) ? "" : "&from_tool=" + fromTool; + var url = BaseClass.BuildObjString("shop/mdy_shop_cookie_and_login_status"); + var data = UserLogin.GetSignaturex() + + "&login_name=" + shop.LoginName + + "&login_status=" + shop.LoginStatus + + "&login_status2=" + shop.LoginStatus2 + + "&cookie=" + shop.Cookies.Replace("&", "&").Replace("%", "%").Replace("+", "+") + + "&cookie2=" + shop.Cookies2.Replace("&", "&").Replace("%", "%").Replace("+", "+") + + fTool; + var result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200")) + result = GetHtml.PostUtf8(url, data); + if (!result.Contains("\"code\":200")) + { + BaseMsgForm.ShowError("服务端登录状态保存失败!请检查网络连接。"); + } + } + ///// + ///// 获取店铺Cookies + ///// + ///// 店铺名称,逗号隔开 + //public static string GetServerShopCookies(string shopNames) + //{ + // var url = BaseClass.BuildObjString("shop&act=get_shop_cookie"); + // var data = UserLogin.GetSignaturex() + "&shop_name=" + shopNames.Trim(','); + // var result = GetHtml.PostUtf8(url, data); + // return result; + //} + #endregion + + public static string GetServerShopTokens(string shopLoginNames) + { + var url = BaseClass.BuildObjString("shop&act=get_shop_token"); + var data = UserLogin.GetSignaturex() + "&login_name=" + shopLoginNames.Trim(','); + var result = GetHtml.PostUtf8(url, data); + return result; + } + + public PDDShopListForm() + { + InitializeComponent(); + + Instance = this; + + LstShopListFormInatance.Add(this); + } + + private void btnAddShop_Click(object sender, EventArgs e) + { + PDDShopAddEditForm sae = new PDDShopAddEditForm(); + sae.SaveCompleteWithDescribe += Sae_SaveComplete; + sae.Show(); + } + + private void Sae_SaveComplete(object obj, object isAdd) + { + var shopInfo = obj as ShopLoginInfo; + if (shopInfo != null) + { + if ((isAdd as bool?) == true) + { + var shop = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.LoginName == shopInfo.LoginName); + if (shop != null) + { + BaseMsgForm.ShowError("店铺" + shopInfo.LoginName + "已存在!"); + } + else + { + PDDShopListForm.AddServerDouShop(shopInfo); + btnRefreshCookie_Click(null, null); + } + } + else + { + PDDShopListForm.MdyServerDouShop(shopInfo); + btnRefreshCookie_Click(null, null); + } + } + } + + private void shopLoginForm_SaveComplete(object obj) + { + Task.Run(() => + { + //CheckShopListLogin(new string[] { (obj as DouShopLoginInfo).LoginName }); + }); + } + + private void UpdateCookieForm_SaveComplete(object obj) + { + Task.Run(() => + { + //CheckShopListLogin(new string[] { (obj as DouShopLoginInfo).LoginName }); + StartUp.SaveLocalShopLoginInfo(); + btnRefreshCookie_Click(null, null); + }); + } + + private void btnImport_Click(object sender, EventArgs e) + { + IsOperate = true; + ImportShop(); + btnRefreshCookie_Click(null, null); + } + + void ImportShop() + { + this.btnImport.Enabled = false; + string text = "店铺导入格式:\r\n\r\n1.店铺账号(手机/用户名/邮箱)-----店铺密码\r\n2.店铺账号-----密码-----备注\r\n\r\n多个店铺请每个店铺新起一行。"; + BaseMsgForm.ShowInfo(text, "", FormLevel.LARGE); + + OpenFileDialog openFileDialog = new OpenFileDialog(); + openFileDialog.Filter = "文本文件(*.txt)|*.txt"; + openFileDialog.RestoreDirectory = true; + openFileDialog.FilterIndex = 1; + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + using (StreamReader sr = new StreamReader(openFileDialog.FileName, System.Text.Encoding.UTF8)) + { + string fileName = openFileDialog.FileName; + string importStr = sr.ReadToEnd().Trim(); + var strArr = importStr.Replace("\r", "").Split('\n'); + for (int i = 0; i < strArr.Length; i++) + { + if (IsOperate == false) + break; + try + { + // 通用格式 + if (strArr[i].Contains("-----")) + { + var productArr = strArr[i].Split(new string[] { "-----" }, StringSplitOptions.RemoveEmptyEntries); + if (productArr.Length > 1) + { + ShopLoginInfo shop = new ShopLoginInfo + { + LoginName = productArr[0], + Password = DataOpenSSL.EncryptString(productArr[1]), + }; + if (productArr.Length > 2) + { + shop.Notes = productArr[2]; + } + + //ShopLoginForm shopLoginForm = new ShopLoginForm(shop); + //shopLoginForm.SaveComplete += shopLoginForm_SaveComplete; + //shopLoginForm.ShowDialog(); + + //StartUp.SaveDouShopLoginInfo(); + var shopInfo = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.LoginName == shop.LoginName); + if (shopInfo != null) + { + shopInfo.Password = shop.Password; + shopInfo.GroupName = shop.GroupName; + } + else + GlobalConfig.ShopLoginList.Add(shop); + StartUp.SaveLocalShopLoginInfo(); + PDDShopListForm.AddServerDouShop(shop); + } + } + } + catch (Exception ex) + { + } + } + } + } + IsOperate = false; + this.btnImport.Enabled = true; + } + + private void RefreshDataGridView(bool updateStatus=true) + { + if (isLoading) + { + //BaseMsgForm.ShowError("当前正在加载,请稍等"); + return; + } + + Invoke(new Action(() => + { + cmbNotes.Items.Clear(); + var notes = GlobalConfig.ShopLoginList.Select(s => s.Notes).Distinct(); + cmbNotes.Items.Add("全部"); + cmbNotes.Items.AddRange(notes.ToArray()); + })); + + Task.Run(() => + { + isLoading = true; + while (StartUp.IsShopInit == false) + { + Thread.Sleep(1000); + } + + var shopList = GlobalConfig.ShopLoginList.Where(s => !string.IsNullOrEmpty(s.ShopId) + || GlobalConfig.ShopLoginList.Where(ss=>ss.LoginName == s.LoginName).Count() == 1) + .OrderBy(s=>s.LoginName).ToList(); + + Invoke(new Action(() => + { + if (!string.IsNullOrWhiteSpace(cmbNotes.Text) && cmbNotes.Text.Trim() != "全部") + { + shopList = shopList.Where(s => s.Notes.ParseToString().ToLower().Contains(cmbNotes.Text.ToLower())).ToList(); + } + if (!string.IsNullOrEmpty(txtShopId.Text)) + { + shopList = shopList.Where(s => s.ShopId.ParseToString().ToLower().Contains(txtShopId.Text.ToLower())).ToList(); + } + if (!string.IsNullOrEmpty(txtShopName.Text)) + { + shopList = shopList.Where(s => s.ShopAccount.ParseToString().ToLower().Contains(txtShopName.Text.ToLower())).ToList(); + } + })); + + List shopIdList = GetCheckedShopIdList(); + this.Invoke(new Action(() => + { + this.dgvShop.Rows.Clear(); + if (updateStatus) + this.statusBar.pgbTaskProgress.Maximum = shopList.Count; // 显示总数 + })); + + for (int i = 0; i < shopList.Count; i++) + { + if (this.Created && updateStatus && (i % 5 == 0 || i == shopList.Count - 1)) + { + this.Invoke(new Action(() => + { + this.statusBar.lblTaskStatus.Text = "正在加载..."; + this.statusBar.pgbTaskProgress.Value = (i + 1); + this.statusBar.pgbTaskProgress.Text = (i + 1) + "/" + shopList.Count; + })); + } + AddDataGridViewRow(shopList[i], true, shopIdList.Contains(shopList[i].ShopId)); + } + if (this.Created) + { + this.Invoke(new Action(() => + { + if (updateStatus) + this.statusBar.lblTaskStatus.Text = "加载完毕"; + this.pbLoading.Visible = false; + })); + } + isLoading = false; + }); + } + + private void AddDataGridViewRow(ShopLoginInfo param, bool isRefresh = false, bool isRowCheck = false) + { + if (!this.Created) + return; + this.Invoke(new Action(() => + { + DataGridViewRow dgvr = dgvShop.Rows.Cast().Where(p => + p.Cells.GetCellValueFromColumnName("colLoginName").ParseToString() == param.LoginName && + p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == param.ShopId).FirstOrDefault(); + if (dgvr != null) + { + UpdateDataGridViewRowToken(dgvr, param); + if (!isRefresh) + { + // help to scroll to checked + dgvShop.CurrentCell = dgvr.Cells[2]; + } + } + else + { + int rowIndex = this.dgvShop.Rows.Add( + isRowCheck, + param.LoginName, + param.ShopId, + param.ShopAccount, + param.Notes, + param.Cookies, + param.SubUserName, + param.GroupName, + param.UploadAccount, + param.BuyAccount, + param.ChatAccount, + "", + "进入", + "检测", + string.IsNullOrWhiteSpace(param.LoginStatus) ? "未登录" : param.LoginStatus.Trim(), + string.IsNullOrWhiteSpace(param.LoginStatus2) ? "国际版未登录" : param.LoginStatus2.Trim(), + "多重登录", + param.ApiAuthStatus, + param.BuyApiAuth.ApiAuthStatus, + "导入Cookie", + "复制Cookie", + "编辑", + "删除"); + if (!isRefresh) + { + // help to scroll to latest checked + dgvShop.CurrentCell = this.dgvShop.Rows[rowIndex].Cells[2]; + } + } + })); + } + + private void UpdateDataGridViewRowToken(DataGridViewRow dgvr, ShopLoginInfo param) + { + if (dgvr == null || param == null) + return; + dgvr.Cells["colCookie"].Value = param.Cookies; + dgvr.Cells["colApiAuth"].Value = param.ApiAuthStatus; + dgvr.Cells["colBuyApiAuth"].Value = param.BuyApiAuth.ApiAuthStatus; + dgvr.Cells["colLoginName"].Value = param.LoginName; + dgvr.Cells["colShopAccount"].Value = param.ShopAccount; + dgvr.Cells["colNotes"].Value = param.Notes; + dgvr.Cells["colCookie"].Value = param.Cookies; + dgvr.Cells["colGroupName"].Value = param.GroupName; + dgvr.Cells["colUploadAccount"].Value = param.UploadAccount; + dgvr.Cells["colBuyAccount"].Value = param.BuyAccount; + dgvr.Cells["colChatAccount"].Value = param.ChatAccount; + dgvr.Cells["colRelogin"].Value = string.IsNullOrWhiteSpace(param.LoginStatus) ? "未登录" : param.LoginStatus.Trim(); + } + + /// + /// 检测店铺授权状态 + /// + /// + /// + public void CheckShopListLogin(string[] shopNames, bool isShowProgress = true) + { + if (isShowProgress) + { + Invoke(new Action(() => + { + this.pbLoading.Visible = true; + this.statusBar.lblTaskStatus.Text = "正在检测..."; + this.statusBar.pgbTaskProgress.Value = 0; + this.statusBar.pgbTaskProgress.Maximum = shopNames.Length; + this.statusBar.pgbTaskProgress.Text = "0" + "/" + shopNames.Length; + })); + } + + CheckShopLogin(shopNames, isShowProgress); + + if (this.Created && isShowProgress) + { + this.Invoke(new Action(() => + { + this.pbLoading.Visible = true; + this.statusBar.lblTaskStatus.Text = "检测完毕"; + })); + } + } + + public void CheckShopLogin(string[] shopNames, bool isShowProgress = true) + { + + for (int i = 0; i < shopNames.Length; i++) + { + var campanys = GlobalConfig.ShopLoginList.Where(v => v.LoginName == shopNames[i]).ToList(); + var shop = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.LoginName == shopNames[i]); + + // 先从服务端取最新cookie + var serverCampanys = ShopBLL.AdminGetServerShopLstByIds(campanys.Select(c => c.ShopId).ToList()); + var sss = string.Join(",", serverCampanys.Select(s => s.UserName + s.ShopAccount)); + var serverShop = serverCampanys.FirstOrDefault(); + if (shop != null && serverShop != null) + { + shop.Cookies = serverShop.Cookies; + shop.Cookies2 = serverShop.Cookies2; + foreach (var sc in campanys) + { + sc.Cookies = serverShop.Cookies; + sc.Cookies2 = serverShop.Cookies2; + } + } + + if (shop != null) + { + var loginResult = GetShopStatus(shop); + if (!loginResult.Contains("\"success\":true")) + { + shop.Cookies = "empty=true;"; + foreach (var sc in campanys) + { + sc.LoginStatus = "未登录"; + shop.Cookies = "empty=true;"; + } + } + else + { + foreach(var sc in campanys) + { + sc.LoginStatus = "登录成功"; + sc.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd"); + } + } + loginResult = PDDShopListForm.GetShopStatus2(shop); + if (!loginResult.Contains("\"success\":true")) + { + shop.Cookies2 = "empty=true;"; + foreach (var sc in campanys) + { + sc.LoginStatus2 = "国际版未登录"; + sc.Cookies2 = "empty=true;"; + } + } + else + { + foreach (var sc in campanys) + { + sc.LoginStatus2 = "国际版在线"; + sc.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd"); + } + } + //if (!string.IsNullOrEmpty(loginResult)) + // shop.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd"); + UpdateServerShopCookies(shop); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie + StartUp.SaveLocalShopLoginInfo(); + } + if (this.Created && isShowProgress) + { + this.Invoke(new Action(() => + { + this.statusBar.lblTaskStatus.Text = "正在检测..."; + this.statusBar.pgbTaskProgress.Value = (i + 1); + this.statusBar.pgbTaskProgress.Text = (i + 1) + "/" + shopNames.Length; + })); + } + } + } + + public static string GetShopStatus(ShopLoginInfo shop) + { + //string url = "https://seller.kuajingmaihuo.com/bg/quiet/api/mms/userInfo"; + //string refere = "https://seller.kuajingmaihuo.com/"; + //string body = @"{}"; + //return KJDHttpResponse.PostResponse(shop, url, body, refere); + return ""; + } + + /// + /// 获取国际版登录状态 + /// + /// + /// + public static string GetShopStatus2(ShopLoginInfo shop) + { + //string url = "https://agentseller.temu.com/api/seller/auth/userInfo"; + //string refere = "https://agentseller.temu.com/"; + //string body = @"{}"; + //return KJDHttpResponse.PostResponse2(shop, url, body, refere); + return ""; + } + + public static string GetShopLogin2Code(ShopLoginInfo shop) + { + //string url = "https://seller.kuajingmaihuo.com/bg/quiet/api/auth/obtainCode"; + //string refere = "https://seller.kuajingmaihuo.com/settle/seller-login?redirectUrl=https%3A%2F%2Fagentseller.temu.com%2F®ion=1&source=https%3A%2F%2Fagentseller.temu.com%2Fmain%2Fauthentication%3FredirectUrl%3Dhttps%253A%252F%252Fagentseller.temu.com%252F"; + //string body = @"{""redirectUrl"":""https://agentseller.temu.com/main/authentication""}"; + //return KJDHttpResponse.PostResponse(shop, url, body, refere); + return ""; + } + + private void ShopListForm_VisibleChanged(object sender, EventArgs e) + { + if (this.Visible == true) + { + this.pbLoading.Visible = true; + RefreshDataGridView(true); + } + } + + private void ShopListForm_Load(object sender, EventArgs e) + { + if (BaseClass.GroupId != 3) + { + this.dgvShop.Columns["ColEdit"].Visible = false; + this.dgvShop.Columns["colDelete"].Visible = false; + this.dgvShop.Columns["colSubUser"].Visible = false; + this.btnImport.Visible = false; + this.btnAddShop.Visible = false; + } + + this.dgvShop.AddSelectorColumn("colSelect"); + this.chkAutoDrag.Checked = GlobalConfig.DouShopSettingParam.IsAutoDragLogin; + this.splitContainer2.FixedPanel = FixedPanel.Panel2; + + //子账号 + //var url = BaseClass.BuildObjString("shop&act=get_shop_user_sub_group"); + //var data = UserLogin.GetSignaturex(); + //var result = GetHtml.PostUtf8(url, data); + //if (result?.Contains("\"code\":200") == true) + //{ + // var jObj = JObject.Parse(result); + // List shopSubAccountList = JsonHelper.DeserializeJsonToList(jObj["data"].ToString()); + // foreach (var shop in GlobalConfig.DouShopLoginList) + // { + // shop.ShopSubAccountList.Clear(); + // shop.ShopSubAccountList.AddRange(shopSubAccountList.Where(s => s.shop_login_name == shop.LoginName)); + // } + //} + foreach (var shop in GlobalConfig.ShopLoginList) + { + shop.ShopSubAccountList.Clear(); + if (!string.IsNullOrWhiteSpace(shop.SubUserName)) + { + ShopSubAccountInfo subAccount = new ShopSubAccountInfo(); + subAccount.sub_user_name = shop.SubUserName; + subAccount.user_name = shop.SubUserName; + subAccount.shop_login_name = shop.LoginName; + subAccount.group_id = "4"; + shop.ShopSubAccountList.Add(subAccount); + } + } + } + + private void dgvShop_CellContentClick(object sender, DataGridViewCellEventArgs e) + { + if (e.ColumnIndex < 0 || e.RowIndex < 0) + return; + string headerText = dgvShop.Columns[e.ColumnIndex].HeaderText; + string loginName = dgvShop.Rows[e.RowIndex].Cells["colLoginName"].Value.ParseToString(); + string accountId = dgvShop.Rows[e.RowIndex].Cells["colShopId"].Value.ParseToString(); + var shop = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.LoginName == loginName && v.ShopId == accountId); + + switch (headerText) + { + case "检测": + //CheckShopLoginAsync(new string[] { loginName }); + case "进入店铺": + IsOperate = true; + { + PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shop); + //shopLoginForm.Parent = this; + shopLoginForm.openType = EnumOpenType.manage; + shopLoginForm.WindowState = FormWindowState.Maximized; + shopLoginForm.InitUrl = "https://mms.pinduoduo.com/home/"; + shopLoginForm.Show(); + IsOperate = false; + } + break; + case "复制Cookie": + string cook = shop.Cookies; + + string cookJs = ""; + var keys = new string[] { "a42", "_bee", "_f77", "_nano_fp", "api_uid", "rckk", "ru1k", "ru2k", "SUB_PASS_ID" }; + //var keys2 = new string[] { "_bee", "_nano_fp", "api_uid", "dilx", "hfsc", "mallid", "njrpl", "seller_temp" }; + var keys2 = new string[] { "_bee", "_nano_fp", "api_uid", "dilx", "hfsc", "njrpl", "seller_temp" }; + foreach (var shopCook in shop.Cookies.Split(';')) + { + var cookie = shopCook.Trim(); + if (!keys.Any(k=>cookie.StartsWith(k))) + continue; + cookJs += "\r\ndocument.cookie='" + cookie.Substring(0, Math.Max(0, cookie.IndexOf("="))) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';"; + } + foreach (var shopCook in shop.Cookies2.Split(';')) + { + var cookie = shopCook.Trim(); + cookJs += "\r\ndocument.cookie='" + cookie.Substring(0, Math.Max(0, cookie.IndexOf("="))) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';"; + } + foreach (var shopCook in shop.Cookies.Split(';')) + { + var cookie = shopCook.Trim(); + if (!keys.Any(k => cookie.StartsWith(k))) + continue; + if (!cookie.StartsWith("SUB_PASS_ID") && !cookie.StartsWith("_nano_fp")) + cookJs += "\r\ndocument.cookie='" + cookie + "; domain=.kuajingmaihuo.com;';"; + else + cookJs += "\r\ndocument.cookie='" + cookie + "; domain=seller.kuajingmaihuo.com;';"; + } + // 全球站cookie + foreach (var shopCook in shop.Cookies2.Split(';')) + { + var cookie = shopCook.Trim(); + if (cookie.StartsWith("mallid")) + cookie = "mallid=" + shop.ShopId; + if (!keys2.Any(k => cookie.StartsWith(k))) + continue; + if (!cookie.StartsWith("seller_temp") && !cookie.StartsWith("_nano_fp") && !cookie.StartsWith("mallid")) + cookJs += "\r\ndocument.cookie='" + cookie + "; domain=.temu.com; expires=" + + DateTime.Now.AddDays(1).ToUniversalTime().ToString("ddd, dd MMM yyyy HH:mm:ss 'UTC'", new DateTimeFormatInfo()) + "; path=/';"; + else + cookJs += "\r\ndocument.cookie='" + cookie + "; domain=agentseller.temu.com; expires=" + + DateTime.Now.AddDays(1).ToUniversalTime().ToString("ddd, dd MMM yyyy HH:mm:ss 'UTC'", new DateTimeFormatInfo()) + "; path=/';"; + } + cookJs += "\r\nwindow.localStorage.setItem('" + "mall-info-id" + "', '" + shop.ShopId + "');"; + cookJs += "\r\nwindow.localStorage.setItem('" + "agentseller-mall-info-id" + "', '" + shop.ShopId + "');"; + cookJs += "\r\nsetTimeout(() => { window.location.href='https://agentseller.temu.com'; }, 200)"; + Clipboard.SetDataObject(cookJs); + BaseMsgForm.ShowInfo("复制成功"); + break; + case "导入Cookie": + PDDShopUpdateCookieForm updateCookieForm = new PDDShopUpdateCookieForm(shop); + updateCookieForm.SaveComplete += UpdateCookieForm_SaveComplete; + updateCookieForm.ShowDialog(); + break; + case "删除": + if (BaseMsgForm.ShowConfirm("确定删除店铺吗?删除后不可恢复!").DialogResult == DialogResult.Cancel) + return; + DeleteShop(e.RowIndex); + DelServerDouShop(shop.LoginName); + StartUp.SaveLocalShopLoginInfo(); + break; + case "编辑": + PDDShopAddEditForm editForm = new PDDShopAddEditForm(shop); + editForm.SaveCompleteWithDescribe += Sae_SaveComplete; + editForm.ShowDialog(); + break; + case "登录": + IsOperate = true; + { + PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shop); + shopLoginForm.openType = EnumOpenType.login; + shopLoginForm.SaveComplete += shopLoginForm_SaveComplete; + shopLoginForm.ShowDialog(); + btnRefreshCookie_Click(null, null); + } + IsOperate = false; + break; + //case "多重登录": + // IsOperate = true; + // ShopLoginForm shopMultiLoginForm = new ShopLoginForm(shop); + // shopMultiLoginForm.isMultiLogin = true; + // shopMultiLoginForm.SaveComplete += shopLoginForm_SaveComplete; + // shopMultiLoginForm.ShowDialog(); + // IsOperate = false; + // break; + //case "接口授权": + //case "上货授权": + // IsOperate = true; + // //GetHtml.OpenUrl("https://fuwu.jinritemai.com/authorize?service_id=815"); + // ShopAuthForm shopAuthForm = new ShopAuthForm(shop); + // shopAuthForm.SaveComplete += shopLoginForm_SaveComplete; + // shopAuthForm.ShowDialog(); + // IsOperate = false; + // break; + //case "拍单授权": + // IsOperate = true; + // //GetHtml.OpenUrl("https://fuwu.jinritemai.com/detail?from=fuwu_market_orderDetail&service_id=20896"); + // ShopAuthForm shopAuthForm1 = new ShopAuthForm(shop); + // shopAuthForm1.shopAuthUrl = "https://fuwu.jinritemai.com/authorize?service_id=20896"; + // shopAuthForm1.SaveComplete += shopLoginForm_SaveComplete; + // shopAuthForm1.ShowDialog(); + // IsOperate = false; + // break; + default: + dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value = !(bool)dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value; + break; + } + } + + private void DeleteShop(int rowIndex) + { + string shopLoginName = this.dgvShop.Rows[rowIndex].Cells["colLoginName"].Value.ParseToString(); + List dgvRows = dgvShop.Rows.Cast().Where(p => + p.Cells.GetCellValueFromColumnName("colLoginName").ParseToString() == shopLoginName).ToList(); + + foreach(var row in dgvRows) + dgvShop.Rows.Remove(row); + GlobalConfig.ShopLoginList.RemoveAll(v => v.LoginName == shopLoginName); + } + + private void btnCheck_Click(object sender, EventArgs e) + { + if (this.btnCheck.Text == "检测选中") + { + List shopNameList = GetCheckedList(); + if (!shopNameList.Any()) + { + BaseMsgForm.ShowError("请选择需要检测的店铺"); + return; + } + + this.pbLoading.Visible = true; + this.btnCheck.Enabled = false; + var t = Task.Run(() => + { + UpdateShop(); + CheckShopListLogin(shopNameList.Distinct().ToArray()); + RefreshDataGridView(false); + }); + Task.Run(() => + { + while (true) + { + Thread.Sleep(1000); + if (t.IsCompleted || t.IsCanceled || t.IsFaulted) + { + Invoke(new Action(() => + { + this.pbLoading.Visible = false; + this.btnCheck.Enabled = true; + })); + break; + } + } + }); + } + } + + private void btnRefreshCookie_Click(object sender, EventArgs e) + { + this.pbLoading.Visible = true; + this.splitContainer1.Panel1.Enabled = false; + var t = Task.Run(() => + { + try + { + UpdateShop(); + RefreshDataGridView(false); + } + catch (Exception ex) { BaseMsgForm.ShowError(ex.Message); } + }); + Task.Run(() => + { + while (true) + { + Thread.Sleep(1000); + if (t.IsCompleted || t.IsCanceled || t.IsFaulted) + { + Invoke(new Action(() => + { + this.pbLoading.Visible = false; + this.splitContainer1.Panel1.Enabled = true; + })); + } + } + }); + } + + private List GetCheckedList() + { + List shopNameList = new List(); + for (int i = 0; i < dgvShop.Rows.Count; i++) + { + if (dgvShop.Rows[i].Cells["colSelect"].Value.ParseToBool()) + { + string shopName = dgvShop.Rows[i].Cells["colLoginName"].Value.ParseToString(); + shopNameList.Add(shopName); + } + } + return shopNameList; + } + + private List GetCheckedShopIdList() + { + List shopNameList = new List(); + for (int i = 0; i < dgvShop.Rows.Count; i++) + { + if (dgvShop.Rows[i].Cells["colSelect"].Value.ParseToBool()) + { + string shopName = dgvShop.Rows[i].Cells["colShopId"].Value.ParseToString(); + shopNameList.Add(shopName); + } + } + return shopNameList; + } + + private void btnLoginSelect_Click(object sender, EventArgs e) + { + PDDShopListForm.IsOperate = true; + if (this.btnLoginSelect.Text == "登录选中") + { + List shopLoginNameList = GetCheckedList(); + if (!shopLoginNameList.Any()) + { + BaseMsgForm.ShowError("请选择需要登录的店铺"); + PDDShopListForm.IsOperate = false; + return; + } + + shopLoginNameList = shopLoginNameList.Distinct().ToList(); + foreach (var loginName in shopLoginNameList) + { + if (PDDShopListForm.IsOperate == false) + break; + + var shopInfo = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.LoginName == loginName); + if (shopInfo != null && !string.IsNullOrEmpty(shopInfo.LoginName) && !string.IsNullOrEmpty(shopInfo.Password)) + { + PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shopInfo); + shopLoginForm.openType = EnumOpenType.login; + shopLoginForm.SaveComplete += shopLoginForm_SaveComplete; + shopLoginForm.ShowDialog(); + } + } + btnRefreshCookie_Click(null, null); + } + PDDShopListForm.IsOperate = false; + } + + private void chkAutoDrag_Click(object sender, EventArgs e) + { + GlobalConfig.DouShopSettingParam.IsAutoDragLogin = chkAutoDrag.Checked; + StartUp.SaveDouShopSettingParam(); + foreach (var i in LstShopListFormInatance) + { + if (i != null && i.chkAutoDrag.Checked != GlobalConfig.DouShopSettingParam.IsAutoDragLogin) + { + if (i.chkAutoDrag.InvokeRequired) + { + i.chkAutoDrag.Invoke(new Action(() => + { + i.chkAutoDrag.Checked = GlobalConfig.DouShopSettingParam.IsAutoDragLogin; + })); + } + else + { + i.chkAutoDrag.Checked = GlobalConfig.DouShopSettingParam.IsAutoDragLogin; + } + } + } + } + + private void btnRefreshAuth_Click(object sender, EventArgs e) + { + if (this.btnRefreshAuth.Text == "刷新授权") + { + List shopNameList = GetCheckedList(); + if (!shopNameList.Any()) + { + BaseMsgForm.ShowError("请选择需要刷新授权的店铺"); + return; + } + + UpdateShopTokens(GlobalConfig.ShopLoginList.Where(s => shopNameList.Contains(s.ShopAccount)).ToList()); + Task.Run(() => + { + CheckShopListLogin(shopNameList.ToArray()); + RefreshDataGridView(false); + }); + } + } + + private void btnSearch_Click(object sender, EventArgs e) + { + //Task.Run(() => + //{ + // RefreshDataGridView(false); + //}); + + this.pbLoading.Visible = true; + this.splitContainer1.Panel1.Enabled = false; + var t = Task.Run(() => + { + try + { + UpdateShop(); + RefreshDataGridView(false); + } + catch (Exception ex) { BaseMsgForm.ShowError(ex.Message); } + }); + Task.Run(() => + { + while (true) + { + Thread.Sleep(1000); + if (t.IsCompleted || t.IsCanceled || t.IsFaulted) + { + Invoke(new Action(() => + { + this.pbLoading.Visible = false; + this.splitContainer1.Panel1.Enabled = true; + })); + } + } + }); + } + + private void btnEmpty_Click(object sender, EventArgs e) + { + this.cmbNotes.Text = "全部"; + this.txtShopId.Text = ""; + this.txtShopName.Text = ""; + } + + private static string sJsSetCookie = @" +function setCookie(name, value, daysToLive, path, domain, secure, httpOnly, sameSite) { + //let cookie = name + '=' + encodeURIComponent(value) + ';'; + let cookie = name + '=' + value + ';'; + if (daysToLive) { + if (typeof daysToLive === 'string' && daysToLive.toLowerCase() == 'session') { + cookie += 'expires=Session;'; + } + else { + let date = new Date(); + date.setTime(date.getTime() + (daysToLive * 24 * 60 * 60 * 1000)); + cookie += 'expires=' + date.toUTCString() + ';'; + } + } + if (path) { + cookie += 'path=' + path + ';'; + } + if (domain) + { + cookie += 'domain=' + domain + ';'; + } + if (secure) + { + cookie += 'secure;'; + } + if (httpOnly) + { + cookie += 'HttpOnly;'; + } + if (sameSite) + { + cookie += 'SameSite=' + sameSite + ';'; + } + document.cookie = cookie; +}"; + + } +} diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopListForm.resx b/TEMUKJD/PDDForms/ShopForms/PDDShopListForm.resx new file mode 100644 index 0000000..59a31c0 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopListForm.resx @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.Designer.cs b/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.Designer.cs new file mode 100644 index 0000000..18a2d49 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.Designer.cs @@ -0,0 +1,379 @@ +namespace TemuKJD.PDDForms.ShopForms +{ + partial class PDDShopLoginForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDDShopLoginForm)); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.btnLoginAgain = new TemuKJD.UserControls.ButtonEx(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.btnCopyPassword = new TemuKJD.UserControls.ButtonEx(); + this.btnCopyUserName = new TemuKJD.UserControls.ButtonEx(); + this.txtPassWord = new System.Windows.Forms.TextBox(); + this.txtUserName = new System.Windows.Forms.TextBox(); + this.btnStop = new TemuKJD.UserControls.ButtonEx(); + this.btnReload = new TemuKJD.UserControls.ButtonEx(); + this.chkCloseAfterLogin = new DevComponents.DotNetBar.Controls.CheckBoxX(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.txtAddress = new System.Windows.Forms.TextBox(); + this.btnDel = new DevComponents.DotNetBar.PanelEx(); + this.btnMultiLogin = new DevComponents.DotNetBar.PanelEx(); + this.cmbMultiCookieName = new DevComponents.DotNetBar.Controls.ComboBoxEx(); + this.pnlMultiLogin = new System.Windows.Forms.Panel(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + this.pnlMultiLogin.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.BackColor = System.Drawing.Color.White; + this.splitContainer1.Panel2.Controls.Add(this.btnLoginAgain); + this.splitContainer1.Panel2.Controls.Add(this.pnlMultiLogin); + this.splitContainer1.Panel2.Controls.Add(this.label2); + this.splitContainer1.Panel2.Controls.Add(this.label1); + this.splitContainer1.Panel2.Controls.Add(this.btnCopyPassword); + this.splitContainer1.Panel2.Controls.Add(this.btnCopyUserName); + this.splitContainer1.Panel2.Controls.Add(this.txtPassWord); + this.splitContainer1.Panel2.Controls.Add(this.txtUserName); + this.splitContainer1.Panel2.Controls.Add(this.btnStop); + this.splitContainer1.Panel2.Controls.Add(this.btnReload); + this.splitContainer1.Panel2.Controls.Add(this.chkCloseAfterLogin); + this.splitContainer1.Size = new System.Drawing.Size(1438, 736); + this.splitContainer1.SplitterDistance = 675; + this.splitContainer1.SplitterWidth = 3; + this.splitContainer1.TabIndex = 4; + // + // btnLoginAgain + // + this.btnLoginAgain.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnLoginAgain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnLoginAgain.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnLoginAgain.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnLoginAgain.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnLoginAgain.ForeColor = System.Drawing.Color.White; + this.btnLoginAgain.Location = new System.Drawing.Point(1137, 31); + this.btnLoginAgain.Margin = new System.Windows.Forms.Padding(2); + this.btnLoginAgain.Name = "btnLoginAgain"; + this.btnLoginAgain.Size = new System.Drawing.Size(91, 25); + this.btnLoginAgain.TabIndex = 462; + this.btnLoginAgain.Text = "重新登录"; + this.btnLoginAgain.UseVisualStyleBackColor = false; + this.btnLoginAgain.Click += new System.EventHandler(this.btnLoginAgain_Click); + // + // label2 + // + this.label2.Location = new System.Drawing.Point(23, 35); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(44, 17); + this.label2.TabIndex = 378; + this.label2.Text = "密码"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(23, 8); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(44, 17); + this.label1.TabIndex = 377; + this.label1.Text = "用户名"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // btnCopyPassword + // + this.btnCopyPassword.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnCopyPassword.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnCopyPassword.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnCopyPassword.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnCopyPassword.ForeColor = System.Drawing.Color.White; + this.btnCopyPassword.Location = new System.Drawing.Point(295, 31); + this.btnCopyPassword.Margin = new System.Windows.Forms.Padding(2); + this.btnCopyPassword.Name = "btnCopyPassword"; + this.btnCopyPassword.Size = new System.Drawing.Size(57, 25); + this.btnCopyPassword.TabIndex = 376; + this.btnCopyPassword.Text = "复制"; + this.btnCopyPassword.UseVisualStyleBackColor = false; + this.btnCopyPassword.Click += new System.EventHandler(this.btnCopyPassword_Click); + // + // btnCopyUserName + // + this.btnCopyUserName.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnCopyUserName.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnCopyUserName.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnCopyUserName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnCopyUserName.ForeColor = System.Drawing.Color.White; + this.btnCopyUserName.Location = new System.Drawing.Point(295, 4); + this.btnCopyUserName.Margin = new System.Windows.Forms.Padding(2); + this.btnCopyUserName.Name = "btnCopyUserName"; + this.btnCopyUserName.Size = new System.Drawing.Size(57, 25); + this.btnCopyUserName.TabIndex = 375; + this.btnCopyUserName.Text = "复制"; + this.btnCopyUserName.UseVisualStyleBackColor = false; + this.btnCopyUserName.Click += new System.EventHandler(this.btnCopyUserName_Click); + // + // txtPassWord + // + this.txtPassWord.Location = new System.Drawing.Point(72, 32); + this.txtPassWord.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.txtPassWord.Name = "txtPassWord"; + this.txtPassWord.PasswordChar = '●'; + this.txtPassWord.ReadOnly = true; + this.txtPassWord.Size = new System.Drawing.Size(221, 23); + this.txtPassWord.TabIndex = 374; + // + // txtUserName + // + this.txtUserName.Location = new System.Drawing.Point(72, 5); + this.txtUserName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.txtUserName.Name = "txtUserName"; + this.txtUserName.ReadOnly = true; + this.txtUserName.Size = new System.Drawing.Size(221, 23); + this.txtUserName.TabIndex = 373; + // + // btnStop + // + this.btnStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnStop.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnStop.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnStop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnStop.ForeColor = System.Drawing.Color.White; + this.btnStop.Location = new System.Drawing.Point(1324, 31); + this.btnStop.Margin = new System.Windows.Forms.Padding(2); + this.btnStop.Name = "btnStop"; + this.btnStop.Size = new System.Drawing.Size(96, 25); + this.btnStop.TabIndex = 372; + this.btnStop.Text = "停止操作"; + this.btnStop.UseVisualStyleBackColor = false; + this.btnStop.Click += new System.EventHandler(this.btnStop_Click); + // + // btnReload + // + this.btnReload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnReload.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnReload.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnReload.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnReload.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnReload.ForeColor = System.Drawing.Color.White; + this.btnReload.Location = new System.Drawing.Point(1231, 31); + this.btnReload.Margin = new System.Windows.Forms.Padding(2); + this.btnReload.Name = "btnReload"; + this.btnReload.Size = new System.Drawing.Size(91, 25); + this.btnReload.TabIndex = 371; + this.btnReload.Text = "重新加载"; + this.btnReload.UseVisualStyleBackColor = false; + this.btnReload.Click += new System.EventHandler(this.btnReload_Click); + // + // chkCloseAfterLogin + // + this.chkCloseAfterLogin.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + // + // + // + this.chkCloseAfterLogin.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.chkCloseAfterLogin.Checked = true; + this.chkCloseAfterLogin.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkCloseAfterLogin.CheckValue = "Y"; + this.chkCloseAfterLogin.Location = new System.Drawing.Point(997, 32); + this.chkCloseAfterLogin.Name = "chkCloseAfterLogin"; + this.chkCloseAfterLogin.Size = new System.Drawing.Size(135, 23); + this.chkCloseAfterLogin.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.chkCloseAfterLogin.TabIndex = 8; + this.chkCloseAfterLogin.Text = "登录成功后关闭窗口"; + // + // splitContainer2 + // + this.splitContainer2.BackColor = System.Drawing.Color.White; + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer2.Location = new System.Drawing.Point(1, 33); + this.splitContainer2.Name = "splitContainer2"; + this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.txtAddress); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.splitContainer1); + this.splitContainer2.Size = new System.Drawing.Size(1438, 766); + this.splitContainer2.SplitterDistance = 26; + this.splitContainer2.TabIndex = 5; + // + // txtAddress + // + this.txtAddress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtAddress.Location = new System.Drawing.Point(3, 3); + this.txtAddress.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.txtAddress.Name = "txtAddress"; + this.txtAddress.Size = new System.Drawing.Size(1432, 23); + this.txtAddress.TabIndex = 7; + this.txtAddress.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtAddress_KeyDown); + // + // btnDel + // + this.btnDel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnDel.CanvasColor = System.Drawing.SystemColors.Control; + this.btnDel.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnDel.DisabledBackColor = System.Drawing.Color.Empty; + this.btnDel.Location = new System.Drawing.Point(161, 3); + this.btnDel.Name = "btnDel"; + this.btnDel.Size = new System.Drawing.Size(20, 24); + this.btnDel.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnDel.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); + this.btnDel.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); + this.btnDel.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; + this.btnDel.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnDel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; + this.btnDel.Style.GradientAngle = 90; + this.btnDel.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center; + this.btnDel.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnDel.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnDel.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnDel.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White; + this.btnDel.TabIndex = 409; + this.btnDel.Text = "删"; + this.btnDel.Click += new System.EventHandler(this.btnDel_Click); + // + // btnMultiLogin + // + this.btnMultiLogin.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnMultiLogin.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.btnMultiLogin.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnMultiLogin.DisabledBackColor = System.Drawing.Color.Empty; + this.btnMultiLogin.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnMultiLogin.Location = new System.Drawing.Point(186, 3); + this.btnMultiLogin.Name = "btnMultiLogin"; + this.btnMultiLogin.Size = new System.Drawing.Size(60, 24); + this.btnMultiLogin.Style.Alignment = System.Drawing.StringAlignment.Center; + this.btnMultiLogin.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnMultiLogin.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnMultiLogin.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.btnMultiLogin.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.btnMultiLogin.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.btnMultiLogin.Style.ForeColor.Color = System.Drawing.Color.White; + this.btnMultiLogin.Style.GradientAngle = 90; + this.btnMultiLogin.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.btnMultiLogin.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnMultiLogin.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.btnMultiLogin.TabIndex = 460; + this.btnMultiLogin.Text = "多重登录"; + this.btnMultiLogin.Click += new System.EventHandler(this.btnMultiLogin_Click); + // + // cmbMultiCookieName + // + this.cmbMultiCookieName.DisplayMember = "Text"; + this.cmbMultiCookieName.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.cmbMultiCookieName.FormattingEnabled = true; + this.cmbMultiCookieName.ItemHeight = 18; + this.cmbMultiCookieName.Location = new System.Drawing.Point(3, 3); + this.cmbMultiCookieName.Name = "cmbMultiCookieName"; + this.cmbMultiCookieName.Size = new System.Drawing.Size(158, 24); + this.cmbMultiCookieName.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.cmbMultiCookieName.TabIndex = 379; + this.cmbMultiCookieName.Text = "cookie1"; + // + // pnlMultiLogin + // + this.pnlMultiLogin.Controls.Add(this.cmbMultiCookieName); + this.pnlMultiLogin.Controls.Add(this.btnMultiLogin); + this.pnlMultiLogin.Controls.Add(this.btnDel); + this.pnlMultiLogin.Location = new System.Drawing.Point(403, 1); + this.pnlMultiLogin.Name = "pnlMultiLogin"; + this.pnlMultiLogin.Size = new System.Drawing.Size(270, 33); + this.pnlMultiLogin.TabIndex = 461; + this.pnlMultiLogin.Visible = false; + // + // ShopLoginForm + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.ClientSize = new System.Drawing.Size(1440, 800); + this.Controls.Add(this.splitContainer2); + this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "ShopLoginForm"; + this.ShowMaximizeBox = true; + this.Text = "店铺登录"; + this.TitleText = "店铺登录"; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ShopLoginForm_FormClosed); + this.Load += new System.EventHandler(this.ShopLoginForm_Load); + this.Controls.SetChildIndex(this.splitContainer2, 0); + this.splitContainer1.Panel2.ResumeLayout(false); + this.splitContainer1.Panel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel1.PerformLayout(); + this.splitContainer2.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); + this.splitContainer2.ResumeLayout(false); + this.pnlMultiLogin.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer1; + private UserControls.ButtonEx btnStop; + private UserControls.ButtonEx btnReload; + private System.Windows.Forms.TextBox txtPassWord; + private System.Windows.Forms.TextBox txtUserName; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private UserControls.ButtonEx btnCopyPassword; + private UserControls.ButtonEx btnCopyUserName; + private System.Windows.Forms.SplitContainer splitContainer2; + private System.Windows.Forms.TextBox txtAddress; + private UserControls.ButtonEx btnLoginAgain; + public DevComponents.DotNetBar.Controls.CheckBoxX chkCloseAfterLogin; + private System.Windows.Forms.Panel pnlMultiLogin; + private DevComponents.DotNetBar.Controls.ComboBoxEx cmbMultiCookieName; + private DevComponents.DotNetBar.PanelEx btnMultiLogin; + private DevComponents.DotNetBar.PanelEx btnDel; + } +} \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.cs b/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.cs new file mode 100644 index 0000000..07b210f --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.cs @@ -0,0 +1,1001 @@ +using AllBase; +using AllBase.Helper; +using AllBase.Model.Result; +using CefSharp; +using CefSharp.WinForms; +//using TemuKJD.DashBoardForms; +using TemuKJD.Helper; +using TemuKJD.KJDForms.BaseForms; +using Microsoft.Win32; +using NaiBa.CefHelper; +using NaiBa.CefHelper.Handler; +using NaiBa.Util.Extension; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +//using System.Web.Hosting; +using System.Windows.Forms; +using Work; +using Work.BLL.Tools; + +namespace TemuKJD.PDDForms.ShopForms +{ + public enum EnumOpenType + { + login, + manage, + } + public partial class PDDShopLoginForm : LRBaseForm + { + public static PDDShopLoginForm shopLoginInstance { get; set; } = null; + + public int CloseAfterSecond { get; set; } + public EnumOpenType openType = EnumOpenType.manage; + public bool isMultiLogin = false; + public string MultiLoginCookieName = ""; + public string InitUrl = ""; + private string shopCookieHead = "pinduoduo.com"; + private string shopCookieHead2 = "temu.com"; + private string shopLoginUrl = "https://mms.pinduoduo.com/login"; + private string shopMainUrl = "https://mms.pinduoduo.com/home"; + private ChromiumWebBrowser cefWebBrowser = null; + private ShopLoginInfo shop = null; + private List lstShopCompany = new List(); + private string currentUrl = ""; + private long currentSupplierId = 0; + + public PDDShopLoginForm(ShopLoginInfo shopInfo) + { + if (shopLoginInstance != null && !shopLoginInstance.IsDisposed) + { + shopLoginInstance.Dispose(); + } + shopLoginInstance = this; + + InitializeComponent(); + + this.shop = shopInfo; + this.txtUserName.Text = shopInfo.LoginName; + this.txtPassWord.Text = DataOpenSSL.DecryptString(shopInfo.Password); + } + + private void ShopLoginForm_Load(object sender, EventArgs e) + { + //this.splitContainer1.SplitterDistance = 674; + + if (openType == EnumOpenType.login) + { + //this.shop.ShopId = ""; + //this.shop.ShopAccount = ""; + } + + if (isMultiLogin && shop != null) + { + this.pnlMultiLogin.Visible = true; + InitMultiLoginCookies(); + } + + if (CloseAfterSecond > 0) + { + Task.Run(() => + { + Thread.Sleep(1000 * CloseAfterSecond); + if (this.Created) + { + Invoke(new Action(() => { this.Close(); })); + } + }); + } + + if (!isMultiLogin) + AutoLogin(); + + CheckAndSaveShop(); //判断登录是否成功,成功则保存店铺信息和店铺cookie + //ClosePopWindow(); //自动关闭弹窗 + } + + /// + /// 判断登录,保存店铺 + /// + private void CheckAndSaveShop() + { + Task.Run(() => + { + // 自动判断是否登录成功,登录成功后记录cookie保存到服务端。 + while (this.Created) + { + Thread.Sleep(3000); + //continue; + if (!this.Created) + break; + + if (this.shop != null && currentUrl.TrimEnd('/') == shopMainUrl) + { + if (!cefWebBrowser.GetBrowser().MainFrame.IsValid) + continue; + + if (openType!= EnumOpenType.login) + continue; + + if (!lstShopCompany.Any(c => c.LoginName == shop.LoginName)) + continue; + + string cookies = ""; + List cookieList = CEFBrowser.GetCookieList(shopCookieHead, cefWebBrowser.GetCookieManager(null)); + if (cookieList != null && cookieList.Count > 0) + { + foreach (var cookie in cookieList) + { + //SUB_PASS_ID同时出现两个,domain是seller.kuajingmaihuo.com才是能登录店铺后台的 + if (cookie.Name == "PASS_ID" && cookie.Domain != "mms.pinduoduo.com" + && cookieList.Any(c=>c.Name== "PASS_ID" && c.Domain == "mms.pinduoduo.com")) + continue; + + cookies += cookie.Name + "=" + cookie.Value + "; "; + } + cookies = cookies.Trim().TrimEnd(';'); + } + + if (!string.IsNullOrEmpty(cookies) + && lstShopCompany.Any(c => c.LoginName == shop.LoginName)) + { + var lstShopCompanyCopy = lstShopCompany.ToList(); + lstShopCompanyCopy = lstShopCompanyCopy.Where(l => l.LoginName == shop.LoginName).ToList(); + + foreach (ShopCompany sc in lstShopCompanyCopy) + { + ShopLoginInfo newShop = new ShopLoginInfo() + { + LoginName = shop.LoginName, + Password = shop.Password, + GroupName = shop.GroupName, + ShopAccount = sc.AccountName, + ShopId = sc.AccountId, + SubUserName = shop.SubUserName, + Notes = shop.Notes, + }; + + var oldShop = GlobalConfig.ShopLoginList.FirstOrDefault(l => + l.LoginName == newShop.LoginName); + if (oldShop == null) + { + GlobalConfig.ShopLoginList.Add(newShop); + PDDShopListForm.AddServerDouShop(newShop); // 店铺写入到服务端 + } + else + { + oldShop.LoginName = newShop.LoginName; + oldShop.Password = newShop.Password; + oldShop.GroupName = newShop.GroupName; + oldShop.ShopAccount = newShop.ShopAccount; + oldShop.ShopId = newShop.ShopId; + oldShop.SubUserName = newShop.SubUserName; + oldShop.Notes = newShop.Notes; + } + } + var lstShop = GlobalConfig.ShopLoginList.Where(l => l.LoginName == shop.LoginName).ToList(); + foreach(var s in lstShop) + { + s.LoginStatus = "登录成功"; + s.Cookies = cookies; + s.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd"); + } + StartUp.SaveLocalShopLoginInfo(); // 店铺保存到本地 + PDDShopListForm.UpdateServerShopCookies(shop); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie + + OnSaveComplete(shop); + if (this.Created && this.chkCloseAfterLogin.Checked) + { + Invoke(new Action(() => { this.Close(); })); + } + else + break; + } + } + } + }); + } + + /// + /// 自动关闭弹窗 + /// + private void ClosePopWindow() + { + // 关闭弹窗 + Task.Run(() => + { + var sleepTime = 2500; + int i = 0; + while (true && i++ < 50) + { + try + { + Thread.Sleep(sleepTime); + var jsStr1 = "function ClosePopWindow(txt) {\r\n" + + " var result = 'no_pop'\r\n" + + " var item = document.getElementsByClassName(txt);\r\n" + + " for(i = 0; i < item.length; i++) {\r\n" + + " item[i].click();\r\n" + + " result = 'success'\r\n" + + " }\r\n" + + " return result;\r\n" + + "}\r\n" + + "ClosePopWindow('anticon-close-circle');\r\n" + + "ClosePopWindow('ant-modal-close-x');\r\n"; + var jsStr2 = "function clickPopWindow(txt) {\r\n" + + "var child = document.body.firstElementChild;\r\n" + + "var element1 = null;\r\n" + + " while (child) {\r\n" + + " if (child.innerHTML.indexOf(txt) >= 0) {\r\n" + + " element1 = child;\r\n" + + " if (child.firstElementChild) {\r\n" + + " child = child.firstElementChild; continue;\r\n" + + " } else break;\r\n" + + " }\r\n" + + " child = child.nextElementSibling;\r\n" + + " }\r\n" + + " if (element1) {\r\n" + + " element1.click(); return 'success';\r\n" + + " } else return 'no_pop';\r\n" + + "}\r\n" + + "clickPopWindow('我知道了');\r\n" + + "clickPopWindow('知道了');\r\n"; + if (cefWebBrowser != null && cefWebBrowser.IsBrowserInitialized) + { + var t1 = cefWebBrowser.GetMainFrame().EvaluateScriptAsync(jsStr1); + t1.Wait(); + var t2 = cefWebBrowser.GetMainFrame().EvaluateScriptAsync(jsStr2); + t2.Wait(); + if (t1.Result?.Result?.ToString() == "success" || t2.Result?.Result?.ToString() == "success") + sleepTime = Randomx.GetId(550, 650); + else + sleepTime = Randomx.GetId(1500, 2000); + } + } + catch (Exception ex) { } + } + }); + } + + /// + /// 自动登录店铺后台 + /// + private void AutoLogin() + { + if (shop == null) + return; + + if (cefWebBrowser == null) + { + //cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser("about:blank", false); + if (!string.IsNullOrEmpty(InitUrl)) //temu国际版不支持无痕模式多开,此处改为true,每次创建cefwebbrowser时删除cookie + cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(InitUrl, true); + else + cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(shopMainUrl, true); + CustomResourceRequestHandlerLocal resourceRequestHandler = new CustomResourceRequestHandlerLocal(); + resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete; + cefWebBrowser.RequestHandler = new CustomRequestHandler(resourceRequestHandler); + var lifeSapnHandler = new LifeSpanHandlerLocal(PopWindowType.SelfWindow); + cefWebBrowser.LifeSpanHandler = lifeSapnHandler; + cefWebBrowser.KeyboardHandler = new KeyboardHandler(); + cefWebBrowser.FrameLoadEnd += CefWebBrowser_FrameLoadEnd; + cefWebBrowser.AddressChanged += CefWebBrowser_AddressChanged; + cefWebBrowser.LoadError += CefWebBrowser_LoadError; + cefWebBrowser.Dock = DockStyle.Fill; + + //js绑定C#对象 + ShopBrowserObject shopObj = new ShopBrowserObject(); + shopObj.OnInfoReceived += ShopObj_OnInfoReceived; + CefSharpSettings.WcfEnabled = true; + cefWebBrowser.JavascriptObjectRepository.Register( + name: "shopObj", + objectToBind: shopObj, + isAsync: false, + options: new BindingOptions { Binder = BindingOptions.DefaultBinder.Binder /*CamelCaseJavascriptNames = false*/ /*cef79*/ } + ); + + if (shop.Cookies == null) + shop.Cookies = ""; + if (shop.Cookies2 == null) + shop.Cookies2 = ""; + + var cookie = shop.Cookies; + if (isMultiLogin) + cookie = shop.DictMultiCookies.Keys.Contains(MultiLoginCookieName) ? shop.DictMultiCookies[MultiLoginCookieName] : ""; + + + Task.Run(() => + { + Invoke(new Action(() => + { + splitContainer1.Panel1.Controls.Add(cefWebBrowser); + //cefWebBrowser.Load(shopMainUrl); + })); + // cef138必须init后方可设置或删除cookie + while (!cefWebBrowser.IsBrowserInitialized || !cefWebBrowser.GetBrowser().MainFrame.IsValid) + Thread.Sleep(20); + CEFBrowser.DeleteCookie(cefWebBrowser.GetCookieManager(null)); + + //cef 138 如果没有设置RequestContext 可能为空,直接getCookieManager + var t = CEFBrowser.SetCookieAsync(shopCookieHead, cookie, cefWebBrowser.GetCookieManager(null)); + t.Wait(5000); + + if (this.openType != EnumOpenType.login) + { + //var cookie2 = shop.Cookies2; + //var t2 = CEFBrowser.SetCookieAsync(shopCookieHead2, cookie2, cefWebBrowser.GetCookieManager(null)); + //t2.Wait(5000); + } + + //根据登录的具体店铺设置local storage + if (!string.IsNullOrEmpty(shop.ShopId)) + { + //var storageJsCode = "window.localStorage.setItem('" + "mall-info-id" + "', '" + shop.ShopId + "');\r\n"; + //storageJsCode += "window.localStorage.setItem('" + "agentseller-mall-info-id" + "', '" + shop.ShopId + "');\r\n"; + //while (!cefWebBrowser.IsBrowserInitialized || !cefWebBrowser.GetBrowser().MainFrame.IsValid) + // Thread.Sleep(20); + //cefWebBrowser.GetBrowser().MainFrame.ExecuteJavaScriptAsync(storageJsCode); + } + + if (!string.IsNullOrEmpty(InitUrl)) + cefWebBrowser.Load(InitUrl); + + //不是登录的话就此返回 + if (openType != EnumOpenType.login) + { + Invoke(new Action(() => + { + chkCloseAfterLogin.Visible = false; + btnLoginAgain.Visible = false; + })); + return; + } + + for (int i = 0; i < 50; i++) + { + if (cefWebBrowser.IsLoading) + Thread.Sleep(100); + } + Thread.Sleep(Randomx.GetId(1500,2000)); + + //设置 local storage + //if (GlobalConfig.dicLocalStorage != null) + //{ + // Thread.Sleep(500); + // string jsCode = "function setStorage() {"; + // foreach (var item in GlobalConfig.dicLocalStorage) + // { + // if (item.Key == "$TCC_CONFIG" || item.Key == "$TCC_CONFIG_operate_config" || item.Key == "menuStyleStr") + // continue; + + // jsCode += "window.localStorage.setItem('" + item.Key + "', '" + item.Value + "');\r\n"; + // } + // jsCode += "}"; + // jsCode += "setStorage();"; + // if (cefWebBrowser.GetBrowser().MainFrame.IsValid) + // cefWebBrowser.GetBrowser().MainFrame.ExecuteJavaScriptAsync(jsCode); + //} + + if (!this.Created) + return; + + InputUserNameAndPassword(cefWebBrowser, shop.LoginName, DataOpenSSL.DecryptString(shop.Password)); + }); + } + } + private void ShopObj_OnInfoReceived(string information) + { + //BaseMsgForm.ShowInfo(information); + if (!string.IsNullOrEmpty(information)) + cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync("alert('" + information + "');"); + } + + private void CefWebBrowser_LoadError(object sender, CefSharp.LoadErrorEventArgs e) + { + } + + private void CefWebBrowser_AddressChanged(object sender, CefSharp.AddressChangedEventArgs e) + { + if (this.Created) + Invoke(new Action(() => + { + currentUrl = e.Address; + txtAddress.Text = e.Address; + })); + } + + private void CefWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEndEventArgs e) + { + //if (!cefWebBrowser.IsBrowserInitialized) return; + + //currentUrl = e.Url; + //if (currentUrl.StartsWith("https://fxg.jinritemai.com/ffa/multiShop")) + //{ + // Thread.Sleep(Randomx.GetId(500, 800)); + //} + //if (currentUrl.StartsWith("https://fxg.jinritemai.com/ffa/mshop/homepage/index")) + //{ + // Task.Run(() => + // { + // + // }); + //} + + //js绑定C#对象 html页面内声明绑定的C#对象 + StringBuilder sb = new StringBuilder(); + sb.Append("(function(){"); + sb.Append("CefSharp.BindObjectAsync('shopObj');"); + sb.Append("})();"); + cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sb.ToString()); + } + + private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request) + { + Task.Run(() => + { + var data = responseData; + var uri = url; + if (data.Contains("球球小小")) + { + + } + if (data.Contains("supplierId") && data.Contains("\"success\":true")) + { + var supplierIds = BaseRegex.GetMatchRegex(ref data, "\"supplierId\":\\d{5,20}"); + if (supplierIds.Count > 0 && supplierIds[0].Groups.Count > 0) + { + var supplierId = supplierIds[0].Groups[0].Value.Replace("\"supplierId\":", "").ParseToLong(); + if (supplierId > 0) + this.currentSupplierId = supplierId; + } + } + }); + if (url.StartsWith("https://seller.kuajingmaihuo.com/settle/site-main")) + { + cefWebBrowser.Load(shopMainUrl); + } + //if (url == shopMainUrl) + if (url == "https://mms.pinduoduo.com/janus/api/userinfo") + { + Task.Run(() => + { + var data = responseData; + if (this.shop != null && data.Contains("\"success\":true")) + { + var maskMobile = BaseRegex.GetStringJson(ref data, "mobile"); + maskMobile = maskMobile.Split('*').Last(); + if (shop.LoginName.EndsWith(maskMobile)) + { + lstShopCompany.Clear(); + var jObj = JObject.Parse(data); + var jArr = jObj["result"] as JArray; + if (jArr == null) + jArr = new JArray(); + + Thread.Sleep(500); + //foreach (var productObj in jArr) + //{ + // var prod = JsonHelper.SerializeObject(productObj); + // ShopCompany sc = new ShopCompany() + // { + // AccountId = BaseRegex.GetStringJson(ref prod, "mallId"), + // AccountName = BaseRegex.GetStringJson(ref prod, "mallName"), + // LoginName = shop.LoginName, + // UserName = BaseClass.UserName, + // LoginStatus = "登录成功", + // }; + // this.lstShopCompany.Add(sc); + //} + + ShopCompany sc = new ShopCompany() + { + //AccountId = BaseRegex.GetStringJson(ref data, "mallId"), + AccountId = BaseRegex.GetStringJson(ref data, "username"), + AccountName = BaseRegex.GetStringJson(ref data, "mall_name"), + LoginName = shop.LoginName, + UserName = BaseClass.UserName, + LoginStatus = "登录成功", + }; + this.lstShopCompany.Add(sc); + } + } + }); + } + //if (url.Contains("_signature")) + //{ + // var re = request; + // if ((re.Headers != null && re.Headers.AllKeys.Contains("x-secsdk-csrf-token"))) + // { + // } + // Task.Run(() => + // { + // var _url = url; + // var data = responseData; + // var signature = url.Substring(url.IndexOf("_signature=") + "_signature=".Length).Split('&')[0]; + // if (shop != null) + // { + // shop.Signature = signature; + // } + // if (url.Contains("x-secsdk-csrf-token") || postData.Contains("x-secsdk-csrf-token") || data.Contains("x-secsdk-csrf-token")) + // { + // } + // }); + //} + // 库存上传按钮 + if (currentUrl.StartsWith("https://seller.kuajingmaihuo.com/goods/product/list") || + currentUrl.StartsWith("https://agentseller.temu.com/goods/list")) + { + Task.Run(() => { + string sAddInputJs = @" + document.addEventListener('wheel', function(event) { + // 检查滚动方向 + //if (event.deltaY < 0) { + // console.log('向上滚动'); + //} else { + // console.log('向下滚动'); + //} + // 或者使用 event.deltaX 来检查水平滚动 + //if (event.deltaX < 0) { + // console.log('向左滚动'); + //} else if (event.deltaX > 0) { + // console.log('向右滚动'); + //} + + // 阻止默认的滚动行为(如果有需要) + //event.preventDefault(); + + addGetProdButton(); + }); + addGetProdButton(); + + function addGetProdButton() { + var productLst = document.getElementsByClassName('product-info_idContent__iDukx'); + for(i=0; i= 0) { + var sSpuId = productLst[i].innerText.replace('\r','').replace('\n','').replace('SPU ID:', ''); + productLst[i].innerHTML = productLst[i].innerHTML.replace("">"", "">""); + } + } + }"; + cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sAddInputJs); + }); + } + } + + /// + /// 自动登录 + /// + /// + /// + /// + private void InputUserNameAndPassword(ChromiumWebBrowser webBrowser, string _account, string _password) + { + webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sGetElementWithText); + + var jsStr0 = "var clickBox1 = getElementWithText('账号登录'); clickBox1.click()"; + var response0 = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr0); + response0.Wait(1000); + Thread.Sleep(Randomx.GetId(500, 1000)); + + string jsStr1 = "function getInputItem () {var usernameId = document.getElementById('usernameId'); if (usernameId) return 'true';} getInputItem();"; + Task response1 = null; + while (response1?.Result?.Result == null || !response1.Result.Result.ParseToString().Contains("true")) + { + Thread.Sleep(250); + if (!this.Created) + return; + + response1 = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr1); + response1.Wait(5000); + + if (!this.Created) + return; + } + + webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sInputValueChange2); + + jsStr1 = "var usernameId = document.getElementById('usernameId'); " + + "changeReactInputValue(usernameId,'" + _account + "');"; + response1 = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr1); + response1.Wait(1000); + Thread.Sleep(Randomx.GetId(500, 1000)); + + string jsStr = "var passwordId = document.getElementById('passwordId'); "+ + "changeReactInputValue(passwordId,'" + _password + "');"; + var response = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr); + response.Wait(1000); + Thread.Sleep(Randomx.GetId(500, 1000)); + + jsStr = "var clickBox = getElementWithText('我已阅读并同意'); " + + "clickBox.click()"; + response = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr); + response.Wait(1000); + Thread.Sleep(Randomx.GetId(500, 1000)); + + jsStr = "var clickBox = getElementWithText('登录'); " + + "clickBox.click()"; + response = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr); + response.Wait(1000); + Thread.Sleep(Randomx.GetId(500, 1000)); + return; + //下面代码原抖音使用,废弃 + + #region 输入用js + string jsSetValue = @" +function keyboardInput(dom, st) { + var evt = new InputEvent('input', { + //var evt = new Event('input', { // cef57 + inputType: 'insertText', + data: st, + dataTransfer: null, + isComposing: false + }); + dom.value = st; + dom.dispatchEvent(evt); + dom.focus(); +};"; + + string jsInputKey = @" +function fireKeyEvent(el, evtType, keyCode) { + var evtObj; + if (document.createEvent) + { + if (window.KeyEvent) + { + //firefox 浏览器下模拟事件 + evtObj = document.createEvent('KeyEvents'); + evtObj.initKeyEvent(evtType, true, true, window, true, false, false, false, keyCode, 0); + } + else + { + //chrome 浏览器下模拟事件 + evtObj = document.createEvent('UIEvents'); + evtObj.initUIEvent(evtType, true, true, window, 1); + + delete evtObj.keyCode; + if (typeof evtObj.keyCode === 'undefined') + { + //为了模拟keycode + Object.defineProperty(evtObj, 'keyCode', { value: keyCode }); + } + else + { + evtObj.key = String.fromCharCode(keyCode); + } + + if (typeof evtObj.ctrlKey === 'undefined') + { + //为了模拟ctrl键 + Object.defineProperty(evtObj, 'ctrlKey', { value: true }); + } + else + { + evtObj.ctrlKey = true; + } + } + el.dispatchEvent(evtObj); + } + else if (document.createEventObject) + { + //IE 浏览器下模拟事件 + evtObj = document.createEventObject(); + evtObj.keyCode = keyCode + el.fireEvent('on' + evtType, evtObj); + } +}"; + #endregion + + #region 输入用户名 + jsStr = @"var txt1 = document.getElementsByName('email')[0]; txt1.focus(); txt1.click(); keyboardInput(txt1, '" + _account + "');" + + "var uname = '" + _account + "';" + + "for(var i = 0; i < uname.length; i++) {" + + " cCode = uname.charCodeAt(i);" + + " fireKeyEvent(txt1, 'keydown', cCode);" + + " fireKeyEvent(txt1, 'keypress', cCode);" + + " fireKeyEvent(txt1, 'keyup', cCode);" + + "}"; + response = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsSetValue + jsInputKey + jsStr); + response.Wait(2000); + Thread.Sleep(Randomx.GetId(400, 800)); + #endregion + + #region 输入密码 + jsStr = @"var txt2 = document.getElementsByName('password')[0]; txt2.focus(); txt2.click(); keyboardInput(txt2, '" + _password + "');" + + "var pwd = '" + _password + "';" + + "for(var i = 0; i < pwd.length; i++) {" + + " cCode = pwd.charCodeAt(i);" + + " fireKeyEvent(txt2, 'keydown', cCode);" + + " fireKeyEvent(txt2, 'keypress', cCode);" + + " fireKeyEvent(txt2, 'keyup', cCode);" + + "}"; + response = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsInputKey + jsStr); + response.Wait(2000); + Thread.Sleep(Randomx.GetId(400, 800)); + #endregion + + #region 点击登录按钮 + jsStr = "var btn = document.getElementsByClassName('account-center-action-button')[0]; btn.click(); //btn.dispatchEvent(new Event('change'));"; + response = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr); + response.Wait(2000); + Thread.Sleep(1500 + Randomx.GetId(1000)); + #endregion + + #region 获取验证码 + int getImageCount = 0; + getImageAgain: + if (!this.Created) + return; + + jsStr = "function getImg() { return document.getElementsByClassName('captcha_verify_img--wrapper')[0].innerHTML; }"; + jsStr += "getImg();"; + response = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr); + response.Wait(2000); + if (response.Result?.Result == null) + { + if (getImageCount < 50) + { + Thread.Sleep(2500); + getImageCount++; + goto getImageAgain; + } + } + if (response.Result?.Result != null) + { + var imgStr = response.Result.Result.ToString(); + var src = BaseRegex.GetMatchRegexString(ref imgStr, "src=\"([\\s\\S]*?)\""); + Bitmap bt = (Bitmap)GetHtml.LoadImage(src); + if (bt != null) + { + int Stopxt = 0; + int dragButtonWidth = 53; + //Stopxt = new Base64ChangeImgUrl().CalculateNick(bt, dragButtonWidth); + Thread.Sleep(500 + Randomx.GetId(1000)); + Stopxt = new Base64ChangeImgUrl().CalculateNickNew(bt, dragButtonWidth); + if (Stopxt > 0) + { + jsStr = "function getImgPos() { return document.getElementsByClassName('secsdk-captcha-drag-icon')[0].getBoundingClientRect().left + '|' " + + " + document.getElementsByClassName('secsdk-captcha-drag-icon')[0].getBoundingClientRect().top;} getImgPos();"; + response = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr); + response.Wait(2000); + if (response.Result?.Result != null) + { + var xy = response.Result?.Result.ToString(); + var xyArr = xy.Split('|'); + if (xyArr.Length == 2) + { + try + { + int x = (int)Convert.ToDecimal(xyArr[0]) + 25; + int y = (int)Convert.ToDecimal(xyArr[1]) + 25; + + // 自动滑块图形验证 + if (GlobalConfig.DouShopSettingParam.IsAutoDragLogin) + { + PDDShopLoginForm.CefMouseDragDou(cefWebBrowser, x, y, Convert.ToInt32((x + Stopxt * 340m / 552m) - 15), y); + for (int i = 0; i < 1; i++) + Thread.Sleep(2000 + Randomx.GetId(1000)); + response = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr); + response.Wait(2000); + if (response.Result?.Result != null && getImageCount < 50) + { + getImageCount++; + goto getImageAgain; + } + } + } + catch + { + } + } + } + for (int i = 0; i < 1; i++) + Thread.Sleep(2000 + Randomx.GetId(1000)); + } + } + } + Thread.Sleep(1500 + Randomx.GetId(1000)); + #endregion + } + + // 鼠标左键按下,移动,移动...左键抬起。 + public static void CefMouseDragDou(ChromiumWebBrowser webBrowser, int x1, int y1, int x2, int y2) + { + Thread.Sleep(100); + var host = webBrowser.GetBrowser().GetHost(); + + var rx = -6 + Randomx.GetId(13); + x2 = x2 + rx; + // 随机按下点的位置(正负6像素),提高仿真性 + int x = x1 + rx; + int y = y1 - 6 + Randomx.GetId(13); + + // 按下鼠标左键 + host.SendMouseClickEvent(x, y, MouseButtonType.Left, false, 1, CefEventFlags.None); + Thread.Sleep(100 + Randomx.GetId(300)); + + // 滑动光标 + int times = -20; + while (x < x2 + 4 - Randomx.GetId(9)) + { + times++; + x += (15 + Randomx.GetId(15)) / 8; + if (times % 5 == 0) + y = y - 1 + Randomx.GetId(3); + Thread.Sleep(6 + Math.Abs(times) / 5 + Randomx.GetId(16)); + host.SendMouseMoveEvent((int)x, (int)y, false, CefEventFlags.LeftMouseButton); + } + if (x < x2 - 1) + while (x < x2) + { + times++; + x += (8 + Randomx.GetId(8)) / 8; + if (times % 5 == 0) + y = y - 1 + Randomx.GetId(3); + Thread.Sleep(6 + Math.Abs(times) / 5 + Randomx.GetId(16)); + host.SendMouseMoveEvent((int)x, (int)y, false, CefEventFlags.LeftMouseButton); + } + else if (x > x2 + 1) + while (x > x2) + { + times++; + x -= (8 + Randomx.GetId(8)) / 8; + if (times % 5 == 0) + y = y - 1 + Randomx.GetId(3); + Thread.Sleep(6 + Math.Abs(times) / 5 + Randomx.GetId(16)); + host.SendMouseMoveEvent((int)x, (int)y, false, CefEventFlags.LeftMouseButton); + } + + // 如果最后位置偏差较多,再做一次调整 + x = x2 - 1 + Randomx.GetId(3); + x = x2; + Thread.Sleep(18 + Math.Abs(times) / 5 + Randomx.GetId(16)); + Thread.Sleep(18 + Math.Abs(times) / 5 + Randomx.GetId(16)); + host.SendMouseMoveEvent((int)x, (int)y, false, CefEventFlags.LeftMouseButton); + + // 抬起鼠标左键 + Thread.Sleep(300 + Randomx.GetId(500)); + host.SendMouseClickEvent(x, y, MouseButtonType.Left, true, 1, CefEventFlags.None); + host.SendMouseClickEvent(x, y, MouseButtonType.Left, true, 1, CefEventFlags.None); + } + + private void btnStop_Click(object sender, EventArgs e) + { + + } + + private void btnCopyUserName_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(txtUserName.Text)) + Clipboard.SetDataObject(txtUserName.Text); + } + + private void btnCopyPassword_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(txtPassWord.Text)) + Clipboard.SetDataObject(txtPassWord.Text); + } + + private void btnReload_Click(object sender, EventArgs e) + { + if (cefWebBrowser != null) + { + if (txtAddress.Text != "about:blank") + cefWebBrowser.Load(txtAddress.Text); + else + cefWebBrowser.Load(shopMainUrl); + } + } + + private void ShopLoginForm_FormClosed(object sender, FormClosedEventArgs e) + { + //OnSaveComplete(shop); + } + + private void txtAddress_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + if (cefWebBrowser != null) + { + cefWebBrowser.Load(txtAddress.Text); + } + } + } + + private void btnMultiLogin_Click(object sender, EventArgs e) + { + MultiLoginCookieName = cmbMultiCookieName.Text; + AutoLogin(); + } + + private void btnDel_Click(object sender, EventArgs e) + { + if (shop != null) + { + shop.DictMultiCookies.Remove(cmbMultiCookieName.Text); + StartUp.SaveLocalShopLoginInfo(); + + InitMultiLoginCookies(); + } + } + + private void InitMultiLoginCookies() + { + this.cmbMultiCookieName.Items.Clear(); + foreach (var cookieKey in shop.DictMultiCookies.Keys) + { + this.cmbMultiCookieName.Items.Add(cookieKey); + } + int i = 1; + foreach (var item in this.cmbMultiCookieName.Items) + { + if (i <= item.ToString().Replace("cookie", "").ParseToInt()) + { + i = item.ToString().Replace("cookie", "").ParseToInt() + 1; + } + } + this.cmbMultiCookieName.Items.Insert(0, "cookie" + i); + this.cmbMultiCookieName.Text = "cookie" + i; + } + + + string sInputValueChange = @" +let usernameId = document.getElementById('usernameId'); +usernameId.value = '1'; + +var event = document.createEvent('HTMLEvents'); +event.initEvent('input', true, true); +event.eventType = 'message'; +usernameId.dispatchEvent(event); +"; + + string sInputValueChange2 = @" +function changeReactInputValue(inputDom,newText){ + let lastValue = inputDom.value; + inputDom.value = newText; + let event = new Event('input', { bubbles: true }); + event.simulated = true; + let tracker = inputDom._valueTracker; + if (tracker) { + tracker.setValue(lastValue); + } + inputDom.dispatchEvent(event); +} +"; + + string sGetElementWithText = @" +function getElementWithText(sText) +{ + var elem=null; + const elements = document.querySelectorAll('*'); // 选择所有元素 + elements.forEach(element => { + if (element.textContent.includes(sText)) { + // 对每个匹配的元素执行操作 + //console.log(element); + elem=element; + } + }); + return elem; +}; +"; + + private void btnLoginAgain_Click(object sender, EventArgs e) + { + if (this.currentUrl != shopLoginUrl) + this.cefWebBrowser.Load(shopLoginUrl); + + + Task.Run(() => + { + InputUserNameAndPassword(cefWebBrowser, shop.LoginName, DataOpenSSL.DecryptString(shop.Password)); + }); + } + } +} diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.resx b/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.resx new file mode 100644 index 0000000..c963c3c --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.resx @@ -0,0 +1,298 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAgIAQYAAAAABoKAAAFgAAACgAAACAAAAAAAEAAAEABAAAAAAAACgAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP// + AAD///8AAAAAAAAAAAAAAAAABEZmbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMZmZkQAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAZszMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMxmAAAAAAAAAAAAAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMZAAAAAAAAAAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMxkAAAAAAAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMzMzMzMzGQAAAAAAAAAAAAAAAAAAAbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMYAAAAAAAAAAAAAAAAARszMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMZAAAAAAAAAAAAAAABszMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAAAAAGzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAAAAbMzMzMzMzMzMzMzMzM + zMzMzMzMzMx3d4iIiIiIiIh3fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAABszMzMzMzMzMzM + zMzMzMzMzMzHeIiIiIj/////////iIiIiId8zMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAGzMzMzMzM + zMzMzMzMzMzMzMeIiI/////////////////////4iIh8zMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAATMzM + zMzMzMzMzMzMzMzMzHiI////////////////////////////iIfMzMzMzMzMzMzMzMzMzMzMxAAAAAAA + AGzMzMzMzMzMzMzMzMzMx3iP///////////////////////////////4iHzMzMzMzMzMzMzMzMzMzMYA + AAAAAAbMzMzMzMzMzMzMzMzMx3iP//////////////////////////////////+IfMzMzMzMzMzMzMzM + zMzMYAAAAABMzMzMzMzMzMzMzMzMx3iP/////////////////////////////////////4h8zMzMzMzM + zMzMzMzMzMQAAAAAbMzMzMzMzMzMzMzMzHiP////////////////////////////////////////h3zM + zMzMzMzMzMzMzMzGAAAABMzMzMzMzMzMzMzMzHiP//////////////////////////////////////// + //iHzMzMzMzMzMzMzMzMzEAAAAbMzMzMzMzMzMzMzMeI//////////////////////////////////// + ////////+IfMzMzMzMzMzMzMzMxgAABMzMzMzMzMzMzMzMx4//////////////////////////////// + //////////////+IfMzMzMzMzMzMzMzMxAAAbMzMzMzMzMzMzMzHj/////////////////////////// + /////////////////////4fMzMzMzMzMzMzMzMYAAMzMzMzMzMzMzMzMeP////////////////////// + ///////////////////////////4fMzMzMzMzMzMzMzMAAbMzMzMzMzMzMzMx4////////////////// + /////////////////////////////////4fMzMzMzMzMzMzMzGAGzMzMzMzMzMzMzHj///////////// + ///////////////////////////////////////4fMzMzMzMzMzMzMxgDMzMzMzMzMzMzMyI//////// + /////////////////////////////////////////////4zMzMzMzMzMzMzMwEzMzMzMzMzMzMzHj/// + //////////////////////////////////////////////////+HzMzMzMzMzMzMzMRszMzMzMzMzMzM + eP//////////////////////////////////////////////////////+HzMzMzMzMzMzMzGbMzMzMzM + zMzMzHj///////////////////////////////////////////////////////+MzMzMzMzMzMzMxmzM + zMzMzMzMzMyP////+IiP////////////////////////////////////////+I//////h8zMzMzMzMzM + zMZszMzMzMzMzMzHj////4iIiI//////////////////////////////////////+IiIj/////jMzMzM + zMzMzMzGbMzMzMzMzMzMyP////iIiIiI/////////////////////////////////////4iIiIj////4 + fMzMzMzMzMzMxszMzMzMzMzMzHj////4iIiIiP////////////////////////////////////+IiIiI + j////4zMzMzMzMzMzMbMzMzMzMzMzMx4////iIiIiIj////////////////////////////////////4 + iIiIiI////+HzMzMzMzMzMzMzMzMzMzMzMzMj////4iIiIiI//////////////+IiP//iI////////// + ////+IiIiIiP////h8zMzMzMzMzMzMzMzMzMzMzMzI/////4iIiIiP/////////////4d3eIiIeIj/// + //////////+IiIiIj/////jMzMzMzMzMzMzMzMzMzMzMzMyP////+IiIiIj/////////////iIiId3eI + iI//////////////iIiIiI/////4zMzMzMzMzMzMzMzMzMzMzMzHj/////+IiIiP/////////////4// + /4d4j/+P//////////////iIiIj/////+MzMzMzMzMzMzMzMzMzMzMzMx4//////+IiP//////////// + ///////4j///////////////////iIiP//////jMzMzMzMzMzMzMzMzMzMzMzMeP//////////+IiIj/ + ///////////////////////////////////////////4fMzMzMzMzMzMzMzMzMzMzMzH//////////+H + fMx8eP//////////////////////////iId3iP//////////+HzMzMzMzMzMzMzMzMzMzMzMyP////// + ///4fMzHh8eP////////////////////////+MzMzMd4//////////h8zMzMzMzMzMzMzMzMzMzMzMf/ + ////////+MzMePjMeP///////////////////////4zMzMeHx4/////////4fMzMzMzMzMzMzMzMzMzM + zMzH/////////4fMd3eHzMeP//////////////////////iMzMzIiHx4////////+HzMzMzMzMzMzMzM + zMzMzMzMx/////////+Hx4iIfMzMj//////////////////////4h3d8x4h8yP////////jMzMzMzMzM + zMzMzMzMzMzMzMeP////////+HiP+IfMzI//////////////////////+HiIiHd3zHj////////4zMzM + zMzMzMzMzMzMzMzMzMzHj/////////h4//+HzMeP//////////////////////h4//h8zMyP//////// + +MzMzMzMzMzMzMzMzMzMzMzMzI/////////4iP//h8x4///////////////////////4j//4fMzHj/// + //////jMzMzMzMzMzMzMzMzMzMzMzMyP///////4iIiP+IfHj///////////////////////+Ij/+HzM + eP/////////4zMzMzMzMzMzMzMzMzMzMzMzMj///////iIiIiIh3eP////////////////////////+I + j4h8x3iI////////h8zMzMzMzMzMzMzMzMzMzMzMzH//////+Hj///iIiI////////////////////// + /////4iId4iIiIj//////4zMzMzMzMzMzMzMzMzMzMzMzMx4//////iP////iP////////////////// + /////////////4iP//iI//////+MzMzMzMzMzMzMzMzMzMzMzMzMyP//////////+I////////////// + ///////////////////4eP//iP//////jMzMzMzMzMzMzMzMzMzMzMzMzMj///////////iP//////// + /////////////////////////4j/////////+HzMzMzMzMzMzMzMzMzMzMzMzMzHj/////////////// + //////////////////////////////+I//////////jMzMzMzMzMzMzMzMzMzMzMzMzMzI////////// + //////////////////////////////////////////////+HzMzMzMzMzMzMzMzMzMzMzMzMzMyP//// + ////////////////////////////////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzM + eP///////////////////////////////////////////////////////4zMzMzMzMzMzMzMzMzMzMzM + zMzMzMj///////////////////////////////////////////////////////h8zMzMzMzMzMzMzMzM + zMzMzMzMzMzHj//////////////////////////////////////////////////////4zMzMzMzMzMzM + zMzMzMzMzMzMzMzMzI//////////////////////////////////////////////////////h8zMzMzM + zMzMzMzMzMzMzMzMzMzMzMx4////////////////////////////////////////////////////+HzM + zMzMzMzMzMzMzMzMzMzMzMzMzMzMyI////+I//////////////////////////////////////////// + //h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP////+Ij///////////////////////////////////// + //////+HzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP////+IiIiIj//////////////////////////4 + ////iI/////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMiP/////4iIiP////////////////////// + ////+IiIiIj/////iHzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiP////////////////////////// + ///////////4iIj//////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiP//////////////////// + //////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiP////////////// + //////////////////////////////+HzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHj///////// + ///////////////////////////////////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP//// + ////////////////////////////////////////+MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzI + j/////////////////////////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMeP//////////////////////////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMx4////////+I//////////////////////////////////////jMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMeP///////4iIj///////////////////////////iP///////4fMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMzMx4////////iIiIiP///////////////////////4iIiP///////4zMzMzMzMzM + zMzMzMzMzMzMzMzMzMzMzMzMj///////+IiIiIiI////////////////////+IiIiIj///////+HzMzM + zMzMzMzMzMzMzMzMzMzMzMzMzMzMx4////////iIiIiIj////////////////////4iIiIiIj/////// + +MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMj///////+IiIiIiI////////////////////+IiIiIiI// + //////h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMx4////////iIiIiIiP////////////////////iIiI + iIiI///////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMj///////+IiIiIiIj/////iIiIiIiIj///// + /4iIiIiIiP///////4zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMx4////////iIiIiIiI/////4zMzMzMzM + j/////+IiIiIiIiP//////+HzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP//////+IiIiIiIj/////+MzM + zMzMzI//////+IiIiIiIj///////+MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzI////////iIiIiIiI//// + //jMzMzMzMyP//////iIiIiIiIj///////jMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP///////4iIiIiI + iP/////4zMzMzMzMj//////4iIiIiIiI///////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzI////////iI + iIiIiI//////+MzMzMzMzI//////+IiIiIiIiP///////4zMzMzMzMzMzMzMzMzMzMzMzMzMzMyP//// + ///4iIiIiIiP//////fMzMzMzMyP//////+IiIiIiIj///////+MzMzMzMzMzMzMzMzMzMzMzMzMzMzH + j///////+IiIiIiI//////+HzMzMzMzMeP//////iIiIiIiIj///////jMzMzMzMzMzMzMzMzMzMzMzM + zMzMyP////////iIiIiIiP//////jMzMzMzMzHj///////iIiIiIiI///////4fMzMzMzMzMzMzMzMzM + zMzMzMzMzMj///////+IiIiIiI///////4zMzMzMzMzI///////4iIiIiIiI///////3zMzMzMzMzMzM + zMzMzMzMzMzMzMzI////////iIiIiIiP//////+MzMzMzMzMyP//////+IiIiIiIiP//////+MzMzMzM + zMzMzMzMzMzMzMzMzMzMeP///////4iIiIiIj///////jMzMzMzMzMj///////+IiIiIiIj///////jM + zMzMzMzMzMzMzMzMzMzMzMzMzI////////+IiIiIiP//////+HzMzMzMzMzHj///////iIiIiIiI//// + ///4zMzMzMzMzMzMzMzMzMzMzMzMzMyP////////iIiIiI////////jMzMzMzMzMzI///////4iIiIiI + iI//////+MzMzMzMzMzMzMzMzMzMzMzMzMzMj////////4iIiIiP///////4zMzMzMzMzMyP///////4 + iIiIiIiP//////jMzMzMzMzMzMzMzMzMzMzMzMzMzI////////+IiIiI////////h8zMzMzMzMzMeP// + /////4iIiIiIj//////4fMzMzMzMzMzMzMzMzMzMzMzMzMyP////////iIiIj////////4fMzMzMzMzM + zHj///////+IiIiIiI//////+HzMzMzMzMzMzMzMzMzMzMzMzMzHj/////////iIiP////////+MzMzM + zMzMzMzI////////+IiIiIiP//////h8zMzMzMzMzMzMxmzMzMzMzMzMx4/////////4iP/////////4 + fMzMzMzMzMzMx4////////+IiIiIj//////4fMzMzMzMzMzMzMZszMzMzMzMzMeP//////////////// + ////+MzMzMzMzMzMzMyP////////iIiIiP//////+HzMzMzMzMzMzMzGbMzMzMzMzMzH//////////// + //////////fMzMzMzMzMzMzMeP////////iIiIj///////98zMzMzMzMzMzMxmzMzMzMzMzMyP////// + //////////////+HzMzMzMzMzMzMzHj/////////+IiP////////jMzMzMzMzMzMzMZszMzMzMzMzMj/ + ////////////////////jMzMzMzMzMzMzMzIj////////////////////4zMzMzMzMzMzMzGTMzMzMzM + zMzH////////////////////+HzMzMzMzMzMzMzMx4////////////////////+MzMzMzMzMzMzMxAzM + zMzMzMzMx/////////////////////jMzMzMzMzMzMzMzMyI///////////////////4fMzMzMzMzMzM + zMAGzMzMzMzMzMeP//////////////////+HzMzMzMzMzMzMzMzMeP//////////////////+HzMzMzM + zMzMzMxgBszMzMzMzMzHj//////////////////4fMzMzMzMzMzMzMzMzMeP//////////////////h8 + zMzMzMzMzMzMYADMzMzMzMzMzI//////////////////+HzMzMzMzMzMzMzMzMzHj/////////////// + ///4zMzMzMzMzMzMzAAAbMzMzMzMzMyP/////////////////4fMzMzMzMzMzMzMzMzMzHj///////// + ////////+MzMzMzMzMzMzMYAAEzMzMzMzMzMj/////////////////+MzMzMzMzMzMzMzMzMzMzIj/// + /////////////4fMzMzMzMzMzMzEAAAGzMzMzMzMzHj////////////////4fMzMzMzMzMzMzMzMzMzM + x4////////////////+MzMzMzMzMzMzMYAAABMzMzMzMzMx4////////////////h8zMzMzMzMzMzMzM + zMzMzMx4///////////////4fMzMzMzMzMzMzEAAAABszMzMzMzMx4//////////////+HzMzMzMzMzM + zMzMzMzMzMzMx4//////////////+MzMzMzMzMzMzMYAAAAATMzMzMzMzMyP/////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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAA + AAGAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAA + AAAAAAABgAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAAAAAADwAAAAAAA + AAAAAAAAAAAAA+AAAAAAAAAAAAAAAAAAAAfgAAAAAAAAAAAAAAAAAAAH8AAAAAAAAAAAAAAAAAAAD/AA + AAAAAAAAAAAAAAAAAA/4AAAAAAAAAAAAAAAAAAAf+AAAAAAAAAAAAAAAAAAAH/wAAAAAAAAAAAAAAAAA + AD/+AAAAAAAAAAAAAAAAAAB//gAAAAAAAAAAAAAAAAAAf/8AAAAAAAAAAAAAAAAAAP//gAAAAAAAAAAA + AAAAAAH//8AAAAAAAAAAAAAAAAAD///gAAAAAAAAAAAAAAAAB///8AAAAAAAAAAAAAAAAA////wAAAAA + AAAAAAAAAAA////+AAAAAAAAAAAAAAAAf////4AAAAAAAAAAAAAAAf/////gAAAAAAAAAAAAAAf///// + +AAAAAAAAAAAAAAf//////8AAAAAAAAAAAAA/////////gAAAAAAAAAAf////w== + + + \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopUpdateCookieForm.Designer.cs b/TEMUKJD/PDDForms/ShopForms/PDDShopUpdateCookieForm.Designer.cs new file mode 100644 index 0000000..24fd240 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopUpdateCookieForm.Designer.cs @@ -0,0 +1,321 @@ +namespace TemuKJD.PDDForms.ShopForms +{ + partial class PDDShopUpdateCookieForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDDShopUpdateCookieForm)); + this.panel2 = new System.Windows.Forms.Panel(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.label4 = new System.Windows.Forms.Label(); + this.txtCookieJs1 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.label3 = new System.Windows.Forms.Label(); + this.txtSubPassId = new System.Windows.Forms.TextBox(); + this.txtLoginName = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.txtSellerTemp = new System.Windows.Forms.TextBox(); + this.radioButton2 = new System.Windows.Forms.RadioButton(); + this.radioButton1 = new System.Windows.Forms.RadioButton(); + this.buttonEx1 = new TemuKJD.UserControls.ButtonEx(); + this.label8 = new System.Windows.Forms.Label(); + this.txtCookieJs2 = new DevComponents.DotNetBar.Controls.TextBoxX(); + this.btnOk = new TemuKJD.UserControls.ButtonEx(); + this.panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.SuspendLayout(); + // + // panel2 + // + this.panel2.BackColor = System.Drawing.Color.White; + this.panel2.Controls.Add(this.splitContainer1); + 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(698, 373); + this.panel2.TabIndex = 1; + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + 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.label4); + this.splitContainer1.Panel1.Controls.Add(this.txtCookieJs1); + this.splitContainer1.Panel1.Controls.Add(this.label3); + this.splitContainer1.Panel1.Controls.Add(this.txtSubPassId); + this.splitContainer1.Panel1.Controls.Add(this.txtLoginName); + this.splitContainer1.Panel1.Controls.Add(this.label1); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.btnOk); + this.splitContainer1.Panel2.Controls.Add(this.label2); + this.splitContainer1.Panel2.Controls.Add(this.txtSellerTemp); + this.splitContainer1.Panel2.Controls.Add(this.radioButton2); + this.splitContainer1.Panel2.Controls.Add(this.radioButton1); + this.splitContainer1.Panel2.Controls.Add(this.buttonEx1); + this.splitContainer1.Panel2.Controls.Add(this.label8); + this.splitContainer1.Panel2.Controls.Add(this.txtCookieJs2); + this.splitContainer1.Size = new System.Drawing.Size(698, 373); + this.splitContainer1.SplitterDistance = 319; + this.splitContainer1.TabIndex = 394; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(40, 103); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(60, 34); + this.label4.TabIndex = 399; + this.label4.Text = " 国内版\r\nCookieJs"; + // + // txtCookieJs1 + // + this.txtCookieJs1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + // + // + // + this.txtCookieJs1.Border.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtCookieJs1.Border.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtCookieJs1.Border.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtCookieJs1.Border.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtCookieJs1.Border.Class = "CrumbBarBackgroundKey"; + this.txtCookieJs1.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.txtCookieJs1.Border.PaddingBottom = 2; + this.txtCookieJs1.Border.PaddingLeft = 2; + this.txtCookieJs1.Border.PaddingRight = 2; + this.txtCookieJs1.Border.PaddingTop = 2; + this.txtCookieJs1.Location = new System.Drawing.Point(100, 101); + this.txtCookieJs1.Multiline = true; + this.txtCookieJs1.Name = "txtCookieJs1"; + this.txtCookieJs1.Size = new System.Drawing.Size(569, 198); + this.txtCookieJs1.TabIndex = 398; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(16, 72); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(84, 17); + this.label3.TabIndex = 397; + this.label3.Text = "SUB_PASS_ID"; + // + // txtSubPassId + // + this.txtSubPassId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtSubPassId.Location = new System.Drawing.Point(100, 69); + this.txtSubPassId.Name = "txtSubPassId"; + this.txtSubPassId.Size = new System.Drawing.Size(569, 23); + this.txtSubPassId.TabIndex = 396; + // + // txtLoginName + // + this.txtLoginName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtLoginName.Location = new System.Drawing.Point(100, 15); + this.txtLoginName.Name = "txtLoginName"; + this.txtLoginName.Size = new System.Drawing.Size(569, 23); + this.txtLoginName.TabIndex = 395; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(44, 18); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(56, 17); + this.label1.TabIndex = 394; + this.label1.Text = "登录账号"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(26, 18); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(74, 17); + this.label2.TabIndex = 399; + this.label2.Text = "seller_temp"; + this.label2.Visible = false; + // + // txtSellerTemp + // + this.txtSellerTemp.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtSellerTemp.Location = new System.Drawing.Point(100, 15); + this.txtSellerTemp.Name = "txtSellerTemp"; + this.txtSellerTemp.Size = new System.Drawing.Size(569, 23); + this.txtSellerTemp.TabIndex = 398; + this.txtSellerTemp.Visible = false; + // + // radioButton2 + // + this.radioButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.radioButton2.AutoSize = true; + this.radioButton2.Location = new System.Drawing.Point(354, 5); + this.radioButton2.Name = "radioButton2"; + this.radioButton2.Size = new System.Drawing.Size(62, 21); + this.radioButton2.TabIndex = 397; + this.radioButton2.TabStop = true; + this.radioButton2.Text = "国际版"; + this.radioButton2.UseVisualStyleBackColor = true; + this.radioButton2.Visible = false; + // + // radioButton1 + // + this.radioButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.radioButton1.AutoSize = true; + this.radioButton1.Location = new System.Drawing.Point(286, 5); + this.radioButton1.Name = "radioButton1"; + this.radioButton1.Size = new System.Drawing.Size(62, 21); + this.radioButton1.TabIndex = 396; + this.radioButton1.TabStop = true; + this.radioButton1.Text = "国内版"; + this.radioButton1.UseVisualStyleBackColor = true; + this.radioButton1.Visible = false; + // + // buttonEx1 + // + this.buttonEx1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonEx1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.buttonEx1.Cursor = System.Windows.Forms.Cursors.Hand; + this.buttonEx1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonEx1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.buttonEx1.ForeColor = System.Drawing.Color.White; + this.buttonEx1.Location = new System.Drawing.Point(100, 0); + this.buttonEx1.Margin = new System.Windows.Forms.Padding(2); + this.buttonEx1.Name = "buttonEx1"; + this.buttonEx1.Size = new System.Drawing.Size(171, 26); + this.buttonEx1.TabIndex = 395; + this.buttonEx1.Text = "去Temu首页获取cookie js"; + this.buttonEx1.UseVisualStyleBackColor = false; + this.buttonEx1.Visible = false; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(40, 50); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(60, 34); + this.label8.TabIndex = 394; + this.label8.Text = " 国际版\r\nCookieJs"; + this.label8.Visible = false; + // + // txtCookieJs2 + // + this.txtCookieJs2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + // + // + // + this.txtCookieJs2.Border.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtCookieJs2.Border.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtCookieJs2.Border.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtCookieJs2.Border.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.txtCookieJs2.Border.Class = "CrumbBarBackgroundKey"; + this.txtCookieJs2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.txtCookieJs2.Border.PaddingBottom = 2; + this.txtCookieJs2.Border.PaddingLeft = 2; + this.txtCookieJs2.Border.PaddingRight = 2; + this.txtCookieJs2.Border.PaddingTop = 2; + this.txtCookieJs2.Location = new System.Drawing.Point(100, 47); + this.txtCookieJs2.Multiline = true; + this.txtCookieJs2.Name = "txtCookieJs2"; + this.txtCookieJs2.Size = new System.Drawing.Size(569, 0); + this.txtCookieJs2.TabIndex = 393; + this.txtCookieJs2.Visible = false; + // + // btnOk + // + this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOk.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnOk.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnOk.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnOk.ForeColor = System.Drawing.Color.White; + this.btnOk.Location = new System.Drawing.Point(614, 0); + 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 = 392; + this.btnOk.Text = "保存"; + this.btnOk.UseVisualStyleBackColor = false; + this.btnOk.Click += new System.EventHandler(this.btnOk_Click); + // + // ShopUpdateCookieForm + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.ClientSize = new System.Drawing.Size(700, 407); + this.Controls.Add(this.panel2); + this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "ShopUpdateCookieForm"; + this.Text = "更新Cookie"; + this.TitleText = "更新Cookie"; + this.Load += new System.EventHandler(this.ShopUpdateCookieForm_Load); + this.Controls.SetChildIndex(this.panel2, 0); + this.panel2.ResumeLayout(false); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel1.PerformLayout(); + this.splitContainer1.Panel2.ResumeLayout(false); + this.splitContainer1.Panel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.SplitContainer splitContainer1; + private DevComponents.DotNetBar.Controls.TextBoxX txtCookieJs1; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox txtSubPassId; + private System.Windows.Forms.TextBox txtLoginName; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txtSellerTemp; + private System.Windows.Forms.RadioButton radioButton2; + private System.Windows.Forms.RadioButton radioButton1; + private UserControls.ButtonEx buttonEx1; + private System.Windows.Forms.Label label8; + private DevComponents.DotNetBar.Controls.TextBoxX txtCookieJs2; + private UserControls.ButtonEx btnOk; + private System.Windows.Forms.Label label4; + } +} \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopUpdateCookieForm.cs b/TEMUKJD/PDDForms/ShopForms/PDDShopUpdateCookieForm.cs new file mode 100644 index 0000000..0437545 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopUpdateCookieForm.cs @@ -0,0 +1,338 @@ +using AllBase.Helper; +using AllBase.Model.Result; +using TemuKJD.KJDForms.BaseForms; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using AllBase; +using NaiBa.Util.Extension; +using Newtonsoft.Json.Linq; +using Work; +using TemuKJD.BLL; + +namespace TemuKJD.PDDForms.ShopForms +{ + public enum SetCookieFromEnum + { + normal_user, + sa, + } + public partial class PDDShopUpdateCookieForm : LRBaseForm + { + ShopLoginInfo shopLoginInfo = null; + SetCookieFromEnum updateFrom; + string cookieVersion = ""; + + public PDDShopUpdateCookieForm(ShopLoginInfo shop = null, SetCookieFromEnum from = SetCookieFromEnum.normal_user, string _cookieVersion="国内版") + { + InitializeComponent(); + shopLoginInfo = shop; + updateFrom = from; + cookieVersion = _cookieVersion; + this.TitleText = "更新Cookie"; + if (cookieVersion == "国内版") + this.radioButton1.Checked = true; + else + this.radioButton2.Checked = true; + } + + private void ShopUpdateCookieForm_Load(object sender, EventArgs e) + { + if (shopLoginInfo != null) + txtLoginName.Text = shopLoginInfo.LoginName + " " + shopLoginInfo.ShopAccount + " " + shopLoginInfo.Notes; + } + + /* + localStorage.clear(); + sessionStorage.clear(); + var cookieDate = new Date(2037, 01, 01); + var cookieDateEnd = new Date(2000, 01, 01); + document.cookie = "SUB_PASS_ID=; path='/'; expires=" + cookieDateEnd.toUTCString(); + document.cookie = "_nano_fp=; path='/'; expires=" + cookieDateEnd.toUTCString(); + document.cookie = "api_uid=; path='/'; domain=.kuajingmaihuo.com; expires=" + cookieDateEnd.toUTCString(); + document.cookie = "_bee=; path='/'; domain=.kuajingmaihuo.com; expires=" + cookieDateEnd.toUTCString(); + document.cookie = "ru2k=; path='/'; domain=.kuajingmaihuo.com; expires=" + cookieDateEnd.toUTCString(); + document.cookie = "_f77=; path='/'; domain=.kuajingmaihuo.com; expires=" + cookieDateEnd.toUTCString(); + document.cookie = "_a42=; path='/'; domain=.kuajingmaihuo.com; expires=" + cookieDateEnd.toUTCString(); + document.cookie = "rckk=; path='/'; domain=.kuajingmaihuo.com; expires=" + cookieDateEnd.toUTCString(); + document.cookie = "ru1k=; path='/'; domain=.kuajingmaihuo.com; expires=" + cookieDateEnd.toUTCString(); + document.cookie = "api_uid=CmP1wGhwa64RUwBSBILCAg==; path='/'; expires=" + cookieDate.toUTCString(); + document.cookie = "_nano_fp=XpmyX5gbl09jlpdoXo_mijphq7nL0UmRaA77jyt3; domain=.kuajingmaihuo.com; path='/'; expires=" + cookieDate.toUTCString(); + document.cookie = "_bee=NkjhfozSFfDuGSJ2zBlOqjOh3KVvJam3; path='/'; expires=" + cookieDate.toUTCString(); + document.cookie = "_f77=2f854ce8-8d0f-4a78-84a1-04e19842a1cb; path='/'; expires=" + cookieDate.toUTCString(); + document.cookie = "_a42=1e97ae4a-c357-4c22-a53f-db43655371e3; path='/'; expires=" + cookieDate.toUTCString(); + document.cookie = "rckk=NkjhfozSFfDuGSJ2zBlOqjOh3KVvJam3; path='/'; expires=" + cookieDate.toUTCString(); + document.cookie = "ru1k=2f854ce8-8d0f-4a78-84a1-04e19842a1cb; path='/'; expires=" + cookieDate.toUTCString(); + document.cookie = "ru2k=1e97ae4a-c357-4c22-a53f-db43655371e3; path='/'; expires=" + cookieDate.toUTCString(); + document.cookie = "SUB_PASS_ID=eyJ0IjoiRDZZY1F2N2JjMnZNK1E0eEZjTm1GVmxsN20yN3N3Ymg2dnVjdmxiclZPQW5uRkJlendUOUtKTHRoWHJyZWlNUCIsInYiOjEsInMiOjEwMDAwLCJ1IjoyMzAxMjcwOTkwNDI5OH0=; domain=.kuajingmaihuo.com; path='/'; expires=" + cookieDate.toUTCString(); + location.reload(); + window.location.href = 'https://seller.kuajingmaihuo.com/goods/product/list'; + */ + + private void btnOk_Click(object sender, EventArgs e) + { + if (shopLoginInfo == null) + { + BaseMsgForm.ShowError("店铺为空!"); + return; + } + + cookieVersion = this.radioButton1.Checked ? "国内版" : "国际版"; + bool ok1 = false; + bool ok2 = false; + if (this.txtCookieJs1.Text.Contains("SUB_PASS_ID") || !string.IsNullOrWhiteSpace(txtSubPassId.Text)) + { + ok1 = GetCookie1(); + } + if (this.txtCookieJs2.Text.Contains("seller_temp") || !string.IsNullOrWhiteSpace(txtSellerTemp.Text)) // 国际版 + { + ok2 = GetCookie2(); + } + + if (ok1 || ok2) + { + this.OnSaveComplete(shopLoginInfo); + this.Close(); + } + } + + bool GetCookie1() + { + string txt = this.txtCookieJs1.Text; + txt = txt.Replace("SUB_PASS_ID=;", "").Replace("_nano_fp=;", "").Replace("api_uid=;", "") + .Replace("_bee=;", "").Replace("ru2k=;", "").Replace("_f77=;", "") + .Replace("_a42=;", "").Replace("rckk=;", "").Replace("ru1k=;", ""); + + string api_uid = BaseRegex.GetStringCookie(ref txt, "api_uid").ParseToString().Trim('\''); + string _nano_fp = BaseRegex.GetStringCookie(ref txt, "_nano_fp").ParseToString().Trim('\''); + string _bee = BaseRegex.GetStringCookie(ref txt, "_bee").ParseToString().Trim('\''); + string _f77 = BaseRegex.GetStringCookie(ref txt, "_f77").ParseToString().Trim('\''); + string _a42 = BaseRegex.GetStringCookie(ref txt, "_a42").ParseToString().Trim('\''); + string rckk = BaseRegex.GetStringCookie(ref txt, "rckk").ParseToString().Trim('\''); + string ru1k = BaseRegex.GetStringCookie(ref txt, "ru1k").ParseToString().Trim('\''); + string ru2k = BaseRegex.GetStringCookie(ref txt, "ru2k").ParseToString().Trim('\''); + string SUB_PASS_ID = BaseRegex.GetStringCookie(ref txt, "SUB_PASS_ID").ParseToString().Trim('\''); + if (!string.IsNullOrWhiteSpace(this.txtSubPassId.Text)) + SUB_PASS_ID = this.txtSubPassId.Text.Trim(); + string cookie = "api_uid=" + api_uid + ";" + + "_nano_fp=" + _nano_fp + ";" + + "_bee=" + _bee + ";" + + "_f77=" + _f77 + ";" + + "_a42=" + _a42 + ";" + + "rckk=" + rckk + ";" + + "ru1k=" + ru1k + ";" + + "ru2k=" + ru2k + ";" + + "SUB_PASS_ID=" + SUB_PASS_ID + ";"; + + if (string.IsNullOrEmpty(SUB_PASS_ID)) + { + BaseMsgForm.ShowError("Cookie缺少关键字段,请检查!"); + return false; + } + + var cookieShop = new ShopLoginInfo(); + cookieShop.Cookies = cookie; + + var data = ""; + + data = PDDShopListForm.GetShopStatus(cookieShop); + if (!data.Contains("\"success\":true")) + { + BaseMsgForm.ShowError("cookie已失效!"); + return false; + } + + var maskMobile = BaseRegex.GetStringJson(ref data, "maskOwnerMobile"); + if (!shopLoginInfo.LoginName.EndsWith(maskMobile)) + { + BaseMsgForm.ShowError("cookie与国内版店铺不匹配,请核对店铺!"); + return false; + } + + List serverShopLst = new List(); + var rst = ShopBLL.AdminGetServerShopLstForSetCookie(shopLoginInfo, serverShopLst); + + if (rst != "success") + { + BaseMsgForm.ShowError(rst); + return false; + } + + //如果店铺没有cookie登录过,处理店铺第一次登录(分裂cookie下的所有店铺) + GetShopFirstLogin(data, serverShopLst); + + if (updateFrom == SetCookieFromEnum.normal_user) // 普通用户更新本地店铺 + { + var localShop = GlobalConfig.ShopLoginList.Where(v => v.LoginName == shopLoginInfo.LoginName).ToList(); + foreach (var sc in localShop) + { + sc.Cookies = cookie; + sc.LoginStatus = "登录成功"; + } + } + shopLoginInfo.Cookies = cookie; + shopLoginInfo.LoginStatus = "登录成功"; + PDDShopListForm.UpdateServerShopCookies(shopLoginInfo); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie + return true; + } + + bool GetCookie2() + { + string txt = this.txtCookieJs2.Text; + txt = txt.Replace("_bee=;", "").Replace("_nano_fp=;", "").Replace("api_uid=;", "") + .Replace("dilx=;", "").Replace("hfsc=;", "").Replace("mallid=;", "") + .Replace("njrpl=;", "").Replace("seller_temp=;", ""); + + string api_uid = BaseRegex.GetStringCookie(ref txt, "api_uid").ParseToString().Trim('\''); + string _nano_fp = BaseRegex.GetStringCookie(ref txt, "_nano_fp").ParseToString().Trim('\''); + string _bee = BaseRegex.GetStringCookie(ref txt, "_bee").ParseToString().Trim('\''); + string dilx = BaseRegex.GetStringCookie(ref txt, "dilx").ParseToString().Trim('\''); + string hfsc = BaseRegex.GetStringCookie(ref txt, "hfsc").ParseToString().Trim('\''); + string mallid = BaseRegex.GetStringCookie(ref txt, "mallid").ParseToString().Trim('\''); + string njrpl = BaseRegex.GetStringCookie(ref txt, "njrpl").ParseToString().Trim('\''); + string seller_temp = BaseRegex.GetStringCookie(ref txt, "seller_temp").ParseToString().Trim('\''); + if (!string.IsNullOrWhiteSpace(txtSellerTemp.Text)) + seller_temp = txtSellerTemp.Text.Trim(); + string cookie2 = "api_uid=" + api_uid + ";" + + "_nano_fp=" + _nano_fp + ";" + + "_bee=" + _bee + ";" + + "dilx=" + dilx + ";" + + "hfsc=" + hfsc + ";" + + "mallid=" + mallid + ";" + + "njrpl=" + njrpl + ";" + + "seller_temp=" + seller_temp + ";"; + + if (string.IsNullOrEmpty(seller_temp)) + { + BaseMsgForm.ShowError("Cookie缺少关键字段,请检查!\r\n请从Temu国际版https://agentseller.temu.com处获得cookie"); + return false; + } + + var cookieShop = new ShopLoginInfo(); + cookieShop.Cookies2 = cookie2; + + var data = PDDShopListForm.GetShopStatus2(cookieShop); + if (!data.Contains("\"success\":true")) + { + BaseMsgForm.ShowError("cookie已失效!"); + return false; + } + + //var maskMobile = BaseRegex.GetStringJson(ref data, "maskOwnerMobile"); + //if (!shopLoginInfo.LoginName.EndsWith(maskMobile)) + if (!data.Contains(shopLoginInfo.ShopAccount)) + { + BaseMsgForm.ShowError("cookie与国际版店铺不匹配,请核对店铺!"); + return false; + } + + List serverShopLst = new List(); + var rst = ShopBLL.AdminGetServerShopLstForSetCookie(shopLoginInfo, serverShopLst); + + if (rst != "success") + { + BaseMsgForm.ShowError(rst); + return false; + } + + //如果店铺没有cookie登录过,处理店铺第一次登录(分裂cookie下的所有店铺) + GetShopFirstLogin(data, serverShopLst); + + if (updateFrom == SetCookieFromEnum.normal_user) // 普通用户更新本地店铺 + { + var localShop = GlobalConfig.ShopLoginList.Where(v => v.LoginName == shopLoginInfo.LoginName).ToList(); + foreach (var sc in localShop) + { + sc.Cookies2 = cookie2; + sc.LoginStatus2 = "国际版在线"; + } + } + shopLoginInfo.Cookies2 = cookie2; + shopLoginInfo.LoginStatus2 = "国际版在线"; + PDDShopListForm.UpdateServerShopCookies(shopLoginInfo); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie + return true; + } + + /// + /// 如果店铺没有cookie登录过,处理店铺第一次登录(分裂cookie下的所有店铺) + /// + /// + void GetShopFirstLogin(string loginData, List lstServerShop) + { + if (this.shopLoginInfo == null) + return; + if (lstServerShop == null) + lstServerShop = new List(); + + List lstShopCompany = new List(); + var jObj = JObject.Parse(loginData); + var jArr = jObj["result"]?["companyList"]?[0]?["malInfoList"] as JArray; + if (jArr == null) + jArr = new JArray(); + + foreach (var productObj in jArr) + { + var prod = JsonHelper.SerializeObject(productObj); + ShopCompany sc = new ShopCompany() + { + AccountId = BaseRegex.GetStringJson(ref prod, "mallId"), + AccountName = BaseRegex.GetStringJson(ref prod, "mallName"), + LoginName = shopLoginInfo.LoginName, + UserName = BaseClass.UserName, + LoginStatus = "登录成功", + }; + lstShopCompany.Add(sc); + } + + var lstShopCompanyCopy = lstShopCompany.ToList(); + foreach (ShopCompany sc in lstShopCompanyCopy) + { + ShopLoginInfo newShop = new ShopLoginInfo() + { + UserName = shopLoginInfo.UserName, + LoginName = shopLoginInfo.LoginName, + Password = shopLoginInfo.Password, + GroupName = shopLoginInfo.GroupName, + ShopAccount = sc.AccountName, + ShopId = sc.AccountId, + SubUserName = shopLoginInfo.SubUserName, + Notes = shopLoginInfo.Notes, + }; + + var oldServerShop = lstServerShop.FirstOrDefault(s => + s.LoginName == newShop.LoginName && s.ShopId == newShop.ShopId); + if (oldServerShop == null) + { + if (updateFrom != SetCookieFromEnum.normal_user) + ShopBLL.AdminAddServerShop(newShop); // 店铺写入到服务端 + else + PDDShopListForm.AddServerDouShop(newShop); // 店铺写入到服务端 + } + } + } + + private void btnGetCookie_Click(object sender, EventArgs e) + { + //复制cookie + var cookJs = @" +document.body.innerHTML = '' + document.body.innerHTML; +function geCookie() +{ + var cookieText = document.cookie; + navigator.clipboard.writeText(cookieText).then(function() { + alert('复制cookie成功!'); + }, function(err) { + alert('复制cookie失败: ', err); + }); +}"; + Clipboard.SetDataObject(cookJs); + BaseMsgForm.ShowInfo("js复制成功"); + } + } +} diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopUpdateCookieForm.resx b/TEMUKJD/PDDForms/ShopForms/PDDShopUpdateCookieForm.resx new file mode 100644 index 0000000..c963c3c --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopUpdateCookieForm.resx @@ -0,0 +1,298 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAgIAQYAAAAABoKAAAFgAAACgAAACAAAAAAAEAAAEABAAAAAAAACgAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP// + AAD///8AAAAAAAAAAAAAAAAABEZmbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMZmZkQAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAZszMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMxmAAAAAAAAAAAAAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMZAAAAAAAAAAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMxkAAAAAAAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMzMzMzMzGQAAAAAAAAAAAAAAAAAAAbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMYAAAAAAAAAAAAAAAAARszMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMZAAAAAAAAAAAAAAABszMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAAAAAGzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAAAAbMzMzMzMzMzMzMzMzM + zMzMzMzMzMx3d4iIiIiIiIh3fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAABszMzMzMzMzMzM + zMzMzMzMzMzHeIiIiIj/////////iIiIiId8zMzMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAAAGzMzMzMzM + zMzMzMzMzMzMzMeIiI/////////////////////4iIh8zMzMzMzMzMzMzMzMzMzMzMxgAAAAAAAATMzM + zMzMzMzMzMzMzMzMzHiI////////////////////////////iIfMzMzMzMzMzMzMzMzMzMzMxAAAAAAA + AGzMzMzMzMzMzMzMzMzMx3iP///////////////////////////////4iHzMzMzMzMzMzMzMzMzMzMYA + AAAAAAbMzMzMzMzMzMzMzMzMx3iP//////////////////////////////////+IfMzMzMzMzMzMzMzM + zMzMYAAAAABMzMzMzMzMzMzMzMzMx3iP/////////////////////////////////////4h8zMzMzMzM + zMzMzMzMzMQAAAAAbMzMzMzMzMzMzMzMzHiP////////////////////////////////////////h3zM + zMzMzMzMzMzMzMzGAAAABMzMzMzMzMzMzMzMzHiP//////////////////////////////////////// + //iHzMzMzMzMzMzMzMzMzEAAAAbMzMzMzMzMzMzMzMeI//////////////////////////////////// + ////////+IfMzMzMzMzMzMzMzMxgAABMzMzMzMzMzMzMzMx4//////////////////////////////// + //////////////+IfMzMzMzMzMzMzMzMxAAAbMzMzMzMzMzMzMzHj/////////////////////////// + /////////////////////4fMzMzMzMzMzMzMzMYAAMzMzMzMzMzMzMzMeP////////////////////// + ///////////////////////////4fMzMzMzMzMzMzMzMAAbMzMzMzMzMzMzMx4////////////////// + /////////////////////////////////4fMzMzMzMzMzMzMzGAGzMzMzMzMzMzMzHj///////////// + ///////////////////////////////////////4fMzMzMzMzMzMzMxgDMzMzMzMzMzMzMyI//////// + /////////////////////////////////////////////4zMzMzMzMzMzMzMwEzMzMzMzMzMzMzHj/// + //////////////////////////////////////////////////+HzMzMzMzMzMzMzMRszMzMzMzMzMzM + eP//////////////////////////////////////////////////////+HzMzMzMzMzMzMzGbMzMzMzM + zMzMzHj///////////////////////////////////////////////////////+MzMzMzMzMzMzMxmzM + zMzMzMzMzMyP////+IiP////////////////////////////////////////+I//////h8zMzMzMzMzM + zMZszMzMzMzMzMzHj////4iIiI//////////////////////////////////////+IiIj/////jMzMzM + zMzMzMzGbMzMzMzMzMzMyP////iIiIiI/////////////////////////////////////4iIiIj////4 + fMzMzMzMzMzMxszMzMzMzMzMzHj////4iIiIiP////////////////////////////////////+IiIiI + j////4zMzMzMzMzMzMbMzMzMzMzMzMx4////iIiIiIj////////////////////////////////////4 + iIiIiI////+HzMzMzMzMzMzMzMzMzMzMzMzMj////4iIiIiI//////////////+IiP//iI////////// + ////+IiIiIiP////h8zMzMzMzMzMzMzMzMzMzMzMzI/////4iIiIiP/////////////4d3eIiIeIj/// + //////////+IiIiIj/////jMzMzMzMzMzMzMzMzMzMzMzMyP////+IiIiIj/////////////iIiId3eI + iI//////////////iIiIiI/////4zMzMzMzMzMzMzMzMzMzMzMzHj/////+IiIiP/////////////4// + /4d4j/+P//////////////iIiIj/////+MzMzMzMzMzMzMzMzMzMzMzMx4//////+IiP//////////// + ///////4j///////////////////iIiP//////jMzMzMzMzMzMzMzMzMzMzMzMeP//////////+IiIj/ + ///////////////////////////////////////////4fMzMzMzMzMzMzMzMzMzMzMzH//////////+H + fMx8eP//////////////////////////iId3iP//////////+HzMzMzMzMzMzMzMzMzMzMzMyP////// + ///4fMzHh8eP////////////////////////+MzMzMd4//////////h8zMzMzMzMzMzMzMzMzMzMzMf/ + ////////+MzMePjMeP///////////////////////4zMzMeHx4/////////4fMzMzMzMzMzMzMzMzMzM + zMzH/////////4fMd3eHzMeP//////////////////////iMzMzIiHx4////////+HzMzMzMzMzMzMzM + zMzMzMzMx/////////+Hx4iIfMzMj//////////////////////4h3d8x4h8yP////////jMzMzMzMzM + zMzMzMzMzMzMzMeP////////+HiP+IfMzI//////////////////////+HiIiHd3zHj////////4zMzM + zMzMzMzMzMzMzMzMzMzHj/////////h4//+HzMeP//////////////////////h4//h8zMyP//////// + +MzMzMzMzMzMzMzMzMzMzMzMzI/////////4iP//h8x4///////////////////////4j//4fMzHj/// + //////jMzMzMzMzMzMzMzMzMzMzMzMyP///////4iIiP+IfHj///////////////////////+Ij/+HzM + eP/////////4zMzMzMzMzMzMzMzMzMzMzMzMj///////iIiIiIh3eP////////////////////////+I + j4h8x3iI////////h8zMzMzMzMzMzMzMzMzMzMzMzH//////+Hj///iIiI////////////////////// + /////4iId4iIiIj//////4zMzMzMzMzMzMzMzMzMzMzMzMx4//////iP////iP////////////////// + /////////////4iP//iI//////+MzMzMzMzMzMzMzMzMzMzMzMzMyP//////////+I////////////// + ///////////////////4eP//iP//////jMzMzMzMzMzMzMzMzMzMzMzMzMj///////////iP//////// + /////////////////////////4j/////////+HzMzMzMzMzMzMzMzMzMzMzMzMzHj/////////////// + //////////////////////////////+I//////////jMzMzMzMzMzMzMzMzMzMzMzMzMzI////////// + //////////////////////////////////////////////+HzMzMzMzMzMzMzMzMzMzMzMzMzMyP//// + ////////////////////////////////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzM + eP///////////////////////////////////////////////////////4zMzMzMzMzMzMzMzMzMzMzM + zMzMzMj///////////////////////////////////////////////////////h8zMzMzMzMzMzMzMzM + zMzMzMzMzMzHj//////////////////////////////////////////////////////4zMzMzMzMzMzM + zMzMzMzMzMzMzMzMzI//////////////////////////////////////////////////////h8zMzMzM + zMzMzMzMzMzMzMzMzMzMzMx4////////////////////////////////////////////////////+HzM + zMzMzMzMzMzMzMzMzMzMzMzMzMzMyI////+I//////////////////////////////////////////// + //h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP////+Ij///////////////////////////////////// + //////+HzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP////+IiIiIj//////////////////////////4 + ////iI/////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMiP/////4iIiP////////////////////// + ////+IiIiIj/////iHzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiP////////////////////////// + ///////////4iIj//////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiP//////////////////// + //////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiP////////////// + //////////////////////////////+HzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHj///////// + ///////////////////////////////////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP//// + ////////////////////////////////////////+MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzI + j/////////////////////////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMeP//////////////////////////////////////////////h8zMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMx4////////+I//////////////////////////////////////jMzMzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMeP///////4iIj///////////////////////////iP///////4fMzMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMzMx4////////iIiIiP///////////////////////4iIiP///////4zMzMzMzMzM + zMzMzMzMzMzMzMzMzMzMzMzMj///////+IiIiIiI////////////////////+IiIiIj///////+HzMzM + zMzMzMzMzMzMzMzMzMzMzMzMzMzMx4////////iIiIiIj////////////////////4iIiIiIj/////// + +MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMj///////+IiIiIiI////////////////////+IiIiIiI// + //////h8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMx4////////iIiIiIiP////////////////////iIiI + iIiI///////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMj///////+IiIiIiIj/////iIiIiIiIj///// + /4iIiIiIiP///////4zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMx4////////iIiIiIiI/////4zMzMzMzM + j/////+IiIiIiIiP//////+HzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP//////+IiIiIiIj/////+MzM + zMzMzI//////+IiIiIiIj///////+MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzI////////iIiIiIiI//// + //jMzMzMzMyP//////iIiIiIiIj///////jMzMzMzMzMzMzMzMzMzMzMzMzMzMzMeP///////4iIiIiI + iP/////4zMzMzMzMj//////4iIiIiIiI///////4fMzMzMzMzMzMzMzMzMzMzMzMzMzMzI////////iI + iIiIiI//////+MzMzMzMzI//////+IiIiIiIiP///////4zMzMzMzMzMzMzMzMzMzMzMzMzMzMyP//// + ///4iIiIiIiP//////fMzMzMzMyP//////+IiIiIiIj///////+MzMzMzMzMzMzMzMzMzMzMzMzMzMzH + j///////+IiIiIiI//////+HzMzMzMzMeP//////iIiIiIiIj///////jMzMzMzMzMzMzMzMzMzMzMzM + zMzMyP////////iIiIiIiP//////jMzMzMzMzHj///////iIiIiIiI///////4fMzMzMzMzMzMzMzMzM + zMzMzMzMzMj///////+IiIiIiI///////4zMzMzMzMzI///////4iIiIiIiI///////3zMzMzMzMzMzM + zMzMzMzMzMzMzMzI////////iIiIiIiP//////+MzMzMzMzMyP//////+IiIiIiIiP//////+MzMzMzM + zMzMzMzMzMzMzMzMzMzMeP///////4iIiIiIj///////jMzMzMzMzMj///////+IiIiIiIj///////jM + zMzMzMzMzMzMzMzMzMzMzMzMzI////////+IiIiIiP//////+HzMzMzMzMzHj///////iIiIiIiI//// + ///4zMzMzMzMzMzMzMzMzMzMzMzMzMyP////////iIiIiI////////jMzMzMzMzMzI///////4iIiIiI + iI//////+MzMzMzMzMzMzMzMzMzMzMzMzMzMj////////4iIiIiP///////4zMzMzMzMzMyP///////4 + iIiIiIiP//////jMzMzMzMzMzMzMzMzMzMzMzMzMzI////////+IiIiI////////h8zMzMzMzMzMeP// + /////4iIiIiIj//////4fMzMzMzMzMzMzMzMzMzMzMzMzMyP////////iIiIj////////4fMzMzMzMzM + zHj///////+IiIiIiI//////+HzMzMzMzMzMzMzMzMzMzMzMzMzHj/////////iIiP////////+MzMzM + zMzMzMzI////////+IiIiIiP//////h8zMzMzMzMzMzMxmzMzMzMzMzMx4/////////4iP/////////4 + fMzMzMzMzMzMx4////////+IiIiIj//////4fMzMzMzMzMzMzMZszMzMzMzMzMeP//////////////// + ////+MzMzMzMzMzMzMyP////////iIiIiP//////+HzMzMzMzMzMzMzGbMzMzMzMzMzH//////////// + //////////fMzMzMzMzMzMzMeP////////iIiIj///////98zMzMzMzMzMzMxmzMzMzMzMzMyP////// + //////////////+HzMzMzMzMzMzMzHj/////////+IiP////////jMzMzMzMzMzMzMZszMzMzMzMzMj/ + ////////////////////jMzMzMzMzMzMzMzIj////////////////////4zMzMzMzMzMzMzGTMzMzMzM + zMzH////////////////////+HzMzMzMzMzMzMzMx4////////////////////+MzMzMzMzMzMzMxAzM + zMzMzMzMx/////////////////////jMzMzMzMzMzMzMzMyI///////////////////4fMzMzMzMzMzM + zMAGzMzMzMzMzMeP//////////////////+HzMzMzMzMzMzMzMzMeP//////////////////+HzMzMzM + zMzMzMxgBszMzMzMzMzHj//////////////////4fMzMzMzMzMzMzMzMzMeP//////////////////h8 + zMzMzMzMzMzMYADMzMzMzMzMzI//////////////////+HzMzMzMzMzMzMzMzMzHj/////////////// + ///4zMzMzMzMzMzMzAAAbMzMzMzMzMyP/////////////////4fMzMzMzMzMzMzMzMzMzHj///////// + ////////+MzMzMzMzMzMzMYAAEzMzMzMzMzMj/////////////////+MzMzMzMzMzMzMzMzMzMzIj/// + /////////////4fMzMzMzMzMzMzEAAAGzMzMzMzMzHj////////////////4fMzMzMzMzMzMzMzMzMzM + x4////////////////+MzMzMzMzMzMzMYAAABMzMzMzMzMx4////////////////h8zMzMzMzMzMzMzM + zMzMzMx4///////////////4fMzMzMzMzMzMzEAAAABszMzMzMzMx4//////////////+HzMzMzMzMzM + zMzMzMzMzMzMx4//////////////+MzMzMzMzMzMzMYAAAAATMzMzMzMzMyP/////////////4fMzMzM + zMzMzMzMzMzMzMzMzMeI/////////////4fMzMzMzMzMzMzEAAAAAAbMzMzMzMzMeP////////////h8 + zMzMzMzMzMzMzMzMzMzMzMzMeI////////////h8zMzMzMzMzMzMYAAAAAAAbMzMzMzMzMeP//////// + //iHzMzMzMzMzMzMzMzMzMzMzMzMzMyI//////////+HzMzMzMzMzMzMxgAAAAAAAEzMzMzMzMzMeP// + //////iHfMzMzMzMzMzMzMzMzMzMzMzMzMzMx4/////////4fMzMzMzMzMzMzMQAAAAAAAAGzMzMzMzM + zMeI//////iHfMzMzMzMzMzMzMzMzMzMzMzMzMzMzMx4j//////4h8zMzMzMzMzMzMxgAAAAAAAAAGzM + zMzMzMzMx4iIiIiHzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzHiIj/+Ih3zMzMzMzMzMzMzGAAAAAAAA + AAAGzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMx3iId8zMzMzMzMzMzMzMYAAA + AAAAAAAAAGzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + xgAAAAAAAAAAAAAGzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzGAAAAAAAAAAAAAAAEbMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM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AAD///gAAAAAAAAAAAAAAAAB///8AAAAAAAAAAAAAAAAA////wAAAAA + AAAAAAAAAAA////+AAAAAAAAAAAAAAAAf////4AAAAAAAAAAAAAAAf/////gAAAAAAAAAAAAAAf///// + +AAAAAAAAAAAAAAf//////8AAAAAAAAAAAAA/////////gAAAAAAAAAAf////w== + + + \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ShopForms/PDDSubAccountListForm.Designer.cs b/TEMUKJD/PDDForms/ShopForms/PDDSubAccountListForm.Designer.cs new file mode 100644 index 0000000..9d20b4a --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDSubAccountListForm.Designer.cs @@ -0,0 +1,477 @@ +namespace TemuKJD.PDDForms.ShopForms +{ + partial class PDDSubAccountListForm + { + /// + /// 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 dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + this.splitContainer5 = new System.Windows.Forms.SplitContainer(); + this.label1 = new System.Windows.Forms.Label(); + this.btnRefresh = new TemuKJD.UserControls.ButtonEx(); + this.btnCancel = new TemuKJD.UserControls.ButtonEx(); + this.btnOpUser = new TemuKJD.UserControls.ButtonEx(); + this.label30 = new System.Windows.Forms.Label(); + this.label31 = new System.Windows.Forms.Label(); + this.txtRePass = new System.Windows.Forms.TextBox(); + this.label32 = new System.Windows.Forms.Label(); + this.label33 = new System.Windows.Forms.Label(); + this.label34 = new System.Windows.Forms.Label(); + this.label35 = new System.Windows.Forms.Label(); + this.label36 = new System.Windows.Forms.Label(); + this.cmbGroup = new System.Windows.Forms.ComboBox(); + this.label37 = new System.Windows.Forms.Label(); + this.txtPassword = new System.Windows.Forms.TextBox(); + this.label38 = new System.Windows.Forms.Label(); + this.mobiletextBox = new System.Windows.Forms.TextBox(); + this.label39 = new System.Windows.Forms.Label(); + this.txtNickName = new System.Windows.Forms.TextBox(); + this.label40 = new System.Windows.Forms.Label(); + this.dgvUser = new TemuKJD.UserComponent.DataGridViewEx(); + this.UserIdColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.UserNickNameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.mobileColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.groupIdColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.groupNameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.shopCountColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.editColumn = new System.Windows.Forms.DataGridViewLinkColumn(); + this.deleteColumn = new System.Windows.Forms.DataGridViewLinkColumn(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer5)).BeginInit(); + this.splitContainer5.Panel1.SuspendLayout(); + this.splitContainer5.Panel2.SuspendLayout(); + this.splitContainer5.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgvUser)).BeginInit(); + this.SuspendLayout(); + // + // splitContainer5 + // + this.splitContainer5.BackColor = System.Drawing.Color.Transparent; + this.splitContainer5.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer5.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer5.Location = new System.Drawing.Point(0, 0); + this.splitContainer5.Name = "splitContainer5"; + // + // splitContainer5.Panel1 + // + this.splitContainer5.Panel1.Controls.Add(this.label1); + this.splitContainer5.Panel1.Controls.Add(this.btnRefresh); + this.splitContainer5.Panel1.Controls.Add(this.btnCancel); + this.splitContainer5.Panel1.Controls.Add(this.btnOpUser); + this.splitContainer5.Panel1.Controls.Add(this.label30); + this.splitContainer5.Panel1.Controls.Add(this.label31); + this.splitContainer5.Panel1.Controls.Add(this.txtRePass); + this.splitContainer5.Panel1.Controls.Add(this.label32); + this.splitContainer5.Panel1.Controls.Add(this.label33); + this.splitContainer5.Panel1.Controls.Add(this.label34); + this.splitContainer5.Panel1.Controls.Add(this.label35); + this.splitContainer5.Panel1.Controls.Add(this.label36); + this.splitContainer5.Panel1.Controls.Add(this.cmbGroup); + this.splitContainer5.Panel1.Controls.Add(this.label37); + this.splitContainer5.Panel1.Controls.Add(this.txtPassword); + this.splitContainer5.Panel1.Controls.Add(this.label38); + this.splitContainer5.Panel1.Controls.Add(this.mobiletextBox); + this.splitContainer5.Panel1.Controls.Add(this.label39); + this.splitContainer5.Panel1.Controls.Add(this.txtNickName); + this.splitContainer5.Panel1.Controls.Add(this.label40); + // + // splitContainer5.Panel2 + // + this.splitContainer5.Panel2.Controls.Add(this.dgvUser); + this.splitContainer5.Panel2.Padding = new System.Windows.Forms.Padding(0, 5, 5, 5); + this.splitContainer5.Size = new System.Drawing.Size(933, 445); + this.splitContainer5.SplitterDistance = 357; + this.splitContainer5.SplitterWidth = 1; + this.splitContainer5.TabIndex = 2; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.ForeColor = System.Drawing.SystemColors.ButtonShadow; + this.label1.Location = new System.Drawing.Point(56, 378); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(212, 17); + this.label1.TabIndex = 37; + this.label1.Text = "编辑时,密码为空表示不更改原密码。"; + // + // btnRefresh + // + this.btnRefresh.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnRefresh.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnRefresh.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnRefresh.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnRefresh.ForeColor = System.Drawing.Color.White; + this.btnRefresh.Location = new System.Drawing.Point(267, 5); + this.btnRefresh.Name = "btnRefresh"; + this.btnRefresh.Size = new System.Drawing.Size(86, 25); + this.btnRefresh.TabIndex = 36; + this.btnRefresh.Text = "刷新列表"; + this.btnRefresh.UseVisualStyleBackColor = false; + this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click); + // + // btnCancel + // + this.btnCancel.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnCancel.ForeColor = System.Drawing.Color.White; + this.btnCancel.Location = new System.Drawing.Point(59, 328); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(86, 25); + this.btnCancel.TabIndex = 35; + this.btnCancel.Text = "取消编辑"; + this.btnCancel.UseVisualStyleBackColor = false; + this.btnCancel.Visible = false; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // btnOpUser + // + this.btnOpUser.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnOpUser.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnOpUser.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnOpUser.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnOpUser.ForeColor = System.Drawing.Color.White; + this.btnOpUser.Location = new System.Drawing.Point(174, 328); + this.btnOpUser.Name = "btnOpUser"; + this.btnOpUser.Size = new System.Drawing.Size(86, 25); + this.btnOpUser.TabIndex = 34; + this.btnOpUser.Text = "添加用户"; + this.btnOpUser.UseVisualStyleBackColor = false; + this.btnOpUser.Click += new System.EventHandler(this.btnOpUser_Click); + // + // label30 + // + this.label30.AutoSize = true; + this.label30.ForeColor = System.Drawing.SystemColors.ButtonShadow; + this.label30.Location = new System.Drawing.Point(282, 145); + this.label30.Name = "label30"; + this.label30.Size = new System.Drawing.Size(56, 17); + this.label30.TabIndex = 33; + this.label30.Text = "登录使用"; + // + // label31 + // + this.label31.AutoSize = true; + this.label31.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); + this.label31.Location = new System.Drawing.Point(266, 229); + this.label31.Name = "label31"; + this.label31.Size = new System.Drawing.Size(13, 17); + this.label31.TabIndex = 32; + this.label31.Text = "*"; + // + // repasstextBox + // + this.txtRePass.Location = new System.Drawing.Point(112, 226); + this.txtRePass.Name = "repasstextBox"; + this.txtRePass.PasswordChar = '*'; + this.txtRePass.Size = new System.Drawing.Size(148, 23); + this.txtRePass.TabIndex = 24; + // + // label32 + // + this.label32.AutoSize = true; + this.label32.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label32.Location = new System.Drawing.Point(27, 227); + this.label32.Name = "label32"; + this.label32.Size = new System.Drawing.Size(79, 20); + this.label32.TabIndex = 31; + this.label32.Text = "重复密码:"; + // + // label33 + // + this.label33.AutoSize = true; + this.label33.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); + this.label33.Location = new System.Drawing.Point(266, 271); + this.label33.Name = "label33"; + this.label33.Size = new System.Drawing.Size(13, 17); + this.label33.TabIndex = 30; + this.label33.Text = "*"; + // + // label34 + // + this.label34.AutoSize = true; + this.label34.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); + this.label34.Location = new System.Drawing.Point(266, 187); + this.label34.Name = "label34"; + this.label34.Size = new System.Drawing.Size(13, 17); + this.label34.TabIndex = 29; + this.label34.Text = "*"; + // + // label35 + // + this.label35.AutoSize = true; + this.label35.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); + this.label35.Location = new System.Drawing.Point(266, 145); + this.label35.Name = "label35"; + this.label35.Size = new System.Drawing.Size(13, 17); + this.label35.TabIndex = 28; + this.label35.Text = "*"; + // + // label36 + // + this.label36.AutoSize = true; + this.label36.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); + this.label36.Location = new System.Drawing.Point(266, 103); + this.label36.Name = "label36"; + this.label36.Size = new System.Drawing.Size(13, 17); + this.label36.TabIndex = 27; + this.label36.Text = "*"; + // + // groupIdcomboBox + // + this.cmbGroup.Enabled = false; + this.cmbGroup.FormattingEnabled = true; + this.cmbGroup.Items.AddRange(new object[] { + "客服", + "采购", + "上货", + "数据", + "登录"}); + this.cmbGroup.Location = new System.Drawing.Point(112, 267); + this.cmbGroup.Name = "groupIdcomboBox"; + this.cmbGroup.Size = new System.Drawing.Size(148, 25); + this.cmbGroup.TabIndex = 26; + this.cmbGroup.Text = "客服"; + // + // label37 + // + this.label37.AutoSize = true; + this.label37.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label37.Location = new System.Drawing.Point(55, 269); + this.label37.Name = "label37"; + this.label37.Size = new System.Drawing.Size(51, 20); + this.label37.TabIndex = 25; + this.label37.Text = "分组:"; + // + // passwordtextBox + // + this.txtPassword.Location = new System.Drawing.Point(112, 184); + this.txtPassword.Name = "passwordtextBox"; + this.txtPassword.PasswordChar = '*'; + this.txtPassword.Size = new System.Drawing.Size(148, 23); + this.txtPassword.TabIndex = 23; + // + // label38 + // + this.label38.AutoSize = true; + this.label38.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label38.Location = new System.Drawing.Point(55, 185); + this.label38.Name = "label38"; + this.label38.Size = new System.Drawing.Size(51, 20); + this.label38.TabIndex = 22; + this.label38.Text = "密码:"; + // + // mobiletextBox + // + this.mobiletextBox.Location = new System.Drawing.Point(112, 142); + this.mobiletextBox.Name = "mobiletextBox"; + this.mobiletextBox.Size = new System.Drawing.Size(148, 23); + this.mobiletextBox.TabIndex = 21; + // + // label39 + // + this.label39.AutoSize = true; + this.label39.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label39.Location = new System.Drawing.Point(41, 143); + this.label39.Name = "label39"; + this.label39.Size = new System.Drawing.Size(65, 20); + this.label39.TabIndex = 20; + this.label39.Text = "手机号:"; + // + // txtNickName + // + this.txtNickName.Location = new System.Drawing.Point(112, 100); + this.txtNickName.Name = "txtNickName"; + this.txtNickName.Size = new System.Drawing.Size(148, 23); + this.txtNickName.TabIndex = 19; + // + // label40 + // + this.label40.AutoSize = true; + this.label40.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label40.Location = new System.Drawing.Point(55, 101); + this.label40.Name = "label40"; + this.label40.Size = new System.Drawing.Size(51, 20); + this.label40.TabIndex = 18; + this.label40.Text = "昵称:"; + // + // dgvUser + // + this.dgvUser.AllowUserToAddRows = false; + this.dgvUser.AllowUserToDeleteRows = false; + dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249))))); + this.dgvUser.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; + this.dgvUser.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dgvUser.BackgroundColor = System.Drawing.Color.White; + this.dgvUser.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvUser.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; + this.dgvUser.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgvUser.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.UserIdColumn, + this.UserNickNameColumn, + this.mobileColumn, + this.groupIdColumn, + this.groupNameColumn, + this.shopCountColumn, + this.editColumn, + this.deleteColumn}); + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvUser.DefaultCellStyle = dataGridViewCellStyle6; + this.dgvUser.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgvUser.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(215)))), ((int)(((byte)(229))))); + this.dgvUser.Location = new System.Drawing.Point(0, 5); + this.dgvUser.Name = "dgvUser"; + this.dgvUser.ReadOnly = true; + this.dgvUser.RowTemplate.Height = 23; + this.dgvUser.Size = new System.Drawing.Size(570, 435); + this.dgvUser.TabIndex = 1; + this.dgvUser.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvUser_CellContentClick); + // + // UserIdColumn + // + this.UserIdColumn.HeaderText = "id"; + this.UserIdColumn.Name = "UserIdColumn"; + this.UserIdColumn.ReadOnly = true; + this.UserIdColumn.Visible = false; + // + // UserNickNameColumn + // + this.UserNickNameColumn.HeaderText = "用户昵称"; + this.UserNickNameColumn.Name = "UserNickNameColumn"; + this.UserNickNameColumn.ReadOnly = true; + // + // mobileColumn + // + this.mobileColumn.HeaderText = "手机(登录账号)"; + this.mobileColumn.Name = "mobileColumn"; + this.mobileColumn.ReadOnly = true; + // + // groupIdColumn + // + this.groupIdColumn.HeaderText = "groupId"; + this.groupIdColumn.Name = "groupIdColumn"; + this.groupIdColumn.ReadOnly = true; + this.groupIdColumn.Visible = false; + // + // groupNameColumn + // + this.groupNameColumn.HeaderText = "分组"; + this.groupNameColumn.Name = "groupNameColumn"; + this.groupNameColumn.ReadOnly = true; + // + // shopCountColumn + // + this.shopCountColumn.HeaderText = "店铺数"; + this.shopCountColumn.Name = "shopCountColumn"; + this.shopCountColumn.ReadOnly = true; + this.shopCountColumn.Visible = false; + // + // editColumn + // + this.editColumn.HeaderText = "编辑"; + this.editColumn.Name = "editColumn"; + this.editColumn.ReadOnly = true; + this.editColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.editColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + // + // deleteColumn + // + this.deleteColumn.HeaderText = "删除"; + this.deleteColumn.Name = "deleteColumn"; + this.deleteColumn.ReadOnly = true; + // + // SubAccountListForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(933, 445); + this.Controls.Add(this.splitContainer5); + this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Name = "SubAccountListForm"; + this.Text = "子账号管理"; + this.Load += new System.EventHandler(this.SubAccountForm_Load); + this.splitContainer5.Panel1.ResumeLayout(false); + this.splitContainer5.Panel1.PerformLayout(); + this.splitContainer5.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer5)).EndInit(); + this.splitContainer5.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dgvUser)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer5; + private UserControls.ButtonEx btnCancel; + private UserControls.ButtonEx btnOpUser; + private System.Windows.Forms.Label label30; + private System.Windows.Forms.Label label31; + private System.Windows.Forms.TextBox txtRePass; + private System.Windows.Forms.Label label32; + private System.Windows.Forms.Label label33; + private System.Windows.Forms.Label label34; + private System.Windows.Forms.Label label35; + private System.Windows.Forms.Label label36; + private System.Windows.Forms.ComboBox cmbGroup; + private System.Windows.Forms.Label label37; + private System.Windows.Forms.TextBox txtPassword; + private System.Windows.Forms.Label label38; + private System.Windows.Forms.TextBox mobiletextBox; + private System.Windows.Forms.Label label39; + private System.Windows.Forms.TextBox txtNickName; + private System.Windows.Forms.Label label40; + private UserComponent.DataGridViewEx dgvUser; + private UserControls.ButtonEx btnRefresh; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.DataGridViewTextBoxColumn UserIdColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn UserNickNameColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn mobileColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn groupIdColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn groupNameColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn shopCountColumn; + private System.Windows.Forms.DataGridViewLinkColumn editColumn; + private System.Windows.Forms.DataGridViewLinkColumn deleteColumn; + } +} \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ShopForms/PDDSubAccountListForm.cs b/TEMUKJD/PDDForms/ShopForms/PDDSubAccountListForm.cs new file mode 100644 index 0000000..218ea65 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDSubAccountListForm.cs @@ -0,0 +1,220 @@ +using AllBase; +using AllBase.Model.Result; +using TemuKJD.KJDForms.BaseForms; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Work; + +namespace TemuKJD.PDDForms.ShopForms +{ + public partial class PDDSubAccountListForm : BaseForm + { + public static List AllUsers { get; set; } = new List(); + public MainForm Mf { get; set; } = null; + public string Uid { get; set; } = ""; + public PDDSubAccountListForm() + { + InitializeComponent(); + } + private void btnOpUser_Click(object sender, EventArgs e) + { + if (txtPassword.Text != txtRePass.Text) + { + BaseMsgForm.ShowInfo("两次密码不正确", "提示"); + return; + } + if (btnOpUser.Text == "添加用户" && txtPassword.Text.Length < 6) + { + BaseMsgForm.ShowInfo("密码最少6位", "提示"); + return; + } + if (string.IsNullOrEmpty(txtNickName.Text) || string.IsNullOrEmpty(mobiletextBox.Text) || + mobiletextBox.Text.Length != 11) + { + BaseMsgForm.ShowInfo("信息不正确", "提示"); + return; + } + + StringBuilder data = new StringBuilder(); + data.Append(UserLogin.GetSignaturex()); + data.Append("&sub_nick_name=" + GetHtml.UrlEncodeUtf8(txtNickName.Text)); + data.Append("&sub_name=" + GetHtml.UrlEncodeUtf8(mobiletextBox.Text)); + data.Append("&sub_mobile=" + GetHtml.UrlEncodeUtf8(mobiletextBox.Text)); + data.Append("&card_id="); + if (cmbGroup.Text == "客服") + data.Append("&group_id=4"); + else + { + BaseMsgForm.ShowInfo("分组不正确", "提示"); + return; + } + //else if (groupIdcomboBox.Text == "采购") + // data.Append("&group_id=9"); + //if (groupIdcomboBox.Text == "上货") + // data.Append("&group_id=10"); + //if (groupIdcomboBox.Text == "数据") + // data.Append("&group_id=11"); + //if (groupIdcomboBox.Text == "登录") + // data.Append("&group_id=8"); + if (!string.IsNullOrEmpty(txtPassword.Text)) + data.Append("&sub_password=" + Md5Base.GetMd5(txtPassword.Text).ToLower()); + string url = BaseClass.BuildObjString("user/add_sub_user"); + if (btnOpUser.Text != "添加用户" && !string.IsNullOrEmpty(Uid)) + { + data.Append("&id=" + Uid); + url = BaseClass.BuildObjString("user/update_sub_user"); + } + string html = GetHtml.PostUtf8(url, data.ToString()).Trim(); + + if (html == "had" || html == "error had") + { + BaseMsgForm.ShowInfo("手机号被占用,请换一个", "提示"); + return; + } + if (!string.IsNullOrEmpty(html)) + { + if (html.Contains("\"code\":200")) + { + btnOpUser.Text = "添加用户"; + EmptyInput(); + btnCancel.Visible = false; + GetUser(); + return; + } + var msg = BaseRegex.GetStringJson(ref html, "msg"); + if (string.IsNullOrEmpty(msg)) + msg = html; + BaseMsgForm.ShowError(msg, "错误"); + return; + } + BaseMsgForm.ShowError("出现异常,添加失败", "错误"); + } + + private void EmptyInput() + { + txtNickName.Clear(); + txtPassword.Clear(); + txtRePass.Clear(); + mobiletextBox.Clear(); + } + + private void GetUser() + { + dgvUser.Rows.Clear(); + AllUsers.Clear(); + string url = BaseClass.BuildObjString("user/get_sub_user"); + string data = UserLogin.GetSignaturex(); + string html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html)) + return; + if (html.Contains("\"data\"")) + { + var userObj = Newtonsoft.Json.Linq.JObject.Parse(html); + foreach (Newtonsoft.Json.Linq.JObject obj in userObj["data"]) + { + string oStr = JsonHelper.SerializeObject(obj); + ShopSubAccountInfo user = new ShopSubAccountInfo(); + user.id = BaseRegex.GetIntJson(ref oStr, "id"); + user.user_name = BaseRegex.GetStringJson(ref oStr, "user_name"); + user.nick_name = BaseRegex.GetStringJson(ref oStr, "nick_name"); + user.mobile = BaseRegex.GetStringJson(ref oStr, "mobile"); + user.group_id = BaseRegex.GetStringJson(ref oStr, "group_id"); + user.shop_count = BaseRegex.GetIntJson(ref oStr, "shop_count"); + + AllUsers.Add(user); + dgvUser.Rows.Add(user.id, user.nick_name, user.user_name, user.group_id, user.group_name, user.shop_count, "编辑", "删除"); + } + } + } + + private void btnCancel_Click(object sender, EventArgs e) + { + btnOpUser.Text = "添加用户"; + Uid = ""; + EmptyInput(); + btnCancel.Visible = false; + } + + private void dgvUser_CellContentClick(object sender, DataGridViewCellEventArgs e) + { + if (e.ColumnIndex < 0 || e.RowIndex < 0) + return; + string columname = dgvUser.Columns[e.ColumnIndex].HeaderText; + string uid = dgvUser.Rows[e.RowIndex].Cells["UseridColumn"].Value.ToString(); + string nickName = dgvUser.Rows[e.RowIndex].Cells["UserNickNameColumn"].Value.ToString(); + string mobile = dgvUser.Rows[e.RowIndex].Cells["mobileColumn"].Value.ToString(); + string groupName = dgvUser.Rows[e.RowIndex].Cells["groupNameColumn"].Value.ToString(); + if (columname == "编辑") + { + Uid = uid; + txtNickName.Text = nickName; + mobiletextBox.Text = mobile; + cmbGroup.Text = groupName; + txtPassword.Text = ""; + txtRePass.Text = ""; + btnOpUser.Text = "保存用户"; + btnCancel.Visible = true; + btnCancel.Text = "取消編輯"; + } + if (columname == "删除") + { + if (BaseMsgForm.ShowConfirm("是否删除,删除后无法再次添加", "提示").DialogResult == DialogResult.OK) + { + Delete(uid); + } + } + } + + public void Delete(string uid) + { + StringBuilder data = new StringBuilder(); + data.Append(UserLogin.GetSignaturex()); + data.Append("&id=" + uid); + string url = BaseClass.BuildObjString("user/delete_user"); + string html = GetHtml.PostUtf8(url, data.ToString()); + if (!string.IsNullOrEmpty(html)) + { + if (html.Contains("\"code\":200")) + { + BaseMsgForm.ShowInfo("删除成功", "提示"); + GetUser(); + return; + } + var msg = BaseRegex.GetStringJson(ref html, "msg"); + if (string.IsNullOrEmpty(msg)) + msg = html; + BaseMsgForm.ShowError(msg, "错误"); + return; + } + BaseMsgForm.ShowError("返回异常", "错误"); + } + + private void SubAccountForm_Load(object sender, EventArgs e) + { + this.cmbGroup.Enabled = false; + this.cmbGroup.Items.Clear(); + //this.groupIdcomboBox.Items.Add("上货"); + //this.groupIdcomboBox.Items.Add("采购"); + this.cmbGroup.Items.Add("客服"); + //if (BaseClass.UserName == "18888888888") + //{ + // this.groupIdcomboBox.Items.Add("主管"); + // this.groupIdcomboBox.Enabled = true; + //} + this.dgvUser.BackgroundColor = Color.White; + GetUser(); + } + + private void btnRefresh_Click(object sender, EventArgs e) + { + GetUser(); + } + } +} diff --git a/TEMUKJD/PDDForms/ShopForms/PDDSubAccountListForm.resx b/TEMUKJD/PDDForms/ShopForms/PDDSubAccountListForm.resx new file mode 100644 index 0000000..8daa718 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDSubAccountListForm.resx @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ShopForms/PDDSubAccountShopEditForm.Designer.cs b/TEMUKJD/PDDForms/ShopForms/PDDSubAccountShopEditForm.Designer.cs new file mode 100644 index 0000000..64fc28e --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDSubAccountShopEditForm.Designer.cs @@ -0,0 +1,259 @@ +namespace TemuKJD.PDDForms.ShopForms +{ + partial class PDDSubAccountShopEditForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDDSubAccountShopEditForm)); + this.label1 = new System.Windows.Forms.Label(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.flpShopSubAccount = new System.Windows.Forms.FlowLayoutPanel(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.btnAdd = new TemuKJD.UserControls.ButtonEx(); + this.btnRemove = new TemuKJD.UserControls.ButtonEx(); + this.flpNotSubAccount = new System.Windows.Forms.FlowLayoutPanel(); + this.btnOk = new TemuKJD.UserControls.ButtonEx(); + this.panel1 = new System.Windows.Forms.Panel(); + this.label2 = 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(); + this.tableLayoutPanel1.SuspendLayout(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 18); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(41, 12); + this.label1.TabIndex = 0; + this.label1.Text = "label1"; + // + // splitContainer1 + // + this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.splitContainer1.Location = new System.Drawing.Point(12, 41); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.BackColor = System.Drawing.Color.Gainsboro; + this.splitContainer1.Panel1.Controls.Add(this.flpShopSubAccount); + this.splitContainer1.Panel1.Padding = new System.Windows.Forms.Padding(2); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.splitContainer2); + this.splitContainer1.Size = new System.Drawing.Size(771, 326); + this.splitContainer1.SplitterDistance = 353; + this.splitContainer1.TabIndex = 1; + // + // flpShopSubAccount + // + this.flpShopSubAccount.AutoScroll = true; + this.flpShopSubAccount.BackColor = System.Drawing.Color.White; + this.flpShopSubAccount.Dock = System.Windows.Forms.DockStyle.Fill; + this.flpShopSubAccount.Location = new System.Drawing.Point(2, 2); + this.flpShopSubAccount.Name = "flpShopSubAccount"; + this.flpShopSubAccount.Size = new System.Drawing.Size(349, 322); + this.flpShopSubAccount.TabIndex = 11111; + // + // splitContainer2 + // + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Name = "splitContainer2"; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.tableLayoutPanel1); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.BackColor = System.Drawing.Color.Gainsboro; + this.splitContainer2.Panel2.Controls.Add(this.flpNotSubAccount); + this.splitContainer2.Panel2.Padding = new System.Windows.Forms.Padding(2); + this.splitContainer2.Size = new System.Drawing.Size(414, 326); + this.splitContainer2.SplitterDistance = 36; + this.splitContainer2.TabIndex = 0; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Controls.Add(this.btnAdd, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.btnRemove, 0, 1); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 5; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(36, 326); + this.tableLayoutPanel1.TabIndex = 0; + // + // btnAdd + // + this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnAdd.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnAdd.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnAdd.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnAdd.ForeColor = System.Drawing.Color.White; + this.btnAdd.Location = new System.Drawing.Point(4, 175); + this.btnAdd.Margin = new System.Windows.Forms.Padding(2); + this.btnAdd.Name = "btnAdd"; + this.btnAdd.Size = new System.Drawing.Size(30, 26); + this.btnAdd.TabIndex = 375; + this.btnAdd.Text = "<<"; + this.btnAdd.UseVisualStyleBackColor = false; + this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); + // + // btnRemove + // + this.btnRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnRemove.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnRemove.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnRemove.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnRemove.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnRemove.ForeColor = System.Drawing.Color.White; + this.btnRemove.Location = new System.Drawing.Point(4, 125); + this.btnRemove.Margin = new System.Windows.Forms.Padding(2); + this.btnRemove.Name = "btnRemove"; + this.btnRemove.Size = new System.Drawing.Size(30, 26); + this.btnRemove.TabIndex = 0; + this.btnRemove.Text = ">>"; + this.btnRemove.UseVisualStyleBackColor = false; + this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click); + // + // flpNotSubAccount + // + this.flpNotSubAccount.AutoScroll = true; + this.flpNotSubAccount.BackColor = System.Drawing.Color.White; + this.flpNotSubAccount.Dock = System.Windows.Forms.DockStyle.Fill; + this.flpNotSubAccount.Location = new System.Drawing.Point(2, 2); + this.flpNotSubAccount.Name = "flpNotSubAccount"; + this.flpNotSubAccount.Size = new System.Drawing.Size(370, 322); + this.flpNotSubAccount.TabIndex = 0; + // + // btnOk + // + this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOk.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.btnOk.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnOk.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnOk.ForeColor = System.Drawing.Color.White; + this.btnOk.Location = new System.Drawing.Point(717, 377); + this.btnOk.Margin = new System.Windows.Forms.Padding(2); + this.btnOk.Name = "btnOk"; + this.btnOk.Size = new System.Drawing.Size(66, 26); + this.btnOk.TabIndex = 373; + this.btnOk.Text = "确定"; + this.btnOk.UseVisualStyleBackColor = false; + this.btnOk.Click += new System.EventHandler(this.btnOk_Click); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.White; + this.panel1.Controls.Add(this.label2); + this.panel1.Controls.Add(this.splitContainer1); + this.panel1.Controls.Add(this.btnOk); + this.panel1.Controls.Add(this.label1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(1, 33); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(798, 416); + this.panel1.TabIndex = 0; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(409, 18); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(41, 12); + this.label2.TabIndex = 374; + this.label2.Text = "label2"; + // + // SubAccountShopEditForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.panel1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.ShowMinimizedBox = true; + this.Name = "SubAccountShopEditForm"; + this.Text = "SubAccountShopEditForm"; + this.TitleText = "SubAccountShopEditForm"; + this.Load += new System.EventHandler(this.SubAccountShopEditForm_Load); + this.Controls.SetChildIndex(this.panel1, 0); + this.splitContainer1.Panel1.ResumeLayout(false); + 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); + this.tableLayoutPanel1.ResumeLayout(false); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.SplitContainer splitContainer2; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private UserControls.ButtonEx btnAdd; + private UserControls.ButtonEx btnRemove; + private UserControls.ButtonEx btnOk; + private System.Windows.Forms.FlowLayoutPanel flpShopSubAccount; + private System.Windows.Forms.FlowLayoutPanel flpNotSubAccount; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label label2; + } +} \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ShopForms/PDDSubAccountShopEditForm.cs b/TEMUKJD/PDDForms/ShopForms/PDDSubAccountShopEditForm.cs new file mode 100644 index 0000000..33bb066 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDSubAccountShopEditForm.cs @@ -0,0 +1,194 @@ +using AllBase; +using AllBase.Model.Result; +using TemuKJD.KJDForms.BaseForms; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Work; + +namespace TemuKJD.PDDForms.ShopForms +{ + public partial class PDDSubAccountShopEditForm : LRBaseForm + { + ShopLoginInfo shop = null; + public List AllSubAccountList { get; set; } = new List(); + public List ShopSubAccountList { get; set; } = new List(); + public List NotShopSubAccountList { get; set; } = new List(); + public PDDSubAccountShopEditForm(ShopLoginInfo _shop) + { + InitializeComponent(); + shop = _shop; + } + + private void SubAccountShopEditForm_Load(object sender, EventArgs e) + { + this.TitleText = "店铺 " + shop?.ShopAccount + " 子账号编辑"; + label1.Text = "店铺 " + shop?.ShopAccount + " 子账号"; + label2.Text = "未分配的子账号"; + + GetUser(); + } + + private void GetUser() + { + flpNotSubAccount.Controls.Clear(); + flpShopSubAccount.Controls.Clear(); + AllSubAccountList.Clear(); + string url = BaseClass.BuildObjString("user/get_sub_user"); + string data = UserLogin.GetSignaturex(); + string html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html)) + return; + if (html.Contains("\"data\"")) + { + var userObj = Newtonsoft.Json.Linq.JObject.Parse(html); + foreach (Newtonsoft.Json.Linq.JObject obj in userObj["data"]) + { + string oStr = JsonHelper.SerializeObject(obj); + ShopSubAccountInfo user = new ShopSubAccountInfo(); + user.id = BaseRegex.GetIntJson(ref oStr, "id"); + user.nick_name = BaseRegex.GetStringJson(ref oStr, "nick_name"); + user.user_name = BaseRegex.GetStringJson(ref oStr, "user_name"); + user.mobile = BaseRegex.GetStringJson(ref oStr, "mobile"); + user.group_id = BaseRegex.GetStringJson(ref oStr, "group_id"); + user.shop_count = BaseRegex.GetIntJson(ref oStr, "shop_count"); + + AllSubAccountList.Add(user); + } + + if (shop != null) + { + ShopSubAccountList.Clear(); + ShopSubAccountList.AddRange(AllSubAccountList.Where(u=>shop.SubUserName.Contains(u.sub_user_name))); + shop.ShopSubAccountList.Clear(); + shop.ShopSubAccountList.AddRange(ShopSubAccountList); + NotShopSubAccountList.AddRange(AllSubAccountList.Where(u => !ShopSubAccountList.Any(bu => bu.id == u.id))); + foreach (var item in ShopSubAccountList) + { + UcSubAccount s = new UcSubAccount(item, false); + s.AddSubAcountEvent += S_AddSubAcountEvent; + s.RemoveSubAcountEvent += S_RemoveSubAcountEvent; + flpShopSubAccount.Controls.Add(s); + } + foreach (var item in NotShopSubAccountList) + { + UcSubAccount s = new UcSubAccount(item); + s.AddSubAcountEvent += S_AddSubAcountEvent; + s.RemoveSubAcountEvent += S_RemoveSubAcountEvent; + flpNotSubAccount.Controls.Add(s); + } + } + } + } + + private void S_AddSubAcountEvent(object obj) + { + var s = obj as UcSubAccount; + if (s != null) + { + if (this.flpShopSubAccount.Controls.Count > 0) + { + //BaseMsgForm.ShowInfo("只能有一个子账户!"); + //s.lblRight_Click(null, null); + //return; + } + + this.flpNotSubAccount.Controls.Remove(s); + this.flpShopSubAccount.Controls.Add(s); + } + } + + private void S_RemoveSubAcountEvent(object obj) + { + var s = obj as UcSubAccount; + if (s != null) + { + this.flpShopSubAccount.Controls.Remove(s); + this.flpNotSubAccount.Controls.Add(s); + } + } + + private void btnRemove_Click(object sender, EventArgs e) + { + var controls = this.flpShopSubAccount.Controls.Cast().ToList(); + foreach (var c in controls) + { + (c as UcSubAccount).DeleteAccount(); + } + } + + private void btnAdd_Click(object sender, EventArgs e) + { + var controls = this.flpNotSubAccount.Controls.Cast().ToList(); + foreach (var c in controls) + { + (c as UcSubAccount).AddAccount(); + } + } + + private void btnOk_Click(object sender, EventArgs e) + { + List AddUsers = new List(); + List DeleteUsers = new List(); + foreach (Control c in this.flpNotSubAccount.Controls) + { + var co = c as UcSubAccount; + if (co == null) + continue; + + if (ShopSubAccountList.Contains(co.subAccount)) + { + DeleteUsers.Add(co.subAccount); + shop.ShopSubAccountList.Remove(co.subAccount); + //string url = BaseClass.BuildObjString("shop&act=delete_shop_user_sub_group"); + //string data = UserLogin.GetSignaturex() + // + "&shop_id=" + shop.ShopId + // + "&sub_user_id=" + co.subAccount.sub_user_id + // + "&sub_user_name=" + co.subAccount.sub_user_name + // + "&status=" + co.subAccount.status + // + "&group_id=" + co.subAccount.group_id; + //string html = GetHtml.PostUtf8(url, data); + } + } + foreach (Control c in this.flpShopSubAccount.Controls) + { + var co = c as UcSubAccount; + if (co == null) + continue; + + if (NotShopSubAccountList.Contains(co.subAccount)) + { + AddUsers.Add(co.subAccount); + shop.ShopSubAccountList.Add(co.subAccount); + //string url = BaseClass.BuildObjString("shop&act=update_shop_user_sub_group"); + //string data = UserLogin.GetSignaturex() + // + "&shop_id=" + shop.ShopId + // + "&sub_user_id=" + co.subAccount.sub_user_id + // + "&sub_user_name=" + co.subAccount.sub_user_name + // + "&status=" + co.subAccount.status + // + "&group_id=" + co.subAccount.group_id; + //string html = GetHtml.PostUtf8(url, data); + } + } + + shop.SubUserName = shop.ShopSubAccountList.FirstOrDefault()?.sub_user_name; + shop.SubUserName = string.Join(",", shop.ShopSubAccountList.Select(s => s.sub_user_name)); + var shopLst = AllBase.Helper.GlobalConfig.ShopLoginList.Where(s => s.LoginName == shop.LoginName && s.ShopId!= shop.ShopId); + foreach(var s in shopLst) + { + s.SubUserName = shop.SubUserName; + s.ShopSubAccountList.Clear(); + shop.ShopSubAccountList.AddRange(s.ShopSubAccountList); + } + + OnSaveComplete(shop); + this.Close(); + } + } +} diff --git a/TEMUKJD/PDDForms/ShopForms/PDDSubAccountShopEditForm.resx b/TEMUKJD/PDDForms/ShopForms/PDDSubAccountShopEditForm.resx new file mode 100644 index 0000000..03e4c89 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/PDDSubAccountShopEditForm.resx @@ -0,0 +1,298 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + AAABAAEAgIAQVQAAAABoKAAAFgAAACgAAACAAAAAAAEAAAEABAAAAAAAACgAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP// + AAD///8AAAAAAAAAAAAAAAAABEZmbMzMz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zHiIiIiHZmZgAAAAAAAAAAAAEAAAAAAAAAAGZmZmZniIiIiHzMzMzMzMzMzMzMxAAAAAAA + AGzMzMzMzMzMzMzMeIiIiGZmAAAAAAERERmZmZmZmZmZkRERERAAAGZmZmZ4iIiIfMzMzMzMzMzMzMYA + AAAAAAbMzMzMzMzMzMzMeIiIiGZgAAAAERmZmZmZmZmZmZmZmZmZmZmZkREAAGZmZniIiIfMzMzMzMzM + zMzMYAAAAABMzMzMzMzMzMzMzIiIiHYAAAARGZmZiIiIj///////+IiIiIeZmZmZkREAZmZmiIiIfMzM + zMzMzMzMzMQAAAAAbMzMzMzMzMzMzO6IiIYAAAARmYiI/////////////////////4iHmZmZEQBmZmeI + iIh8zMzMzMzMzMzGAAAABMzMzMzMzMzMzMeIiIdgAAAZmI////////////////////////////iJmZmR + EGZmZ4iIh8zMzMzMzMzMzEAAAAbMzMzMzMzMzMzoiIhwAAAZeP////////////////////////////// + /4iZmZEAZmZ4iIh8zMzMzMzMzMxgAABMzMzMzMzMzMzOiIiGAAABiP////////////////////////// + ////////+JmZkQZmZ4iIh8zMzMzMzMzMxAAAbMzMzMzMzMzM7oiIYAABeP////////////////////// + ///////////////4mZkQZmZ4iIjMzMzMzMzMzMYAAMzMzMzMzMzMzu6IhwAAGP////////////////// + /////////////////////4iZmRZmZ4iIfMzMzMzMzMzMAAbMzMzMzMzMzM7oiHAAB4////////////// + ////////////////////////////iZmRBmZ4iIfMzMzMzMzMzGAGzMzMzMzMzMzuiIcAAHj///////// + //////////////////////////////////iZmRZmZ4iIzMzMzMzMzMxgDMzMzMzMzMzM7ohwAAf///// + ////////////////////////////////////////95mRZmaIiHzMzMzMzMzMwEzMzMzMzMzMzuiIEABo + //////////////////////////////////////////////95mRZmaIiMzMzMzMzMzMRszMzMzMzMzM7o + hwAGj///////////////////////////////////////////////95kQZmeIh8zMzMzMzMzGbMzMzMzM + zMzu6HEAB/////////////////////////////////////////////////+ZkQZmiIjMzMzMzMzMxmzM + zMzMzMzM7ohwAGj/////////////////////////////////////////////////iZkWZniIfMzMzMzM + zMZszMzMzMzMxu6HEAbv/4iI/////////////////////////////////////////4iP//iZEGZoiHzM + zMzMzMzGbMzMzMzMzM7uhxAGj/iIiIj//////////////////////////////////////4iIiI//mZFm + aIiMzMzMzMzMxszMzMzMzMzO6IEAbv+IiIiIj/////////////////////////////////////iIiIiP + /4mRBmeIh8zMzMzMzMbMzMzMzMzMbuhxAG7/iIiIiI////////////////iIj///j//////////////4 + iIiIiP/5mQZmiIfMzMzMzMzMzMzMzMzMzO7ocQDo+IiIiIiP///////////////u7u7u7u7o//////// + ////iIiIiIj/+JkWZoiHzMzMzMzMzMzMzMzMzMzu6BEG7/iIiIiIj/////////////+Hd3ju5maO7v// + /////////4iIiIiI//iZEGaIh8zMzMzMzMzMzMzMzMzM7ugRBu//iIiIiI//////////////kZmZdmAZ + mP/////////////4iIiIiP//mRBmeIjMzMzMzMzMzMzMzMzMzO7nEAbv/4iIiIiP////////////+HiI + mZEBd5n/////////////+IiIiIj//4mQZniIzMzMzMzMzMzMzMzMzMzu5xAO7//4iIiI//ju7o////// + //j//4mZeP/4//////////////iIiIiP//+JkGZ4iHzMzMzMzMzMzMzMzMzG7ocQDu///4iI//ju7u7u + j//////////4mP//////////////7u7uiIiI////iZBmaIh8zMzMzMzMzMzMzMzMzu6HEG7v//////+G + ZmZ47u7//////////4//////////////7u7u7u6P/////4mQBmiIfMzMzMzMzMzMzMzMzM7uhRBu7/// + ///3AAAAF37u7///////////////////////h2AABm7u7v/////5kAZ4iHzMzMzMzMzMzMzMzMzO7oUQ + bu//////gQAAZgEG7u//////////////////////+BAAAAAFfu6P////+ZAGeIjMzMzMzMzMzMzMzMzM + zu6FEG7v////+JEAAXhwAG7o/////////////////////4gAABEGARbu7/////kQBoiIzMzMzMzMzMzM + zMzMzM7uhRBu7/////iZABmZkQBm6P////////////////////+JABGZF2AAbo////+JEGaIiMzMzMzM + zMzMzMzMzMzO7ucRbu/////4mRZ4iZkQBu//////////////////////mQB5mZdgAG7/////iRBmiIfM + zMzMzMzMzMzMzMzMxu7nEQ7v////+Bl+j/iZEAaP/////////////////////5l2/4mRAABu/////4kQ + ZoiHzMzMzMzMzMzMzMzMzMzu5xEO6P//+Phgbu/4kQAI//////////////////////+Zfo/4kQAAeIiP + //+JEGaIh8zMzMzMzMzMzMzMzMzM7ucRBu7///iOYHiI+HAAf///////////////////////mYjv+BAA + BuiIj///iQBniIfMzMzMzMzMzMzMzMzMzO7nEQbu///3EAAG6IcRF4iP/////////////////////4GP + /4cQAAZnbv///5EAaIiMzMzMzMzMzMzMzMzMzMzu5xEW7v//iRF3dmZgAXjmj/////////////////// + ///3ePiBEQAHdm7///iRAGiIfMzMzMzMzMzMzMzMzMzM7u5xFu6P/5EZmXZmZmbmaP////////////// + ///////4/4d2cRAAFwbuj//4kQZoiHzMzMzMzMzMzMzMzMzMzG7ucRDu7/iXiZkQAAZmAH////////// + ////////////+IiIdmYABmAX//j/+BAGeIh8zMzMzMzMzMzMzMzMzMzO7nEQbu/4iP+BERkREZf///// + //////////////////+JmXdxEBEAB3////kQBoiIzMzMzMzMzMzMzMzMzMzMzu5xEW7o+P//gZmZmZmP + ////////////////////////+JmZmZmZl453//+JAGaIh8zMzMzMzMzMzMzMzMzMzM7u5xEO7vj/+IeP + iIj////////////////////////////4iZmZmZiPiP//cQBoiIfMzMzMzMzMzMzMzMzMzMzM7ucRFu6P + //iP//////////////////////////////////////+Jn/j/+JAAaIiMzMzMzMzMzMzMzMzMzMzMzO7n + ERbu7//4/////////////////////////////////////////4j///gQBoiIfMzMzMzMzMzMzMzMzMzM + zMzu7nERbuj////////////////////////////////////////////4//+BAAaIiMzMzMzMzMzMzMzM + zMzMzMzMzu5xEW7u////////////////////////////////////////////////cQBoiIfMzMzMzMzM + zMzMzMzMzMzMzM7u5xEW7u//////////////////////////////////////////////+BAAaIiMzMzM + zMzMzMzMzMzMzMzMzMzO7uYREO7o//7v//////////////////////////////////////////cABoiI + fMzMzMzMzMzMzMzMzMzMzMzMzO7ucRFu7oj/7o////////////////////////////////////////9x + AAeIiMzMzMzMzMzMzMzMzMzMzMzMzMzO7ucRFu7nePju7u7v//////////////////////////////// + 6P/4EAB4iIfMzMzMzMzMzMzMzMzMzMzMzMzMzu7nERBu7nmIiO7oj/////////////////////////// + ju7u7o//hwAGiIh8zMzMzMzMzMzMzMzMzMzMzMzMzMzu7nERbu7nmZl5eP////////////////////// + ///4iPiO5nj/+HAAaIiIzMzMzMzMzMzMzMzMzMzMzMzMzMzM7u7nERbu7oiZeI////////////////// + ////////+ImXd5mP/4cAAHiIh8zMzMzMzMzMzMzMzMzMzMzMzMzMzM7u53ERbu7v//////////////// + ///////////////4iZl4//hgAAeIiHzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM7u53ERBu7v////////// + //////////////////////////+GAAB4iI7MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzO7uiHEADujv//// + ///////////////////////////////3AAAGiIh8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzO7ohwABmP + ////////////////////////////////////iREAZniIjMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzuiI + EAB4f///////////////////////////////////+JmZkWZoiIfMzMzMzMzMzMzMzMzMzMzMzMzMzMzM + zO6IhwBo//////////////////////////////////////iImZl2ZoiIzMzMzMzMzMzMzMzMzMzMzMzM + zMzMzMzuiHAA7////////////////////////////////////////4iZFmZ4iHzMzMzMzMzMzMzMzMzM + zMzMzMzMzMzO6IgQBo/////4j///////////////////////////////////mZFmaIiMzMzMzMzMzMzM + zMzMzMzMzMzMzMzMzuiHAA7/////iIiP//////7o//////////////////iI/////4mRZmeIh8zMzMzM + zMzMzMzMzMzMzMzMzMzMzO6IcQBo////+IiIiI/////+7u7u7uiIiI7u7v////iIiI/////5mRZmiIjM + zMzMzMzMzMzMzMzMzMzMzMzMzMzuiHAA7////4iIiIiIj//3d2bu7u7u7u7u7u7//4iIiIiP////+JkW + ZniIfMzMzMzMzMzMzMzMzMzMzMzMzMzO6IcQBo////+IiIiIiI//+ZkAAGZmZmZmZmbv//iIiIiIiP// + //+ZkWZoiIzMzMzMzMzMzMzMzMzMzMzMzMzMzuiFAG7////4iIiIiIj///iZABEREREREBAG7//4iIiI + iIj/////iZFmaIiMzMzMzMzMzMzMzMzMzMzMzMzMzO6IcQBo////+IiIiIiI///4kQARERERERERDo// + +IiIiIiIj/////mZBmeIh8zMzMzMzMzMzMzMzMzMzMzMzMzuiHAG7////4iIiIiIiP//+JFmeHd3d3dx + EW6P//iIiIiIiI/////4mRZmiIfMzMzMzMzMzMzMzMzMzMzMzMzO7ocQBo////+IiIiIiIj///iQZoiO + 7u7u5xFu7//4iIiIiIiI////+JkWZniIzMzMzMzMzMzMzMzMzMzMzMzMzuiHEA7////4iIiIiIiP///5 + kGaIju7u7ucRbu///4iIiIiIiP////95kGZ4iHzMzMzMzMzMzMzMzMzMzMzMzM7ogQBu////+IiIiIiI + j///+RBmiI7u7u7nEW7v//+IiIiIiIiP////iZFmaIh8zMzMzMzMzMzMzMzMzMzMzMzu6HEAaP////iI + iIiIiI////kQZoiHzMzu5xEO6P//iIiIiIiIj////4mRZmiIjMzMzMzMzMzMzMzMzMzMzMzM7ugRBu// + ///4iIiIiIj///+JEGaIh8zM7ucRBu7//4iIiIiIiI/////5kQZniIzMzMzMzMzMzMzMzMzMzMzMzO6I + EAbv////iIiIiIiI////iQBniIzMzO7oERbu///4iIiIiIiP////+JkGZ4iHzMzMzMzMzMzMzMzMzMzM + zMbuhxAGj////4iIiIiIj////3kAaIiMzMzu7nEW7v//+IiIiIiIiP////iZFmaIh8zMzMzMzMzMzMzM + zMzMzMzO7oUQbv////+IiIiIiI////+RBmiIfMzMzu5xFu6P//+IiIiIiIj////4mRZmiIfMzMzMzMzM + zMzMzMzMzMzMzu6BAG7////4iIiIiIj////4kQZoiHzMzM7ucRDu7///iIiIiIiIj////5kQZoiHzMzM + zMzMzMzMzMzMzMzMzM7ocQBu////+IiIiIiI////+JAGeIh8zMzO7nERbu///4iIiIiIiI////95EGaI + h8zMzMzMzMzMzMzMzMzMzMxu6HEA7v////iIiIiIiP////cQBoiIzMzMzu7lEW7v///4iIiIiIiP//// + iRBmeIjMzMzMzMzMzMzMzMzMzMzM7uhxBuj////4iIiIiI/////5EAaIiMzMzMbu5xEO7v//+IiIiIiI + j////4kQZniIzMzMzMzMzMzMzMzMzMzMzO7oEQbv////+IiIiIj/////iQBmiIfMzMzM7ucRBu7///iI + iIiIiIj///+JkGZ4iMzMzMzMzMzMzMzMzMzMzMzu6BEG7/////iIiIiI/////4EAaIiHzMzMzO7nERbu + j///iIiIiIiI////iZBmaIh8zMzMzMzMzMzMzMzMzMzM7ucRBu/////4iIiIj/////+RAGiIjMzMzMzu + 7nEQ7u////iIiIiIiP///4mQBmiIfMzMzMzMzMzMzMzMzMzMzO7nEAbv////+IiIiP/////4EAZ4iHzM + zMzMzu5xEG7v///4iIiIiIj///+JkAZoiHzMzMzMzMzMxmzMzMzMzMzu5xAO7/////+IiI//////+RAG + iIjMzMzMzM7ucRFu7v///4iIiIiI////+ZAGaIh8zMzMzMzMzMZszMzMzMzG7ocQDu//////+I////// + /4EAZoiIzMzMzMzO7ucRBu7////4iIiIiP////mQBmiIfMzMzMzMzMzGbMzMzMzMzu6HEA7v//////// + //////9xAGiIh8zMzMzMzO7nERbu7///+IiIiI/////5kAZoiHzMzMzMzMzMxmzMzMzMzM7uhxAO7/// + ///////////4EABoiIzMzMzMzMzu7nEQbu////+IiIiP////+ZAGaIh8zMzMzMzMzMZszMzMzMzO7oUQ + Du//////////////9xAGiIh8zMzMzMzM7u5xEW7u/////4iI//////mQBmiIfMzMzMzMzMzGTMzMzMzM + zu6HEA7v/////////////4EABoiIzMzMzMzMzM7u5xEG7v/////////////5kAZoiHzMzMzMzMzMxAzM + zMzMzM7uhxEO7/////////////9wAGiIh8zMzMzMzMzO7ucRFu7v////////////+RAGeIh8zMzMzMzM + zMAGzMzMzMzO7ucRDuj////////////4EAB4iIzMzMzMzMzMzO7ucRBu6P///////////4kQBoiIzMzM + zMzMzMxgBszMzMzMxu7nEQbo////////////gQAGiIh8zMzMzMzMzMzu7nERDu7///////////+JEAaI + iMzMzMzMzMzMYADMzMzMzMzu5xEG7v///////////3EAZ4iIzMzMzMzMzMzMzu7nERbu7/////////// + gQBmiIfMzMzMzMzMzAAAbMzMzMzM7ucRBu7///////////gQAGiIh8zMzMzMzMzMzM7u5xEQbu7///// + /////5EAZ4iHzMzMzMzMzMYAAEzMzMzMzO7nERDu7/////////+HAAaIiIzMzMzMzMzMzMzM7u5xEQ7u + 7/////////gQAGiIjMzMzMzMzMzEAAAGzMzMzMzu7nEQbuj////////4cAAHiIh8zMzMzMzMzMzMzO7u + dxEW7uj////////3AAZoiHzMzMzMzMzMYAAABMzMzMzM7u5xEG7u////////hgAAeIiHzMzMzMzMzMzM + zMzO7ucREW7u7///////gQAGiIh8zMzMzMzMzEAAAABszMzMzM7ucREG7uj/////hmAAB4iI7MzMzMzM + zMzMzMzMzu7ucREG7u6P////+AAAB4iIzMzMzMzMzMYAAAAATMzMzMzO7ucREG7u7oiO7mAAAHiIiMzM + zMzMzMzMzMzMzMzu7ucREG7u7o//+HYAAHiIh8zMzMzMzMzEAAAAAAbMzMzMzu7nEREG7u7u5mAAAAeI + iIfMzMzMzMzMzMzMzMzMzu7ucREQbu7u7uYAAAeIiHzMzMzMzMzMYAAAAAAAbMzMzMzu7nEREAZmZgAA + AAF4iI58zMzMzMzMzMzMzMzMzMzu7ncREQZm7mZgAAB4iI7MzMzMzMzMxgAAAAAAAEzMzMzM7u7nEREQ + AAAAABF4iI7uzMzMzMzMzMzMzMzMzMzM7u7ucRERAAAAAAAHiIiMzMzMzMzMzMQAAAAAAAAGzMzMzM7u + 7nERERERERF3iIju7MzMzMzMzMzMzMzMzMzMzM7u7udREREQAAAReIiIfMzMzMzMzMxgAAAAAAAAAGzM + zMzM7u7udRERERV4iI7u7MzMzMzMzMzMzMzMzMzMzMzM7u7u5xEREREReIiO7MzMz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AcAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAAAAAADwAAAAAAA + AAAAAAAAAAAAA+AAAAAAAAAAAAAAAAAAAAfgAAAAAAAAAAAAAAAAAAAH8AAAAAAAAAAAAAAAAAAAD/AA + AAAAAAAAAAAAAAAAAA/4AAAAAAAAAAAAAAAAAAAf+AAAAAAAAAAAAAAAAAAAH/wAAAAAAAAAAAAAAAAA + AD/+AAAAAAAAAAAAAAAAAAB//gAAAAAAAAAAAAAAAAAAf/8AAAAAAAAAAAAAAAAAAP//gAAAAAAAAAAA + AAAAAAH//8AAAAAAAAAAAAAAAAAD///gAAAAAAAAAAAAAAAAB///8AAAAAAAAAAAAAAAAA////wAAAAA + AAAAAAAAAAA////+AAAAAAAAAAAAAAAAf////4AAAAAAAAAAAAAAAf/////gAAAAAAAAAAAAAAf///// + +AAAAAAAAAAAAAAf//////8AAAAAAAAAAAAA/////////gAAAAAAAAAAf////w== + + + \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ShopForms/ShopBrowserObject.cs b/TEMUKJD/PDDForms/ShopForms/ShopBrowserObject.cs new file mode 100644 index 0000000..b88be05 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/ShopBrowserObject.cs @@ -0,0 +1,320 @@ +using AllBase; +using AllBase.Helper; +using AllBase.Model.Result; +using NaiBa.Util.Extension; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using TemuKJD.KJDForms.BaseForms; +using Work; + +namespace TemuKJD.PDDForms.ShopForms +{ + public class ShopBrowserObject + { + public delegate void InfoReceivedHandler(string information); + public event InfoReceivedHandler OnInfoReceived; + + public string getProduct(ShopLoginInfo shop, string productId) + { + var prodId = productId.ParseToLong(); + if (prodId <= 0) + { + BaseMsgForm.ShowError("商品Id不存在!"); + return "failed"; + } + if (shop == null) + { + BaseMsgForm.ShowError("店铺不存在!"); + return "failed"; + } + + Task.Run(() => + { + try + { + var shop1 = shop; + var prodId1 = prodId; + string success_err_msg = ""; + var html = ProductQuery(shop1, prodId1.ToString()); + + var testHtml1 = GetHtml.UrlEncodeUtf8(html); + var testHtml2 = GetHtml.UrlDecode(testHtml1); + testHtml1 = HttpUtility.UrlEncode(html, Encoding.UTF8); + testHtml2 = HttpUtility.UrlDecode(testHtml1); + if (!html.Contains("\"success\":true") || !html.Contains("\"result\"")) + { + OnInfoReceived("商品获取失败!" + BaseRegex.GetStringJson(ref html, "errorMsg")); + return; + } + + JObject obj = JObject.Parse(html); + var result = JsonHelper.SerializeObject(obj["result"]); + var sizeRst = ""; + TemuDetailProductInfo product = JsonHelper.DeserializeJsonToObject(result); + + if (product.sizeTemplateId > 0) + { + html = SizeSpecQuery(shop1, prodId1.ToString(), product.sizeTemplateId.ToString()); + if(!html.Contains("\"success\":true")) + { + success_err_msg += " 尺码表获取失败!" + BaseRegex.GetStringJson(ref html, "errorMsg"); + } + else + { + obj = JObject.Parse(html); + sizeRst = JsonHelper.SerializeObject(obj["result"]); + } + } + + var url = BaseClass.BuildObjString("product/add_product"); + var data = Work.UserLogin.GetSignaturex() + + "&spu_id=" + product?.productId + + "&skc_id=" + product?.productSkcList?.FirstOrDefault()?.productSkcId + + "&cat_id=" + GetCat(product).catId + + "&cat_name=" + HttpUtility.UrlEncode(GetCat(product).catName, Encoding.UTF8) + + "&ext_code=" + HttpUtility.UrlEncode(product?.productSkcList?.FirstOrDefault()?.extCode, Encoding.UTF8) + + "&product_name=" + HttpUtility.UrlEncode(product?.productName, Encoding.UTF8) + + "&product_json=" + HttpUtility.UrlEncode(result, Encoding.UTF8) + + "&size_json=" + HttpUtility.UrlEncode(sizeRst, Encoding.UTF8) + + "&main_img=" + HttpUtility.UrlEncode(product?.carouselImageUrls?.FirstOrDefault(), Encoding.UTF8); + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + { + string msg = "选品商品保存失败!请检查网络连接:" + + BaseRegex.GetStringJson(ref html, "msg"); + OnInfoReceived(msg); + } + else + { + OnInfoReceived("选品商品保存成功!" + success_err_msg); + } + + + //// 创建 SaveFileDialog 的实例 + //SaveFileDialog saveFileDialog = new SaveFileDialog(); + + //// 单线程单元(STA)模式运行文件对话框,否则会报错。 + //System.Threading.Thread InvokeThread = new System.Threading.Thread(new System.Threading.ThreadStart(()=> { + + // // 设置对话框的属性 + // saveFileDialog.Title = "保存商品"; + // saveFileDialog.Filter = "商品文件 (*.prd)|*.prd|所有文件 (*.*)|*.*"; // 过滤文件类型 + // saveFileDialog.FileName = product.productId.ParseToString(); // 默认文件名 + // saveFileDialog.DefaultExt = "txt"; // 默认文件扩展名 + + // // 显示对话框并获取结果 + // if (saveFileDialog.ShowDialog() == DialogResult.OK) + // { + // // 用户点击了“保存”按钮,此时可以获取文件的路径 + // string filePath = saveFileDialog.FileName; + // // 在这里处理文件保存逻辑,例如写入数据到文件 + // System.IO.File.WriteAllText(filePath, result); + + // //BaseMsgForm.ShowInfo("商品保存成功!"); + // } + //})); + //InvokeThread.SetApartmentState(System.Threading.ApartmentState.STA); + //InvokeThread.Start(); + //InvokeThread.Join(); + } + catch (Exception ex) + { + } + }); + + return "success"; + } + + /// + /// 第三方获取商品并直接提交到第三方待上传列表 + /// + /// + /// + /// + public string getThirdProduct(string sProdId, long supplierId) + { + var prodId = sProdId.ParseToLong(); + if (prodId <= 0) + { + BaseMsgForm.ShowError("商品Id不存在!"); + return "failed"; + } + var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == supplierId.ToString()); + if (supplierId <= 0 || shop == null) + { + BaseMsgForm.ShowError("店铺不存在!"); + return "failed"; + } + + Task.Run(() => + { + try + { + var sourceShop = shop; + var sourceProdId = prodId; + string success_err_msg = ""; + string errorMsg = ""; + var html = ProductQuery(sourceShop, sourceProdId.ToString()); + if (!html.Contains("\"success\":true") || !html.Contains("\"result\"")) + { + OnInfoReceived("商品获取失败!" + BaseRegex.GetStringJson(ref html, "errorMsg")); + return; + } + + JObject obj = JObject.Parse(html); + var result = JsonHelper.SerializeObject(obj["result"]); + var sizeRst = ""; + TemuDetailProductInfo product = JsonHelper.DeserializeJsonToObject(result); + + if (product.sizeTemplateId > 0) + { + html = SizeSpecQuery(sourceShop, sourceProdId.ToString(), product.sizeTemplateId.ToString()); + if (!html.Contains("\"success\":true")) + { + success_err_msg += " 尺码表获取失败!" + BaseRegex.GetStringJson(ref html, "errorMsg"); + } + else + { + obj = JObject.Parse(html); + sizeRst = JsonHelper.SerializeObject(obj["result"]); + } + } + + List shopLst = new List(); + PDDShopListForm.Instance.Invoke(new Action(() => + { + //todo: + //ProductThirdSelectAddShopForm shopForm = new ProductThirdSelectAddShopForm(); + //shopForm.ShowDialog(); + //shopLst.AddRange(shopForm.lstSelectShop); + })); + + var url = BaseClass.BuildObjString("product_third/add_product"); + var data = UserLogin.GetSignaturex() + + "&spu_id=" + product?.productId + + "&skc_id=" + product?.productSkcList?.FirstOrDefault()?.productSkcId + + "&cat_id=" + GetCat(product).catId + + "&cat_name=" + HttpUtility.UrlEncode(GetCat(product).catName, Encoding.UTF8) + + "&ext_code=" + HttpUtility.UrlEncode(product?.productSkcList?.FirstOrDefault()?.extCode, Encoding.UTF8) + + "&product_name=" + HttpUtility.UrlEncode(product?.productName, Encoding.UTF8) + + "&product_json=" + HttpUtility.UrlEncode(result, Encoding.UTF8) + + "&size_json=" + HttpUtility.UrlEncode(sizeRst, Encoding.UTF8) + + "&main_img=" + HttpUtility.UrlEncode(product?.carouselImageUrls?.FirstOrDefault(), Encoding.UTF8); + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + { + errorMsg = "选品商品保存失败!请检查网络连接:" + + BaseRegex.GetStringJson(ref html, "msg").Replace("'", "\\'").Replace("\"", "\\\""); + } + var id = BaseRegex.GetLongJson(ref html, "id"); + if (id == 0) + goto end; + + foreach (var addProdShop in shopLst) + { + url = BaseClass.BuildObjString("product_third/add_user_select_product"); + data = UserLogin.GetSignaturex() + + "&out_product_id=" + id + + "&shop_id=" + addProdShop.ShopId + + "&shop_account=" + addProdShop.ShopAccount + + "&main_user_name=" + addProdShop.UserName + + "&sub_user_name=" + addProdShop.SubUserName + + "&add_product_remaining=" + addProdShop.AddProductRemaining + + "&status=待上传"; + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + { + errorMsg += product?.productId + " " + BaseRegex.GetStringJson(ref html, "msg") + "; "; + } + else + { + addProdShop.AddProductRemaining = addProdShop.AddProductRemaining - 1; + } + } + end:; + if (!string.IsNullOrEmpty(errorMsg)) + { + OnInfoReceived(errorMsg); + } + else + { + OnInfoReceived("库存上传保存成功!" + success_err_msg); + } + } + catch (Exception ex) + { + OnInfoReceived("发生错误:" + ex.Message); + } + }); + + return "success"; + } + + TemuCat GetCat(TemuDetailProductInfo product) + { + if (product == null) + return new TemuCat(); + + var cat = product.categories.cat10; + if (string.IsNullOrWhiteSpace(cat.catName)) + cat = product.categories.cat9; + if (string.IsNullOrWhiteSpace(cat.catName)) + cat = product.categories.cat8; + if (string.IsNullOrWhiteSpace(cat.catName)) + cat = product.categories.cat7; + if (string.IsNullOrWhiteSpace(cat.catName)) + cat = product.categories.cat6; + if (string.IsNullOrWhiteSpace(cat.catName)) + cat = product.categories.cat5; + if (string.IsNullOrWhiteSpace(cat.catName)) + cat = product.categories.cat4; + if (string.IsNullOrWhiteSpace(cat.catName)) + cat = product.categories.cat3; + if (string.IsNullOrWhiteSpace(cat.catName)) + cat = product.categories.cat2; + if (string.IsNullOrWhiteSpace(cat.catName)) + cat = product.categories.cat1; + + return cat; + } + + + + private string ProductQuery(ShopLoginInfo shop, string prodId) + { + //string url = "https://seller.kuajingmaihuo.com/bg-visage-mms/product/query"; + //string body = @"{""productId"":" + prodId + @",""productEditTaskUid"":""""}"; + //string refere = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?from=productList&productId=" + prodId; + //return KJDHttpResponse.PostResponse(shop, url, body, refere); + + return ""; + } + + private string SizeSpecQuery(ShopLoginInfo shop, string prodId, string sizeSpecId) + { + //string url = "https://seller.kuajingmaihuo.com/bg-anniston-mms/sizespec/query"; + //string body = @"{""businessId"":" + sizeSpecId + @",""reusable"":false}"; + //string refere = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?from=productList&productId=" + prodId; + //return KJDHttpResponse.PostResponse(shop, url, body, refere); + + return ""; + } + } +} diff --git a/TEMUKJD/PDDForms/ShopForms/UcSubAccount.Designer.cs b/TEMUKJD/PDDForms/ShopForms/UcSubAccount.Designer.cs new file mode 100644 index 0000000..099edfb --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/UcSubAccount.Designer.cs @@ -0,0 +1,136 @@ +namespace TemuKJD.PDDForms.ShopForms +{ + partial class UcSubAccount + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 组件设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.lblLeft = new System.Windows.Forms.Label(); + this.lblSubAccountName = new System.Windows.Forms.Label(); + this.lblRight = new System.Windows.Forms.Label(); + this.lblSubAccountGroupName = new System.Windows.Forms.Label(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.AutoSize = true; + this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel1.ColumnCount = 4; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel1.Controls.Add(this.lblLeft, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.lblSubAccountName, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.lblRight, 3, 0); + this.tableLayoutPanel1.Controls.Add(this.lblSubAccountGroupName, 2, 0); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(0, 3, 0, 3); + this.tableLayoutPanel1.RowCount = 1; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(95, 20); + this.tableLayoutPanel1.TabIndex = 0; + // + // lblLeft + // + this.lblLeft.AutoSize = true; + this.lblLeft.BackColor = System.Drawing.Color.DodgerBlue; + this.lblLeft.Cursor = System.Windows.Forms.Cursors.Hand; + this.lblLeft.ForeColor = System.Drawing.Color.White; + this.lblLeft.Location = new System.Drawing.Point(3, 4); + this.lblLeft.Margin = new System.Windows.Forms.Padding(3, 1, 0, 0); + this.lblLeft.Name = "lblLeft"; + this.lblLeft.Size = new System.Drawing.Size(11, 12); + this.lblLeft.TabIndex = 3; + this.lblLeft.Text = "<"; + this.lblLeft.Click += new System.EventHandler(this.lblLeft_Click); + // + // lblSubAccountName + // + this.lblSubAccountName.AutoSize = true; + this.lblSubAccountName.Location = new System.Drawing.Point(17, 4); + this.lblSubAccountName.Margin = new System.Windows.Forms.Padding(3, 1, 0, 0); + this.lblSubAccountName.Name = "lblSubAccountName"; + this.lblSubAccountName.Size = new System.Drawing.Size(29, 12); + this.lblSubAccountName.TabIndex = 1; + this.lblSubAccountName.Text = "名称"; + // + // lblRight + // + this.lblRight.AutoSize = true; + this.lblRight.BackColor = System.Drawing.Color.DodgerBlue; + this.lblRight.Cursor = System.Windows.Forms.Cursors.Hand; + this.lblRight.ForeColor = System.Drawing.Color.White; + this.lblRight.Location = new System.Drawing.Point(81, 4); + this.lblRight.Margin = new System.Windows.Forms.Padding(0, 1, 3, 0); + this.lblRight.Name = "lblRight"; + this.lblRight.Size = new System.Drawing.Size(11, 12); + this.lblRight.TabIndex = 4; + this.lblRight.Text = ">"; + this.lblRight.Click += new System.EventHandler(this.lblRight_Click); + // + // lblSubAccountGroupName + // + this.lblSubAccountGroupName.AutoSize = true; + this.lblSubAccountGroupName.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); + this.lblSubAccountGroupName.Location = new System.Drawing.Point(49, 3); + this.lblSubAccountGroupName.Name = "lblSubAccountGroupName"; + this.lblSubAccountGroupName.Padding = new System.Windows.Forms.Padding(0, 1, 0, 1); + this.lblSubAccountGroupName.Size = new System.Drawing.Size(29, 14); + this.lblSubAccountGroupName.TabIndex = 2; + this.lblSubAccountGroupName.Text = "分组"; + // + // UcSubAccount + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoSize = true; + this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.BackColor = System.Drawing.Color.Gainsboro; + this.Controls.Add(this.tableLayoutPanel1); + this.Name = "UcSubAccount"; + this.Size = new System.Drawing.Size(95, 20); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label lblSubAccountName; + private System.Windows.Forms.Label lblSubAccountGroupName; + private System.Windows.Forms.Label lblLeft; + private System.Windows.Forms.Label lblRight; + } +} diff --git a/TEMUKJD/PDDForms/ShopForms/UcSubAccount.cs b/TEMUKJD/PDDForms/ShopForms/UcSubAccount.cs new file mode 100644 index 0000000..492cdd3 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/UcSubAccount.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using AllBase.Model.Result; + +namespace TemuKJD.PDDForms.ShopForms +{ + public partial class UcSubAccount : UserControl + { + public ShopSubAccountInfo subAccount = null; + + public delegate void SubAcountDelegate(object obj); + + public event SubAcountDelegate AddSubAcountEvent; + public event SubAcountDelegate RemoveSubAcountEvent; + + public UcSubAccount(ShopSubAccountInfo _subAccount, bool isNotShopSubAccount = true) + { + InitializeComponent(); + subAccount = _subAccount; + if (isNotShopSubAccount) + lblRight.Visible = false; + else + lblLeft.Visible = false; + + this.Load += UcSubAccount_Load; + } + + public void AddAccount() + { + this.lblLeft_Click(null, null); + } + + public void DeleteAccount() + { + this.lblRight_Click(null, null); + } + + private void UcSubAccount_Load(object sender, EventArgs e) + { + this.lblSubAccountName.Text = subAccount.user_name; + this.lblSubAccountGroupName.Text = subAccount.group_name; + this.lblSubAccountName.Resize += Lbl_Resize; + this.lblSubAccountGroupName.Resize += Lbl_Resize; + } + + + private void Lbl_Resize(object sender, EventArgs e) + { + } + + public void lblLeft_Click(object sender, EventArgs e) + { + this.lblRight.Visible = true; + this.lblLeft.Visible = false; + AddSubAcountEvent?.Invoke(this); + } + + public void lblRight_Click(object sender, EventArgs e) + { + this.lblRight.Visible = false; + this.lblLeft.Visible = true; + RemoveSubAcountEvent?.Invoke(this); + } + } +} diff --git a/TEMUKJD/PDDForms/ShopForms/UcSubAccount.resx b/TEMUKJD/PDDForms/ShopForms/UcSubAccount.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/TEMUKJD/PDDForms/ShopForms/UcSubAccount.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/Resources/login_bg_pdd.png b/TEMUKJD/Resources/login_bg_pdd.png new file mode 100644 index 0000000000000000000000000000000000000000..9b3649a94ca33893a365b2831a84fd06d2176c13 GIT binary patch literal 41277 zcmeFXbyS>Nwl9hk9D;`6?k-ih6a)zF4n_!a^92ZoD+fja^M7UA!IM1;(2G6V#ILtAZq4}BG75s0%R7ueF-0?Os%=mMuk zKoFDkaREc@p&m3AP-|N!ak`_H4muiJOL00qK@}bq7g?x{t%9E$RLf6Q8{%gV0b0^Y zO3;Y;h`<+cgnEE!d>kE|+(mrE>Hb((1b+SdHa8v3A0!_3;&jr#8Pe#hsME+gyFqDy zT)dnR9v(g#VIUV+2rR@86yl)aTZL77+l5@bT09?L`M?=Voaoq6w1! z8#DMfaXK3h4;K+`Zf|dIE^mG=XE$qZULX+2&BMpd$Hx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