优化了微店商品上传 优化pdd买手读单

This commit is contained in:
wule committed 2026-04-15 21:04:37 +08:00
1 parent 6c4f16b897
commit f360688c43
62 files changed
+5620 -1432

No files matched your search

+2
View File
@@ -197,6 +197,7 @@
<Compile Include="Model\Param\OutServerGoodsParam.cs" />
<Compile Include="Model\Param\PDDProdParam\PDDActivitySubmitParamV2.cs" />
<Compile Include="Model\Param\PDDProdParam\PddEditProdStockQuantity.cs" />
<Compile Include="Model\Param\PDDProdParam\PddRelationParam.cs" />
<Compile Include="Model\Param\ToolsManage\ADSLAccountParam.cs" />
<Compile Include="Model\Param\ToolsManage\ProductMappingExportInfo.cs" />
<Compile Include="Model\Param\ToolsManage\ProductMappingImportParam.cs" />
@@ -213,6 +214,7 @@
<Compile Include="Model\Result\PDDResult\PDDActivityResult\ActivityListProdInfo.cs" />
<Compile Include="Model\Result\PDDResult\PDDActivityResult\ActEnrollV3GoodsRuleInfo.cs" />
<Compile Include="Model\Result\PDDResult\PddBuyerOrderInfoLite.cs" />
<Compile Include="Model\Result\PDDResult\PddClientInfo.cs" />
<Compile Include="Model\Result\VDianShopLoginInfo.cs" />
<Compile Include="Model\Result\WXResult\WXAddressInfo.cs" />
<Compile Include="Model\Result\WXResult\WXClientProductInfoLite.cs" />
+1 -1
View File
@@ -27,7 +27,7 @@ namespace AllBase
/// <summary>
/// 版本ID
/// </summary>
public static int VersionCount = 979;
public static int VersionCount = 989;
//public static int VersionCount = 613;
/// <summary>
+15
View File
@@ -681,6 +681,8 @@ namespace AllBase
public static System.Collections.Generic.List<string> GetJsonObjStrJson(ref string html, string reg, int level = 0)
{
var startTime = DateTime.Now;
System.Collections.Generic.List<string> rstLst = new System.Collections.Generic.List<string>();
if (html == null)
return rstLst;
@@ -716,6 +718,10 @@ namespace AllBase
//htmlTmp = htmlTmp.Substring(1);
if (braceNum == 0)
{
var endTime1 = DateTime.Now;
if ((endTime1 - startTime).TotalSeconds > 1)
{
}
rstLst.Add(htmlTmp.Substring(0, i + 1).Replace("\\这里是正花括号占位符", "\\{").Replace("\\这里是反花括号占位符", "\\}"));
htmlTmp = htmlTmp.Substring(i + 1);
//rstLst.Add(rst.Replace("\\这里是正花括号占位符", "\\{").Replace("\\这里是反花括号占位符", "\\}"));
@@ -729,11 +735,16 @@ namespace AllBase
if (htmlTmp.Length > 0)
goto retry;
var endTime2 = DateTime.Now;
if ((endTime2 - startTime).TotalSeconds > 1)
{
}
return rstLst;
}
public static System.Collections.Generic.List<string> GetJsonArrStrJson(ref string html, string reg)
{
var startTime = DateTime.Now;
System.Collections.Generic.List<string> rstLst = new System.Collections.Generic.List<string>();
if (html == null)
return rstLst;
@@ -766,6 +777,10 @@ namespace AllBase
if (htmlTmp.Length > 0)
goto retry;
var endTime = DateTime.Now;
if ((endTime - startTime).TotalSeconds > 1)
{
}
return rstLst;
}
+6
View File
@@ -3,6 +3,7 @@ using AllBase.Model.Param.ProductManage;
using AllBase.Model.Param.ShopManage;
using AllBase.Model.Param.TemuProductManage;
using AllBase.Model.Result;
using AllBase.Model.Result.PDDResult;
using AllBase.Model.Result.WXResult;
using LittleCow.Model.Param.WeiDianManage;
using NaiBa.Util;
@@ -53,6 +54,11 @@ namespace AllBase.Helper
/// 微店上货参数
/// </summary>
public static WeiDianSettingParam WeiDianUploadParam { get; set; }
/// <summary>
/// 拼多多api列表
/// </summary>
public static ConcurrentList<PddClientInfo> PddClentInfoList = new ConcurrentList<PddClientInfo>();
}
public enum ShopPlatform
+1 -1
View File
@@ -154,7 +154,7 @@ namespace AllBase
BaseClass.ViewCode += message + "\r\n";
if (Logs.Count > 5000)
{
BaseClass.ViewCode += "日志队列超长,请检查日志处理\r\n";
//BaseClass.ViewCode += "日志队列超长,请检查日志处理\r\n";
Logs.Clear();
return;
}
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AllBase.Model.Param.PDDProdParam
{
public class PddRelationParam
{
public string up_spu_id { get; set; } // "88C9F35912594F76A21CDD5F36DAE972",
public string up_goods_name { get; set; } // "婴儿衣服POLO衫短袖T恤0-3岁男童夏装宝宝女小童上衣儿童幼儿外出",
public string from_site { get; set; } // "vd",
public string goods_id { get; set; } // "7735389957",
public string shop_id { get; set; } // "1668907464",
public string price_min { get; set; } // 8941,
public string price_max { get; set; } // 8941,
}
}
@@ -24,6 +24,7 @@ namespace AllBase.Model.Result.PDDResult
{
if (outExpressCompanyMsg == null) return "";
if (outExpressCompanyMsg.Contains("邮政快递包裹")) return "EMS";
if (outExpressCompanyMsg.Contains("邮政电商标快")) return "EMS";
if (outExpressCompanyMsg.Contains("极兔速递")) return "JTSD";
if (outExpressCompanyMsg.Contains("申通快递")) return "STO";
if (outExpressCompanyMsg.Contains("韵达快递")) return "YD";
@@ -39,6 +40,7 @@ namespace AllBase.Model.Result.PDDResult
{
if (outExpressCompanyMsg == null) return "";
if (outExpressCompanyMsg.Contains("邮政快递包裹")) return "邮政快递包裹";
if (outExpressCompanyMsg.Contains("邮政电商标快")) return "邮政电商标快";
if (outExpressCompanyMsg.Contains("极兔速递")) return "极兔速递";
if (outExpressCompanyMsg.Contains("申通快递")) return "申通快递";
if (outExpressCompanyMsg.Contains("韵达快递")) return "韵达快递";
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AllBase.Model.Result.PDDResult
{
public class PddClientInfo
{
public string describe { get; set; } // "小红椒商品管理"
public string client_id { get; set; } // "48ccccaaaa33335555ccccbbbb6666b5"
public string client_secret { get; set; } // "b2aaaaeeee6666222233332222ffff5555aaaa97"
public int? market_id { get; set; } // 84691
public string redirect_uri { get; set; } // "http%3A%2F%2Fxtjpd.aabbccddeeff.vip%2Fpdd_token.html"
public bool? is_current { get; set; } // "true"
}
}
+2 -2
View File
@@ -103,7 +103,7 @@ namespace AllBase.Model.Result
public string RefreshToken { get { return (CurrentAuthInfo?.RefreshToken).ParseToString(); } }
public string AppKey { get { return (CurrentAuthInfo?.AppKey).ParseToString(); } }
public string AppSecret { get { return (CurrentAuthInfo?.AppSecret).ParseToString(); } }
public DateTime AuthAddTime { get { return CurrentAuthInfo?.AddTime == null ? new DateTime() : CurrentAuthInfo.AddTime; } }
public DateTime AuthUpdateTime { get { return CurrentAuthInfo?.UpdateTime == null ? new DateTime() : CurrentAuthInfo.UpdateTime; } }
public DateTime AuthExpiresTime { get { return CurrentAuthInfo?.ExpiresTime == null ? new DateTime() : CurrentAuthInfo.ExpiresTime; } }
/// <summary>
/// 店铺运费模板
@@ -209,7 +209,7 @@ namespace AllBase.Model.Result
public string AppKey { get; set; } = "";
public string AppSecret { get; set; } = "";
public DateTime ExpiresTime { get; set; }
public DateTime AddTime { get; set; } = DateTime.MinValue;
public DateTime UpdateTime { get; set; } = DateTime.MinValue;
public string ApiAuthStatus { get; set; } = "未授权";
}
@@ -8,6 +8,7 @@ namespace AllBase.Model.Result
{
public class VDianShopLoginInfo
{
public int DbId { get; set; }
public string user_name { get; set; }
public string ShopName { get; set; }
@@ -149,6 +149,7 @@ namespace KJD_Web.BLL.BXX
string sku_secret_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_secret_json"))?.Replace("'", "\\'");
string wx_img_map_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_img_map_json"))?.Replace("'", "\\'");
string problem_prod_data = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "problem_prod_data"))?.Replace("'", "\\'");
string is_relation = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "is_relation"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
@@ -226,6 +227,8 @@ namespace KJD_Web.BLL.BXX
sql += " p.wx_img_map_json=@wx_img_map_json,";
if (!problem_prod_data.IsNullOrEmpty())
sql += " p.problem_prod_data=" + problem_prod_data + ",";
if (!is_relation.IsNullOrEmpty())
sql += " p.is_relation=" + is_relation + ",";
sql += " p.mdy_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
sql = sql.TrimEnd(',');
sql += " where spu_id='" + spu_id + "';";
@@ -471,6 +474,7 @@ namespace KJD_Web.BLL.BXX
var real_coid = RegexUtils.GetStringQuery(ref inputData, "real_coid")?.Replace("'", "\\'");
var has_wx_format = RegexUtils.GetStringQuery(ref inputData, "has_wx_format")?.Replace("'", "\\'");
var problem_prod_data = RegexUtils.GetStringQuery(ref inputData, "problem_prod_data")?.Replace("'", "\\'");
var is_relation = RegexUtils.GetStringQuery(ref inputData, "is_relation")?.Replace("'", "\\'");
var start_time = RegexUtils.GetStringQuery(ref inputData, "start_time")?.Replace("'", "\\'");
var end_time = RegexUtils.GetStringQuery(ref inputData, "end_time")?.Replace("'", "\\'");
@@ -517,7 +521,8 @@ namespace KJD_Web.BLL.BXX
where += " and p.special_prod_type ='" + special_prod_type + "'";
if (!string.IsNullOrWhiteSpace(search_spu))
where += " and p.spu_id like '%" + search_spu + "%'";
//where += " and p.spu_id like '%" + 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))
@@ -599,6 +604,10 @@ namespace KJD_Web.BLL.BXX
else
where += " and p.problem_prod_data='" + problem_prod_data + "'";
}
if (!string.IsNullOrEmpty(is_relation))
{
where += " and p.is_relation=" + is_relation;
}
if (start_time != null && end_time != null)
{
where += " and p.mdy_time between '" + start_time + "' and '" + end_time + "'";
@@ -627,7 +636,7 @@ namespace KJD_Web.BLL.BXX
sql = "select p.id,p.from_shop_id,p.spu_id,p.skc_id,p.main_cat_id,p.main_cat_name,p.cat_id,p.cat_name,p.price_text,p.ext_code,p.product_name," +
" p.main_img,p.notes,p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,p.group," +
" p.product_get_type,p.wx_safe_status,p.sale_count,p.sale_count_text,p.special_prod_type,p.from_shop_name,p.wx_cat_1,p.wx_cat_2,p.wx_cat_3," +
" p.wx_cat_leaf,p.send_to_out_server,p.secret_spu_id,p.real_coid,p.real_spu_id," +
" p.wx_cat_leaf,p.send_to_out_server,p.secret_spu_id,p.real_coid,p.real_spu_id,p.is_relation," +
" s.img_url,e.ext_code_price" +
" FROM bxx.product p " +
" left join bxx.sku_img_replace s ON p.sku_img_replace_id=s.id" +
@@ -637,7 +646,7 @@ namespace KJD_Web.BLL.BXX
sql = "SELECT p.id,p.from_shop_id,p.spu_id,p.skc_id,p.main_cat_id,p.main_cat_name,p.cat_id,p.cat_name,p.price_text,p.ext_code,p.product_name," +
" p.main_img,p.notes,p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,p.group," +
" p.product_get_type,p.wx_safe_status,p.sale_count,p.sale_count_text,p.special_prod_type,p.from_shop_name,p.wx_cat_1,p.wx_cat_2,p.wx_cat_3," +
" p.wx_cat_leaf,p.send_to_out_server,p.secret_spu_id,p.real_coid,p.real_spu_id," +
" p.wx_cat_leaf,p.send_to_out_server,p.secret_spu_id,p.real_coid,p.real_spu_id,p.is_relation," +
" s.img_url,COUNT(se.id) AS select_count,e.ext_code_price" +
" FROM bxx.product p left join bxx.sku_img_replace s ON p.sku_img_replace_id=s.id LEFT JOIN bxx.product_select se ON p.id=se.out_product_id AND se.shop_id='" + select_shop_id + "' " +
" LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
@@ -707,6 +716,7 @@ namespace KJD_Web.BLL.BXX
secret_spu_id = row["secret_spu_id"].IsNullOrEmpty() ? null : row["secret_spu_id"].ParseToString(),
real_coid = row["real_coid"].IsNullOrEmpty() ? null : row["real_coid"].ParseToString(),
real_spu_id = row["real_spu_id"].IsNullOrEmpty() ? null : row["real_spu_id"].ParseToString(),
is_relation = row["is_relation"].ParseToInt(),
};
if (isDetail)
{
@@ -1362,10 +1372,11 @@ namespace KJD_Web.BLL.BXX
var wx_safe_status = RegexUtils.GetStringQuery(ref inputData, "wx_safe_status")?.Replace("'", "\\'");
var special_prod_type = RegexUtils.GetStringQuery(ref inputData, "special_prod_type")?.Replace("'", "\\'");
var is_supplier_prod_ok = RegexUtils.GetStringQuery(ref inputData, "is_supplier_prod_ok")?.Replace("'", "\\'");
var is_not_count = (RegexUtils.GetStringQuery(ref inputData, "is_not_count")?.Replace("'", "\\'")).ParseToBool();
var prod_count = (RegexUtils.GetStringQuery(ref inputData, "prod_count")?.Replace("'", "\\'")).ParseToInt();
var add_days_less = RegexUtils.GetStringQuery(ref inputData, "add_days_less")?.Replace("'", "\\'").ParseToNullableInt();
var has_wx_format = RegexUtils.GetStringQuery(ref inputData, "has_wx_format")?.Replace("'", "\\'").ParseToString();
var is_not_count = RegexUtils.GetStringQuery(ref inputData, "is_not_count").ParseToBool(); // 不计数
var prod_count = RegexUtils.GetStringQuery(ref inputData, "prod_count").ParseToInt();
var add_days_less = RegexUtils.GetStringQuery(ref inputData, "add_days_less").ParseToNullableInt();
var has_wx_format = RegexUtils.GetStringQuery(ref inputData, "has_wx_format")?.Replace("'", "\\'");
var is_relation = RegexUtils.GetStringQuery(ref inputData, "is_relation").ParseToNullableInt();
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
@@ -1439,6 +1450,10 @@ namespace KJD_Web.BLL.BXX
{
where += " and has_wx_format = '" + has_wx_format + "'";
}
if (is_relation != null)
{
where += " and is_relation = " + is_relation;
}
sql += where;
int count = prod_count;
@@ -1480,7 +1495,7 @@ namespace KJD_Web.BLL.BXX
sql = "select p.id,p.from_shop_id,p.spu_id,p.skc_id,p.main_cat_id,p.main_cat_name,p.cat_id,p.cat_name,p.price_text,p.ext_code," +
" p.product_name,p.main_img,p.group,p.notes,p.add_time,p.mdy_time,p.product_get_type," +
" p.wx_safe_status,p.special_prod_type,p.wx_cat_1,p.wx_cat_2,p.wx_cat_3,p.send_to_out_server," +
" p.wx_cat_leaf" +
" p.wx_cat_leaf,p.is_relation" +
" from bxx.product p where p.is_del=0";
//where子句
//sql += where;
@@ -1528,6 +1543,7 @@ namespace KJD_Web.BLL.BXX
wx_safe_status = row["wx_safe_status"].ToString(),
special_prod_type = row["special_prod_type"].ToString(),
send_to_out_server = row["send_to_out_server"].ParseToInt(),
is_relation = row["is_relation"].ParseToInt(),
};
productLst.Add(prod);
}
@@ -2996,6 +3012,11 @@ namespace KJD_Web.BLL.BXX
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
/// <summary>
/// 随机工厂商品
/// </summary>
/// <param name="inputData"></param>
/// <returns></returns>
public string GetRandomCompanyProductConfig(string inputData)
{
var timeCalc = DateTime.Now;
@@ -3043,6 +3064,131 @@ namespace KJD_Web.BLL.BXX
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddRelation(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 up_spu_id = RegexUtils.GetStringQuery(ref inputData, "up_spu_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(up_spu_id))
{
return "{\"code\":500,\"msg\":\"缺少上家编号\"}";
}
var index = RegexUtils.GetStringQuery(ref inputData, "index").ParseToNullableLong();
if (index == null)
index = Math.Abs(up_spu_id.GetHashCode()) % 128;
var up_goods_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "up_goods_name"));
if (string.IsNullOrEmpty(up_goods_name))
{
return "{\"code\":500,\"msg\":\"缺少上家商品名称\"}";
}
var from_site = RegexUtils.GetStringQuery(ref inputData, "from_site")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(from_site))
{
return "{\"code\":500,\"msg\":\"缺少关联商品平台\"}";
}
var goods_id = RegexUtils.GetStringQuery(ref inputData, "goods_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(goods_id))
{
return "{\"code\":500,\"msg\":\"缺少关联商品编号\"}";
}
var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(shop_id))
{
return "{\"code\":500,\"msg\":\"缺少关联店铺编号\"}";
}
var price_max = RegexUtils.GetStringQuery(ref inputData, "price_max")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(price_max))
{
return "{\"code\":500,\"msg\":\"缺少关联最高价格\"}";
}
var price_min = RegexUtils.GetStringQuery(ref inputData, "price_min")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(price_min))
{
return "{\"code\":500,\"msg\":\"缺少关联最低价格\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "insert into bxx_relation.out_prod_relation_" + index.ParseToString().PadLeft(4, '0') +
" (up_spu_id,up_goods_name,from_site,goods_id,shop_id,price_min,price_max) " +
" values ('" + up_spu_id + "',@up_goods_name,'" + from_site + "','" +
goods_id + "'," + shop_id + "," + price_min + "," + price_max + ");";
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@up_goods_name", Value = up_goods_name, });
mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (mySql.Message.IsNullOrEmpty())
{
return "{\"code\":200,\"msg\":\"成功\"}";
}
else
{
return "{\"code\":500,\"msg\":\"失败:" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetRelation(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 up_spu_id = RegexUtils.GetStringQuery(ref inputData, "up_spu_id")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(up_spu_id))
{
return "{\"code\":500,\"msg\":\"缺少来源商品编号\"}";
}
var index = RegexUtils.GetStringQuery(ref inputData, "index").ParseToNullableLong();
if (index == null)
index = Math.Abs(up_spu_id.GetHashCode()) % 128;
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select * from bxx_relation.out_prod_relation_" + index.ParseToString().PadLeft(4, '0') +
" where up_spu_id='" + up_spu_id + "' limit 20;";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (mySql.Message.IsNullOrEmpty())
{
JArray jArr = new JArray();
foreach (DataRow row in dt.Rows)
{
JObject jObj = new JObject();
jObj["id"] = row["id"].ParseToInt();
jObj["up_spu_id"] = row["up_spu_id"].ToString();
jObj["up_goods_name"] = row["up_goods_name"].ToString();
jObj["from_site"] = row["from_site"].ToString();
jObj["goods_id"] = row["goods_id"].ToString();
jObj["shop_id"] = row["shop_id"].ToString();
jObj["price_min"] = row["price_min"].ParseToInt();
jObj["price_max"] = row["price_max"].ParseToInt();
jObj["add_time"] = row["add_time"].ParseToString().ParseToDateTime();
jArr.Add(jObj);
}
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
var data = JsonUtils.SerializeObjectToString(jArr, jsonSetting);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + jArr.Count + "}";
}
else
{
return "{\"code\":500,\"msg\":\"失败:" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
@@ -1,8 +1,10 @@
using KJD_Web.Model;
using KJD_Web.Model.ShopModel;
using KJD_Web.Utils;
using MySql.Data.MySqlClient;
using MySqlX.XDevAPI;
using NaiBa.Util.Extension;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -10,11 +12,242 @@ using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI.WebControls;
namespace KJD_Web.BLL.BXX
{
public class BXXShopManage
{
public string GetPddClientInfo(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)
{
return "{\"code\":500,\"msg\":\"用户不存在\"}";
}
JArray jArr = new JArray();
JObject obj1 = new JObject();
obj1["describe"] = "貔貅管家";
obj1["client_id"] = "ad502ec19e0c49ab9df14f83494e153c";
obj1["client_secret"] = "bd52aba51737d03fc073711d386b3b0779d010ad";
obj1["market_id"] = 84862;
obj1["redirect_uri"] = "http%3A%2F%2Fpo.e57.cn%2Flogin%3Fsource%3Dpdd_code";
obj1["is_current"] = false;
jArr.Add(obj1);
JObject obj2 = new JObject();
obj2["describe"] = "小红椒商品管理";
obj2["client_id"] = "48e76c60853d47d8a4e2e631b6db26b5";
obj2["client_secret"] = "b2a5f9eeb36d192ed035f023eaf9ce5280aac397";
obj2["market_id"] = 84690;
obj2["redirect_uri"] = "http%3A%2F%2Fxtjpd.jiaotian.vip%2Fpdd_token.html";
obj2["is_current"] = true;
jArr.Add(obj2);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + JsonUtils.SerializeObject(jArr) + "}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetShopClientInfo(string inputData, bool isAdmin = false)
{
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 user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var password = RegexUtils.GetStringQuery(ref inputData, "password");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
}
var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "");
if (!string.IsNullOrWhiteSpace(shop_ids))
{
List<string> shopIdLst = shop_ids.Split(',').ToList();
shop_ids = "'" + string.Join("','", shopIdLst) + "'";
}
var page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
var page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt();
if (page_size == 0)
page_size = 500;
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "SELECT COUNT(s.id) FROM bxx.shop_api_auth s WHERE 1=1";
//where子句
string where = "";
if (!string.IsNullOrWhiteSpace(shop_ids))
where += " and s.ShopId in (" + shop_ids + ")";
sql += where;
var count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "SELECT * FROM bxx.shop_api_auth s WHERE 1=1";
sql += where; // where 子句
sql += " ORDER BY s.id DESC";
sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":50001,\"msg\":\"查询失败:" + mySql.Message + "\"}";
}
if (dt != null)
{
List<AuthInfo> shopAuthList = new List<AuthInfo>();
foreach (DataRow row in dt.Rows)
{
AuthInfo auth = new AuthInfo
{
id = Convert.ToInt32(row["id"]),
AccessToken = row["AccessToken"].ToString(),
ApiAuthStatus = row["ApiAuthStatus"].ToString(),
AppKey = row["AppKey"].ToString(),
AppSecret = row["AppSecret"].ToString(),
ExpiresTime = row["ExpiresTime"].ParseToString().ParseToDateTime(),
RefreshToken = row["RefreshToken"].ToString(),
ShopId = row["ShopId"].ToString(),
UpdateTime = row["UpdateTime"].ParseToString().ParseToDateTime(),
};
shopAuthList.Add(auth);
}
var data = JsonUtils.SerializeObjectToString(shopAuthList);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string AddMdyShopClientInfo(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\":\"没有用户名\"}";
}
string ShopId = RegexUtils.GetStringQuery(ref inputData, "ShopId")?.Replace("'", "\\'");
string AppKey = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "AppKey"))?.Replace("'", "\\'");
string AccessToken = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "AccessToken"))?.Replace("'", "\\'");
string RefreshToken = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "RefreshToken"))?.Replace("'", "\\'");
string AppSecret = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "AppSecret"))?.Replace("'", "\\'");
string ExpiresTime = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ExpiresTime"))?.Replace("'", "\\'");
string ApiAuthStatus = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ApiAuthStatus"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty("ShopId"))
return "{\"code\":50001,\"msg\":\"没有店铺编号\"}";
if (string.IsNullOrEmpty("AppKey"))
return "{\"code\":50001,\"msg\":\"没有Api编号\"}";
if (string.IsNullOrEmpty("AccessToken"))
return "{\"code\":50001,\"msg\":\"没有令牌信息\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "SELECT ShopId,AppKey FROM `bxx`.`shop_api_auth` where ShopId='" + ShopId + "' and AppKey='" + AppKey + "'";
string where = "";
sql += where;
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
if (dt != null)
{
conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
mySql = new MysqlUtils(conn);
if (dt.Rows.Count == 0)
{
sql = "INSERT INTO `bxx`.`shop_api_auth` (ShopId,AppKey,AccessToken,RefreshToken,AppSecret,ExpiresTime,ApiAuthStatus)" +
" VALUES (@ShopId,@AppKey,@AccessToken,@RefreshToken,@AppSecret,@ExpiresTime,@ApiAuthStatus);";
}
else
{
sql = "UPDATE `bxx`.`shop_api_auth` SET AccessToken=@AccessToken";
if (RefreshToken != null)
sql += ", RefreshToken=@RefreshToken ";
if (AppSecret != null)
sql += ", AppSecret=@AppSecret ";
if (ExpiresTime != null)
sql += ", ExpiresTime=@ExpiresTime ";
if (ApiAuthStatus != null)
sql += ", ApiAuthStatus=@ApiAuthStatus ";
sql += " WHERE ShopId=@ShopId and AppKey=@AppKey;";
}
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "ShopId", Value = ShopId, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "AppKey", Value = AppKey, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "AccessToken", Value = AccessToken.ParseToString(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "RefreshToken", Value = RefreshToken.ParseToString(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "AppSecret", Value = AppSecret.ParseToString(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.DateTime, ParameterName = "ExpiresTime", Value = ExpiresTime.ParseToDateTime(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "ApiAuthStatus", Value = ApiAuthStatus, });
mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":200,\"msg\":\"success\",\"data\":\"\"}";
}
else
{
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
}
}
else
{
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetShop(string inputData, bool isAdmin = false)
{
if (!string.IsNullOrEmpty(inputData))
@@ -919,10 +1152,10 @@ namespace KJD_Web.BLL.BXX
}
else
{
sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.anti_contents,s.pddid,s.mall_id,s.shop_id,s.shop_account,s.sub_user_name," +
"s.user_name,s.company_name,s.notes,s.login_status,s.login_status2,c.add_product_remaining,c.add_product_month," +
sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.wd_token,s.mall_id,s.shop_id,s.shop_account,s.sub_user_name," +
"s.user_name,s.company_name,s.notes,s.login_status,s.login_status2," +
"s.add_time,s.mdy_time,s.add_sub_sa_time,s.operate_sub_sa_name";
sql += " FROM weidian.shop s LEFT JOIN weidian.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1";
sql += " FROM weidian.shop s WHERE 1=1";
sql += where; // where 子句
@@ -932,6 +1165,10 @@ namespace KJD_Web.BLL.BXX
}
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
if (dt != null)
{
List<ShopParam> shopList = new List<ShopParam>();
@@ -944,7 +1181,7 @@ namespace KJD_Web.BLL.BXX
login_pass = row["login_pass"].ToString(),
cookie = row["cookie"].ToString(),
cookie2 = row["cookie2"].ToString(),
anti_contents = row["anti_contents"].ToString(),
wd_token = row["wd_token"].ToString(),
shop_id = row["shop_id"].ToString(),
shop_account = row["shop_account"].ToString(),
sub_user_name = row["sub_user_name"].ToString(),
@@ -953,10 +1190,7 @@ namespace KJD_Web.BLL.BXX
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"].ParseToString(),
pddid = row["pddid"].ParseToString(),
mall_id = row["mall_id"].ParseToString(),
};
shopList.Add(shop);
@@ -981,7 +1215,7 @@ namespace KJD_Web.BLL.BXX
string sub_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_user_name"));
string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie");
string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2");
string anti_contents = RegexUtils.GetStringQuery(ref inputData, "anti_contents");
string wd_token = RegexUtils.GetStringQuery(ref inputData, "wd_token");
string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
string mall_id = RegexUtils.GetStringQuery(ref inputData, "mall_id");
string shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account");
@@ -1011,12 +1245,13 @@ namespace KJD_Web.BLL.BXX
if (exist > 0)
{
mySql.Close();
return "{\"code\":500,\"msg\":\"店铺" + login_name + " " + shop_account + "已存在\"}";
//return "{\"code\":500,\"msg\":\"店铺" + login_name + " " + shop_account + "已存在\"}";
return MdyWeiDianShop(inputData, isAdmin);
}
sql = "insert into weidian.shop (login_name,login_pass,cookie,cookie2,anti_contents,shop_account,shop_id," +
sql = "insert into weidian.shop (login_name,login_pass,cookie,cookie2,wd_token,shop_account,shop_id," +
"mall_id,sub_user_name,user_name,group_name,notes,add_time,mdy_time) " +
"values ('" + login_name + "','" + login_pass + "','" + cookie + "','" + cookie2 + "','" + anti_contents + "','" + shop_account + "','" + shop_id +
"values ('" + login_name + "','" + login_pass + "','" + cookie + "','" + cookie2 + "','" + wd_token + "','" + shop_account + "','" + shop_id +
"','" + mall_id + "','" + sub_user_name + "','" + user_name + "','" + group_name + "','" + notes + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
@@ -1026,6 +1261,8 @@ namespace KJD_Web.BLL.BXX
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
@@ -1042,7 +1279,7 @@ namespace KJD_Web.BLL.BXX
string sub_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_user_name"));
string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie");
string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2");
string anti_contents = RegexUtils.GetStringQuery(ref inputData, "anti_contents");
string wd_token = RegexUtils.GetStringQuery(ref inputData, "wd_token");
string new_shop_id = RegexUtils.GetStringQuery(ref inputData, "new_shop_id");
string old_shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
string mall_id = RegexUtils.GetStringQuery(ref inputData, "mall_id");
@@ -1072,8 +1309,8 @@ namespace KJD_Web.BLL.BXX
sql += " cookie='" + cookie + "',";
if (cookie2 != null)
sql += " cookie2='" + cookie2 + "',";
if (anti_contents != null)
sql += " anti_contents='" + anti_contents + "',";
if (wd_token != null)
sql += " wd_token='" + wd_token + "',";
if (new_shop_id != null)
sql += " shop_id='" + new_shop_id + "',";
if (mall_id != null)
@@ -1093,6 +1330,95 @@ namespace KJD_Web.BLL.BXX
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\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string MdyWeiDianShopCookie(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 shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
string wd_token = RegexUtils.GetStringQuery(ref inputData, "wd_token");
string cookie = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cookie"));
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(shop_id))
{
return "{\"code\":501,\"msg\":\"没有店铺信息\"}";
}
if (string.IsNullOrEmpty(cookie) && string.IsNullOrEmpty(login_status))
{
return "{\"code\":501,\"msg\":\"cookie和登录状态不能全为空\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update weidian.shop set";
if (cookie != null)
sql += " cookie='" + cookie + "',";
if (wd_token != null)
sql += " wd_token='" + wd_token + "',";
if (login_status != null)
sql += " login_status='" + login_status + "',";
sql = sql.TrimEnd(',');
sql += " where shop_id='" + shop_id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
public string DelWeiDianShop(string inputData, bool isAdmin = false)
{
if (!string.IsNullOrEmpty(inputData))
{
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
if (isAdmin)
user_name = RegexUtils.GetStringQuery(ref inputData, "shop_user_name")?.Replace("'", "\\'");
string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
if (string.IsNullOrEmpty(shop_id))
{
return "{\"code\":501,\"msg\":\"没有指定要删除的店铺\"}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "delete from weidian.shop where user_name='" + user_name + "' and shop_id='" + shop_id + "'";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
@@ -33,6 +33,33 @@ namespace KJD_Web.BLL
public void CreateTable()
{
//string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
//MysqlUtils mySql = new MysqlUtils(conn);
//string sql = "";
//for (int i = 0; i < 128; i++)
//{
// sql = @"drop table if exists bxx_relation.out_prod_relation_" + i.ParseToString().PadLeft(4, '0') + ";\r\n";
// sql += @"CREATE TABLE bxx_relation.out_prod_relation_" + i.ParseToString().PadLeft(4, '0') + @" (
// `id` int NOT NULL AUTO_INCREMENT,
// `up_spu_id` varchar(50) NOT NULL COMMENT '源商品id信息,此字段为分表依据',
// `up_goods_name` varchar(255) NOT NULL COMMENT '源商品标题',
// `from_site` varchar(10) NOT NULL COMMENT '商品来源平台如pdd,tb,1688,vd(微店)等',
// `goods_id` varchar(50) NOT NULL COMMENT '映射商品id信息',
// `shop_id` varchar(50) NOT NULL COMMENT '上传到的店铺id',
// `price_min` int NOT NULL COMMENT '最低价,单位分',
// `price_max` int NOT NULL COMMENT '最高价,单位分',
// `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
// PRIMARY KEY(`id`),
// KEY `index_add_time` (`add_time`) USING BTREE,
// KEY `index_up_spu_id` (`up_spu_id`) USING BTREE,
// KEY `index_shop_id` (`shop_id`) USING BTREE,
// KEY `index_price_min` (`price_min`) USING BTREE,
// KEY `index_price_max` (`price_max`) USING BTREE
// ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '记录拼多多关联数据信息'";
// var rst = mySql.ExecuteNonQuery(sql);
//}
//mySql.Close();
//string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
//MysqlUtils mySql = new MysqlUtils(conn);
@@ -374,6 +374,7 @@ namespace KJD_Web.BLL.WXXD
public string WXAddSecretSpuIdShopIdMap(string inputData)
{
return "{\"code\":500,\"msg\":\"接口已作废\"}";
if (!string.IsNullOrEmpty(inputData))
{
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
@@ -539,5 +539,34 @@ namespace KJD_Web
Context.Response.Write(result);
Context.Response.End();
}
/// <summary>
/// 拼多多关联新增
/// </summary>
[WebMethod]
public void add_relation()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddRelation(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
/// <summary>
/// 拼多多关联获取
/// </summary>
[WebMethod]
public void get_relation()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetRelation(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
@@ -49,6 +49,41 @@ namespace KJD_Web
}
}
[WebMethod]
public void get_pdd_client_info()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().GetPddClientInfo(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_shop_client_info()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().GetShopClientInfo(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//WXAddMdyShopClientInfo
[WebMethod]
public void add_mdy_shop_client_info()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().AddMdyShopClientInfo(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_shop_list()
{
@@ -240,5 +275,61 @@ namespace KJD_Web
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_weidian_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().AddWeiDianShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_weidian_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().MdyWeiDianShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_weidian_shop_cookie()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().MdyWeiDianShopCookie(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_weidian_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().GetWeiDianShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_weidian_shop()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXShopManage().DelWeiDianShop(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}
@@ -102,6 +102,7 @@ namespace KJD_Web.Model
public string real_spu_id { get; set; }
public string has_wx_format { get; set; }
public string problem_prod_data { get; set; }
public int is_relation { get; set; }
}
public class KJDDBProduct : DBProductResultParam
@@ -25,6 +25,10 @@ namespace KJD_Web.Model.ShopModel
/// </summary>
public string mall_id { get; set; }
/// <summary>
/// 微店网页token
/// </summary>
public string wd_token { get; set; }
/// <summary>
/// 微信openId
/// </summary>
public string openid { get; set; }
@@ -65,4 +69,17 @@ namespace KJD_Web.Model.ShopModel
public DateTime? jit_expire_time { get; set; }
public DateTime? add_time { get; set; }
}
public class AuthInfo
{
public int id { get; set; }
public string ShopId { get; set; } = "";
public string AccessToken { get; set; } = "";
public string RefreshToken { get; set; } = "";
public string AppKey { get; set; } = "";
public string AppSecret { get; set; } = "";
public DateTime ExpiresTime { get; set; }
public DateTime UpdateTime { get; set; } = DateTime.MinValue;
public string ApiAuthStatus { get; set; } = "未授权";
}
}
@@ -83,6 +83,10 @@ namespace KJD_Web.Upload.Prod
{
string prodStr = Encoding.UTF8.GetString(this.FileUpload1.FileBytes);
prodStr = TextBox2.Text.Trim();
var reducePer = 0m;
var realPricePer = 1m - reducePer * 0.01m;
if (realPricePer < 0.1m)
realPricePer = 0.1m;
WXClientProductInfoLite wxClientProd = new WXClientProductInfoLite();
@@ -92,11 +96,11 @@ namespace KJD_Web.Upload.Prod
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.product_key = JsonUtils.DeserializeJsonToObject<wx_client_prod_key>(regex_str);
if (wxClientProd.product_key == null)
return "解析失败";
return "解析失败product_key";
}
catch
{
return "解析失败";
return "解析失败product_key";
}
//商品详情格式
@@ -105,7 +109,7 @@ namespace KJD_Web.Upload.Prod
//主标题
wxClientProd.info.title = RegexUtils.GetStringJson(ref prodStr, "title");
if (wxClientProd.info.title.IsNullOrEmpty())
return "解析失败";
return "解析失败title";
//副标题
wxClientProd.info.sub_title = RegexUtils.GetStringJson(ref prodStr, "sub_title");
@@ -116,11 +120,11 @@ namespace KJD_Web.Upload.Prod
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.info.head_img = JsonUtils.DeserializeJsonToListNullable<string>(regex_str);
if (wxClientProd.info.head_img == null)
return "解析失败";
return "解析失败head_img";
}
catch
{
return "解析失败";
return "解析失败head_img";
}
var nodeCatId = RegexUtils.GetStringJson(ref prodStr, "nodeCatId");
@@ -139,7 +143,7 @@ namespace KJD_Web.Upload.Prod
}
catch
{
return "解析失败";
return "解析失败category";
}
str_lst = RegexUtils.GetJsonObjStrJson(ref prodStr, "detail");
@@ -158,7 +162,7 @@ namespace KJD_Web.Upload.Prod
}
catch
{
return "解析失败";
return "解析失败detail";
}
str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "param");
@@ -173,7 +177,7 @@ namespace KJD_Web.Upload.Prod
}
catch
{
return "解析失败";
return "解析失败param";
}
//品牌id
@@ -191,7 +195,7 @@ namespace KJD_Web.Upload.Prod
}
catch
{
return "";
return "解析失败sku_id_list";
}
str_lst = RegexUtils.GetJsonObjStrJson(ref prodStr, "sku_list");
@@ -204,7 +208,7 @@ namespace KJD_Web.Upload.Prod
}
catch
{
return "解析失败";
return "解析失败sku_list";
}
if (wxClientProd.info.sku_list == null)
@@ -222,7 +226,16 @@ namespace KJD_Web.Upload.Prod
}
catch
{
return "解析失败";
return "解析失败sku_info";
}
}
// 佣金商品 根据折扣价格和佣金比例减去佣金
if (wxClientProd.info.sku_list != null)
{
foreach (var sku in wxClientProd.info.sku_list.sku_info)
{
sku.price = (sku.price - (sku.price - sku.discounted_price) * (1m - realPricePer)).ParseToInt();
}
}
@@ -236,7 +249,7 @@ namespace KJD_Web.Upload.Prod
}
catch
{
return "解析失败";
return "解析失败product_sale_attrs";
}
@@ -255,7 +268,7 @@ namespace KJD_Web.Upload.Prod
}
catch
{
return "解析失败";
return "解析失败service_desc";
}
str_lst = RegexUtils.GetJsonObjStrJson(ref prodStr, "express_info");
@@ -268,7 +281,7 @@ namespace KJD_Web.Upload.Prod
}
catch
{
return "解析失败";
return "解析失败express_info";
}
str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "headVideoInfo");
@@ -281,7 +294,7 @@ namespace KJD_Web.Upload.Prod
}
catch
{
return "解析失败";
return "解析失败headVideoInfo";
}
str_lst = RegexUtils.GetJsonObjStrJson(ref prodStr, "afterSaleInfo");
@@ -294,7 +307,7 @@ namespace KJD_Web.Upload.Prod
}
catch
{
return "解析失败";
return "解析失败afterSaleInfo";
}
str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "deliveryExpressFee");
@@ -307,7 +320,7 @@ namespace KJD_Web.Upload.Prod
}
catch
{
return "解析失败";
return "解析失败deliveryExpressFee";
}
str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "templateInfo");
@@ -320,7 +333,7 @@ namespace KJD_Web.Upload.Prod
}
catch
{
return "解析失败";
return "解析失败templateInfo";
}
wxClientProd.info.spuCode = RegexUtils.GetStringJson(ref prodStr, "spuCode");
@@ -331,11 +344,26 @@ namespace KJD_Web.Upload.Prod
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.productSkus = JsonUtils.DeserializeJsonToList<WXProductSkuInfoLite>(regex_str);
if (wxClientProd.productSkus == null)
return "解析失败";
return "解析失败productSkus";
}
catch
{
return "解析失败";
return "解析失败productSkus";
}
// 佣金商品 根据价格给售卖价格赋值,如果价格丢失,直接在售卖价上计算
foreach (var sku in wxClientProd.productSkus)
{
var wxDisSku = wxClientProd.info.sku_list?.sku_info?.FirstOrDefault(s => s.sku_id == sku.skuKey.skuId);
if (wxDisSku != null)
sku.productSkuInfo.salePrice = wxDisSku.price;
else
sku.productSkuInfo.salePrice = (sku.productSkuInfo.salePrice - sku.productSkuInfo.salePrice * realPricePer).ParseToInt();
}
if (wxClientProd.productSkus.Min(s => s.productSkuInfo.salePrice * 0.01m) == 0)
{
return "解析失败Sku价格为0";
}
return SaveWxProd(wxClientProd.product_key.product_id, wxClientProd, prodStr);
+32 -20
View File
@@ -1,4 +1,5 @@
using AllBase;
using AllBase.Helper;
using AllBase.Model.Result;
using NaiBa.Util.Extension;
using Newtonsoft.Json;
@@ -25,8 +26,18 @@ namespace TemuKJD.BLL.PddApi
}
Data["access_token"] = shop.AccessToken;
Data["client_id"] = shop.AppKey;
}
/// <summary>
/// 貔貅管家
/// </summary>
public static string clientId_pi_xiu_guan_jia { get; set; } = "ad502ec19e0c49ab9df14f83494e153c";
///// <summary>
///// 小红椒商品管理
///// </summary>
//public static string clientId_xiao_hong_jiao_ { get; set; } = "48e76c60853d47d8a4e2e631b6db26b5";
public string PddGoodsAdd()
{
string type = "pdd.goods.add";
@@ -91,11 +102,11 @@ namespace TemuKJD.BLL.PddApi
return html;
}
public string PddPopAuthTokenCreate()
public string PddPopAuthTokenCreate(string code)
{
string type = "pdd.pop.auth.token.create";
if (!Data.Keys.Contains("code"))
Data["code"] = "83be994d5ed04e6cb9643a423094a3296bf8827a";
Data["code"] = code; //"83be994d5ed04e6cb9643a423094a3296bf8827a";
string html = PddApiRequest(type, Data);
return html;
}
@@ -103,7 +114,7 @@ namespace TemuKJD.BLL.PddApi
/// <summary>
/// 关联
/// </summary>
/// <param name="pid"></param>
/// <param name="goodsId"></param>
/// <param name="outGoodsId"></param>
/// <param name="minPrice">最低价 分</param>
/// <param name="maxPrice">最高价 分</param>
@@ -114,12 +125,11 @@ namespace TemuKJD.BLL.PddApi
/// 15-折800,16-当当,17-青创网,18-开山网,19-新款网
/// </param>
/// <returns></returns>
public string Relation2603(long pid, long outGoodsId, int minPrice, int maxPrice, int postAge, int sourceType)
public string Relation2603(long goodsId, string outGoodsId, int minPrice, int maxPrice, int postAge, int sourceType)
{
string type = "pdd.goods.relation.set";
Data = new Dictionary<string, object>();
Data.Add("goods_id", pid.ToString());
Data.Add("out_goods_id", outGoodsId.ToString());
Data["goods_id"] = goodsId.ToString();
Data["out_goods_id"] = outGoodsId.ToString();
string detailUrl = "";
if (sourceType == 0)
detailUrl = "https://item.taobao.com/item.htm?id=" + outGoodsId;
@@ -129,11 +139,11 @@ namespace TemuKJD.BLL.PddApi
detailUrl = "https://weidian.com/item.html?itemID=" + outGoodsId;
else if (sourceType == 1)
detailUrl = "https://item.jd.com/" + outGoodsId + ".html";
Data.Add("out_detail_url", detailUrl);
Data.Add("out_low_goods_price", minPrice.ToString());
Data.Add("out_high_goods_price", maxPrice.ToString());
Data.Add("source_type", sourceType.ToString());
Data.Add("postage", postAge.ToString());
Data["out_detail_url"] = detailUrl;
Data["out_low_goods_price"] = minPrice.ToString();
Data["out_high_goods_price"] = maxPrice.ToString();
//Data["source_type"] = sourceType.ToString();
Data["postage"] = postAge.ToString();
string html = PddApiRequest(type, Data);
return html;
}
@@ -255,7 +265,7 @@ namespace TemuKJD.BLL.PddApi
#region 设置关联
try
{
string html = this.Relation2603(pddRelation.goods_id.Value, long.Parse(pddRelation.out_goods_id),
string html = this.Relation2603(pddRelation.goods_id.Value, pddRelation.out_goods_id,
(int)pddRelation.out_low_goods_price.Value, (int)pddRelation.out_high_goods_price,
(int)pddRelation.postage.Value, pddRelation.source_type.Value);
if (string.IsNullOrEmpty(html) || !html.Contains("\"is_success\":true"))
@@ -272,10 +282,6 @@ namespace TemuKJD.BLL.PddApi
return upResult;
}
public static string clientId { get; set; } = "ad502ec19e0c49ab9df14f83494e153c";
public static string clientSecret { get; set; } = "bd52aba51737d03fc073711d386b3b0779d010ad";
/// <summary>
///
/// </summary>
@@ -283,18 +289,24 @@ namespace TemuKJD.BLL.PddApi
/// <param name="dict">拼多多接口入参</param>
/// <returns></returns>
static string PddApiRequest(string type, Dictionary<string,object> dict)
{
{
if (string.IsNullOrEmpty(type))
return "{\"success\":false, \"error_msg\":\"调用接口不能为空\"}";
if (dict == null)
return "{\"success\":false, \"error_msg\":\"参数数组不能为空\"}";
if (!dict.Keys.Contains("client_id") || string.IsNullOrEmpty(dict["client_id"].ParseToString()))
return "{\"success\":false, \"error_msg\":\"调用Api编号不能为空\"}";
if (!dict.Keys.Contains("access_token") || string.IsNullOrWhiteSpace(dict["access_token"].ParseToString()))
return "{\"success\":false, \"error_msg\":\"调用令牌不能为空\"}";
var clientSecret = GlobalConfig.PddClentInfoList.FirstOrDefault(c => c.client_id == dict["client_id"].ParseToString())?.client_secret;
if (clientSecret.IsNullOrEmpty())
return "{\"success\":false, \"error_msg\":\"调用密钥不能为空\"}";
DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
var timeStamp = (long)(DateTime.Now - startTime).TotalMilliseconds;
dict["type"] = type;
dict["client_id"] = clientId;
dict["timestamp"] = timeStamp.ToString();
dict["data_type"] = "JSON";
+125 -16
View File
@@ -1,6 +1,8 @@
using AllBase;
using AllBase.Helper;
using AllBase.Model.Result;
using AllBase.Model.Result.PDDResult;
using NaiBa.Util;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
@@ -15,15 +17,18 @@ namespace TemuKJD.BLL.PddApi
{
public static void RefreshApi(ShopLoginInfo shop, bool isForceRefresh = false)
{
if (isForceRefresh || (shop.AuthAddTime <= DateTime.Now.AddDays(-1) && shop.AuthExpiresTime <= DateTime.Now))
if (isForceRefresh || (shop.AuthUpdateTime <= DateTime.Now.AddDays(-1) && shop.AuthExpiresTime <= DateTime.Now))
{
string errStr = "";
var authInfo = PddApiHelper.GetE57ShopPddToken(shop, out errStr);
if (errStr.IsNullOrEmpty() || (shop.AuthAddTime <= DateTime.Now.AddDays(-1) && shop.AuthExpiresTime <= DateTime.Now))
if (errStr.IsNullOrEmpty() || (shop.AuthUpdateTime <= DateTime.Now.AddDays(-1) && shop.AuthExpiresTime <= DateTime.Now))
{
shop.ApiAuthInfoList.RemoveAll(a => a.AppKey.IsNullOrEmpty() || a.AppKey == PddApi.clientId);
shop.ApiAuthInfoList.RemoveAll(a => a.AppKey.IsNullOrEmpty() || a.AppKey == authInfo.AppKey);
shop.ApiAuthInfoList.Add(authInfo);
}
if (authInfo != null && !string.IsNullOrEmpty(authInfo.AccessToken))
PddApiHelper.SaveShopClientInfo(authInfo);
}
}
@@ -38,7 +43,8 @@ namespace TemuKJD.BLL.PddApi
public static AuthInfo GetE57ShopPddToken(ShopLoginInfo shop, out string errorStr)
{
errorStr = "";
var url = BaseClass.BuildObjString("shop/e57_get_pdd_shop_token");
var url = BaseClass.BuildPDDObjString("shop/e57_get_pdd_shop_token");
var data = UserLogin.GetSignaturex();
data += "&mall_id=" + shop.MallId;
var html = GetHtml.PostUtf8(url, data);
@@ -53,30 +59,133 @@ namespace TemuKJD.BLL.PddApi
var token = new AuthInfo()
{
ShopId = shop.ShopId,
AddTime = DateTime.Now,
AppKey = PddApi.clientId, // BaseRegex.GetStringJson(ref html, "appKey").ParseToString(),
UpdateTime = DateTime.Now,
AppKey = PddApi.clientId_pi_xiu_guan_jia,
AccessToken = BaseRegex.GetStringJson(ref html, "accessToken"),
ExpiresTime = BaseClass.StampToDateTime(BaseRegex.GetIntJson(ref html, "tokenExpiresTime")),
ApiAuthStatus = "授权成功",
};
return token;
}
return new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = DateTime.Now };
return new AuthInfo()
{
ShopId = shop.ShopId,
UpdateTime = DateTime.Now,
AppKey = PddApi.clientId_pi_xiu_guan_jia,
AccessToken = "",
ExpiresTime = DateTime.Now,
ApiAuthStatus = "未授权",
};
}
public static List<List<AuthInfo>> LstAuthInfos;
public static void PddGetLocalTokens()
//public static List<List<AuthInfo>> LstAuthInfos { get; set; }
//public static void GetPddLocalTokens()
//{
// if (BaseClass.MainPath == "binxixi")
// {
// LstAuthInfos = NaiBa.Util.Helper.ConfigHelper.LoadConfig<List<List<AuthInfo>>>("pdd_shop_api_auth_info_lists");
// if (LstAuthInfos == null)
// LstAuthInfos = new List<List<AuthInfo>>();
// foreach (var shop in GlobalConfig.ShopLoginList)
// {
// shop.ApiAuthInfoList = LstAuthInfos.FirstOrDefault(l => l.FirstOrDefault()?.ShopId == shop.ShopId);
// if (shop.ApiAuthInfoList == null)
// shop.ApiAuthInfoList = new List<AuthInfo>();
// }
// }
//}
public static void GetShopClientInfo(List<ShopLoginInfo> shops = null)
{
if (BaseClass.MainPath == "binxixi")
{
LstAuthInfos = NaiBa.Util.Helper.ConfigHelper.LoadConfig<List<List<AuthInfo>>>("pdd_shop_api_auth_info_lists");
if (LstAuthInfos == null)
LstAuthInfos = new List<List<AuthInfo>>();
foreach (var shop in GlobalConfig.ShopLoginList)
ConcurrentList<ShopLoginInfo> shopList = new ConcurrentList<ShopLoginInfo>();
if (shops == null)
shopList.AddRange(GlobalConfig.ShopLoginList);
else
shopList.AddRange(shops);
while (shopList.Count > 0)
{
shop.ApiAuthInfoList = LstAuthInfos.FirstOrDefault(l => l.FirstOrDefault()?.ShopId == shop.ShopId);
if (shop.ApiAuthInfoList == null)
shop.ApiAuthInfoList = new List<AuthInfo>();
var shopTemp = shopList.Take(50).ToList();
var url = BaseClass.BuildPDDObjString("shop/get_shop_client_info");
var data = UserLogin.GetSignaturex();
data += "&shop_ids=" + string.Join(",", shopTemp.Select(s => s.ShopId).Distinct());
var html = GetHtml.PostUtf8(url, data);
if (!html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (html.Contains("\"code\":200"))
{
try
{
var dataStr = JsonHelper.SerializeObject(JsonHelper.JObjectParse(html)["data"]);
var serverApiAuthList = JsonHelper.DeserializeJsonToList<AuthInfo>(dataStr);
foreach (var serverAuth in serverApiAuthList)
{
var shop = shopList.FirstOrDefault(s => s.ShopId == serverAuth.ShopId);
var auth = shop.ApiAuthInfoList.FirstOrDefault(a => a.AppKey == serverAuth.AppKey);
if (auth == null)
{
auth = new AuthInfo();
shop.ApiAuthInfoList.Add(auth);
}
auth.ShopId = serverAuth.ShopId;
auth.AccessToken = serverAuth.AccessToken;
auth.RefreshToken = serverAuth.RefreshToken;
auth.AppKey = serverAuth.AppKey;
auth.ExpiresTime = serverAuth.ExpiresTime;
auth.UpdateTime = serverAuth.UpdateTime;
auth.ApiAuthStatus = serverAuth.ApiAuthStatus;
auth.AppSecret = serverAuth.AppSecret;
}
}
catch
{
}
}
shopList.RemoveAll(s => shopTemp.Contains(s));
}
}
}
public static string SaveShopClientInfo(AuthInfo auth)
{
var clientUrl = BaseClass.BuildObjString("shop/add_mdy_shop_client_info");
var data = UserLogin.GetSignaturex()
+ "&ShopId=" + auth.ShopId
+ "&AccessToken=" + auth.AccessToken
+ "&RefreshToken=" + auth.RefreshToken
+ "&AppKey=" + auth.AppKey
+ "&ExpiresTime=" + auth.ExpiresTime.ToString("yyyy-MM-dd HH:mm:ss")
+ "&UpdateTime=" + auth.UpdateTime.ToString("yyyy-MM-dd HH:mm:ss")
+ "&ApiAuthStatus=" + auth.ApiAuthStatus
+ "&AppSecret=" + auth.AppSecret;
var result = GetHtml.PostUtf8(clientUrl, data);
return result;
}
public static void GetPddClientInfo()
{
if (BaseClass.MainPath == "binxixi")
{
var url = BaseClass.BuildPDDObjString("shop/get_pdd_client_info");
var data = UserLogin.GetSignaturex();
data += "&password=" + BaseClass.PassWord;
var html = GetHtml.PostUtf8(url, data);
if (!html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (html.Contains("\"code\":200"))
{
try
{
var clientDataStr = JsonHelper.SerializeObject(JsonHelper.JObjectParse(html)["data"]);
GlobalConfig.PddClentInfoList.Clear();
GlobalConfig.PddClentInfoList.AddRange(JsonHelper.DeserializeJsonToList<PddClientInfo>(clientDataStr));
}
catch { }
}
}
}
+104 -67
View File
@@ -274,6 +274,11 @@ namespace TemuKJD.BLL.VDian
{
vDToken = vDianShop.Wdtoken;
vDCookie = vDianShop.Cookies;
if (vDToken.IsNullOrEmpty())
{
vDToken = "" + BaseRegex.GetMatchRegexString(ref vDCookie, "wdtoken=([^;]+?);");
vDianShop.Wdtoken = vDToken;
}
spider_token = BaseClass.GetMd5(DateTime.Now.ToString()).Substring(0, 4).ToLower();
bool useCache = false;
@@ -289,54 +294,54 @@ namespace TemuKJD.BLL.VDian
// 商品标题赋值
vDianProduct.itemName = prod.ProductTitle;
var allAttrResult = "";
for (int i = 0; !allAttrResult.Contains("\"message\":\"OK\"") && i < 20; i++)
{
allAttrResult = request_vdian_all_attr_com();
Thread.Sleep(Randomx.GetId(300, 500));
}
if (allAttrResult.Contains("\"message\":\"OK\""))
{
var AttrMatches = BaseRegex.GetMatchRegex(ref allAttrResult, "\"attr_id\":([\\s\\S]*?),");
List<string> lst = new List<string>();
foreach (Match match in AttrMatches)
{
var attr = BaseRegex.GetMatchRegexString(match.ToString(), "\"attr_id\":([\\s\\S]*?),");
lst.Add(attr);
if (lst.Count >= 100)
{
var hideAttrResult = request_vdian_hideAttr_com(lst);
if (!hideAttrResult.Contains("\"message\":\"OK\""))
{
prod.MappingResult = BaseRegex.GetMatchRegexString(hideAttrResult, "\"message\":\"([\\s\\S]+?)\"");
if (string.IsNullOrEmpty(prod.MappingResult))
prod.MappingResult = hideAttrResult;
if (hideAttrResult.Contains("LOGIN ERROR"))
{
vDianShop.LoginStatus = 2;
vDianShop.UpGoodAuth = "请先登录";
prod.MappingResult = "店铺 " + vDianShop.ShopName + " 未登录";
}
prod.MappingResult = "转换失败,删除attribute出错" + prod.MappingResult;
LogSave.Add("[微店批量删除店铺attribute出错]" + " pid-" + prod.ProductId + " ptitle-" + prod.ProductTitle + " psid-" + vDianShop.ShopId
+ " psname-" + vDianShop.ShopName + " pfrom-" + prod.From + " pmsg-" + prod.MappingResult);
return null;
}
Thread.Sleep(500);
lst.Clear();
}
}
}
else
{
prod.MappingResult = BaseRegex.GetMatchRegexString(allAttrResult, "\"message\":\"([\\s\\S]+?)\"");
if (string.IsNullOrEmpty(prod.MappingResult))
prod.MappingResult = allAttrResult;
prod.MappingResult = "转换失败,获取attribute出错" + prod.MappingResult;
LogSave.Add("[微店获取店铺attribute出错]" + " pid-" + prod.ProductId + " ptitle-" + prod.ProductTitle + " psid-" + vDianShop.ShopId
+ " psname-" + vDianShop.ShopName + " pfrom-" + prod.From + " pmsg-" + prod.MappingResult);
return null;
}
//var allAttrResult = "";
//for (int i = 0; !allAttrResult.Contains("\"message\":\"OK\"") && i < 20; i++)
//{
// allAttrResult = request_vdian_all_attr_com();
// Thread.Sleep(Randomx.GetId(300, 500));
//}
//if (allAttrResult.Contains("\"message\":\"OK\""))
//{
// var AttrMatches = BaseRegex.GetMatchRegex(ref allAttrResult, "\"attr_id\":([\\s\\S]*?),");
// List<string> lst = new List<string>();
// foreach (Match match in AttrMatches)
// {
// var attr = BaseRegex.GetMatchRegexString(match.ToString(), "\"attr_id\":([\\s\\S]*?),");
// lst.Add(attr);
// if (lst.Count >= 100)
// {
// var hideAttrResult = request_vdian_hideAttr_com(lst);
// if (!hideAttrResult.Contains("\"message\":\"OK\""))
// {
// prod.MappingResult = BaseRegex.GetMatchRegexString(hideAttrResult, "\"message\":\"([\\s\\S]+?)\"");
// if (string.IsNullOrEmpty(prod.MappingResult))
// prod.MappingResult = hideAttrResult;
// if (hideAttrResult.Contains("LOGIN ERROR"))
// {
// vDianShop.LoginStatus = 2;
// vDianShop.UpGoodAuth = "请先登录";
// prod.MappingResult = "店铺 " + vDianShop.ShopName + " 未登录";
// }
// prod.MappingResult = "转换失败,删除attribute出错" + prod.MappingResult;
// LogSave.Add("[微店批量删除店铺attribute出错]" + " pid-" + prod.ProductId + " ptitle-" + prod.ProductTitle + " psid-" + vDianShop.ShopId
// + " psname-" + vDianShop.ShopName + " pfrom-" + prod.From + " pmsg-" + prod.MappingResult);
// return null;
// }
// Thread.Sleep(500);
// lst.Clear();
// }
// }
//}
//else
//{
// prod.MappingResult = BaseRegex.GetMatchRegexString(allAttrResult, "\"message\":\"([\\s\\S]+?)\"");
// if (string.IsNullOrEmpty(prod.MappingResult))
// prod.MappingResult = allAttrResult;
// prod.MappingResult = "转换失败,获取attribute出错" + prod.MappingResult;
// LogSave.Add("[微店获取店铺attribute出错]" + " pid-" + prod.ProductId + " ptitle-" + prod.ProductTitle + " psid-" + vDianShop.ShopId
// + " psname-" + vDianShop.ShopName + " pfrom-" + prod.From + " pmsg-" + prod.MappingResult);
// return null;
//}
// 商品属性
retry:
@@ -372,10 +377,27 @@ namespace TemuKJD.BLL.VDian
// 上传属性获取属性ID
if (wdAttrList.Count > 0)
{
Thread.Sleep(Randomx.GetId(2000, 5000));
List<VDianParam.VDianAttr> wdAttrList_New = new List<VDianParam.VDianAttr>();
var res = this.upLoadAttrx(prod, vDianShop, wdAttrList, wdAttrList_New);
if (!res) return null;
//var res = this.upLoadAttrx(prod, vDianShop, wdAttrList, wdAttrList_New);
//if (!res) return null;
var inAttr = JsonHelper.SerializeObject(wdAttrList);
var outAttr = JsonHelper.SerializeObject(wdAttrList_New);
wdAttrList_New = JsonHelper.DeserializeJsonToList<VDianParam.VDianAttr>(JsonHelper.SerializeObject(wdAttrList));
foreach (var wdAttr in wdAttrList_New)
{
int id = 0;
foreach (var atv in wdAttr.attr_values)
{
id++;
atv.attr_id = id;
atv.attr_title = wdAttr.attr_title;
}
}
wdAttrList = wdAttrList_New;
vDianProduct.attrList = wdAttrList_New;
@@ -431,7 +453,8 @@ namespace TemuKJD.BLL.VDian
}
}
}
vDianSku.price = ((sku.price * (100M + addPercent) / 100M + addPrice) * reduceRate + product.express_price).ToString();
int priceFen = (((sku.price * (100M + addPercent) / 100M + addPrice) * reduceRate + product.express_price) * 100).ParseToInt();
vDianSku.price = (priceFen * 0.01m).ToString();
vDianSku.stock = sku.number > 999999 ? 999999.ToString() : sku.number.ToString();
if (vDianSku.stock == "0")
vDianSku.stock = "1";
@@ -446,7 +469,7 @@ namespace TemuKJD.BLL.VDian
var wdMaxPrice = 0M;
try
{
wdMaxPrice = (product.price * (100M + addPercent) / 100M + addPrice) * reduceRate + product.express_price;
//wdMaxPrice = (product.price * (100M + addPercent) / 100M + addPrice) * reduceRate + product.express_price;
wdMaxPrice = vDianProduct.sku.Max(wd => Convert.ToDecimal(wd.price));
}
catch
@@ -628,15 +651,15 @@ namespace TemuKJD.BLL.VDian
if (mainImgResult.Contains("\"message\":\"SUCCESS\""))
{
var imgUrl = BaseRegex.GetMatchRegexString(mainImgResult, "\"url\":\"([\\s\\S]*?)\"");
//if (!string.IsNullOrEmpty(imgUrl))
//{
// bigImages.Add(imgUrl);
if (!string.IsNullOrEmpty(imgUrl))
{
bigImages.Add(imgUrl);
// // 写图片缓存
// var url = BaseClass.LoginApiUrl + "?obj=upshopid/image_weidian&act=weidian_add";
// var data = UserLogin.GetSignaturex() + "&data=" + item.Item2.Key + "," + imgUrl + ";";
// var html = GetHtml.PostUtf8(url, data);
//}
//// 写图片缓存
//var url = BaseClass.LoginApiUrl + "?obj=upshopid/image_weidian&act=weidian_add";
//var data = UserLogin.GetSignaturex() + "&data=" + item.Item2.Key + "," + imgUrl + ";";
//var html = GetHtml.PostUtf8(url, data);
}
}
else
{
@@ -753,7 +776,7 @@ namespace TemuKJD.BLL.VDian
if (++timesx > 1 || !IsUploadLimitedFailed(tmp_detailId)) break;
Thread.Sleep(Randomx.GetId(2000, 3000));
}
if (tmp_detailId.Contains("\"message\":\"OK\""))
if (tmp_detailId.ParseToString().Contains("\"message\":\"OK\""))
{
tmp_detailId = BaseRegex.GetMatchRegexString(tmp_detailId, "\"tmp_detail_id\":\"([\\s\\S]*?)\"");
vDianProduct.tmpDetailId = tmp_detailId;
@@ -763,7 +786,7 @@ namespace TemuKJD.BLL.VDian
prod.MappingResult = BaseRegex.GetMatchRegexString(tmp_detailId, "\"message\":\"([\\s\\S]+?)\"");
if (string.IsNullOrEmpty(prod.MappingResult))
prod.MappingResult = tmp_detailId;
if (tmp_detailId.Contains("LOGIN ERROR"))
if (tmp_detailId.ParseToString().Contains("LOGIN ERROR"))
{
vDianShop.LoginStatus = 2;
vDianShop.UpGoodAuth = "请先登录";
@@ -824,20 +847,27 @@ namespace TemuKJD.BLL.VDian
vDianProduct.bgCateId = 50023878;
}
vDianProduct.merchantCode = product.out_goods_sn;
// 上货上传商品
var jsonStr = JsonHelper.SerializeObject(vDianProduct);
var result = "";
int timesxx = 0;
while (true)
{
//Thread.Sleep(15000);
Thread.Sleep(Randomx.GetId(8000, 11000));
var ua = getUa(vDianShop);
Thread.Sleep(Randomx.GetId(8000, 11000));
if (string.IsNullOrEmpty(ua))
ua = getUa(vDianShop);
if (string.IsNullOrEmpty(ua))
LogSave.Add("[微店获取Ua失败]" + " pid-" + prod.ProductId + " ptitle-" + prod.ProductTitle + " psid-" + vDianShop.ShopId
+ " psname-" + vDianShop.ShopName + " pfrom-" + prod.From + " pmsg-" + prod.MappingResult);
Thread.Sleep(15000);
//JObject obj = JsonHelper.JObjectParse(jsonStr);
//(obj["attrList"] as JArray).RemoveAt(0);
//var str1 = JsonHelper.SerializeObject(obj);
result = request_vdian_product_com(jsonStr, ua);
if (string.IsNullOrEmpty(result))
@@ -895,7 +925,7 @@ namespace TemuKJD.BLL.VDian
}
if (result.Contains("创建商品过于频繁"))
{
prod.MappingResult = "商品驳回,请更换其它商品转换";
prod.MappingResult = "过于频繁,商品驳回,请更换其它商品转换";
}
prod.MappingResult = "转换失败,上传商品出错:" + prod.MappingResult;
LogSave.Add("[微店上传商品出错]" + " pid-" + prod.ProductId + " ptitle-" + prod.ProductTitle + " psid-" + vDianShop.ShopId
@@ -1009,7 +1039,8 @@ namespace TemuKJD.BLL.VDian
request.KeepAlive = true;
request.Accept = "application/json, */*";
request.Headers.Add("Origin", @"https://d.weidian.com");
request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36";
//request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36";
request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
request.ContentType = "multipart/form-data; boundary=----WebKitFormBoundaryl8PNkxxP0AKTlrpf";
request.Referer = "https://d.weidian.com/weidian-pc/pc-vue-item/?spider_token=" + spider_token;
request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br");
@@ -1117,6 +1148,7 @@ Content-Disposition: form-data; name=""wdtoken""
isGetAttrId = true;
string param = attrList;
//https://thor.weidian.com/wditem/itemSearch.searchAttrs/1.0
string url = "https://thor.weidian.com/wditem/itemWrite.updateAttrList/1.0";
var result = request_vdian_common(url, param);
@@ -1165,7 +1197,8 @@ Content-Disposition: form-data; name=""wdtoken""
request.KeepAlive = true;
request.Accept = "application/json, */*";
request.Headers.Add("Origin", @"https://d.weidian.com");
request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36";
//request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36";
request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
request.Referer = "https://d.weidian.com/weidian-pc/pc-vue-item/?spider_token=" + spider_token;
request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br");
@@ -1261,7 +1294,8 @@ Content-Disposition: form-data; name=""wdtoken""
request.Headers.Add("sec-ch-ua", @"""Google Chrome"";v=""89"", ""Chromium"";v=""89"", "";Not A Brand"";v=""99""");
request.Accept = "application/json, */*";
request.Headers.Add("sec-ch-ua-mobile", @"?0");
request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36";
//request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36";
request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
request.Headers.Add("Origin", @"https://d.weidian.com");
request.Headers.Add("Sec-Fetch-Site", @"same-site");
@@ -1453,6 +1487,7 @@ Content-Disposition: form-data; name=""wdtoken""
request.Accept = "application/json, */*";
request.Headers.Add("Origin", @"https://d.weidian.com");
request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36";
//request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
request.Referer = "https://d.weidian.com/weidian-pc/pc-vue-item/?spider_token=" + spider_token;
request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br");
request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
@@ -1658,6 +1693,8 @@ Content-Disposition: form-data; name=""wdtoken""
/// <returns></returns>
private static bool IsUploadLimitedFailed(string result)
{
if (result == null)
result = "";
return result.Contains("无法连接到远程服务器") || result.Contains("操作超时") || result.Contains("基础连接已经关闭")
|| result.Contains("远程主机强迫关闭") || result.Contains("Unable to write data") || result.Contains("现在人太多了, 请稍后重试");
}
+27
View File
@@ -158,6 +158,12 @@
<Compile Include="PDDForms\ProductForms\ActivityForms\PDDAddActivityForm.Designer.cs">
<DependentUpon>PDDAddActivityForm.cs</DependentUpon>
</Compile>
<Compile Include="PDDForms\ProductForms\ExprotProductForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PDDForms\ProductForms\ExprotProductForm.Designer.cs">
<DependentUpon>ExprotProductForm.cs</DependentUpon>
</Compile>
<Compile Include="PDDForms\ProductForms\WXProdViolationManage.cs" />
<Compile Include="PDDForms\ProductSelectForms\PDDGetChanceProdByImgForm.cs">
<SubType>Form</SubType>
@@ -219,6 +225,18 @@
<Compile Include="ToolForms\GetAddressForm.Designer.cs">
<DependentUpon>GetAddressForm.cs</DependentUpon>
</Compile>
<Compile Include="VDianForms\VDianShopEditForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="VDianForms\VDianShopEditForm.designer.cs">
<DependentUpon>VDianShopEditForm.cs</DependentUpon>
</Compile>
<Compile Include="VDianForms\VDianLoginForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="VDianForms\VDianLoginForm.Designer.cs">
<DependentUpon>VDianLoginForm.cs</DependentUpon>
</Compile>
<Compile Include="VDianForms\VDianShopLoginForm.cs">
<SubType>Form</SubType>
</Compile>
@@ -1204,6 +1222,9 @@
<EmbeddedResource Include="PDDForms\ProductForms\ActivityForms\PDDAddActivityForm.resx">
<DependentUpon>PDDAddActivityForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PDDForms\ProductForms\ExprotProductForm.resx">
<DependentUpon>ExprotProductForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PDDForms\ProductSelectForms\PDDGetChanceProdByImgForm.resx">
<DependentUpon>PDDGetChanceProdByImgForm.cs</DependentUpon>
</EmbeddedResource>
@@ -1234,6 +1255,12 @@
<EmbeddedResource Include="UserComponent\DataGridViewEx.resx">
<DependentUpon>DataGridViewEx.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="VDianForms\VDianShopEditForm.resx">
<DependentUpon>VDianShopEditForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="VDianForms\VDianLoginForm.resx">
<DependentUpon>VDianLoginForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="VDianForms\VDianShopLoginForm.resx">
<DependentUpon>VDianShopLoginForm.cs</DependentUpon>
</EmbeddedResource>
+4 -4
View File
@@ -67,7 +67,7 @@ namespace TemuKJD.KJDForms.ShopForms
localShop.ApiAuthInfoList = new List<AuthInfo>();
localShop.ApiAuthInfoList.AddRange(serverShop.ApiAuthInfoList);
localShop.BuyApiAuth.AccessToken = serverShop.BuyApiAuth.AccessToken;
localShop.BuyApiAuth.AddTime = serverShop.BuyApiAuth.AddTime;
localShop.BuyApiAuth.UpdateTime = serverShop.BuyApiAuth.UpdateTime;
localShop.BuyApiAuth.AppKey = serverShop.BuyApiAuth.AppKey;
localShop.BuyApiAuth.ExpiresTime = serverShop.BuyApiAuth.ExpiresTime;
localShop.BuyApiAuth.RefreshToken = serverShop.BuyApiAuth.RefreshToken;
@@ -160,7 +160,7 @@ namespace TemuKJD.KJDForms.ShopForms
AppKey = appkey,
AccessToken = BaseRegex.GetStringJson(ref shopStr, "access_token"),
RefreshToken = BaseRegex.GetStringJson(ref shopStr, "refresh_token"),
AddTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(),
UpdateTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(),
ExpiresTime = BaseRegex.GetStringJson(ref shopStr, "expires_in").ParseToDateTime(),
});
}
@@ -173,7 +173,7 @@ namespace TemuKJD.KJDForms.ShopForms
AppKey = appkey,
AccessToken = BaseRegex.GetStringJson(ref shopStr, "access_token"),
RefreshToken = BaseRegex.GetStringJson(ref shopStr, "refresh_token"),
AddTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(),
UpdateTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(),
ExpiresTime = BaseRegex.GetStringJson(ref shopStr, "expires_in").ParseToDateTime(),
});
}
@@ -182,7 +182,7 @@ namespace TemuKJD.KJDForms.ShopForms
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.UpdateTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime();
shop.BuyApiAuth.ExpiresTime = BaseRegex.GetStringJson(ref shopStr, "expires_in").ParseToDateTime();
}
}
+12 -8
View File
@@ -40,8 +40,9 @@
System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("库存上传");
System.Windows.Forms.TreeNode treeNode11 = new System.Windows.Forms.TreeNode("商品核价");
System.Windows.Forms.TreeNode treeNode12 = new System.Windows.Forms.TreeNode("随机厂商商品");
System.Windows.Forms.TreeNode treeNode13 = new System.Windows.Forms.TreeNode("微店管理");
System.Windows.Forms.TreeNode treeNode14 = new System.Windows.Forms.TreeNode("超级权限管理", new System.Windows.Forms.TreeNode[] {
System.Windows.Forms.TreeNode treeNode13 = new System.Windows.Forms.TreeNode("商品导入");
System.Windows.Forms.TreeNode treeNode14 = new System.Windows.Forms.TreeNode("微店管理");
System.Windows.Forms.TreeNode treeNode15 = new System.Windows.Forms.TreeNode("超级权限管理", new System.Windows.Forms.TreeNode[] {
treeNode1,
treeNode2,
treeNode3,
@@ -54,7 +55,8 @@
treeNode10,
treeNode11,
treeNode12,
treeNode13});
treeNode13,
treeNode14});
this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
@@ -169,12 +171,14 @@
treeNode11.Text = "商品核价";
treeNode12.Name = "随机厂商商品";
treeNode12.Text = "随机厂商商品";
treeNode13.Name = "微店管理";
treeNode13.Text = "微店管理";
treeNode14.Name = "超级权限管理";
treeNode14.Text = "超级权限管理";
treeNode13.Name = "商品导入";
treeNode13.Text = "商品导入";
treeNode14.Name = "微店管理";
treeNode14.Text = "微店管理";
treeNode15.Name = "超级权限管理";
treeNode15.Text = "超级权限管理";
this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
treeNode14});
treeNode15});
this.tv.OverForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.tv.Size = new System.Drawing.Size(140, 446);
this.tv.TabIndex = 1;
@@ -11,6 +11,7 @@ using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using TemuKJD.BaseForms;
using TemuKJD.PDDForms.ProductForms;
using TemuKJD.PDDForms.ProductSelectForms;
using TemuKJD.ToolForms;
//using TemuKJD.KJDForms.ProductSelectForms;
@@ -28,6 +29,7 @@ namespace TemuKJD.PDDForms.AdminForms
public Lazy<PDDGetChanceProdByImgForm> getChanceProdByImgForm = new Lazy<PDDGetChanceProdByImgForm>();
public Lazy<GetJuShuitanProdForm> getJuShuitanProdForm = new Lazy<GetJuShuitanProdForm>();
public Lazy<RandomComProductForm> randomComProductForm = new Lazy<RandomComProductForm>();
public Lazy<ExprotProductForm> importProdForm = new Lazy<ExprotProductForm>();
public Lazy<VDianUploadProductForm> vDianUploadProductForm = new Lazy<VDianUploadProductForm>();
//public Lazy<DbPriceMarkUpForm> dbPriceMarkUpForm = new Lazy<DbPriceMarkUpForm>();
//public Lazy<DbProductSelectListManageForm> dbProductSelectListManageForm = new Lazy<DbProductSelectListManageForm>();
@@ -108,6 +110,9 @@ namespace TemuKJD.PDDForms.AdminForms
case "随机厂商商品":
SetForm(randomComProductForm.Value);
break;
case "商品导入":
SetForm(importProdForm.Value);
break;
case "微店管理":
SetForm(vDianUploadProductForm.Value);
break;
@@ -2861,7 +2861,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
=> row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList();
foreach (var shop in GlobalConfig.ShopLoginList)
{
if (isForceRefresh || (shop.AuthAddTime <= DateTime.Now.AddDays(-1) && shop.AuthExpiresTime <= DateTime.Now))
if (isForceRefresh || (shop.AuthUpdateTime <= DateTime.Now.AddDays(-1) && shop.AuthExpiresTime <= DateTime.Now))
{
Invoke(new Action(() =>
{
@@ -2876,26 +2876,26 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
}));
}
}
List<List<AuthInfo>> NewApiInfolsts = JsonHelper.DeserializeJsonToList<List<AuthInfo>>(JsonHelper.SerializeObject(GlobalConfig.ShopLoginList.Select(s => s.ApiAuthInfoList).ToList()));
foreach (var newLst in NewApiInfolsts)
{
if (newLst.FirstOrDefault()!= null)
{
var oldApiAuths = PddApiHelper.LstAuthInfos.FirstOrDefault(oldLst => oldLst.FirstOrDefault()?.ShopId == newLst.FirstOrDefault().ShopId);
if (oldApiAuths != null)
{
oldApiAuths.Clear();
oldApiAuths.AddRange(newLst);
}
else
{
PddApiHelper.LstAuthInfos.Add(newLst);
}
}
}
//List<List<AuthInfo>> NewApiInfolsts = JsonHelper.DeserializeJsonToList<List<AuthInfo>>(JsonHelper.SerializeObject(GlobalConfig.ShopLoginList.Select(s => s.ApiAuthInfoList).ToList()));
//foreach (var newLst in NewApiInfolsts)
//{
// if (newLst.FirstOrDefault()!= null)
// {
// var oldApiAuths = PddApiHelper.LstAuthInfos.FirstOrDefault(oldLst => oldLst.FirstOrDefault()?.ShopId == newLst.FirstOrDefault().ShopId);
// if (oldApiAuths != null)
// {
// oldApiAuths.Clear();
// oldApiAuths.AddRange(newLst);
// }
// else
// {
// PddApiHelper.LstAuthInfos.Add(newLst);
// }
// }
//}
PddApiHelper.LstAuthInfos = PddApiHelper.LstAuthInfos.Where(a => a.OrderBy(o => o.AddTime).LastOrDefault().AddTime > DateTime.Now.AddDays(-30)).ToList();
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_shop_api_auth_info_lists", PddApiHelper.LstAuthInfos);
//PddApiHelper.LstAuthInfos = PddApiHelper.LstAuthInfos.Where(a => a.OrderBy(o => o.UpdateTime).LastOrDefault().UpdateTime > DateTime.Now.AddDays(-30)).ToList();
//NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_shop_api_auth_info_lists", PddApiHelper.LstAuthInfos);
Invoke(new Action(() => { pbShopLoading.Visible = false; }));
});
}
@@ -0,0 +1,102 @@
namespace TemuKJD.PDDForms.ProductForms
{
partial class ExprotProductForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.btnExportWxApp = new DevComponents.DotNetBar.PanelEx();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.White;
this.panel1.Controls.Add(this.statusBar);
this.panel1.Controls.Add(this.btnExportWxApp);
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(800, 450);
this.panel1.TabIndex = 432;
//
// 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, 427);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(800, 23);
this.statusBar.TabIndex = 435;
//
// btnExportWxApp
//
this.btnExportWxApp.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnExportWxApp.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnExportWxApp.DisabledBackColor = System.Drawing.Color.Empty;
this.btnExportWxApp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnExportWxApp.Location = new System.Drawing.Point(32, 26);
this.btnExportWxApp.Name = "btnExportWxApp";
this.btnExportWxApp.Size = new System.Drawing.Size(167, 23);
this.btnExportWxApp.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnExportWxApp.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnExportWxApp.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnExportWxApp.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnExportWxApp.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnExportWxApp.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnExportWxApp.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnExportWxApp.Style.GradientAngle = 90;
this.btnExportWxApp.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnExportWxApp.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnExportWxApp.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnExportWxApp.TabIndex = 431;
this.btnExportWxApp.Text = "微信App商品";
this.btnExportWxApp.Click += new System.EventHandler(this.btnExportWxApp_Click);
//
// ExprotProductForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.panel1);
this.Name = "ExprotProductForm";
this.Text = "ExprotProductForm";
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private DevComponents.DotNetBar.PanelEx btnExportWxApp;
private System.Windows.Forms.Panel panel1;
private UserControls.StatusBarUserControl statusBar;
}
}
@@ -0,0 +1,486 @@
using AllBase;
using AllBase.Model.Result.WXResult;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TemuKJD.BaseForms;
using Work;
namespace TemuKJD.PDDForms.ProductForms
{
public partial class ExprotProductForm : BaseForms.BaseForm
{
public ExprotProductForm()
{
InitializeComponent();
}
private void btnExportWxApp_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Multiselect = true;
// 设置过滤条件,只显示文本文件
openFileDialog.Filter = "文本文件 (*.txt)|*.txt|All files (*.*)|*.*";
// 显示对话框并获取结果
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
var filePathLst = openFileDialog.FileNames.ToList();
//pbLoading.Visible = true;
this.statusBar.pgbTaskProgress.Maximum = filePathLst.Count;
this.statusBar.UpdateProgressBar(0);
Task.Run(() =>
{
int successNum = 0;
int failedNum = 0;
foreach (var path in filePathLst)
{
Invoke(new Action(() =>
{
this.statusBar.lblTaskStatus.Text = "正在导入 " + (successNum + failedNum) + "/" + filePathLst.Count + " 成功:" + successNum + " 失败:" + failedNum;
}));
//string content = "";
string rst = "";
try
{
rst = getProd(path);
if (!rst.Contains("成功"))
{
}
}
catch (Exception ex)
{
rst = ex.Message;
}
if (string.IsNullOrEmpty(rst) || rst.Contains("入库成功"))
successNum++;
else
failedNum++;
Invoke(new Action(() =>
{
this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + 1);
this.statusBar.lblTaskStatus.Text = "正在导入 " + (successNum + failedNum) + "/" + filePathLst.Count + " 成功:" + successNum + " 失败:" + failedNum;
}));
}
Invoke(new Action(() =>
{
//pbLoading.Visible = false;
this.statusBar.lblTaskStatus.Text = "导入完成" + (successNum + failedNum) + "/" + filePathLst.Count + " 成功:" + successNum + " 失败:" + failedNum;
BaseMsgForm.ShowInfo("导入完成!");
}));
});
}
}
string getProd(string filePath)
{
string prodStr = "";
//prodStr = Encoding.UTF8.GetString(this.FileUpload1.FileBytes);
//prodStr = TextBox2.Text.Trim();
//prodStr = FileBase.ReadAllText(filePath, Encoding.UTF8);
using (StreamReader sr = new StreamReader(filePath))
{
prodStr = sr.ReadToEnd();
}
var reducePer = filePath.Replace(".txt", "").Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault().ParseToInt();
if (reducePer > 0)
prodStr = "{\"reducePre\":" + reducePer + "}" + prodStr;
var realPricePer = 1m - reducePer * 0.01m;
if (realPricePer < 0.1m)
realPricePer = 0.1m;
WXClientProductInfoLite wxClientProd = new WXClientProductInfoLite();
var str_lst = BaseRegex.GetJsonObjStrJson(ref prodStr, "product_key");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.product_key = JsonHelper.DeserializeJsonToObject<wx_client_prod_key>(regex_str);
if (wxClientProd.product_key == null)
return "解析失败product_key";
}
catch
{
return "解析失败product_key";
}
//商品详情格式
wxClientProd.info = new wx_client_prod_info();
//主标题
wxClientProd.info.title = BaseRegex.GetStringJson(ref prodStr, "title");
if (wxClientProd.info.title.IsNullOrEmpty())
return "解析失败title";
//副标题
wxClientProd.info.sub_title = BaseRegex.GetStringJson(ref prodStr, "sub_title");
str_lst = BaseRegex.GetJsonArrStrJson(ref prodStr, "head_img");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.info.head_img = JsonHelper.DeserializeJsonToListNullable<string>(regex_str);
if (wxClientProd.info.head_img == null)
return "解析失败sub_title";
}
catch
{
return "解析失败sub_title";
}
var nodeCatId = BaseRegex.GetStringJson(ref prodStr, "nodeCatId");
str_lst = BaseRegex.GetJsonArrStrJson(ref prodStr, "category");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.info.category = JsonHelper.DeserializeJsonToListNullable<wx_client_category>(regex_str);
if (wxClientProd.info.category != null && !str_lst.IsNullOrEmpty() && !wxClientProd.info.category.Any(c => c.catIdStr == nodeCatId))
{
wxClientProd.info.category.Add(new wx_client_category() { catId = nodeCatId, cat_id = nodeCatId });
}
//if (wxClientProd.info.category == null)
// return "解析失败";
}
catch
{
return "解析失败category";
}
str_lst = BaseRegex.GetJsonObjStrJson(ref prodStr, "detail");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.info.detail = JsonHelper.DeserializeJsonToObjectNullable<wx_client_prod_detail>(regex_str);
if (wxClientProd.info.detail == null)
{
wxClientProd.info.detail = new wx_client_prod_detail();
wxClientProd.info.detail.detail_img.Add(wxClientProd.info.head_img.FirstOrDefault());
}
//if (wxClientProd.info.detail == null)
// return "解析失败";
}
catch
{
return "解析失败detail";
}
str_lst = BaseRegex.GetJsonArrStrJson(ref prodStr, "param");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.info.param = JsonHelper.DeserializeJsonToListNullable<wx_client_param>(regex_str);
if (wxClientProd.info.param == null)
wxClientProd.info.param = new List<wx_client_param>();
//if (wxClientProd.info.param == null)
// return "解析失败";
}
catch
{
return "解析失败param";
}
//品牌id
wxClientProd.info.brand_id = BaseRegex.GetStringJson(ref prodStr, "brand_id");
//if (wxClientProd.info.brand_id.IsNullOrEmpty())
// return "解析失败";
str_lst = BaseRegex.GetJsonObjStrJson(ref prodStr, "sku_id_list");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.info.sku_id_list = JsonHelper.DeserializeJsonToObjectNullable<wx_client_sku_id_list>(regex_str);
//if (wxClientProd.info.sku_id_list == null)
// return "解析失败";
}
catch
{
return "解析失败sku_id_list";
}
str_lst = BaseRegex.GetJsonObjStrJson(ref prodStr, "sku_list");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.info.sku_list = JsonHelper.DeserializeJsonToObjectNullable<wx_sku>(regex_str);
//if (wxClientProd.info.sku_list == null)
// return "解析失败";
}
catch
{
return "解析失败sku_id_list";
}
if (wxClientProd.info.sku_list == null)
{
str_lst = BaseRegex.GetJsonArrStrJson(ref prodStr, "sku_info");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
var sku_infos = JsonHelper.DeserializeJsonToListNullable<wx_client_sku_info>(regex_str);
if (sku_infos != null)
{
wxClientProd.info.sku_list = new wx_sku();
wxClientProd.info.sku_list.sku_info = sku_infos;
}
}
catch
{
return "解析失败sku_info";
}
}
// 佣金商品 根据折扣价格和佣金比例减去佣金
if (wxClientProd.info.sku_list != null)
{
foreach (var sku in wxClientProd.info.sku_list.sku_info)
{
sku.price = (sku.price - (sku.price - sku.discounted_price) * (1m - realPricePer)).ParseToInt();
}
}
str_lst = BaseRegex.GetJsonArrStrJson(ref prodStr, "product_sale_attrs");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.info.product_sale_attrs = JsonHelper.DeserializeJsonToListNullable<wx_client_product_sale_attr>(regex_str);
//if (wxClientProd.info.product_sale_attrs == null)
// return "解析失败";
}
catch
{
return "解析失败product_sale_attrs";
}
//总销量
wxClientProd.info.total_sold_num = BaseRegex.GetStringJson(ref prodStr, "total_sold_num");
//if (wxClientProd.info.total_sold_num.IsNullOrEmpty())
// return "解析失败";
str_lst = BaseRegex.GetJsonObjStrJson(ref prodStr, "service_desc");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.info.service_desc = JsonHelper.DeserializeJsonToObjectNullable<wx_client_service_desc>(regex_str);
//if (wxClientProd.info.service_desc == null)
// return "解析失败";
}
catch
{
return "解析失败service_desc";
}
str_lst = BaseRegex.GetJsonObjStrJson(ref prodStr, "express_info");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.info.express_info = JsonHelper.DeserializeJsonToObjectNullable<wx_client_express_info>(regex_str);
//if (wxClientProd.info.express_info == null)
// return;
}
catch
{
return "解析失败express_info";
}
str_lst = BaseRegex.GetJsonArrStrJson(ref prodStr, "headVideoInfo");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.info.headVideoInfo = JsonHelper.DeserializeJsonToListNullable<wx_client_head_video_info>(regex_str);
//if (wxClientProd.info.headVideoInfo == null)
// return "解析失败";
}
catch
{
return "解析失败headVideoInfo";
}
str_lst = BaseRegex.GetJsonObjStrJson(ref prodStr, "afterSaleInfo");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.info.afterSaleInfo = JsonHelper.DeserializeJsonToObjectNullable<object>(regex_str);
//if (wxClientProd.info.afterSaleInfo == null)
// return "解析失败";
}
catch
{
return "解析失败afterSaleInfo";
}
str_lst = BaseRegex.GetJsonArrStrJson(ref prodStr, "deliveryExpressFee");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.info.deliveryExpressFee = JsonHelper.DeserializeJsonToListNullable<object>(regex_str);
//if (wxClientProd.info.deliveryExpressFee == null)
// return "解析失败";
}
catch
{
return "解析失败deliveryExpressFee";
}
str_lst = BaseRegex.GetJsonArrStrJson(ref prodStr, "templateInfo");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.info.templateInfo = JsonHelper.DeserializeJsonToListNullable<object>(regex_str);
//if (wxClientProd.info.templateInfo == null)
// return "解析失败";
}
catch
{
return "解析失败templateInfo";
}
wxClientProd.info.spuCode = BaseRegex.GetStringJson(ref prodStr, "spuCode");
str_lst = BaseRegex.GetJsonArrStrJson(ref prodStr, "productSkus");
try
{
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
wxClientProd.productSkus = JsonHelper.DeserializeJsonToList<WXProductSkuInfoLite>(regex_str);
if (wxClientProd.productSkus == null)
return "解析失败productSkus";
}
catch
{
return "解析失败productSkus";
}
// 佣金商品 根据价格给售卖价格赋值,如果价格丢失,直接在售卖价上计算
foreach (var sku in wxClientProd.productSkus)
{
var wxDisSku = wxClientProd.info.sku_list?.sku_info?.FirstOrDefault(s => s.sku_id == sku.skuKey.skuId);
if (wxDisSku != null)
sku.productSkuInfo.salePrice = wxDisSku.price;
else
sku.productSkuInfo.salePrice = (sku.productSkuInfo.salePrice - sku.productSkuInfo.salePrice * realPricePer).ParseToInt();
}
if (wxClientProd.productSkus.Min(s => s.productSkuInfo.salePrice * 0.01m) == 0)
{
return "解析失败Sku价格为0";
}
return SaveWxProd(wxClientProd.product_key.product_id, wxClientProd, prodStr);
}
string SaveWxProd(string prodId, WXClientProductInfoLite wxClientProdInfoLite, string baseStr)
{
bool isExist = false;
var existUrl = BaseClass.BuildPDDObjString("product/get_product_spu_id_list");
string existData = UserLogin.GetSignaturex() + "&search_spu_ids=" + prodId;
//if (!string.IsNullOrEmpty(prod.dbProduct.real_spu_id))
// existData = UserLogin.GetSignaturex() + "&search_spu_ids=" + prod.spuId + "," + prod.dbProduct.real_spu_id;
string html = GetHtml.PostUtf8(existUrl, existData);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(existUrl, existData);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
return "采集入库失败,产品数据库连接失败";
}
else
{
if (html.Contains("\"data\":[") && !html.Contains("\"data\":[]"))
isExist = true;
}
var url = BaseClass.BuildPDDObjString("product/add_product");
if (isExist)
url = BaseClass.BuildPDDObjString("product/mdy_product");
var skus = wxClientProdInfoLite.productSkus;
var product_json = "{\"wxxdData\":" + JsonHelper.SerializeObject(wxClientProdInfoLite) + ",\"baseData\":" + JsonHelper.SerializeObject(baseStr) + "}";
var data = UserLogin.GetSignaturex() +
"&from_shop_id=" + wxClientProdInfoLite.product_key.appid +
"&from_shop_name=" + wxClientProdInfoLite.product_key.appid +
"&spu_id=" + prodId +
"&skc_id=" + prodId +
"&price_text=" + skus.Min(s => s.productSkuInfo.salePrice * 0.01m) + " - " + skus.Max(s => s.productSkuInfo.salePrice * 0.01m) +
"&ext_code=" + wxClientProdInfoLite.info.spuCode +
"&product_name=" + HttpUtility.UrlEncode(wxClientProdInfoLite.info.title, Encoding.UTF8) +
"&product_json=" + HttpUtility.UrlEncode(product_json, Encoding.UTF8) + // product_json /*HttpUtility.UrlEncode(JsonUtils.SerializeObject(wxClientProdInfoLite), Encoding.UTF8)*/
"&sale_count=" + wxClientProdInfoLite.info.total_sold_num +
"&sale_count_text=" + wxClientProdInfoLite.info.total_sold_num +
"&main_img=" + HttpUtility.UrlEncode(wxClientProdInfoLite.info.head_img.FirstOrDefault(), Encoding.UTF8) +
"&wx_safe_status=" + HttpUtility.UrlEncode("安全商品", Encoding.UTF8) +
"&product_get_type=" + HttpUtility.UrlEncode("微信小店", Encoding.UTF8);
if (wxClientProdInfoLite.info.category.Count > 0)
{
data += "&wx_cat_1=" + wxClientProdInfoLite.info.category[0].catIdStr;
data += "&main_cat_id=" + wxClientProdInfoLite.info.category[0].catIdStr;
data += "&main_cat_name=" + wxClientProdInfoLite.info.category[0].name;
data += "&wx_cat_leaf=" + wxClientProdInfoLite.info.category.LastOrDefault()?.catIdStr;
data += "&cat_id=" + wxClientProdInfoLite.info.category.LastOrDefault()?.catIdStr;
data += "&cat_name=" + HttpUtility.UrlEncode((wxClientProdInfoLite.info.category.LastOrDefault()?.name).ParseToString(), Encoding.UTF8);
}
if (wxClientProdInfoLite.info.category.Count > 1)
{
data += "&wx_cat_2=" + wxClientProdInfoLite.info.category[1].catIdStr;
}
if (wxClientProdInfoLite.info.category.Count > 2)
{
data += "&wx_cat_3=" + wxClientProdInfoLite.info.category[2].catIdStr;
}
if (wxClientProdInfoLite.info.category.FirstOrDefault().name == "图书")
{
data += "&special_prod_type=" + HttpUtility.UrlEncode("书籍", 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"))
{
string msg = "商品入库失败!请检查网络连接:" + BaseRegex.GetStringJson(ref html, "msg");
//Invoke(new Action(() =>
//{
// row.Cells["colMsg"].Value = msg;
//}));
return msg;
}
else
{
//prod.getProductMsg = "商品入库成功!";
//Invoke(new Action(() =>
//{
// row.Cells["colMsg"].Value = prod.getProductMsg;
//}));
if (!isExist)
{
url = BaseClass.BuildPDDObjString("product/mdy_product");
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");
return msg;
}
}
return "微信商品采集入库成功!";
}
}
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -43,8 +43,8 @@ namespace TemuKJD.PDDForms.ProductForms
if (info.updateDay == DateTime.Now.ToString("yyMMdd"))
{
// 今日同步过,跳过
continue;
// 今日同步过,跳过,暂时关闭改为每次打开立即读取
//continue;
}
info.failReason = "";
@@ -148,8 +148,8 @@ namespace TemuKJD.PDDForms.ProductForms
catch { }
}
}
// 休眠一小时
Thread.Sleep(1000 * 60 * 60);
// 休眠两个小时
Thread.Sleep(1000 * 60 * 60 * 2);
}
});
}
File diff suppressed because it is too large. Load diff
@@ -412,6 +412,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
data += "&problem_prod_data=2";
else if (!string.IsNullOrEmpty(cmbHasReturn.Text.Trim()))
data += "&problem_prod_data=" + cmbHasReturn.Text.Trim();
if (cmbPddRelation.Text == "否")
data += "&is_relation=0";
else if (cmbPddRelation.Text == "是")
data += "&is_relation=1";
}));
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
@@ -526,6 +532,24 @@ namespace TemuKJD.PDDForms.ProductSelectForms
var cate3 = cates3.FirstOrDefault(c => c.level == 3 && c.name == cmbCat1.Text.Trim());
}
private void dgvDbProduct_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0)
return;
string headerText = dgvDbProduct.Columns[e.ColumnIndex].HeaderText;
var dbId = dgvDbProduct.Rows[e.RowIndex].Cells["col_db_id"].Value.ParseToString();
var dbProduct = lstTemuDbProduct.FirstOrDefault(p => p.id.ToString() == dbId);
switch (headerText)
{
case "标题":
dgvDbProduct.Rows[e.RowIndex].Cells["colSelect"].Value = !(bool)dgvDbProduct.Rows[e.RowIndex].Cells["colSelect"].Value;
break;
default:
break;
}
}
private void dgvDbProduct_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0)
@@ -40,6 +40,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.txtMultiPcsSku4 = new System.Windows.Forms.TextBox();
this.label27 = new System.Windows.Forms.Label();
this.txtMultiPcsSku3 = new System.Windows.Forms.TextBox();
this.txtMultiPcsSku2 = new System.Windows.Forms.TextBox();
this.txtMultiPcsSku1 = new System.Windows.Forms.TextBox();
@@ -96,6 +98,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.line2 = new DevComponents.DotNetBar.Controls.Line();
this.label26 = new System.Windows.Forms.Label();
this.ucGroupBoxEx4 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.chkRelation = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.cmbCateFilter3 = new TemuKJD.UserComponent.UcComboBoxMutiSelect();
this.label25 = new System.Windows.Forms.Label();
this.cmbCateFilter2 = new TemuKJD.UserComponent.UcComboBoxMutiSelect();
@@ -186,8 +189,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnClear = new DevComponents.DotNetBar.PanelEx();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.panel1 = new System.Windows.Forms.Panel();
this.txtMultiPcsSku4 = new System.Windows.Forms.TextBox();
this.label27 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -306,6 +307,27 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucGroupBoxEx2.TabStop = false;
this.ucGroupBoxEx2.Text = "商品上传";
//
// txtMultiPcsSku4
//
this.txtMultiPcsSku4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtMultiPcsSku4.Location = new System.Drawing.Point(849, 109);
this.txtMultiPcsSku4.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtMultiPcsSku4.Name = "txtMultiPcsSku4";
this.txtMultiPcsSku4.Size = new System.Drawing.Size(25, 23);
this.txtMultiPcsSku4.TabIndex = 884;
this.txtMultiPcsSku4.Text = "1.1";
//
// label27
//
this.label27.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label27.AutoSize = true;
this.label27.Location = new System.Drawing.Point(812, 112);
this.label27.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label27.Name = "label27";
this.label27.Size = new System.Drawing.Size(41, 17);
this.label27.TabIndex = 883;
this.label27.Text = "价格×";
//
// txtMultiPcsSku3
//
this.txtMultiPcsSku3.Location = new System.Drawing.Point(787, 109);
@@ -486,7 +508,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnApiUpload.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnApiUpload.TabIndex = 742;
this.btnApiUpload.Text = "批量上传";
this.btnApiUpload.Visible = false;
this.btnApiUpload.Click += new System.EventHandler(this.btnApiUpload_Click);
//
// btnUpload
@@ -1027,6 +1048,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
| System.Windows.Forms.AnchorStyles.Left)));
this.ucGroupBoxEx4.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx4.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx4.Controls.Add(this.chkRelation);
this.ucGroupBoxEx4.Controls.Add(this.cmbCateFilter3);
this.ucGroupBoxEx4.Controls.Add(this.label25);
this.ucGroupBoxEx4.Controls.Add(this.cmbCateFilter2);
@@ -1057,6 +1079,18 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucGroupBoxEx4.TabStop = false;
this.ucGroupBoxEx4.Text = "待传商品";
//
// chkRelation
//
this.chkRelation.Checked = true;
this.chkRelation.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkRelation.Location = new System.Drawing.Point(262, 76);
this.chkRelation.Name = "chkRelation";
this.chkRelation.Size = new System.Drawing.Size(64, 21);
this.chkRelation.TabIndex = 856;
this.chkRelation.Text = "转换数据";
this.chkRelation.UseVisualStyleBackColor = true;
this.chkRelation.Visible = false;
//
// cmbCateFilter3
//
this.cmbCateFilter3.DefaultText = "全部";
@@ -2249,27 +2283,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.panel1.TabIndex = 189;
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
//
// txtMultiPcsSku4
//
this.txtMultiPcsSku4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtMultiPcsSku4.Location = new System.Drawing.Point(849, 109);
this.txtMultiPcsSku4.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtMultiPcsSku4.Name = "txtMultiPcsSku4";
this.txtMultiPcsSku4.Size = new System.Drawing.Size(25, 23);
this.txtMultiPcsSku4.TabIndex = 884;
this.txtMultiPcsSku4.Text = "1.1";
//
// label27
//
this.label27.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label27.AutoSize = true;
this.label27.Location = new System.Drawing.Point(812, 112);
this.label27.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label27.Name = "label27";
this.label27.Size = new System.Drawing.Size(41, 17);
this.label27.TabIndex = 883;
this.label27.Text = "价格×";
//
// PDDDBProdUserSelectForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -2474,5 +2487,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private System.Windows.Forms.Label label26;
private System.Windows.Forms.TextBox txtMultiPcsSku4;
private System.Windows.Forms.Label label27;
private UserComponent.UcCheckBox chkRelation;
}
}
@@ -71,7 +71,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private void UserSelectDbProductForm_Load(object sender, EventArgs e)
{
//Task.Run(() => { InitPddToken(); });
RefreshApi();
//RefreshApi();
this.splitContainer1.Dock = DockStyle.Fill;
this.panel1.Location = new Point(40, 30);
@@ -6275,6 +6275,10 @@ Content-Type: image/jpeg
data += "&is_supplier_prod_ok=" + "已设置";
data += "&wx_safe_status=" + "安全商品,未校验";
}
if (chkRelation.Checked)
{
data += "&is_relation=1";
}
}));
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
@@ -7239,6 +7243,32 @@ Content-Type: image/jpeg
//Thread.Sleep(Randomx.GetId(500, 5000));
//return "{\"success\":true,\"goods_id\":" + 1000000 + ",\"status\":\"已上传\",\"msg\":\"上传成功\"}";
// 获取映射关系
List<PddRelationParam> relationLst = new List<PddRelationParam>();
PddRelationParam relationData = null;
{
var url = BaseClass.BuildPDDObjString("product/get_relation");
var data = UserLogin.GetSignaturex();
data += "&up_spu_id=" + selectProd.spu_id;
data += "&index=" + Math.Abs((selectProd.spu_id).GetHashCode()) % 128;
var result = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(result) || !result.Contains("\"code\":200"))
result = GetHtml.PostUtf8(url, data);
if (result.Contains("\"data\":[]"))
{
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"转换数据获取失败\"}";
}
try
{
var jStr = JsonHelper.SerializeObject(JsonHelper.JObjectParse(result)["data"]);
relationLst = JsonHelper.DeserializeJsonToList<PddRelationParam>(jStr);
}
catch (Exception ex)
{
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"转换数据获取失败" + ex.Message + "\"}";
}
}
KJDDBProduct dbProd = selectProd.kjdDbProduct;
if (dbProd == null)
dbProd = GetProductDetail(selectProd.out_product_Id.ToString());
@@ -7773,6 +7803,14 @@ Content-Type: image/jpeg
// sk.multi_price = maxPrice1;
// sk.price = maxPrice1 + 100;
//}
var addPriceFakeSkuInfoMinPrice = addPriceFakeSkuInfoLst.Min(s => s.price);
var addPriceFakeSkuInfoMaxPrice = addPriceFakeSkuInfoLst.Max(s => s.price);
relationData = relationLst?
.OrderBy(r => r.price_min.ParseToInt())
.FirstOrDefault(r => r.price_min.ParseToInt() * 1.08m > addPriceFakeSkuInfoMinPrice && r.price_max.ParseToInt() * 1.08m > addPriceFakeSkuInfoMaxPrice);
if (relationData == null)
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"转换数据获取价格失败\"}";
}
#endregion
@@ -7831,6 +7869,17 @@ Content-Type: image/jpeg
addPriceSkuInfoLst.Add(skuInfo);
}
if (relationData == null)
{
var addPriceSkuInfoMinPrice = addPriceSkuInfoLst.Min(s => s.price);
var addPriceSkuInfoMaxPrice = addPriceSkuInfoLst.Max(s => s.price);
relationData = relationLst?
.OrderBy(r => r.price_min.ParseToInt())
.FirstOrDefault(r => r.price_min.ParseToInt() * 1.08m > addPriceSkuInfoMinPrice && r.price_max.ParseToInt() * 1.08m > addPriceSkuInfoMaxPrice);
if (relationData == null)
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"转换数据获取价格失败\"}";
}
}
#endregion
@@ -8024,6 +8073,25 @@ Content-Type: image/jpeg
}
var goods_id = BaseRegex.GetStringJson(ref upLoadRst, "goods_id");
if (!string.IsNullOrEmpty(goods_id))
{
var pddRelationApi = new PddApi(shop);
int sourceType = 8;
if (relationData.from_site == "vd")
sourceType = 8;
var relationRst = pddRelationApi.Relation2603(goods_id.ParseToLong(), relationData.goods_id, relationData.price_min.ParseToInt(), relationData.price_max.ParseToInt(), 0, sourceType);
if (!relationRst.Contains("\"is_success\":true"))
relationRst = pddRelationApi.Relation2603(goods_id.ParseToLong(), relationData.goods_id, relationData.price_min.ParseToInt(), relationData.price_max.ParseToInt(), 0, sourceType);
if (!relationRst.Contains("\"is_success\":true"))
relationRst = pddRelationApi.Relation2603(goods_id.ParseToLong(), relationData.goods_id, relationData.price_min.ParseToInt(), relationData.price_max.ParseToInt(), 0, sourceType);
if (!relationRst.Contains("\"is_success\":true"))
{
return "{\"success\":true,\"goods_id\":" + goods_id + ",\"status\":\"已上传但转换异常\",\"msg\":\"上传成功\"}";
}
}
return "{\"success\":true,\"goods_id\":" + goods_id + ",\"status\":\"已上传\",\"msg\":\"上传成功\"}";
}
@@ -8631,7 +8699,12 @@ Content-Type: image/jpeg
=> row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList();
foreach (var shop in GlobalConfig.ShopLoginList)
{
if (isForceRefresh || (shop.AuthAddTime <= DateTime.Now.AddDays(-1) && shop.AuthExpiresTime <= DateTime.Now))
if (shop.ShopAccount.Contains("阿杰"))
{
}
if (isForceRefresh || (shop.AuthUpdateTime <= DateTime.Now.AddDays(-1) && shop.AuthExpiresTime <= DateTime.Now))
{
Invoke(new Action(() =>
{
@@ -8646,26 +8719,26 @@ Content-Type: image/jpeg
}));
}
}
List<List<AuthInfo>> NewApiInfolsts = JsonHelper.DeserializeJsonToList<List<AuthInfo>>(JsonHelper.SerializeObject(GlobalConfig.ShopLoginList.Select(s => s.ApiAuthInfoList).ToList()));
foreach (var newLst in NewApiInfolsts)
{
if (newLst.FirstOrDefault()!= null)
{
var oldApiAuths = PddApiHelper.LstAuthInfos.FirstOrDefault(oldLst => oldLst.FirstOrDefault()?.ShopId == newLst.FirstOrDefault().ShopId);
if (oldApiAuths != null)
{
oldApiAuths.Clear();
oldApiAuths.AddRange(newLst);
}
else
{
PddApiHelper.LstAuthInfos.Add(newLst);
}
}
}
//List<List<AuthInfo>> NewApiInfolsts = JsonHelper.DeserializeJsonToList<List<AuthInfo>>(JsonHelper.SerializeObject(GlobalConfig.ShopLoginList.Select(s => s.ApiAuthInfoList).ToList()));
//foreach (var newLst in NewApiInfolsts)
//{
// if (newLst.FirstOrDefault()!= null)
// {
// var oldApiAuths = PddApiHelper.LstAuthInfos.FirstOrDefault(oldLst => oldLst.FirstOrDefault()?.ShopId == newLst.FirstOrDefault().ShopId);
// if (oldApiAuths != null)
// {
// oldApiAuths.Clear();
// oldApiAuths.AddRange(newLst);
// }
// else
// {
// PddApiHelper.LstAuthInfos.Add(newLst);
// }
// }
//}
PddApiHelper.LstAuthInfos = PddApiHelper.LstAuthInfos.Where(a => a.OrderBy(o => o.AddTime).LastOrDefault().AddTime > DateTime.Now.AddDays(-30)).ToList();
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_shop_api_auth_info_lists", PddApiHelper.LstAuthInfos);
//PddApiHelper.LstAuthInfos = PddApiHelper.LstAuthInfos.Where(a => a.OrderBy(o => o.UpdateTime).LastOrDefault().UpdateTime > DateTime.Now.AddDays(-30)).ToList();
//NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_shop_api_auth_info_lists", PddApiHelper.LstAuthInfos);
Invoke(new Action(() => { pbShopLoading.Visible = false; }));
});
}
@@ -8675,6 +8748,9 @@ Content-Type: image/jpeg
WXUserProdListForm.Instance.lstTemuDBProductSelect = this.lstTemuDBProductSelect;
WXUserProdListForm.Instance.cmbSourceType.Items.Clear();
WXUserProdListForm.Instance.cmbSourceType.Items.AddRange(this.cmbSourceType.Items.Cast<Object>().ToArray());
WXUserProdListForm.Instance.lblRelation.Visible = false;
WXUserProdListForm.Instance.cmbRelation.Visible = false;
WXUserProdListForm.Instance.cmbRelation.Text = "是";
WXUserProdListForm.Instance.SaveComplete -= dbProdList_SaveComplete;
WXUserProdListForm.Instance.SaveComplete += dbProdList_SaveComplete;
WXUserProdListForm.Instance.Show();
+32 -35
View File
@@ -65,7 +65,7 @@ namespace TemuKJD.PDDForms.ShopForms
localShop.ApiAuthInfoList.AddRange(serverShop.ApiAuthInfoList);
}
localShop.BuyApiAuth.AccessToken = serverShop.BuyApiAuth.AccessToken;
localShop.BuyApiAuth.AddTime = serverShop.BuyApiAuth.AddTime;
localShop.BuyApiAuth.UpdateTime = serverShop.BuyApiAuth.UpdateTime;
localShop.BuyApiAuth.AppKey = serverShop.BuyApiAuth.AppKey;
localShop.BuyApiAuth.ExpiresTime = serverShop.BuyApiAuth.ExpiresTime;
localShop.BuyApiAuth.RefreshToken = serverShop.BuyApiAuth.RefreshToken;
@@ -82,7 +82,7 @@ namespace TemuKJD.PDDForms.ShopForms
GlobalConfig.ShopLoginList.Add(localShop);
}
}
PddApiHelper.PddGetLocalTokens();
//PddApiHelper.GetPddLocalTokens();
}
public static List<ShopLoginInfo> GetServerShop()
@@ -152,7 +152,7 @@ namespace TemuKJD.PDDForms.ShopForms
AppKey = appkey,
AccessToken = BaseRegex.GetStringJson(ref shopStr, "access_token"),
RefreshToken = BaseRegex.GetStringJson(ref shopStr, "refresh_token"),
AddTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(),
UpdateTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(),
ExpiresTime = BaseRegex.GetStringJson(ref shopStr, "expires_in").ParseToDateTime(),
});
}
@@ -165,7 +165,7 @@ namespace TemuKJD.PDDForms.ShopForms
AppKey = appkey,
AccessToken = BaseRegex.GetStringJson(ref shopStr, "access_token"),
RefreshToken = BaseRegex.GetStringJson(ref shopStr, "refresh_token"),
AddTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(),
UpdateTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(),
ExpiresTime = BaseRegex.GetStringJson(ref shopStr, "expires_in").ParseToDateTime(),
});
}
@@ -174,7 +174,7 @@ namespace TemuKJD.PDDForms.ShopForms
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.UpdateTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime();
shop.BuyApiAuth.ExpiresTime = BaseRegex.GetStringJson(ref shopStr, "expires_in").ParseToDateTime();
}
}
@@ -805,23 +805,6 @@ namespace TemuKJD.PDDForms.ShopForms
cookJs += "\r\ndocument.cookie='" + cookie + "; domain=mms.pinduoduo.com; expires=" +
DateTime.Now.AddMonths(1).ToUniversalTime().ToString("ddd, dd MMM yyyy HH:mm:ss 'UTC'", new DateTimeFormatInfo()) + "; path=/';";
}
// 全球站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://mms.pinduoduo.com/home'; }, 200)";
Clipboard.SetDataObject(cookJs);
BaseMsgForm.ShowInfo("复制成功");
@@ -831,6 +814,7 @@ namespace TemuKJD.PDDForms.ShopForms
//PDDShopUpdateCookieForm updateCookieForm = new PDDShopUpdateCookieForm(shop);
//updateCookieForm.SaveComplete += UpdateCookieForm_SaveComplete;
//updateCookieForm.ShowDialog();
// 使用fiddler工具获取小密封破解工作台cookie
PDDShopUpdateFddlCookieForm updateFddlCookieForm = new PDDShopUpdateFddlCookieForm(shop);
updateFddlCookieForm.SaveComplete += UpdateCookieForm_SaveComplete;
updateFddlCookieForm.ShowDialog();
@@ -861,23 +845,36 @@ namespace TemuKJD.PDDForms.ShopForms
break;
case "购买授权":
{
PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shop);
shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/service-detail?detailId=84862";
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
shopLoginForm.ShowDialog();
btnRefreshCookie_Click(null, null);
var currentPddClient = GlobalConfig.PddClentInfoList.FirstOrDefault(c => c.is_current == true);
if (currentPddClient != null)
{
PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shop);
//shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/service-detail?detailId=84862";
//shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/service-detail?detailId=84690";
shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/service-detail?detailId=" + currentPddClient.market_id;
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
shopLoginForm.ShowDialog();
btnRefreshCookie_Click(null, null);
}
}
break;
case "绑定授权":
{
PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shop);
shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=" + PddApi.clientId + "&redirect_uri=" +
GetHtml.UrlEncodeUtf8("http://po.e57.cn/login") + "?source=pdd_code&response_type=code";
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
shopLoginForm.ShowDialog();
btnRefreshCookie_Click(null, null);
var currentPddClient = GlobalConfig.PddClentInfoList.FirstOrDefault(c => c.is_current == true);
if (currentPddClient != null)
{
PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shop);
//shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=" + PddApi.clientId_pi_xiu_guan_jia + "&redirect_uri=" + GetHtml.UrlEncodeUtf8("http://po.e57.cn/login") + "?source=pdd_code&response_type=code";
//shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=48e76c60853d47d8a4e2e631b6db26b5&redirect_uri=http%3A%2F%2Fxtjpd.jiaotian.vip%2Fpdd_token.html&response_type=code"
shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=" + currentPddClient.client_id +
"&redirect_uri=" + currentPddClient.redirect_uri + "&response_type=code";
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.AuthClientId = currentPddClient.client_id;
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
shopLoginForm.ShowDialog();
btnRefreshCookie_Click(null, null);
}
}
break;
//case "多重登录":
+44 -39
View File
@@ -27,6 +27,7 @@ using Work.BLL.Tools;
using TemuKJD.BLL;
using AllBase.Model.Result.PDDResult;
using AllBase.Model.Param.PDDProdParam;
using TemuKJD.BLL.PddApi;
namespace TemuKJD.PDDForms.ShopForms
{
@@ -63,6 +64,8 @@ namespace TemuKJD.PDDForms.ShopForms
private ShopLoginInfo shop = null;
private List<ShopCompany> lstShopCompany = new List<ShopCompany>();
private string currentUrl = "";
// 绑定授权的时候传进来和回调信息封装好传到数据库端
public string AuthClientId = "";
public PDDShopLoginForm(ShopLoginInfo shopInfo)
{
@@ -754,45 +757,6 @@ namespace TemuKJD.PDDForms.ShopForms
}
}
//if (responseData.Contains("球球小小店铺55") && responseData.Contains("pdd24873711027"))
//{
// Task.Run(() =>
// {
// var data = responseData;
// if (this.shop != null && data.Contains("\"success\":true"))
// {
// var username = BaseRegex.GetStringJson(ref data, "username");
// var maskMobile = BaseRegex.GetStringJson(ref data, "mobile");
// maskMobile = maskMobile.Split('*').Last();
// if (string.IsNullOrWhiteSpace(maskMobile) || string.IsNullOrWhiteSpace(username))
// return;
// if (shop.LoginName.EndsWith(maskMobile) || shop.LoginName == username)
// {
// lstShopCompany.Clear();
// //var jObj = JObject.Parse(data);
// //var jArr = jObj["result"] as JArray;
// //if (jArr == null)
// // jArr = new JArray();
// Thread.Sleep(500);
// ShopCompany sc = new ShopCompany()
// {
// MallId = BaseRegex.GetStringJson(ref data, "mall_id"),
// AccountId = BaseRegex.GetStringJson(ref data, "username"),
// AccountName = BaseRegex.GetStringJson(ref data, "mall_name"),
// LoginName = shop.LoginName,
// UserName = BaseClass.UserName,
// LoginStatus = "登录成功",
// AntiContent = antiContent,
// };
// this.lstShopCompany.Add(sc);
// }
// }
// });
//}
//if (url == "https://mms.pinduoduo.com/janus/api/userinfo" /*|| url == "https://mms.pinduoduo.com/janus/api/new/userinfo"*/)
//{
// Task.Run(() =>
@@ -889,6 +853,47 @@ namespace TemuKJD.PDDForms.ShopForms
}
});
}
if (url.Contains("https://xtjpd.jiaotian.vip/") && responseData.Contains("access_token"))
{
Task.Run(() =>
{
var pddClientData = responseData;
pddClientData = GetHtml.Unicode2String(pddClientData);
// {"id":"2","cid":"2","company_id":"0","site_id":"2","main_sid":"0","shop_id":"490943134","shop_name":"pdd49094313446","mall_name":"阿杰小铺浦哈哈","mall_desc":"您的小店已开启,为了更方便消费者了解您的店铺,快来补充店铺详情吧~","logo":"http:\/\/t16img.yangkeduo.com\/pdd_ims\/img_check\/v2\/E62F2CFFFFFF0720200112155452281\/7a235545414b40deaa2a90ab8eaebfd3.png","merchant_type":"1","mall_character":"2","access_token":"3f66557920e0481697325b46c73299e76e3d9e7e","refresh_token":"aa163da98e944063abbbe57a5365fad2fa90fe50","expires_at":"1776264848","expires_in":"26259","refresh_token_expires_at":"1776264848","refresh_token_expires_in":"26259","buy_sku_id":"435494","spec_name":"服务版本:专业版,周期:15天","spec_value":"专业版","goods_get_time":null,"order_get_time":null,"addtime":"2026-03-31 22:54:29","add_user_id":"2","add_user_name":"授权","update_time":"2026-04-15 15:36:27","update_user_id":"0","delete_user_id":"0"}
var access_token = BaseRegex.GetStringJson(ref pddClientData, "access_token");
var refresh_token = BaseRegex.GetStringJson(ref pddClientData, "refresh_token");
var mall_id = BaseRegex.GetStringJson(ref pddClientData, "shop_id");
var shop_id = BaseRegex.GetStringJson(ref pddClientData, "shop_name");
var mall_name = BaseRegex.GetStringJson(ref pddClientData, "mall_name"); // 阿杰小铺浦哈哈
var expires_at = BaseRegex.GetStringJson(ref pddClientData, "expires_at");
if (shop?.MallId == mall_id && !string.IsNullOrWhiteSpace(AuthClientId))
{
var auth = shop.ApiAuthInfoList.FirstOrDefault(a => a.AppKey == AuthClientId);
if (auth == null)
{
auth = new AuthInfo();
shop.ApiAuthInfoList.Add(auth);
}
auth.ShopId = shop_id;
auth.AccessToken = access_token;
auth.RefreshToken = refresh_token;
auth.AppKey = AuthClientId;
auth.ExpiresTime = BaseClass.StampToDateTime(expires_at.ParseToInt());
auth.UpdateTime = DateTime.Now;
auth.ApiAuthStatus = "授权成功";
auth.AppSecret = "";
var rst = PddApiHelper.SaveShopClientInfo(auth);
Invoke(new Action(() =>
{
if (this.Created && !this.IsDisposed && !this.Disposing)
this.Close();
}));
}
});
}
}
/// <summary>
+5 -3
View File
@@ -87,7 +87,9 @@ namespace TemuKJD
Thread.Sleep(200);
ShopListForm.UpdateShop();
PddApiHelper.PddGetLocalTokens();
PddApiHelper.GetPddClientInfo();
PddApiHelper.GetShopClientInfo();
//PddApiHelper.GetPddLocalTokens();
IsShopInit = true;
}));
@@ -185,7 +187,7 @@ namespace TemuKJD
});
#endregion
#region Pdd读取违规商品信息
#region 微信小店读取违规商品信息
Task.Run(() =>
{
@@ -194,7 +196,7 @@ namespace TemuKJD
Thread.Sleep(1000);
}
if (BaseClass.MainPath != "weixin") // 跨境达才读取库存
if (BaseClass.MainPath != "weixin") // 微信才读取违规商品信息
return;
WXProdViolationManage.GetShopProdViolation();
+8 -1
View File
@@ -5,6 +5,7 @@ using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using TemuKJD.BaseForms;
@@ -99,7 +100,13 @@ namespace TemuKJD.ToolForms
try
{
Clipboard.SetImage(this.pictureBox1.Image); // 设置剪贴板内容
BaseMsgForm.ShowInfo("图片已复制到剪贴板");
this.btnCopy.Text = "已复制";
Task.Run(() =>
{
Thread.Sleep(2500);
Invoke(new Action(() => { this.btnCopy.Text = "复制图片"; }));
});
//BaseMsgForm.ShowInfo("图片已复制到剪贴板");
}
catch (Exception ex)
{
+168
View File
@@ -0,0 +1,168 @@
namespace TemuKJD.VDianForms
{
partial class VDianLoginForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VDianLoginForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.panel2 = new System.Windows.Forms.Panel();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.btnStop = new DevComponents.DotNetBar.ButtonX();
this.btnReload = new DevComponents.DotNetBar.ButtonX();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.panel2.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.Location = new System.Drawing.Point(1, 33);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.panel2);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.BackColor = System.Drawing.Color.White;
this.splitContainer1.Panel2.Controls.Add(this.textBox1);
this.splitContainer1.Panel2.Controls.Add(this.btnStop);
this.splitContainer1.Panel2.Controls.Add(this.btnReload);
this.splitContainer1.Size = new System.Drawing.Size(998, 666);
this.splitContainer1.SplitterDistance = 602;
this.splitContainer1.SplitterWidth = 2;
this.splitContainer1.TabIndex = 1;
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.White;
this.panel2.Controls.Add(this.label2);
this.panel2.Controls.Add(this.label1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(998, 602);
this.panel2.TabIndex = 1;
//
// label2
//
this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(271, 168);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(458, 42);
this.label2.TabIndex = 5;
this.label2.Text = "0%";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(271, 297);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(458, 42);
this.label1.TabIndex = 4;
this.label1.Text = " 接口模式2授权中,请稍候。成功后将自动关闭窗口\r\n请确保店铺手机号和密码正确,如果密码错误,请删除重新导入";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(147, 17);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(709, 21);
this.textBox1.TabIndex = 7;
//
// btnStop
//
this.btnStop.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnStop.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnStop.Location = new System.Drawing.Point(873, 16);
this.btnStop.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btnStop.Name = "btnStop";
this.btnStop.Size = new System.Drawing.Size(115, 23);
this.btnStop.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnStop.TabIndex = 6;
this.btnStop.Text = "停止操作";
this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
//
// btnReload
//
this.btnReload.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnReload.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnReload.Location = new System.Drawing.Point(12, 16);
this.btnReload.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btnReload.Name = "btnReload";
this.btnReload.Size = new System.Drawing.Size(115, 23);
this.btnReload.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnReload.TabIndex = 5;
this.btnReload.Text = "重新加载";
this.btnReload.Click += new System.EventHandler(this.btnReload_Click);
//
// VDianLoginForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(157)))), ((int)(((byte)(235)))));
this.ClientSize = new System.Drawing.Size(1000, 700);
this.Controls.Add(this.splitContainer1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "VDianLoginForm";
this.ShowMaximizeBox = true;
this.Text = "登录微店";
this.TitleText = "登录微店";
this.Load += new System.EventHandler(this.ProductMappingVDianLoginForm_Load);
this.Controls.SetChildIndex(this.splitContainer1, 0);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private DevComponents.DotNetBar.ButtonX btnReload;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private DevComponents.DotNetBar.ButtonX btnStop;
private System.Windows.Forms.TextBox textBox1;
}
}
+780
View File
@@ -0,0 +1,780 @@
using AllBase;
using AllBase.Model.Result;
using CefSharp;
using CefSharp.WinForms;
using NaiBa.CefHelper;
using NaiBa.CefHelper.Handler;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using TemuKJD.BaseForms;
using TemuKJD.Helper;
using Work;
namespace TemuKJD.VDianForms
{
public partial class VDianLoginForm : BaseGeneralForm
{
public static bool IsRun = false;
/// <summary>
/// 微店进店操作url
/// </summary>
public string vDianManageUrl = "https://d.weidian.com/weidian-pc/weidian-loader/#/pc-vue-micro-index/index";
/// <summary>
/// 微店相关接口默认地址
/// </summary>
public static string VDianUrl { get; set; } = BaseClass.LoginApiUrl;
//public static string VDianUrl = "http://192.168.8.191:82/";
/// <summary>
/// 微店文件夹目录
/// </summary>
//public static string VDianFolder = "/bak";
public static string VDianFolder = "";
/// <summary>
/// 微店授权接口
/// </summary>
//http://new.qixiaoke.com/weidian/authorize.php?appkey=691685
static string vDianApiAuthUrl = VDianUrl + "weidian" + VDianFolder + "/authorize.php"; // ?appkey={appkey}
/// <summary>
/// 微店授权成功页面判断部分
/// </summary>
static string vDianApiAuthSuccessUrl = "weidian/weidian.php?code=";
/// <summary>
/// 1000调用次数接口授权成功页面判断
/// </summary>
static string[] vDianMultiApiAuthSuccessUrls = new string[] { "http://weidian.e57.cn/", "http://new.qixiaoke.com/weidian/", "http://wd.6nt.cn" };
/// <summary>
/// 微店测试授权接口回调页面(成功页面)
/// </summary>
static string vDianApiAuthCodeUrl = VDianUrl + "weidian" + VDianFolder + "/weidian.php"; // ?code={code}&appkey={appkey}
/// <summary>
/// 获取所有appkey的地址
/// </summary>
static string VDianApiAppKeyListUrl = VDianUrl + "weidian" + VDianFolder + "/wd_list.php";
/// <summary>
/// 默认appkey
/// </summary>
static string defaultAppKey = "691685";
/// <summary>
/// 全局微店AppKey列表 "691685" 威武宝宝, "691402" 开箱小店
/// </summary>
public static List<VDianAppKey> lstVDianAppKey = new List<VDianAppKey>();
string vDianBaseUrl = "https://www.weidian.com";
string vDianLoginUrl = "https://d.weidian.com/loginNew/#/login/loginMain";
string vDianAuthUrl = "https://weidian.com/pay/member/credential-status.html?essentials=twoParam&redirect=https://d.weidian.com/weidian-pc/pc-vue-item/";
/// <summary>
/// 第三方微店授权url
/// </summary>
//string vDianApi2AuthUrl = "https://h5.weidian.com/m/signin/index.html?redirect=https%3a%2f%2fapi.vdian.com%2foauth2%2fauthorize%3fappkey%3d690473%26redirect_uri%3dhttp%3a%2f%2f2up.shuaishou.com%2fwdsc.aspx%26response_type%3dcode%26state%3d123";
string vDianApi2AuthUrl = "https://h5.weidian.com/m/signin/index.html?redirect=https%3a%2f%2fapi.vdian.com%2foauth2%2fauthorize%3fappkey%3d690473%26redirect_uri%3dhttp%3a%2f%2f2up.shuaishou.com%2fwdsc.aspx%26response_type%3dcode%26state%3d124";
string loginType = "";
List<Cookie> lstCookie = new List<Cookie>();
VDianShopLoginInfo vDianInfo = null;
string vDianShopName = "";
string vDianShopId = "";
/// <summary>
/// 微店账户手机号
/// </summary>
string phone = "";
/// <summary>
/// 微店账户密码
/// </summary>
string password = "";
/// <summary>
/// 当前要授权的appkey
/// </summary>
VDianAppKey appKey = null;
private ChromiumWebBrowser cefWebBrowser = null;
/// <summary>
/// 获取全部的可授权appkey及状态。
/// </summary>
public static void GetVDianAppKeys()
{
// 获取所有微店Api接口
var data = UserLogin.GetSignaturex();
var html = GetHtml.PostUtf8(VDianApiAppKeyListUrl, data);
if (!string.IsNullOrEmpty(html))
{
var appkeyArr = html.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
if (appkeyArr.Length > 0)
{
foreach (var item in appkeyArr)
{
var itemArr = item.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
if (itemArr.Length > 1)
{
var appkey = lstVDianAppKey.FirstOrDefault(a => a.AppKey == itemArr[0]);
if (appkey == null)
lstVDianAppKey.Add(new VDianAppKey() { AppKey = itemArr[0], Status = itemArr[1], GoodsCountStatus = "ok", ImgsCountStatus = "ok", PropCountStatus = "ok" });
else
{
appkey.Status = itemArr[1];
}
}
}
}
}
// 如果获取失败了,赋一个默认appkey
if (lstVDianAppKey.Count == 0)
lstVDianAppKey.Add(new VDianAppKey() { AppKey = defaultAppKey, Status = "ok", GoodsCountStatus = "ok", ImgsCountStatus = "ok", PropCountStatus = "ok" });
}
public VDianLoginForm(string _phone = "", string _password = "")
{
InitializeComponent();
phone = _phone;
password = _password;
}
/// <summary>
/// 授权等的操作
/// </summary>
/// <param name="_vDianInfo">店铺信息</param>
/// <param name="type">操作类型</param>
/// <param name="_appKey">appKey</param>
public VDianLoginForm(VDianShopLoginInfo _vDianInfo, string type = "", VDianAppKey _appKey = null)
{
InitializeComponent();
this.vDianInfo = _vDianInfo;
this.loginType = type;
phone = _vDianInfo.Phone;
password = _vDianInfo.Password;
appKey = _appKey;
this.lstCookie = ConvertStringCookieToCefCookie(_vDianInfo.Cookies, "weidian.com");
}
private void ProductMappingVDianLoginForm_Load(object sender, EventArgs e)
{
TitleText = this.Text;
string url = vDianLoginUrl;
if (loginType == "apiAuth")
{
url = vDianApiAuthUrl + "?appkey=" + appKey?.AppKey;
}
else if (loginType == "api2Auth")
{
url = vDianApi2AuthUrl;
}
else if (loginType == "upAuth")
{
url = vDianAuthUrl;
}
else if (loginType == "mainAuth")
{
url = "https://h5.weidian.com/m/shop-certify/status.html";
}
cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(url, false);
CustomResourceRequestHandlerLocal resourceRequestHandler = new CustomResourceRequestHandlerLocal();
resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete;
var lifeSapnHandler = new LifeSpanHandlerLocal(PopWindowType.SelfWindow);
cefWebBrowser.LifeSpanHandler = lifeSapnHandler;
cefWebBrowser.RequestHandler = new CustomRequestHandler(resourceRequestHandler);
cefWebBrowser.KeyboardHandler = new KeyboardHandler();
cefWebBrowser.FrameLoadEnd += CefWebBrowser_FrameLoadEnd;
cefWebBrowser.AddressChanged += CefWebBrowser_AddressChanged;
cefWebBrowser.Dock = DockStyle.Fill;
splitContainer1.Panel1.Controls.Add(cefWebBrowser);
if (loginType == "api2Auth")
{
cefWebBrowser.SendToBack();
}
else
{
cefWebBrowser.BringToFront();
}
if (loginType == "apiAuth")
{
if (lstCookie != null && lstCookie.Count > 0)
{
var cookieManager = cefWebBrowser.RequestContext.GetCookieManager(null);
foreach (Cookie cookie in lstCookie)
{
Task<bool> t = cookieManager.SetCookieAsync(vDianBaseUrl, cookie);
t.Wait();
}
}
cefWebBrowser.Load(url);
}
else if (loginType == "upAuth" || loginType == "mainAuth")
{
if (lstCookie != null && lstCookie.Count > 0)
{
var cookieManager = cefWebBrowser.RequestContext.GetCookieManager(null);
foreach (Cookie cookie in lstCookie)
{
Task<bool> t = cookieManager.SetCookieAsync(url, cookie);
t.Wait();
}
}
cefWebBrowser.Load(url);
}
else if (loginType == "manage")
{
if (lstCookie != null && lstCookie.Count > 0)
{
var cookieManager = cefWebBrowser.RequestContext.GetCookieManager(null);
foreach (Cookie cookie in lstCookie)
{
Task<bool> t = cookieManager.SetCookieAsync(url, cookie);
t.Wait();
}
}
cefWebBrowser.Load(vDianManageUrl);
}
else
{
cefWebBrowser.Load(url);
}
}
private void CefWebBrowser_AddressChanged(object sender, AddressChangedEventArgs e)
{
Invoke(new Action(() =>
{
textBox1.Text = e.Address;
this.TitleText = "登录微店 " + e.Address;
this.Text = "登录微店 " + e.Address;
}));
if (e.Address.Contains("/shopSelect"))
{
Task.Run(() =>
{
SelectShop(cefWebBrowser);
});
}
}
public static void InputUserNameAndPassword(ChromiumWebBrowser webBrowser, string _phone, string _password)
{
// 用户名
string jsStr = "var txt = document.getElementsByClassName('el-input__inner')[1]; "
+ "txt.value = '" + _phone + "'; txt.dispatchEvent(new Event('input'));";
var response = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr);
response.Wait();
//Thread.Sleep(1500 + Randomx.GetId(1000));
Thread.Sleep(500 + Randomx.GetId(500));
// 密码
jsStr = "var pass = document.getElementsByClassName('el-input__inner')[2]; "
+ "pass.value = '" + _password + "'; pass.dispatchEvent(new Event('input'));";
var response2 = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr);
response2.Wait();
Thread.Sleep(500 + Randomx.GetId(500));
jsStr = "document.getElementsByClassName('el-checkbox__inner')[0].click();";
var response3 = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr);
response3.Wait();
Thread.Sleep(500 + Randomx.GetId(500));
}
public static void ClickLogin(ChromiumWebBrowser webBrowser)
{ // 获取登录位置后CEF模拟点击
string code = "function getPos() { var box = document.getElementsByClassName('el-button weidian-button el-button--primary')[0];" +
"if (box == null) return '0|0';" +
"var actualLeft = box.offsetLeft;" +
"var actualTop = box.offsetTop;" +
"var parent = box.offsetParent;" +
"while (parent !== null) { actualLeft += parent.offsetLeft; actualTop += parent.offsetTop; parent = parent.offsetParent; }" +
"return '' + actualLeft + '|' + actualTop;}" +
"getPos();";
var task = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(code);
task.Wait(5000);
var result = task.Result.Result;
if (result != null && result.ToString() != "0|0")
{
var arr = result.ToString().Split('|');
if (arr.Length == 2)
{
int x = Convert.ToInt32(arr[0]);
int y = Convert.ToInt32(arr[1]);
int x1 = x + 50 + new Random(DateTime.Now.Millisecond).Next(50);
int y1 = y + 10 + new Random(DateTime.Now.Millisecond).Next(10);
var host = webBrowser.GetBrowser().GetHost();
//host.SendFocusEvent(true);
host.SendMouseClickEvent(x1, y1, MouseButtonType.Left, false, 1, CefEventFlags.None); // 按下鼠标左键
Thread.Sleep(70 + new Random(DateTime.Now.Millisecond).Next(50));
host.SendMouseClickEvent(x1, y1, MouseButtonType.Left, true, 1, CefEventFlags.None); // 松开鼠标左键
Thread.Sleep(500 + new Random(DateTime.Now.Millisecond).Next(500));
}
}
else
{
// 模拟鼠标按键,获取焦点后JS才能提交登录
var x1 = 100 + Randomx.GetId(100);
var y1 = 200 + Randomx.GetId(100);
var host = webBrowser.GetBrowser().GetHost();
//host.SendFocusEvent(true);
host.SendMouseClickEvent(x1, y1, MouseButtonType.Left, false, 1, CefEventFlags.None); // 按下鼠标左键
Thread.Sleep(70 + Randomx.GetId(50));
host.SendMouseClickEvent(x1, y1, MouseButtonType.Left, true, 1, CefEventFlags.None); // 松开鼠标左键
// 登录
Thread.Sleep(1500 + Randomx.GetId(1000));
string jsStr = "var sub = document.getElementsByClassName('el-button weidian-button el-button--primary')[0];"
+ "sub.click();";
var response3 = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr);
response3.Wait(5000);
}
}
/// <summary>
/// 点击选择店铺
/// </summary>
public static void SelectShop(ChromiumWebBrowser webBrowser)
{
Thread.Sleep(1250);
var x1 = 320 + Randomx.GetId(70);
var y1 = 310 + Randomx.GetId(40);
cefClick(webBrowser, x1, y1);
Thread.Sleep(250);
x1 = 320 + Randomx.GetId(70);
y1 = 310 + Randomx.GetId(40);
cefClick(webBrowser, x1, y1);
}
private void AutoLogin()
{
if (!string.IsNullOrEmpty(password) && !string.IsNullOrEmpty(phone))
{
Task.Run(() =>
{
Thread.Sleep(1000);
InputUserNameAndPassword(cefWebBrowser, phone, password);
ClickLogin(cefWebBrowser);
Thread.Sleep(30000);
if (this != null && this.Created && !this.IsDisposed)
{
Invoke(new Action(() =>
{
//this.Close();
}));
}
});
}
}
private void AutoApiAuth()
{
if (!string.IsNullOrEmpty(password) && !string.IsNullOrEmpty(phone))
{
Task.Run(() =>
{
Invoke(new Action(() => { label2.Text = 5 + Randomx.GetId(10) / 5.0 + "%"; }));
Thread.Sleep(1270 + Randomx.GetId(250));
Invoke(new Action(() => { label2.Text = 10 + Randomx.GetId(10) / 5.0 + "%"; }));
var x1 = 757 + Randomx.GetId(50);
var y1 = 250 + Randomx.GetId(20);
cefClick(cefWebBrowser, x1, y1);
Invoke(new Action(() => { label2.Text = 15 + Randomx.GetId(10) / 5.0 + "%"; }));
x1 = 643 + Randomx.GetId(50);
y1 = 123 + Randomx.GetId(20);
cefClick(cefWebBrowser, x1, y1);
Invoke(new Action(() => { label2.Text = 25 + Randomx.GetId(10) / 5.0 + "%"; }));
x1 = 700 + Randomx.GetId(50);
y1 = 244 + Randomx.GetId(20);
cefClick(cefWebBrowser, x1, y1);
Invoke(new Action(() => { label2.Text = 35 + Randomx.GetId(10) / 5.0 + "%"; }));
#region 模拟输入用户名和密码
cefInput(vDianInfo.Phone);
Invoke(new Action(() => { label2.Text = 57 + Randomx.GetId(10) / 5.0 + "%"; }));
cefClick(cefWebBrowser, 710 + Randomx.GetId(50), 302 + Randomx.GetId(20));
Invoke(new Action(() => { label2.Text = 75 + Randomx.GetId(10) / 5.0 + "%"; }));
cefInput(vDianInfo.Password);
Invoke(new Action(() => { label2.Text = 85 + Randomx.GetId(10) / 5.0 + "%"; }));
#endregion
x1 = 758 + Randomx.GetId(50);
y1 = 374 + Randomx.GetId(20);
cefClick(cefWebBrowser, x1, y1);
x1 = 758 + Randomx.GetId(50);
y1 = 374 + Randomx.GetId(20);
cefClick(cefWebBrowser, x1, y1);
Invoke(new Action(() => { label2.Text = 90 + Randomx.GetId(10) / 5.0 + "%"; }));
Thread.Sleep(1000);
Invoke(new Action(() => { label2.Text = 95 + Randomx.GetId(10) / 5.0 + "%"; }));
Thread.Sleep(14000);
if (this.Created)
{
Invoke(new Action(() => { this.label2.Text = "过长时间没有响应,可能是授权失败\r\n或者密码错误,请核对帐户密码后重试。"; }));
Thread.Sleep(10000);
}
});
}
else { Invoke(new Action(() => { BaseMsgForm.ShowConfirm("微店手机号或登录密码为空,请删除店铺后重新导入\r\n导入格式为:手机号-----密码"); })); }
}
private static void cefClick(ChromiumWebBrowser webBrowser, int x1, int y1)
{
try
{
var host = webBrowser.GetBrowser().GetHost();
//host.SendFocusEvent(true);
host.SendMouseClickEvent(x1, y1, MouseButtonType.Left, false, 1, CefEventFlags.None); // 按下鼠标左键
Thread.Sleep(70 + Randomx.GetId(50));
host.SendMouseClickEvent(x1, y1, MouseButtonType.Left, true, 1, CefEventFlags.None); // 松开鼠标左键
Thread.Sleep(270 + Randomx.GetId(250));
}
catch { }
}
private void cefInput(string text)
{
try
{
var host = cefWebBrowser.GetBrowser().GetHost();
foreach (var word in text)
{
var key = Encoding.ASCII.GetBytes(word.ToString())[0];
Thread.Sleep(10 + Randomx.GetId(10));
host.SendKeyEvent(new CefSharp.KeyEvent() { WindowsKeyCode = key, Type = KeyEventType.Char });
Thread.Sleep(50 + Randomx.GetId(40));
Thread.Sleep(50 + Randomx.GetId(40));
}
Thread.Sleep(1000 + Randomx.GetId(500));
}
catch { }
}
private async void CefWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEndEventArgs e)
{
try
{
Invoke(new Action(() =>
{
cefWebBrowser.Visible = true;
}));
string url = e.Frame.Url;
string html = await e.Frame.GetSourceAsync();
// 微店网页自动登录
if (url.Contains("https://d.weidian.com/loginNew/") || url.Contains("loginMain"))
{
AutoLogin();
}
// 微店api自动登录以便授权
if (url.Contains("https://sso.weidian.com/login/index.php"))
{
this.AutoApiAuth();
}
// 微店工具箱自动点击授权
if (url.StartsWith("https://api.vdian.com/oauth2/authorize?appkey=690473"))
{
Invoke(new Action(() => { label2.Text = 97 + Randomx.GetId(10) / 5.0 + "%"; }));
Thread.Sleep(1000 + Randomx.GetId(2000));
Invoke(new Action(() => { label2.Text = 100 + "%"; }));
var x1 = 630 + Randomx.GetId(20);
var y1 = 400 + Randomx.GetId(20);
cefClick(cefWebBrowser, x1, y1);
}
// 公司Api接口自动点击授权
if (url.StartsWith("https://oauth.open.weidian.com/oauth2/authorize?appkey="))
{
Thread.Sleep(5000 + Randomx.GetId(5000));
var x1 = 630 + Randomx.GetId(20);
var y1 = 370 + Randomx.GetId(20);
cefClick(cefWebBrowser, x1, y1);
}
// 第三方Api接口授权成功后操作
if (url.Contains("http://2up.shuaishou.com/wdsc.aspx"))
{
BaseMsgForm.ShowError("第三方工具已不支持,请使用其他接口");
//Invoke(new Action(() =>
//{
// cefWebBrowser.Visible = false;
//}));
//if (url.Contains("code="))
//{
// var code = url.Substring(url.IndexOf("code=")).Replace("code=", "");
// var realToken = MappingVDianThirdApiBLL.GetTok(code);
// if (!string.IsNullOrEmpty(realToken))
// {
// if (realToken.Contains("订购该应用"))
// {
// Invoke(new Action(() => { this.label2.Text = "授权失败。"; }));
// Thread.Sleep(5000);
// if (this.Created)
// Invoke(new Action(() =>
// {
// this.OnSaveComplete(vDianInfo);
// this.Close();
// }));
// }
// else
// {
// vDianInfo.WdApi2Token = realToken;
// vDianInfo.WdApi2RefreshToken = "";
// if (this.Created)
// Invoke(new Action(() =>
// {
// this.OnSaveComplete(vDianInfo);
// this.Close();
// }));
// }
// }
//}
}
// 微店Api授权成功回调页面
//if (url.Contains(vDianApiAuthSuccessUrl) || url.Replace("state=STATE&", "").Contains(vDianApiAuthSuccessUrl)
// || url.Replace(VDianFolder, "").Contains(vDianApiAuthSuccessUrl))
if (url.Contains(vDianApiAuthSuccessUrl) || url.Replace("state=STATE&", "").Contains(vDianApiAuthSuccessUrl)
|| vDianMultiApiAuthSuccessUrls.Any(u => url.Contains(u)) || (url.Contains("appkey=") && url.Contains("redirect_uri=")))
{
if (!Created)
return;
var task = cefWebBrowser.GetBrowser().MainFrame.GetSourceAsync();
task.Wait();
// 两个主要的接口的回调信息
if (task.Result.Contains("授权成功"))
{
Thread.Sleep(2000);
if (this.Created)
Invoke(new Action(() =>
{
this.OnSaveComplete(vDianInfo);
this.Close();
}));
}
// 1000次调用的api接口
else if (task.Result.Contains("\"openid\":"))
{
Thread.Sleep(Randomx.GetId(500, 1500));
// 获取json数据读取AccessToken等信息
if (appKey != null)
{
string str = task.Result;
if (appKey.ImgsCountStatus == "ok")
{
vDianInfo.MultiImgApiToken = new VDianApiToken();
vDianInfo.MultiImgApiToken.LastRefreshDate = DateTime.Now.Date.ToString("yyyyMMdd");
vDianInfo.MultiImgApiToken.ApiAuth = "已授权";
vDianInfo.MultiImgApiToken.ApiAccessToken = BaseRegex.GetStringJson(ref str, "access_token");
vDianInfo.MultiImgApiToken.AppKey = appKey;
}
if ((appKey.PropCountStatus == "ok"))
{
vDianInfo.MultiAttrApiToken = new VDianApiToken();
vDianInfo.MultiAttrApiToken.LastRefreshDate = DateTime.Now.Date.ToString("yyyyMMdd");
vDianInfo.MultiAttrApiToken.ApiAuth = "已授权";
vDianInfo.MultiAttrApiToken.ApiAccessToken = BaseRegex.GetStringJson(ref str, "access_token");
vDianInfo.MultiAttrApiToken.AppKey = appKey;
}
if ((appKey.GoodsCountStatus == "ok"))
{
vDianInfo.MultiProductApiToken = new VDianApiToken();
vDianInfo.MultiProductApiToken.LastRefreshDate = DateTime.Now.Date.ToString("yyyyMMdd");
vDianInfo.MultiProductApiToken.ApiAuth = "已授权";
vDianInfo.MultiProductApiToken.ApiAccessToken = BaseRegex.GetStringJson(ref str, "access_token");
vDianInfo.MultiProductApiToken.AppKey = appKey;
}
}
Thread.Sleep(2000);
if (this.Created)
Invoke(new Action(() =>
{
this.Close();
}));
}
else if (task.Result.Contains("授权失败"))
{
// 本地回调保存accesstoken数据,测试用
if (url.Contains("state=STATE"))
{
Invoke(new Action(() =>
{
var code = "";
if (url.Contains("code="))
code = url.Substring(url.IndexOf("code=")).Substring("code=".Length);
if (!string.IsNullOrEmpty(code))
{
var testUrl = vDianApiAuthCodeUrl + "?code=" + code + "&appkey=" + appKey?.AppKey;
cefWebBrowser.Load(testUrl);
}
}));
}
}
else if (task.Result == "<html><head></head><body></body></html>")
{
Thread.Sleep(2000);
if (this.Created)
Invoke(new Action(() =>
{
this.Close();
}));
}
}
// 微店登录成功后退出
if (url.Contains("https://qiyukf.com/sdk/res/delegate.html?") || url.Contains("/weidian-loader/#/pc-vue-micro-index/index"))
{
if (loginType != "manage")
{
VDianShopLoginInfo vDianShopLoginInfo = new VDianShopLoginInfo();
vDianShopLoginInfo.ShopName = this.vDianShopName;
vDianShopLoginInfo.ShopId = this.vDianShopId;
vDianShopLoginInfo.LoginStatus = 1;
vDianShopLoginInfo.Cookies = "";
vDianShopLoginInfo.LstWdApiToken = new List<VDianApiToken>();
List<Cookie> cookieList = CEFBrowser.GetCookieList("weidian.com", cefWebBrowser.RequestContext.GetCookieManager(null));
if (cookieList != null && cookieList.Count > 0)
{
foreach (var cookie in cookieList)
{
vDianShopLoginInfo.Cookies += cookie.Name + "=" + cookie.Value + "; ";
if (cookie.Name == "wdtoken")
vDianShopLoginInfo.Wdtoken = cookie.Value;
}
vDianShopLoginInfo.Cookies = vDianShopLoginInfo.Cookies.Trim().TrimEnd(';');
}
if (!string.IsNullOrEmpty(vDianShopLoginInfo.ShopName) && !string.IsNullOrEmpty(vDianShopLoginInfo.ShopId)
&& !string.IsNullOrEmpty(vDianShopLoginInfo.Cookies) && !string.IsNullOrEmpty(vDianShopLoginInfo.Wdtoken))
{
vDianShopLoginInfo.Phone = this.phone;
vDianShopLoginInfo.Password = this.password;
if (this.Created)
{
Invoke(new Action(() =>
{
this.OnSaveComplete(vDianShopLoginInfo);
this.Close();
}));
}
}
}
}
}
catch { }
}
private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
{
if (url.Contains("getShopInfoByList"))
{
vDianShopId = AllBase.BaseRegex.GetMatchRegexString(responseData, "shop_id\":\"([\\s\\S]*?)\"");
vDianShopName = AllBase.BaseRegex.GetMatchRegexString(responseData, "shop_name\":\"([\\s\\S]*?)\"");
}
// 实名认证
else if (url.Contains("authentication/realname.queryAuthStatus"))
{
if (responseData.Contains("\"status\":\"SUCCESS\"") && this.vDianInfo != null) // \"status\":\"UNAUTH\" 未认证
{
if (loginType == "upAuth")
{
if (this.Created)
Invoke(new Action(() =>
{
this.OnSaveComplete(vDianInfo);
this.Close();
}));
}
}
}
else if (url.Contains("https://thor.weidian.com/authentication/realname.getUserAuthInfoWithScopes"))
{
if (responseData.Contains("\"CERT\"") && this.vDianInfo != null) // 验证成功了
{
if (this.Created)
Invoke(new Action(() =>
{
this.OnSaveComplete(vDianInfo);
this.Close();
}));
}
}
}
private void btnReload_Click(object sender, EventArgs e)
{
if (cefWebBrowser != null)
{
cefWebBrowser.Load(textBox1.Text);
//cefWebBrowser.Reload();
}
}
/// <summary>
/// name1=value1; name2=value2... 的格式转换为 Cef Cookie
/// </summary>
/// <param name="cookies"></param>
/// <returns></returns>
List<Cookie> ConvertStringCookieToCefCookie(string cookies, string domain)
{
List<Cookie> cookieList = new List<Cookie>();
if (string.IsNullOrEmpty(cookies))
return cookieList;
string[] cookieArr = cookies.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
foreach (var item in cookieArr)
{
if (item.Contains("="))
{
Cookie cookie = new Cookie();
cookie.Name = item.Substring(0, item.IndexOf('=')).Trim();
cookie.Value = item.Substring(item.IndexOf('=') + 1).Trim();
cookie.Domain = domain;
cookie.Path = "/";
cookieList.Add(cookie);
}
}
return cookieList;
}
private void btnStop_Click(object sender, EventArgs e)
{
IsRun = false;
this.Close();
}
}
}
+298
View File
@@ -0,0 +1,298 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAgIAQAAAAAABoKAAAFgAAACgAAACAAAAAAAEAAAEABAAAAAAAACgAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8AAAAAAAAAAAAAAAAzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMQ
AAAAAAAAAAAAAAAAAAAAAAAAABM5mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ
mZmZkzEAAAAAAAAAAAAAAAAAAAAAADOZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ
mZmZmZmZmZmZMwAAAAAAAAAAAAAAAAAAABOZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ
mZmZmZmZmZmZmZmZmZkzAAAAAAAAAAAAAAAAAAOZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ
mZmZmZmZmZmZmZmZmZmZmZmZmTEAAAAAAAAAAAAAAAOZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZMAAAAAAAAAAAAAA5mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZMAAAAAAAAAAAADmZmZmZmZmZmZmZ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Y//+JmZmZmZmT///7mZj///+ZmZmZj///uZmZmZmZ
mZM5mZmZmZmZmZmZmY//+JmZmZmZn///iZmZmZmZmZmZmP//iZmZN5k5k///+5mY///zk5mZOT///4mZ
mZmZmZmTOZmZmZmZmZmZmZmP//iZmZmZmZ///4mZmZmZmZmZmZj//4mZmP/5k5P///uZmP//+ZmZmZmY
//+JmZmZmZmZkzmZmZmZmZmZmZmZj//4mZmZmZmf///4iIiIiIg5mZmY//+JOb//+JmT///7mZj//4mZ
mZmZmP//+ZmZmZmZmZM5mZmZmZmZmZmZmY//+JmZmZmZn///////////85mZmP//iZn///+Jk///+5mf
//+JmZmZmZj///mZmZmZmZmTOZmZmZmZmZmZmZmP//iZmZmZmZ////////////+ZmZj//4mY////85v/
//uZmP//iZmZmZmY///5mZmZmZmZkzmZmZmZmZmZmZmZj//4mZmZmZmf////////////mZmY//+Jv///
//+Z///7mZj//4mZmZmZmP//+ZmZmZmZmZM5mZmZmZmZmZmZmY//+JmZmZmZn///////////+JmZmP//
if//////if//+5mY//+JmZmZmZj///mZmZmZmZmTOZmZmZmZmZmZmZmP//iZmZmZmZ///////////4mZ
mZj//4j///////j///uZmP//iZmZmZmY///5mZmZmZmZkzmZmZmZmZmZmZmZj//4mZmZmZmf//+JMzMz
MzOZOZmY//////+D///////7mZj//4mZmZmZmP//+ZmZmZmZmZM5mZmZmZmZmZmZmY//+JmZmZmZn///
iZmZmZmZmZmZmP//////mY//////+5mY//+JmZmZmZj///mZmZmZmZmTOZmZmZmZmZmZmZmP//iZmZmZ
mZ///4mZmZmZmZmZmZj/////+5mf//////uZmP//iZmZmZmY///5mZmZmZmZkzmZmZmZmZmZMzM5j//4
kzMzmZmf//+JMzMzMzM5mZmY/////4mTk//////7mZj//4mZmZmZmP//+ZmZmZmZmZM5mZmZmZmZmP//
/////////4mZn////////////4mZmP////+ZmZmP////+5mY//+JmZmZmZj///mZmZmZmZmTOZmZmZmZ
mY/////////////4mZ/////////////7mZj////7mZmZn/////uZmP//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/5mZmP///////////4mZmZmZmZmZM5mZmZmZmZn///
//////////mZmY///5mZmZP///iZmP////////+ZOZk/iZmY/////////////4mZmZmZmZmTOZmZmZmZ
mZ/////////////5mZ////+JmZmY////iZl/////////+ZmZP4mZP//////////////7mZmZmZmZkzmZ
mZmZmZmb////////////uZP/j///+HM3j/////+ZmYj///////iZmT+JmY//////////////+JmZmZmZ
mZM5mZmZmZmZmY//////////+JmT+Jv///////////iPmTmZOI/4mP//uTk/iZmP//////////////iZ
mZmZmZmTOZmZmZmZmZmf//////////mZmZmZ///////////5mZmZmZmTOZk///mZP4mZj///////////
///4mZmZmZmZkzmZmZmZmZmTmP////////+JOZmZOY//////////iZmZmZmZmZk5mf/4mT+JmY//////
////////+JmZmZmZmZM5mZmZmZmZmZn/////////mZmZmZk//////////zmZmZmZmZmZmTmP/zm/iZmP
//////////////iZmZmZmZmTOZmZmZmZmZk5v///////85OZmZkzmP////////iZmZmZmZmZmZmZn//4
/4mZj/////hzN4/////4mZmZmZmZkzmZmZmZmZmZmZj//////4mZmTmY/4j////////4mZmZmZmZmZmZ
mZj///+JmY////+JmZmY////+JmZmZmZmZM5mZmZmZmZmZmZ//////+ZmZmZj////////////4mZmZmZ
mZmZmZmb////+ZmP///4mZu5mY////iZmZmZmZmTOZmZmZmZmZmZOb/////4k5mZmP/////////////7
mZmZmZmZmZmZk/////OZv///+ZmP+Jmf///4mZmZmZmZkzmZmZmZmZmZmZmf////+ZmZmZj////////4
eI//+JmZmZmZmZmZmZP////4mb///4mY//+JmP//+5mZmZmZmZM5mZmZmZmZmZk5v/////uTmZmb////
///4mZmX//iZmZmZmZmZmZmZ////+Jmf//95n///+Zj///OZmZmZmZmTOZmZmZmZmZmZmf//////mZmZ
mY//////+ZOZmZiJmZmZmZmZmZmZmY////+ZmP//+I////iP//+JmZmZmZmZkzmZmZmZmZmZmZj/////
/4mZmZmf/////5k5mZOZmTmZmZmZmZmZmZmP///4mZP/////////////OZmZmZmZmZM5mZmZmZmZmZk/
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AAP//+AAAAAA
AAAAAAAAAAAH///4AAAAAAAAAAAAAAAAD////AAAAAAAAAAAAAAAAD////8AAAAAAAAAAAAAAAD/////
wAAAAAAAAAAAAAAD//////wAAAAAAAAAAAAAH////////////////////////w==
</value>
</data>
</root>
+45
View File
@@ -0,0 +1,45 @@
using AllBase.Model.Result;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TemuKJD.BaseForms;
namespace KJD.VDianForms
{
public partial class VDianShopEditForm : BaseGeneralForm
{
private VDianShopLoginInfo shop = null;
public VDianShopEditForm(VDianShopLoginInfo shopInfo = null)
{
InitializeComponent();
this.Text = this.TitleText = "编辑微店";
if (shopInfo != null)
{
this.txtName.Text = shopInfo.ShopName;
this.txtPhone.Text = shopInfo.Phone;
this.txtPassword.Text = shopInfo.Password;
shop = shopInfo;
}
}
private void btnSave_Click(object sender, EventArgs e)
{
if (shop != null)
{
shop.Phone = txtPhone.Text;
shop.Password = txtPassword.Text;
this.OnSaveComplete(shop);
this.Close();
}
}
}
}
+180
View File
@@ -0,0 +1,180 @@
namespace KJD.VDianForms
{
partial class VDianShopEditForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VDianShopEditForm));
this.panel2 = new System.Windows.Forms.Panel();
this.btnSave = new DevComponents.DotNetBar.ButtonX();
this.txtPassword = new DevComponents.DotNetBar.Controls.TextBoxX();
this.txtPhone = new DevComponents.DotNetBar.Controls.TextBoxX();
this.txtName = new DevComponents.DotNetBar.Controls.TextBoxX();
this.labelX3 = new DevComponents.DotNetBar.LabelX();
this.labelX2 = new DevComponents.DotNetBar.LabelX();
this.labelX1 = new DevComponents.DotNetBar.LabelX();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.White;
this.panel2.Controls.Add(this.btnSave);
this.panel2.Controls.Add(this.txtPassword);
this.panel2.Controls.Add(this.txtPhone);
this.panel2.Controls.Add(this.txtName);
this.panel2.Controls.Add(this.labelX3);
this.panel2.Controls.Add(this.labelX2);
this.panel2.Controls.Add(this.labelX1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.panel2.Location = new System.Drawing.Point(1, 33);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(348, 216);
this.panel2.TabIndex = 1;
//
// btnSave
//
this.btnSave.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnSave.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnSave.Location = new System.Drawing.Point(231, 150);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(63, 23);
this.btnSave.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSave.TabIndex = 6;
this.btnSave.Text = "保存";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// txtPassword
//
//
//
//
this.txtPassword.Border.Class = "TextBoxBorder";
this.txtPassword.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.txtPassword.Location = new System.Drawing.Point(125, 111);
this.txtPassword.Name = "txtPassword";
this.txtPassword.PasswordChar = '●';
this.txtPassword.PreventEnterBeep = true;
this.txtPassword.Size = new System.Drawing.Size(169, 23);
this.txtPassword.TabIndex = 5;
//
// txtPhone
//
//
//
//
this.txtPhone.Border.Class = "TextBoxBorder";
this.txtPhone.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.txtPhone.Location = new System.Drawing.Point(125, 73);
this.txtPhone.Name = "txtPhone";
this.txtPhone.PreventEnterBeep = true;
this.txtPhone.Size = new System.Drawing.Size(169, 23);
this.txtPhone.TabIndex = 4;
//
// txtName
//
//
//
//
this.txtName.Border.Class = "TextBoxBorder";
this.txtName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.txtName.Location = new System.Drawing.Point(125, 34);
this.txtName.Name = "txtName";
this.txtName.PreventEnterBeep = true;
this.txtName.ReadOnly = true;
this.txtName.Size = new System.Drawing.Size(169, 23);
this.txtName.TabIndex = 3;
//
// labelX3
//
this.labelX3.AutoSize = true;
//
//
//
this.labelX3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX3.Location = new System.Drawing.Point(44, 76);
this.labelX3.Name = "labelX3";
this.labelX3.Size = new System.Drawing.Size(56, 20);
this.labelX3.TabIndex = 2;
this.labelX3.Text = "店铺手机";
//
// labelX2
//
this.labelX2.AutoSize = true;
//
//
//
this.labelX2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX2.Location = new System.Drawing.Point(44, 114);
this.labelX2.Name = "labelX2";
this.labelX2.Size = new System.Drawing.Size(56, 20);
this.labelX2.TabIndex = 1;
this.labelX2.Text = "店铺密码";
//
// labelX1
//
this.labelX1.AutoSize = true;
//
//
//
this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX1.Location = new System.Drawing.Point(44, 37);
this.labelX1.Name = "labelX1";
this.labelX1.Size = new System.Drawing.Size(56, 20);
this.labelX1.TabIndex = 0;
this.labelX1.Text = "店铺名称";
//
// VDianShopEditForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(350, 250);
this.Controls.Add(this.panel2);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "VDianShopEditForm";
this.Text = "店铺编辑";
this.TitleText = "店铺编辑";
this.Controls.SetChildIndex(this.panel2, 0);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel2;
private DevComponents.DotNetBar.LabelX labelX3;
private DevComponents.DotNetBar.LabelX labelX2;
private DevComponents.DotNetBar.LabelX labelX1;
private DevComponents.DotNetBar.ButtonX btnSave;
private DevComponents.DotNetBar.Controls.TextBoxX txtPassword;
private DevComponents.DotNetBar.Controls.TextBoxX txtPhone;
private DevComponents.DotNetBar.Controls.TextBoxX txtName;
}
}
+298
View File
@@ -0,0 +1,298 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAgIAQAAAAAABoKAAAFgAAACgAAACAAAAAAAEAAAEABAAAAAAAACgAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8AAAAAAAAAAAAAAAAzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMQ
AAAAAAAAAAAAAAAAAAAAAAAAABM5mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ
mZmZkzEAAAAAAAAAAAAAAAAAAAAAADOZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ
mZmZmZmZmZmZMwAAAAAAAAAAAAAAAAAAABOZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ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mZmZmZmP//iZmZmZ
mZ/////////////4mZ///4mZmZmZmZP///uZmZmP////////+JmZmZmZmZmZkzmZmZmZmZmZmZmZj//4
mZmZmZmf////////////+Jmf//+JmZmZmZmb///4mZmY//////////+JmZmZmZmZmZM5mZmZmZmZmZmZ
mY//+JmZmZmZn/////////////mZmP//iZmZmZmZk///+5mZj/////iP////+JmZmZmZmZmTOZmZmZmZ
mZmZmZmP//iZmZmZmZ////iIiIiIiIiZOZj//4mZmZmZmZP///uZmf////eZmT////+ZmZmZmZmZkzmZ
mZmZmZmZmZmZj//4mZmZmZmf//+JmZmZmZmZk5mY//+JmZmZmZmT///7mZj///+ZmZmZj///uZmZmZmZ
mZM5mZmZmZmZmZmZmY//+JmZmZmZn///iZmZmZmZmZmZmP//iZmZN5k5k///+5mY///zk5mZOT///4mZ
mZmZmZmTOZmZmZmZmZmZmZmP//iZmZmZmZ///4mZmZmZmZmZmZj//4mZmP/5k5P///uZmP//+ZmZmZmY
//+JmZmZmZmZkzmZmZmZmZmZmZmZj//4mZmZmZmf///4iIiIiIg5mZmY//+JOb//+JmT///7mZj//4mZ
mZmZmP//+ZmZmZmZmZM5mZmZmZmZmZmZmY//+JmZmZmZn///////////85mZmP//iZn///+Jk///+5mf
//+JmZmZmZj///mZmZmZmZmTOZmZmZmZmZmZmZmP//iZmZmZmZ////////////+ZmZj//4mY////85v/
//uZmP//iZmZmZmY///5mZmZmZmZkzmZmZmZmZmZmZmZj//4mZmZmZmf////////////mZmY//+Jv///
//+Z///7mZj//4mZmZmZmP//+ZmZmZmZmZM5mZmZmZmZmZmZmY//+JmZmZmZn///////////+JmZmP//
if//////if//+5mY//+JmZmZmZj///mZmZmZmZmTOZmZmZmZmZmZmZmP//iZmZmZmZ///////////4mZ
mZj//4j///////j///uZmP//iZmZmZmY///5mZmZmZmZkzmZmZmZmZmZmZmZj//4mZmZmZmf//+JMzMz
MzOZOZmY//////+D///////7mZj//4mZmZmZmP//+ZmZmZmZmZM5mZmZmZmZmZmZmY//+JmZmZmZn///
iZmZmZmZmZmZmP//////mY//////+5mY//+JmZmZmZj///mZmZmZmZmTOZmZmZmZmZmZmZmP//iZmZmZ
mZ///4mZmZmZmZmZmZj/////+5mf//////uZmP//iZmZmZmY///5mZmZmZmZkzmZmZmZmZmZMzM5j//4
kzMzmZmf//+JMzMzMzM5mZmY/////4mTk//////7mZj//4mZmZmZmP//+ZmZmZmZmZM5mZmZmZmZmP//
/////////4mZn////////////4mZmP////+ZmZmP////+5mY//+JmZmZmZj///mZmZmZmZmTOZmZmZmZ
mY/////////////4mZ/////////////7mZj////7mZmZn/////uZmP//iZmZmZmY///5mZmZmZmZkzmZ
mZmZmZn//////////////5mf////////////+Jmf////iZmZk5P////4mZ///4mZmZmZmP//+ZmZmZmZ
mZM5mZmZmZmZj/////////////iZn/////////////iZmP///5mZmZmZj///+5mY//+JmZmZmZj//4mZ
mZmZmZmTOZmZmZmZmZ/////////////zmZP///////////+JmZP///uTmZmZmZj//4mZm///mZmZmZmZ
//85mZmZmZmZkzmZmZmZmZOZiIiIiIiIiIiImTmZOIiIiIiIiIiImTmZOIi5mZmZmZOZiIuZmZk4iZOZ
mZmZOZiDmZmZmZmZmZM5mZmZmZmZOZmZmZmZmZmZmZOZmZmZmZmZmZmZmZOZmZmZmZmZmZmZOZmZmZmZ
mZk5mZmZmZOZmZmZmZmZmZmTOZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ
mZmZmZmZmZmZmZmZmZmZmZmZmZmZkzmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZM5mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmTOZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZkzmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZM5mZmZmZmZmZmTuIiIiIs5mZmZmZmZ
mTu4i7mZmZmZmZmZmTMzmZOZmZkzOZmZmZmZmZmZmZmZmZmZmZmZmZmTOZmZmZmZmTmbj///////+HmT
mZmZk4j/////iJmZmZk4iP////iZOZmZj/mZOZOIiIiIiIiIiDmZmZmZmZmZkzmZmZmZmZmZj///////
///4mZk5k4///4iI///4OZOY////////iZOZmb/5mZmP///////////4mZmZmZmZmZM5mZmZmZmZn///
//////////mZmY///5mZmZP///iZmP////////+ZOZk/iZmY/////////////4mZmZmZmZmTOZmZmZmZ
mZ/////////////5mZ////+JmZmY////iZl/////////+ZmZP4mZP//////////////7mZmZmZmZkzmZ
mZmZmZmb////////////uZP/j///+HM3j/////+ZmYj///////iZmT+JmY//////////////+JmZmZmZ
mZM5mZmZmZmZmY//////////+JmT+Jv///////////iPmTmZOI/4mP//uTk/iZmP//////////////iZ
mZmZmZmTOZmZmZmZmZmf//////////mZmZmZ///////////5mZmZmZmTOZk///mZP4mZj///////////
///4mZmZmZmZkzmZmZmZmZmTmP////////+JOZmZOY//////////iZmZmZmZmZk5mf/4mT+JmY//////
////////+JmZmZmZmZM5mZmZmZmZmZn/////////mZmZmZk//////////zmZmZmZmZmZmTmP/zm/iZmP
//////////////iZmZmZmZmTOZmZmZmZmZk5v///////85OZmZkzmP////////iZmZmZmZmZmZmZn//4
/4mZj/////hzN4/////4mZmZmZmZkzmZmZmZmZmZmZj//////4mZmTmY/4j////////4mZmZmZmZmZmZ
mZj///+JmY////+JmZmY////+JmZmZmZmZM5mZmZmZmZmZmZ//////+ZmZmZj////////////4mZmZmZ
mZmZmZmb////+ZmP///4mZu5mY////iZmZmZmZmTOZmZmZmZmZmZOb/////4k5mZmP/////////////7
mZmZmZmZmZmZk/////OZv///+ZmP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AAAAAA
AAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAAAAAAD4AAAAAAAAAAAAAAAAAAAA+AA
AAAAAAAAAAAAAAAAAAfgAAAAAAAAAAAAAAAAAAAH8AAAAAAAAAAAAAAAAAAAD/AAAAAAAAAAAAAAAAAA
AA/4AAAAAAAAAAAAAAAAAAAf/AAAAAAAAAAAAAAAAAAAH/wAAAAAAAAAAAAAAAAAAD/+AAAAAAAAAAAA
AAAAAAB//wAAAAAAAAAAAAAAAAAA//+AAAAAAAAAAAAAAAAAAf//wAAAAAAAAAAAAAAAAAP//+AAAAAA
AAAAAAAAAAAH///4AAAAAAAAAAAAAAAAD////AAAAAAAAAAAAAAAAD////8AAAAAAAAAAAAAAAD/////
wAAAAAAAAAAAAAAD//////wAAAAAAAAAAAAAH////////////////////////w==
</value>
</data>
</root>
+138 -136
View File
@@ -20,6 +20,8 @@ using TemuKJD.Extension;
using AllBase.Model.Result;
using TemuKJD.BLL.VDian;
using TemuKJD;
using TemuKJD.VDianForms;
using Newtonsoft.Json.Linq;
namespace KJD.VDianForms
{
@@ -53,7 +55,7 @@ namespace KJD.VDianForms
RefreshDataGridView();
}
private void ProductMappingVDianLoginForm_SaveComplete(object obj)
private void VDianLoginForm_SaveComplete(object obj)
{
VDianShopLoginInfo vDianShopLoginInfo = obj as VDianShopLoginInfo;
if (vDianShopLoginInfo == null)
@@ -80,106 +82,91 @@ namespace KJD.VDianForms
if (vDianShopLoginInfo.LoginStatus == 1)
{
// cookie保存到服务端
var url = BaseClass.BuildObjString("api/weidian&act=add_weidian_login_cookie").Replace("littlecow/api/weidian", "api/weidian");
//保存cookie到服务器
var url = BaseClass.BuildPDDObjString("shop/mdy_weidian_shop_cookie");
var data = UserLogin.GetSignaturex() +
"&shop_id=" + vDianShopLoginInfo.ShopId +
"&shop_name=" + vDianShopLoginInfo.ShopName +
"&cookie=" + GetHtml.UrlEncodeUtf8(vDianShopLoginInfo.Cookies.Replace(" ", ""));
"&wd_token=" + vDianShopLoginInfo.Wdtoken +
"&cookie=" + GetHtml.UrlEncodeUtf8(vDianShopLoginInfo.Cookies.Replace(" ", "")) +
"&login_status=在线";
var html = GetHtml.PostUtf8(url, data);
// 测试获取cookie
//url = BaseClass.BuildObjString("api/weidian&act=get_weidian_login_cookie").Replace("littlecow/api/weidian", "api/weidian");
//data = UserLogin.GetSignaturex() + "&cid=6";
//html = GetHtml.PostUtf8(url, data);
}
}
/// <summary>
/// 读取服务端的微店
/// </summary>
public static List<VDianShopLoginInfo> GetServerVDian()
public static void GetServerVDian()
{
// 读取已有店铺
List<VDianShopLoginInfo> list = new List<VDianShopLoginInfo>();
string url = BaseClass.BuildObjString("shop&act=auto_login_shop_v1");
string url = BaseClass.BuildObjString("shop/get_weidian_shop");
string data = UserLogin.GetSignaturex();
data += "&siteid=5";
string html = GetHtml.PostUtf8(url, data);
if (html == "Ok" || string.IsNullOrEmpty(html))
if (!html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (!html.Contains("\"code\":200"))
return;
var jArr = JsonHelper.JObjectParse(html)["data"] as JArray;
foreach(JObject o in jArr)
{
return list;
}
var m = BaseRegex.GetMatchRegex(ref html, "<shop([^>]+?)>");
for (int i = 0; m != null && i < m.Count; i++)
{
string shopStr = m[i].Groups[0].Value;
string shopStr = JsonHelper.SerializeObject(o);
VDianShopLoginInfo vsp = new VDianShopLoginInfo();
vsp.ShopId = BaseRegex.GetStringJson(ref shopStr, "id");
vsp.ShopId = BaseRegex.GetStringJson(ref shopStr, "shop_id");
if (vsp.ShopId == null)
continue;
vsp.Phone = BaseRegex.GetStringJson(ref shopStr, "user_name");
vsp.ShopName = BaseRegex.GetStringJson(ref shopStr, "name");
vsp.Password = BaseRegex.GetStringJson(ref shopStr, "password");
vsp.Phone = BaseRegex.GetStringJson(ref shopStr, "login_name");
vsp.ShopName = BaseRegex.GetStringJson(ref shopStr, "shop_account");
vsp.Password = BaseRegex.GetStringJson(ref shopStr, "login_pass");
vsp.Cookies = BaseRegex.GetStringJson(ref shopStr, "cookie");
vsp.LoginStatus = BaseRegex.GetStringJson(ref shopStr, "login_status") == "在线" ? 1 : 2;
vsp.Wdtoken = BaseRegex.GetStringJson(ref shopStr, "wd_token");
if (!string.IsNullOrEmpty(vsp.Password))
vsp.Password = DataOpenSSL.DecryptString(vsp.Password);
vsp.ShopId = BaseRegex.GetStringJson(ref shopStr, "shop_id");
if (list.Any(l => l.Phone == vsp.Phone))
continue;
list.Add(vsp);
}
return list;
GlobalConfig.VDianShopLoginList.RemoveAll(vDian => !list.Any(v => v.ShopId == vDian.ShopId));
foreach (var v in list)
{
var vDian = GlobalConfig.VDianShopLoginList.FirstOrDefault(vo => vo.ShopId == v.ShopId);
if (vDian == null)
GlobalConfig.VDianShopLoginList.Add(v);
else
{
vDian.Api2Auth = v.Api2Auth;
vDian.ApiAuth = v.ApiAuth;
vDian.Cookies = v.Cookies;
vDian.LoginStatus = v.LoginStatus;
vDian.LstWdApiToken = v.LstWdApiToken;
vDian.MainAuth = v.MainAuth;
vDian.MultiAttrApiToken = v.MultiAttrApiToken;
vDian.MultiImgApiToken = v.MultiImgApiToken;
vDian.MultiProductApiToken = v.MultiProductApiToken;
vDian.Password = v.Password;
vDian.Phone = v.Phone;
vDian.ShopId = v.ShopId;
vDian.ShopName = v.ShopName;
vDian.UpGoodAuth = v.UpGoodAuth;
vDian.user_name = v.user_name;
vDian.WdApi2RefreshToken = v.WdApi2RefreshToken;
vDian.WdApi2Token = v.WdApi2Token;
vDian.Wdtoken = v.Wdtoken;
}
}
}
/// <summary>
/// 新增微店店铺列表
/// </summary>
/// <param name="vDianList"></param>
/// <param name="isUpdateContainsShop">是否更新服务端已存在的店铺</param>
public void SaveVDianToServer(List<VDianShopLoginInfo> vDianList, bool isUpdateContainsShop = false)
public void SaveVDianToServer(List<VDianShopLoginInfo> vDianList)
{
var shops = vDianList;
if (!isUpdateContainsShop)
for (int i = 0; i < vDianList.Count; i++)
{
/// <summary>
/// 读取店铺列表
/// </summary>
/// <returns></returns>
List<VDianShopLoginInfo> list = new List<VDianShopLoginInfo>();
string url = BaseClass.BuildObjString("shop&act=auto_login_shop_v1");
string data = UserLogin.GetSignaturex();
data += "&siteid=5";
string html = GetHtml.PostUtf8(url, data);
if (!string.IsNullOrEmpty(html))
{
var m = BaseRegex.GetMatchRegex(ref html, "<shop([^>]+?)>");
for (int i = 0; m != null && i < m.Count; i++)
{
string shopStr = m[i].Groups[0].Value;
VDianShopLoginInfo vsp = new VDianShopLoginInfo();
vsp.ShopId = BaseRegex.GetStringJson(ref shopStr, "id");
if (vsp.ShopId == null)
continue;
vsp.Phone = BaseRegex.GetStringJson(ref shopStr, "user_name");
vsp.ShopName = BaseRegex.GetStringJson(ref shopStr, "name");
vsp.Password = BaseRegex.GetStringJson(ref shopStr, "password");
if (!string.IsNullOrEmpty(vsp.Password))
vsp.Password = DataOpenSSL.DecryptString(vsp.Password);
vsp.ShopId = BaseRegex.GetStringJson(ref shopStr, "shop_id");
if (list.Any(l => l.Phone == vsp.Phone))
continue;
list.Add(vsp);
}
}
// 写入服务端没有的店铺
shops = GlobalConfig.VDianShopLoginList.Where(s => !list.Any(l => l.ShopId == s.ShopId)).ToList();
}
for (int i = 0; i < shops.Count; i++)
{
var vShop = shops[i];
var vShop = vDianList[i];
SaveVDianToServer(vShop);
}
}
@@ -193,29 +180,21 @@ namespace KJD.VDianForms
string sPassword = vShop.Password;
string sShopName = vShop.ShopName;
string sShopId = vShop.ShopId;
//string sGroup = "";
//var x = "123 +/";
//var r = GetHtml.UrlEncodeUtf8(DataOpenSSL.EncryptString(x));
//var rr = DataOpenSSL.DecryptString(GetHtml.UrlDecode(r));
var url = BaseClass.BuildObjString("shop&act=add_shop_vd_v1");
var data = UserLogin.GetSignaturex() + "&user_name=" + sShopPhone
+ "&password=" + GetHtml.UrlEncodeUtf8(DataOpenSSL.EncryptString(sPassword)) + "&name=" + sShopName
+ "&shop_id=" + sShopId //+ "&cat_name=" + sGroup
+ "&service=&buyer=&login_user=&upload_user="
+ "&collect_user=" + BaseClass.NickName + "&sub_account_name=&sub_account_password=";
data += "&site_id=5"; // 5为微店
var url = BaseClass.BuildPDDObjString("shop/add_weidian_shop");
var data = UserLogin.GetSignaturex()
+ "&login_name=" + sShopPhone
+ "&login_pass=" + GetHtml.UrlEncodeUtf8(DataOpenSSL.EncryptString(sPassword))
+ "&shop_id=" + sShopId
+ "&shop_account=" + sShopName;
data += "&login_status=" + (vShop.LoginStatus == 1 ? "在线" : "掉线");
var html = GetHtml.PostUtf8(url, data);
if (!string.IsNullOrEmpty(html) && html.Equals("Full Shop Count"))
if (!html.Contains("\"code\":200"))
{
BaseMsgForm.ShowInfo("当前版本支持的最大店铺数已满,请升级版本或另外购买一个账户");
}
if (string.IsNullOrEmpty(html))
{
Thread.Sleep(1000);
html = GetHtml.PostUtf8(url, data);
}
if (!html.Contains("\"code\":200"))
BaseMsgForm.ShowError("店铺保存失败");
}
/// <summary>
@@ -223,11 +202,10 @@ namespace KJD.VDianForms
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public string DelServerVDianShop(string name)
public string DelServerVDianShop(string shopId)
{
string url = BaseClass.BuildObjString("shop&act=delete");
string data = UserLogin.GetSignaturex() + "&name=" + name;
data += "&site_id=5";
string url = BaseClass.BuildPDDObjString("shop/del_weidian_shop");
string data = UserLogin.GetSignaturex() + "&shop_id=" + shopId;
string html = GetHtml.PostUtf8(url, data);
return html;
}
@@ -249,9 +227,8 @@ namespace KJD.VDianForms
case "删除":
if (BaseMsgForm.ShowConfirm("确定删除店铺吗?").DialogResult == DialogResult.Cancel)
return;
DelServerVDianShop(shopId);
DeleteVDianShop(e.RowIndex);
DelServerVDianShop(shopName);
//StartUp.SaveVDianShopLogin();
break;
case "编辑":
@@ -262,19 +239,35 @@ namespace KJD.VDianForms
break;
case "重登":
//ProductMappingVDianLoginForm.IsRun = true;
//var vDian = GlobalConfig.VDianShopLoginList.FirstOrDefault(v => v.ShopId == shopId);
//var phone = "";
//var password = "";
//if (vDian != null)
//{
// phone = vDian.Phone;
// password = vDian.Password;
//}
//ProductMappingVDianLoginForm productMappingVDianLoginForm = new ProductMappingVDianLoginForm(phone, password);
//productMappingVDianLoginForm.SaveComplete += ProductMappingVDianLoginForm_SaveComplete;
//productMappingVDianLoginForm.ShowDialog();
//ProductMappingVDianLoginForm.IsRun = false;
{
VDianLoginForm.IsRun = true;
var vDian = GlobalConfig.VDianShopLoginList.FirstOrDefault(v => v.ShopId == shopId);
var phone = "";
var password = "";
if (vDian != null)
{
phone = vDian.Phone;
password = vDian.Password;
}
VDianLoginForm vDianLoginForm = new VDianLoginForm(phone, password);
vDianLoginForm.SaveComplete += VDianLoginForm_SaveComplete;
vDianLoginForm.ShowDialog();
VDianLoginForm.IsRun = false;
}
break;
case "进店":
{
VDianLoginForm.IsRun = true;
var vDian = GlobalConfig.VDianShopLoginList.FirstOrDefault(v => v.ShopId == shopId);
if (vDian != null)
{
VDianLoginForm vDianLoginForm = new VDianLoginForm(vDian, "manage");
vDianLoginForm.WindowState = FormWindowState.Maximized;
vDianLoginForm.ShowDialog();
}
VDianLoginForm.IsRun = false;
}
break;
case "上货认证":
@@ -364,7 +357,7 @@ namespace KJD.VDianForms
// string url = "https://d.weidian.com/weidian-pc/pc-vue-index/index.html"; // 微店商家后台
var result = new VDianUpProdMappingBLL().request_vdian_sell_com(vDian.Wdtoken, vDian.Cookies);
Thread.Sleep(200);
if (result.Contains("LOGIN ERROR"))
if (result.ToUpper().Contains("LOGIN ERROR"))
{
vDian.LoginStatus = 2;
}
@@ -372,6 +365,14 @@ namespace KJD.VDianForms
{
vDian.LoginStatus = 1;
}
var url = BaseClass.BuildPDDObjString("shop/mdy_weidian_shop_cookie");
var data = UserLogin.GetSignaturex() +
"&shop_id=" + vDian.ShopId +
"&cookie=" + vDian.Cookies +
"&wd_token=" + vDian.Wdtoken +
"&login_status=" + (vDian.LoginStatus == 1 ? "在线" : "掉线");
var html = GetHtml.PostUtf8(url, data);
// 获取店铺token列表
vDian.ApiAuth = "未授权";
@@ -556,7 +557,8 @@ namespace KJD.VDianForms
param.ShopName,
param.Phone,
param.Cookies,
param.LoginStatus == 1 ? "正常" : "未登录",
param.LoginStatus == 1 ? "在线" : "掉线",
"进店",
"检测",
"重登",
param.UpGoodAuth,
@@ -577,7 +579,7 @@ namespace KJD.VDianForms
{
if (dgvr == null || param == null)
return;
dgvr.Cells["colLoginStatus"].Value = (param.LoginStatus == 1 ? "正常" : "未登录");
dgvr.Cells["colLoginStatus"].Value = (param.LoginStatus == 1 ? "在线" : "掉线");
dgvr.Cells["colCookie"].Value = param.Cookies;
dgvr.Cells["colUpGoodAuth"].Value = param.UpGoodAuth;
dgvr.Cells["colApiAuth"].Value = param.ApiAuth;
@@ -663,7 +665,7 @@ namespace KJD.VDianForms
// 批量导入店铺
private void btnImport_Click(object sender, EventArgs e)
{
// ProductMappingVDianLoginForm.IsRun = true;
VDianLoginForm.IsRun = true;
ImportShop();
}
@@ -684,28 +686,28 @@ namespace KJD.VDianForms
var strArr = importStr.Replace("\r", "").Split('\n');
for (int i = 0; i < strArr.Length; i++)
{
//if (ProductMappingVDianLoginForm.IsRun == false)
// break;
//try
//{
// // 通用格式
// if (strArr[i].Contains("-----"))
// {
// var productArr = strArr[i].Split(new string[] { "-----" }, StringSplitOptions.RemoveEmptyEntries);
// if (productArr.Length >= 2)
// {
// var phone = productArr[0];
// var password = productArr[1];
if (VDianLoginForm.IsRun == false)
break;
try
{
// 通用格式
if (strArr[i].Contains("-----"))
{
var productArr = strArr[i].Split(new string[] { "-----" }, StringSplitOptions.RemoveEmptyEntries);
if (productArr.Length >= 2)
{
var phone = productArr[0];
var password = productArr[1];
// ProductMappingVDianLoginForm productMappingVDianLoginForm = new ProductMappingVDianLoginForm(phone, password);
// productMappingVDianLoginForm.SaveComplete += ProductMappingVDianLoginForm_SaveComplete;
// productMappingVDianLoginForm.ShowDialog();
// }
// }
//}
//catch (Exception ex)
//{
//}
VDianLoginForm vDianLoginForm = new VDianLoginForm(phone, password);
vDianLoginForm.SaveComplete += VDianLoginForm_SaveComplete;
vDianLoginForm.ShowDialog();
}
}
}
catch (Exception ex)
{
}
}
}
this.btnImport.Enabled = true;
@@ -821,7 +823,7 @@ namespace KJD.VDianForms
private void btnLoginSelect_Click(object sender, EventArgs e)
{
//ProductMappingVDianLoginForm.IsRun = true;
VDianLoginForm.IsRun = true;
if (this.btnLoginSelect.Text == "登录选中")
{
List<string> shopIdList = GetCheckedTokenList();
@@ -833,15 +835,15 @@ namespace KJD.VDianForms
foreach (var shopId in shopIdList)
{
//if (ProductMappingVDianLoginForm.IsRun == false)
// break;
if (VDianLoginForm.IsRun == false)
break;
var vDian = GlobalConfig.VDianShopLoginList.FirstOrDefault(v => v.ShopId == shopId);
if (vDian != null && !string.IsNullOrEmpty(vDian.Phone)/* && !string.IsNullOrEmpty(vDian.Password)*/)
{
//ProductMappingVDianLoginForm productMappingVDianLoginForm = new ProductMappingVDianLoginForm(vDian.Phone, vDian.Password);
//productMappingVDianLoginForm.SaveComplete += ProductMappingVDianLoginForm_SaveComplete;
//productMappingVDianLoginForm.ShowDialog();
VDianLoginForm vDianLoginForm = new VDianLoginForm(vDian.Phone, vDian.Password);
vDianLoginForm.SaveComplete += VDianLoginForm_SaveComplete;
vDianLoginForm.ShowDialog();
}
}
}
+67 -55
View File
@@ -46,12 +46,16 @@
this.panel2 = new System.Windows.Forms.Panel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.dgvVDianShop = new TemuKJD.UserComponent.DataGridViewXEx();
this.panel3 = new System.Windows.Forms.Panel();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.panel6 = new System.Windows.Forms.Panel();
this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colPhone = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colCookie = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colLoginStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colIn = new System.Windows.Forms.DataGridViewLinkColumn();
this.colShopOperate = new System.Windows.Forms.DataGridViewLinkColumn();
this.colRelogin = new System.Windows.Forms.DataGridViewLinkColumn();
this.colUpGoodAuth = new System.Windows.Forms.DataGridViewLinkColumn();
@@ -59,9 +63,6 @@
this.colApi2Auth = new System.Windows.Forms.DataGridViewLinkColumn();
this.ColEdit = new System.Windows.Forms.DataGridViewLinkColumn();
this.colDelete = new System.Windows.Forms.DataGridViewLinkColumn();
this.panel3 = new System.Windows.Forms.Panel();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.panel6 = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -93,7 +94,7 @@
//
this.splitContainer1.Panel2.Controls.Add(this.panel2);
this.splitContainer1.Panel2.Margin = new System.Windows.Forms.Padding(4);
this.splitContainer1.Size = new System.Drawing.Size(858, 499);
this.splitContainer1.Size = new System.Drawing.Size(873, 499);
this.splitContainer1.SplitterWidth = 2;
this.splitContainer1.TabIndex = 32;
//
@@ -109,7 +110,7 @@
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(858, 50);
this.tableLayoutPanel2.Size = new System.Drawing.Size(873, 50);
this.tableLayoutPanel2.TabIndex = 37;
//
// panel5
@@ -117,7 +118,7 @@
this.panel5.Controls.Add(this.btnAuthSelect);
this.panel5.Controls.Add(this.btnLoginSelect);
this.panel5.Controls.Add(this.btnCheck);
this.panel5.Location = new System.Drawing.Point(626, 3);
this.panel5.Location = new System.Drawing.Point(641, 3);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(229, 44);
this.panel5.TabIndex = 1;
@@ -166,7 +167,7 @@
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(617, 44);
this.panel4.Size = new System.Drawing.Size(632, 44);
this.panel4.TabIndex = 0;
//
// labelX1
@@ -214,7 +215,7 @@
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Name = "panel2";
this.panel2.Padding = new System.Windows.Forms.Padding(8, 0, 8, 8);
this.panel2.Size = new System.Drawing.Size(858, 447);
this.panel2.Size = new System.Drawing.Size(873, 447);
this.panel2.TabIndex = 0;
//
// tableLayoutPanel1
@@ -230,7 +231,7 @@
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(842, 439);
this.tableLayoutPanel1.Size = new System.Drawing.Size(857, 439);
this.tableLayoutPanel1.TabIndex = 28;
//
// dgvVDianShop
@@ -255,6 +256,7 @@
this.colPhone,
this.colCookie,
this.colLoginStatus,
this.colIn,
this.colShopOperate,
this.colRelogin,
this.colUpGoodAuth,
@@ -286,12 +288,43 @@
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvVDianShop.RowHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.dgvVDianShop.RowTemplate.Height = 23;
this.dgvVDianShop.Size = new System.Drawing.Size(842, 399);
this.dgvVDianShop.Size = new System.Drawing.Size(857, 399);
this.dgvVDianShop.TabIndex = 26;
this.dgvVDianShop.UseCustomBackgroundColor = true;
this.dgvVDianShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvVDianShop_CellContentClick);
this.dgvVDianShop.UserDeletedRow += new System.Windows.Forms.DataGridViewRowEventHandler(this.dgvVDianShop_UserDeletedRow);
//
// panel3
//
this.panel3.Controls.Add(this.statusBar);
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel3.Location = new System.Drawing.Point(0, 399);
this.panel3.Margin = new System.Windows.Forms.Padding(0);
this.panel3.Name = "panel3";
this.panel3.Padding = new System.Windows.Forms.Padding(0, 8, 0, 0);
this.panel3.Size = new System.Drawing.Size(857, 40);
this.panel3.TabIndex = 27;
//
// statusBar
//
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 8);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(857, 32);
this.statusBar.TabIndex = 27;
//
// panel6
//
this.panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel6.Controls.Add(this.splitContainer1);
this.panel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel6.Location = new System.Drawing.Point(1, 33);
this.panel6.Name = "panel6";
this.panel6.Size = new System.Drawing.Size(875, 501);
this.panel6.TabIndex = 33;
//
// colShopId
//
this.colShopId.HeaderText = "店铺Id";
@@ -337,6 +370,15 @@
this.colLoginStatus.ReadOnly = true;
this.colLoginStatus.Width = 75;
//
// colIn
//
this.colIn.HeaderText = "进店";
this.colIn.Name = "colIn";
this.colIn.ReadOnly = true;
this.colIn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colIn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colIn.Width = 55;
//
// colShopOperate
//
this.colShopOperate.HeaderText = "检测";
@@ -399,42 +441,11 @@
this.colDelete.ReadOnly = true;
this.colDelete.Width = 55;
//
// panel3
//
this.panel3.Controls.Add(this.statusBar);
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel3.Location = new System.Drawing.Point(0, 399);
this.panel3.Margin = new System.Windows.Forms.Padding(0);
this.panel3.Name = "panel3";
this.panel3.Padding = new System.Windows.Forms.Padding(0, 8, 0, 0);
this.panel3.Size = new System.Drawing.Size(842, 40);
this.panel3.TabIndex = 27;
//
// statusBar
//
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 8);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(842, 32);
this.statusBar.TabIndex = 27;
//
// panel6
//
this.panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel6.Controls.Add(this.splitContainer1);
this.panel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel6.Location = new System.Drawing.Point(1, 33);
this.panel6.Name = "panel6";
this.panel6.Size = new System.Drawing.Size(860, 501);
this.panel6.TabIndex = 33;
//
// VDianShopListForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(862, 535);
this.ClientSize = new System.Drawing.Size(877, 535);
this.Controls.Add(this.panel6);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "VDianShopListForm";
@@ -467,19 +478,6 @@
private DevComponents.DotNetBar.ButtonX btnImport;
private DevComponents.DotNetBar.ButtonX buttonX1;
private DevComponents.DotNetBar.LabelX labelX1;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopId;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopName;
private System.Windows.Forms.DataGridViewTextBoxColumn colPhone;
private System.Windows.Forms.DataGridViewTextBoxColumn colCookie;
private System.Windows.Forms.DataGridViewTextBoxColumn colLoginStatus;
private System.Windows.Forms.DataGridViewLinkColumn colShopOperate;
private System.Windows.Forms.DataGridViewLinkColumn colRelogin;
private System.Windows.Forms.DataGridViewLinkColumn colUpGoodAuth;
private System.Windows.Forms.DataGridViewLinkColumn colApiAuth;
private System.Windows.Forms.DataGridViewLinkColumn colApi2Auth;
private System.Windows.Forms.DataGridViewLinkColumn ColEdit;
private System.Windows.Forms.DataGridViewLinkColumn colDelete;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
@@ -488,5 +486,19 @@
private System.Windows.Forms.Panel panel6;
private DevComponents.DotNetBar.ButtonX btnLoginSelect;
private DevComponents.DotNetBar.ButtonX btnAuthSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopId;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopName;
private System.Windows.Forms.DataGridViewTextBoxColumn colPhone;
private System.Windows.Forms.DataGridViewTextBoxColumn colCookie;
private System.Windows.Forms.DataGridViewTextBoxColumn colLoginStatus;
private System.Windows.Forms.DataGridViewLinkColumn colIn;
private System.Windows.Forms.DataGridViewLinkColumn colShopOperate;
private System.Windows.Forms.DataGridViewLinkColumn colRelogin;
private System.Windows.Forms.DataGridViewLinkColumn colUpGoodAuth;
private System.Windows.Forms.DataGridViewLinkColumn colApiAuth;
private System.Windows.Forms.DataGridViewLinkColumn colApi2Auth;
private System.Windows.Forms.DataGridViewLinkColumn ColEdit;
private System.Windows.Forms.DataGridViewLinkColumn colDelete;
}
}
@@ -132,6 +132,9 @@
<metadata name="colLoginStatus.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colIn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colShopOperate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
+453 -184
View File
@@ -22,11 +22,16 @@ using AllBase.Model.Param.VDianManage;
using AllBase.Model.Param.ToolsManage;
using Work.Api;
using TemuKJD.BaseForms;
using NaiBa.Util.Helper;
using TemuKJD.BLL.VDian;
using CefSharp.Handler;
using TemuKJD.Extension;
using LittleCow.Model.Param.WeiDianManage;
using TemuKJD.WXForms.ProductForms;
using TemuKJD.PDDForms.ProductSelectForms;
using TemuKJD.BLL;
using AllBase.Model.Result.PDDResult;
using TemuKJD.VDianForms;
using Work;
namespace KJD.VDianForms
{
@@ -37,7 +42,9 @@ namespace KJD.VDianForms
/// <summary>
/// 微店上货地址(使用getUa(); js方法获取ua算法)
/// </summary>
public static string vDianUploadUrl = "https://d.weidian.com/weidian-pc/pc-vue-item/#/item/edit";
public static string vDianUploadUrl = "https://d.weidian.com/weidian-pc/weidian-loader/#/pc-vue-item/item/edit";
//public static string vDianUploadUrl = "https://d.weidian.com/weidian-pc/weidian-loader/#/pc-vue-micro-index/index";
//public static string vDianUploadUrl = "https://d.weidian.com/weidian-pc/pc-vue-item/#/item/edit";
//public static string vDianUploadUrl = "https://d.weidian.com/weidian-pc/pc-vue-item/#/item/listNew";
//public static string vDianUploadUrl = "https://d.weidian.com/weidian-pc/pc-vue-index/index.html";
@@ -72,12 +79,17 @@ namespace KJD.VDianForms
#region 窗体事件
private void UploadProductForm_Load(object sender, EventArgs e)
{
GlobalConfig.WeiDianUploadParam = ConfigHelper.LoadConfig<WeiDianSettingParam>("vdian_upload_setting_param");
chkSelectAll = dgvShop.Columns["colIsUpload"].AddHeaderCheckBox(HorizontalAlignment.Right, 0, 10, null, null, false);
chkSelectAll.Width = 20;
chkSelectAll.Height = 16;
chkSelectAll.CheckedChanged += chkSelectAll_CheckedChanged;
GlobalConfig.WeiDianUploadParam = NaiBa.Util.Helper.ConfigHelper.LoadConfig<WeiDianSettingParam>("vdian_upload_setting_param");
if (GlobalConfig.WeiDianUploadParam == null)
{
GlobalConfig.WeiDianUploadParam = new WeiDianSettingParam
{
AddPercent = "400",
AddPercent = "300",
AddPrice = "0",
IsSetCps = false,
CpsPercent = "10",
@@ -85,167 +97,64 @@ namespace KJD.VDianForms
};
}
// 连续单击6次出现显示网页按钮
Task.Run(() =>
{
while (true)
{
Thread.Sleep(200);
if (labelClickTimes > 0)
{
Thread.Sleep(6000);
labelClickTimes = 0;
}
}
});
lstTemuDBProductSelect = NaiBa.Util.Helper.ConfigHelper.LoadConfig<NaiBa.Util.ConcurrentList<TemuDBProductSelect>>("vdian_db_prod_upload_list");
if (lstTemuDBProductSelect == null)
lstTemuDBProductSelect = new NaiBa.Util.ConcurrentList<TemuDBProductSelect>();
LoadThreadCount();
LoadUploadQueue();
RefreshQueueCount();
BtnRefreshShop_Click(null, null);
this.VisibleChanged += UploadProductForm_VisibleChanged;
chkSelectAll = dgvShop.Columns["colIsUpload"].AddHeaderCheckBox(HorizontalAlignment.Right, 0, 0, null, null, false);
chkSelectAll.Width = chkSelectAll.Height = 13;
chkSelectAll.CheckedChanged += chkSelectAll_CheckedChanged;
this.chkCPS.Checked = GlobalConfig.WeiDianUploadParam.IsSetCps;
this.txtCPSRate.Text = GlobalConfig.WeiDianUploadParam.CpsPercent;
this.txtPriceBase.Text = GlobalConfig.WeiDianUploadParam.AddPrice;
this.txtPriceRatio.Text = GlobalConfig.WeiDianUploadParam.AddPercent;
this.cmbThreadCount.SelectedIndexChanged -= cmbThreadCount_SelectedIndexChanged;
try { this.cmbThreadCount.SelectedValue = Convert.ToInt32(GlobalConfig.WeiDianUploadParam.ThreadCount); } catch { }
try
{
this.cmbThreadCount.SelectedValue = GlobalConfig.WeiDianUploadParam.ThreadCount.ParseToInt();
}
catch
{
}
this.cmbThreadCount.SelectedIndexChanged += cmbThreadCount_SelectedIndexChanged;
Task.Run(() =>
{
VDianShopListForm.GetServerVDian();
BtnRefreshShop_Click(null, null);
});
}
bool init = false;
private void UploadProductForm_VisibleChanged(object sender, EventArgs e)
{
if (Visible == true)
if (Visible == true && !init)
{
init = true;
RefreshShop();
}
}
private void BtnImport_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Title = "请选择需要导入的商品";
ofd.Filter = "文本文件|*.txt";
if (DialogResult.OK == ofd.ShowDialog())
{
this.btnImport.Enabled = false;
this.btnUpload.Enabled = false;
this.btnClear.Enabled = false;
Task.Run(new Action(() =>
{
try
{
//List<ProductInfo> importList = new List<ProductInfo>();
//List<IdValueTypeEntity> dbList = new List<IdValueTypeEntity>();
//List<ProductInfo> uploadQueueList = DataManageBLL.WeiDianUploadQueueList.Clone();
//string file = ofd.FileName;
//string source = File.ReadAllText(file, Encoding.Default);
//string[] sourceArr = source.Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToArray();
//for (int i = 0; i < sourceArr.Length; i++)
//{
// string[] lineArr = sourceArr[i].Split(new string[] { "-----" }, StringSplitOptions.RemoveEmptyEntries);
// ProductInfo product = null;
// if (lineArr.Length > 0)
// {
// product = new ProductInfo();
// productBLL.GetProductInfoByUrl(product, lineArr);
// }
// if (product.ProductId <= 0)
// {
// product = new ProductInfo();
// var text = sourceArr[i];
// var pStr = BaseRegex.GetMatchRegexString(text, "id=(\\d{5,18})");
// if (!text.Contains(',') && string.IsNullOrEmpty(pStr) && !text.Contains("detail.1688.com/offer/"))
// text = BaseEncrypt.EncryptDecode(text);
// // 通用格式 "来源", "商品ID", "商品标题",...
// if (text != null && text.Contains(','))
// {
// var productArr = text.Split(',');
// if (productArr.Length >= 6)
// {
// string From = productArr[0].Trim('"');
// string ProductId = productArr[1].Trim('"');
// string ProductTitle = productArr[2].Trim('"');
// string RealProductId = productArr[1].Trim('"');
// string CatId = productArr[5].Trim('"');
// if (From == "淘宝" || From == "天猫")
// {
// product.Platform = (int)ShopPlatform.TaoBao;
// }
// else if (From == "拼多多" || From == "搜款网")
// {
// product.Platform = (int)ShopPlatform.PinDuoDuo;
// }
// else if (From == "1688" || From == "阿里巴巴")
// {
// product.Platform = (int)ShopPlatform.Alibaba;
// }
// if (From == "搜款网")
// {
// var idStr = ProductId.ToString();
// if (idStr.Length >= 2)
// {
// var idStrNew = idStr[idStr.Length - 1] + idStr.Substring(1, idStr.Length - 2) + idStr[0];
// RealProductId = idStrNew;
// }
// }
// product.ProductId = RealProductId.ParseToLong();
// product.FissionProductName = ProductTitle;
// }
// }
// }
// if (product != null && product.ProductId > 0)
// {
// if (!importList.Where(p => p.ProductId == product.ProductId && p.Platform == product.Platform && p.FissionProductName == product.FissionProductName).Any())
// {
// if (!uploadQueueList.Where(p => p.ProductId == product.ProductId && p.Platform == product.Platform && p.FissionProductName == product.FissionProductName).Any())
// {
// if (i % 30 == 0)
// {
// RefreshQueueCount(importList.Count);
// }
// importList.Add(product);
// dbList.Add(new IdValueTypeEntity
// {
// Id = product.ProductId,
// Type = product.Platform,
// Value = JsonConvert.SerializeObject(product)
// });
// }
// }
// }
// if (importList.Count > 100)
// {
// SaveBatch(dbList, importList);
// }
//}
//SaveBatch(dbList, importList);
//RefreshQueueCount();
}
catch (Exception ex)
{
LogHelper.WriteWithTime(ex);
}
this.BeginInvoke(new Action(() =>
{
this.btnImport.Enabled = true;
this.btnUpload.Enabled = true;
this.btnClear.Enabled = true;
}));
}));
}
WXUserProdListForm.Instance.lstTemuDBProductSelect = this.lstTemuDBProductSelect;
//WXUserProdListForm.Instance.cmbSourceType.Items.Clear();
//WXUserProdListForm.Instance.cmbSourceType.Items.Add("厂商直采");
WXUserProdListForm.Instance.lblRelation.Visible = true;
WXUserProdListForm.Instance.cmbRelation.Visible = true;
WXUserProdListForm.Instance.cmbRelation.Text = "否";
WXUserProdListForm.Instance.SaveComplete -= dbProdList_SaveComplete;
WXUserProdListForm.Instance.SaveComplete += dbProdList_SaveComplete;
WXUserProdListForm.Instance.Show();
WXUserProdListForm.Instance.BringToFront();
}
private void dbProdList_SaveComplete(object obj)
{
NaiBa.Util.Helper.ConfigHelper.SaveConfig("vdian_db_prod_upload_list", this.lstTemuDBProductSelect);
RefreshQueueCount();
}
private void BtnUpload_Click(object sender, EventArgs e)
@@ -274,7 +183,7 @@ namespace KJD.VDianForms
GlobalConfig.WeiDianUploadParam.AddPercent = addPercent.ToString();
GlobalConfig.WeiDianUploadParam.AddPrice = addPrice.ToString();
GlobalConfig.WeiDianUploadParam.ThreadCount = threadCount.ToString();
ConfigHelper.SaveConfig("vdian_upload_setting_param", GlobalConfig.WeiDianUploadParam);
NaiBa.Util.Helper.ConfigHelper.SaveConfig("vdian_upload_setting_param", GlobalConfig.WeiDianUploadParam);
}
catch
{
@@ -310,16 +219,87 @@ namespace KJD.VDianForms
{
try
{
var prodInfo = obj as KJDDBProduct;
var selectProd = obj as TemuDBProductSelect;
KJDDBProduct dbProd = selectProd.kjdDbProduct;
if (dbProd == null || dbProd.product_json.IsNullOrEmpty())
dbProd = PDDDBProdUserSelectForm.GetProductDetail(selectProd.out_product_Id.ToString());
DataGridViewRow row = null;
Invoke(new Action(() =>
{
var rowIndex = dgvProduct.Rows.Add(
selectProd?.from_shop_id,
"",
dbProd?.product_get_type_text,
selectProd?.spu_id,
selectProd?.product_name,
dbProd?.price_text,
dbProd?.sale_count,
"", //vDianProduct?.itemId,
"", //vDianProduct?.itemName,
"", //新价
selectProd?.status,
"",
"删除");
row = dgvProduct.Rows[rowIndex];
}));
if (dbProd == null || dbProd.id == 0)
{
if (dbProd?.id == 0)
{
selectProd.status = "已清除";
}
Invoke(new Action(() => { row.Cells["colUploadStatus"].Value = selectProd?.status; }));
return;
}
// 获取该商品是否已建立关联
{
var url = BaseClass.BuildPDDObjString("product/get_relation");
var data = UserLogin.GetSignaturex();
data += "&up_spu_id=" + dbProd?.spu_id;
data += "&index=" + Math.Abs((dbProd?.spu_id).GetHashCode()) % 128;
var result = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(result) || !result.Contains("\"code\":200"))
result = GetHtml.PostUtf8(url, data);
if (!result.Contains("\"data\":[]"))
{
Invoke(new Action(() => { row.Cells["colUploadStatus"].Value = "已存在关联"; }));
return;
}
}
#region 将聚水潭产品数据格式进行转换成pdd格式统一上传,匹配加密的spuCode和skuCoke
if (dbProd.product_get_type_text == "厂商直采" && dbProd.sku_secret_json != null && dbProd.sku_secret_json.Contains("goodsId"))
{
string convertRst = "";
var pProd = new PDDProdFormConverter().JstPddProdToPddConvert(out convertRst, dbProd);
if (!string.IsNullOrEmpty(convertRst))
{
selectProd.status = "未上传";
Invoke(new Action(() => { row.Cells["colUploadStatus"].Value = "商品查询错误 " + convertRst; }));
return;
}
}
#endregion
PDDProductInfo prodInfo = null;
prodInfo = JsonHelper.DeserializeJsonToObject<PDDProductInfo>(dbProd.product_json);
prodInfo.detail.galleries.RemoveAll(g => g.type == 6); // 视频暂时移除,以后再视情况加上
var prod = new ProductMappingImportParam()
{
From = "",
ProductId = prodInfo.spu_id.ToString(),
RealProductId = prodInfo.spu_id.ToString(),
ProductTitle = prodInfo.product_name
ProductId = selectProd.spu_id.ToString(),
RealProductId = selectProd.spu_id.ToString(),
ProductTitle = selectProd.product_name
};
ProductCollectBase product = null;
ProductCollectBase product = new ProductCollectBase();
//if (prodInfo.Platform == (int)ShopPlatform.TaoBao)
//{
// prod.From = "淘宝";
@@ -335,6 +315,97 @@ namespace KJD.VDianForms
// prod.From = "阿里巴巴";
// product = GetAlibabaProduct(prod);
//}
product.out_goods_sn = dbProd.secret_spu_id;
if (string.IsNullOrEmpty(product.out_goods_sn))
product.out_goods_sn = "VD1" + dbProd.spu_id + "A";
product.saleCount = dbProd.sale_count.ParseToInt();
product.addPricePercent = GlobalConfig.WeiDianUploadParam.AddPercent.ParseToDecimal();
product.baseAddPrice = GlobalConfig.WeiDianUploadParam.AddPrice.ParseToDecimal();
product.express_price = 0;
product.name = dbProd.product_name;
product.Images = new List<string>(); // 主图
foreach(var img in prodInfo.detail.galleries.Where(g => g.type == 1).ToList())
{
product.Images.Add(img.url);
}
product.content = ""; // 详情图
foreach (var img in prodInfo.detail.galleries.Where(g => g.type == 2).ToList())
{
product.content += "<img src='" + img.url + "'>";
}
product.Prop = new List<KeyValueBase>(); // 属性
foreach (var propInfo in prodInfo.property.goods_properties)
{
foreach (var valueInfo in propInfo.values)
{
}
product.Prop.Add(new KeyValueBase()
{
Id = propInfo.ref_pid.ParseToString(),
Key = propInfo.name,
Value = string.Join(";", propInfo.values),
});
}
product.Props = new List<PropBase>();
if (prodInfo.detail.sku.Count > 0)
{
var spec1 = prodInfo.detail.sku[0].spec[0];
var pBase1 = new PropBase()
{
id = spec1.parent_id.ParseToLong(),
name = spec1.parent_name,
Values = new List<PropValueBase>(),
};
product.Props.Add(pBase1);
foreach(var sku in prodInfo.detail.sku)
{
if (pBase1.Values.Any(v => v.name == sku.spec[0].spec_name))
continue;
pBase1.Values.Add(new PropValueBase
{
id = sku.spec[0].spec_id.ParseToString(),
name = sku.spec[0].spec_name,
});
}
if (prodInfo.detail.sku[0].spec.Count > 1)
{
var spec2 = prodInfo.detail.sku[0].spec[1];
var pBase2 = new PropBase()
{
id = spec2.parent_id.ParseToLong(),
name = spec2.parent_name,
Values = new List<PropValueBase>(),
};
product.Props.Add(pBase2);
foreach (var sku in prodInfo.detail.sku)
{
if (pBase2.Values.Any(v => v.name == sku.spec[1].spec_name))
continue;
pBase2.Values.Add(new PropValueBase
{
id = sku.spec[1].spec_id.ParseToString(),
name = sku.spec[1].spec_name,
});
}
}
}
product.SkuMaps = new List<SkuMapBase>(); // sku
foreach(var skuInfo in prodInfo.detail.sku)
{
var skuMap = new SkuMapBase()
{
id = skuInfo.id.ParseToLong(),
price = skuInfo.price.ParseToDecimal() * 0.01m,
name = string.Join(";", skuInfo.spec.Select(s => s.spec_name).ToList()),
number = skuInfo.quantity.ParseToInt() == 0 ? skuInfo.quantity_delta.ParseToInt() : skuInfo.quantity.ParseToInt(),
pinduoduo_image = skuInfo.thumb_url,
};
product.SkuMaps.Add(skuMap);
}
VDianParam.VDianProductBase vDianProduct = null;
if (product != null && !string.IsNullOrEmpty(product.content) && (!string.IsNullOrEmpty(product.image) || product.Images.Count > 0))
@@ -363,13 +434,27 @@ namespace KJD.VDianForms
// 新接口
//vDianProduct = UpLoadProductUseMutliApi(prod, product);
// 开箱小店和威武宝宝接口
vDianProduct = UpLoadProductUseApi(prod, product);
//vDianProduct = UpLoadProductUseApi(prod, product);
// 模拟上传
if (vDianProduct == null)
{
Thread.Sleep(5000);
//vDianProduct = UpLoadProductUseApi(prod, product);
prod.MappingResult = "";
vDianProduct = UploadProductSim(prod, product);
if (prod.MappingResult.Contains("过于频繁,商品驳回") && vDianProduct != null)
{
//var shop = GlobalConfig.VDianShopLoginList.FirstOrDefault(s => s.ShopId == vDianProduct.shopId);
var dgvRow = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ParseToString() == vDianProduct.shopId);
Invoke(new Action(() =>
{
if (dgvRow != null)
{
dgvRow.Cells["colIsUpload"].Value = false;
}
}));
}
}
if (!string.IsNullOrEmpty(prod.MappingResult))
{
@@ -399,10 +484,58 @@ namespace KJD.VDianForms
prod.MappingResult = prod.MappingResult.Replace("转换失败", "上货失败");
}
if (prod.MappingResult.ParseToString().Contains("上货成功"))
{
var url = BaseClass.BuildPDDObjString("product/add_relation");
var data = UserLogin.GetSignaturex();
data += "&up_spu_id=" + dbProd?.spu_id;
data += "&index=" + Math.Abs((dbProd?.spu_id).GetHashCode()) % 128;
data += "&up_goods_name=" + dbProd?.product_name;
data += "&from_site=vd";
data += "&goods_id=" + vDianProduct?.itemId;
data += "&shop_id=" + vDianProduct?.shopId;
data += "&price_max=" + (vDianProduct.sku.Max(wd => wd.price.ParseToDecimal()) * 100).ParseToInt();
data += "&price_min=" + (vDianProduct.sku.Min(wd => wd.price.ParseToDecimal()) * 100).ParseToInt();
var result = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(result) || !result.Contains("\"code\":200"))
result = GetHtml.PostUtf8(url, data);
if (result.Contains("\"code\":200"))
{
prod.MappingResult += ",关联保存成功";
url = BaseClass.BuildPDDObjString("product/mdy_product");
data = UserLogin.GetSignaturex();
data += "&spu_id=" + dbProd?.spu_id;
data += "&is_relation=1";
result = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(result) || !result.Contains("\"code\":200"))
result = GetHtml.PostUtf8(url, data);
}
}
else
{
}
// 显示上货结果
var old_real_price = prodInfo.detail.sku?.Min(s => s.price.ParseToDecimal()) * 0.01m + "-" + prodInfo.detail.sku?.Max(s => s.price.ParseToDecimal()) * 0.01m;
var new_real_price = vDianProduct?.sku?.Min(wd => wd.price.ParseToDecimal()) + "-" + vDianProduct?.sku?.Max(wd => wd.price.ParseToDecimal());
Invoke(new Action(() =>
{
dgvProduct.Rows.Add(product?.upShopId, prodInfo?.product_get_type_text, product?.from_id, product?.from_title, product?.price, product?.saleCount
, vDianProduct?.itemId, vDianProduct?.itemName, prod?.MappingResult, prod?.CPSResult, vDianProduct?.shopName, "删除");
row.Cells["colUploadShopId"].Value = vDianProduct?.shopId;
row.Cells["colProductPlatform"].Value = dbProd?.product_get_type_text;
row.Cells["colProductId"].Value = dbProd?.spu_id;
row.Cells["colProductName"].Value = dbProd?.product_name;
row.Cells["colProductSaleCount"].Value = product?.saleCount;
row.Cells["colProductPrice"].Value = old_real_price;
row.Cells["colProductPriceNew"].Value = new_real_price;
row.Cells["colWeiDianProductId"].Value = vDianProduct?.itemId;
row.Cells["colWeiDianProductName"].Value = vDianProduct?.itemName;
row.Cells["colUploadStatus"].Value = prod?.MappingResult;
row.Cells["colCPSResult"].Value = prod?.CPSResult;
row.Cells["colUploadShop"].Value = vDianProduct?.shopName;
}));
}
catch (Exception ex)
@@ -411,6 +544,7 @@ namespace KJD.VDianForms
finally
{
RefreshQueueCount();
NaiBa.Util.Helper.ConfigHelper.SaveConfig("vdian_db_prod_upload_list", this.lstTemuDBProductSelect);
}
});
Thread.Sleep(1500 + Randomx.GetId(1000));
@@ -578,7 +712,8 @@ namespace KJD.VDianForms
private VDianParam.VDianProductBase UploadProductSim(ProductMappingImportParam prod, ProductCollectBase product)
{
VDianParam.VDianProductBase vDianProduct = null;
var UpShopList = GlobalConfig.VDianShopLoginList.Where(s => lstUpVDianShopId.Contains(s.ShopId) && s.UpGoodAuth == "认证成功").ToList();
//var UpShopList = GlobalConfig.VDianShopLoginList.Where(s => lstUpVDianShopId.Contains(s.ShopId) && s.UpGoodAuth == "认证成功").ToList();
var UpShopList = GlobalConfig.VDianShopLoginList.Where(s => lstUpVDianShopId.Contains(s.ShopId) && s.LoginStatus == 1).ToList();
if (UpShopList.Count > 0 && vDianProduct == null)
{
@@ -599,7 +734,7 @@ namespace KJD.VDianForms
|| prod.MappingResult.Contains("未找到合适的转换接口")))
{
Thread.Sleep(Randomx.GetId(2000, 4000));
vDianProduct = new VDianUpProdMappingBLL().ProductToVDianBySim(prod, product, vDianShop, this.addPercent, this.addPrice, GetVDianUa);
vDianProduct = new VDianUpProdMappingBLL().ProductToVDianBySim(prod, product, vDianShop, this.addPercent, this.addPrice, GetVDianUaV2);
}
if (prod.MappingResult != null && prod.MappingResult.Contains("现在人太多了, 请稍后重试"))
{
@@ -619,11 +754,18 @@ namespace KJD.VDianForms
// 设置分成推广金
if (isSetCPS)
{
SetCps(prod, vDianShop, vDianProduct);
//SetCps(prod, vDianShop, vDianProduct);
}
}
if (vDianProduct == null)
{
vDianProduct = new VDianParam.VDianProductBase();
vDianProduct.shopName = vDianShop?.ShopName;
vDianProduct.shopId = vDianShop?.ShopId;
}
Thread.Sleep(Randomx.GetId(1500, 2500));
dicCurrentVDian.Remove(vDianShop);
dicCurrentVDian.Remove(vDianShop);
}
return vDianProduct;
}
@@ -690,6 +832,62 @@ namespace KJD.VDianForms
lstCefUsing.Remove(cefWebBrowser);
return vDianUa;
}
Dictionary<VDianShopLoginInfo, ChromiumWebBrowser> dicShopCef = new Dictionary<VDianShopLoginInfo, ChromiumWebBrowser>();
ChromiumWebBrowser currentCef = null;
public string GetVDianUaV2(VDianShopLoginInfo vDianShop)
{
Thread.Sleep(moreSleep * 1000);
if (!dicShopCef.Keys.Contains(vDianShop))
{
var browser = CEFBrowser.CreateChromiumWebBrowser("about:blank", false);
browser.KeyboardHandler = new KeyboardHandler();
Invoke(new Action(() =>
{
this.panel1.Controls.Add(browser);
}));
dicShopCef[vDianShop] = browser;
}
var cefWebBrowser = dicShopCef[vDianShop];
currentCef = cefWebBrowser;
var vDianUa = "";
// 登录cef店铺为模拟上传计算ua值
var cookieManager = cefWebBrowser.RequestContext.GetCookieManager(null);
if (vDianShop != null)
{
var task = CEFBrowser.SetCookieAsync("weidian.com", vDianShop.Cookies, cookieManager);
task.Wait(2000);
//Thread.Sleep(500);
}
cefWebBrowser.Load(vDianUploadUrl);
Thread.Sleep(Randomx.GetId(6000, 8000));
var t = cefWebBrowser.GetMainFrame().GetSourceAsync();
t.Wait(5000);
//if (t.Result.Contains("进入微店"))
//{
// // 模拟登录
// //ProductMappingVDianLoginForm.InputUserNameAndPassword(cefWebBrowser, vDianShop.Phone, vDianShop.Password);
// //ProductMappingVDianLoginForm.ClickLogin(cefWebBrowser);
// //ProductMappingVDianLoginForm.SelectShop(cefWebBrowser);
// vDianShop.LoginStatus = 2;
// Thread.Sleep(2000);
// return "店铺掉线";
//}
var response = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync("getUa();");
response.Wait(2000);
Thread.Sleep(500 + Randomx.GetId(1000));
vDianUa = response.Result?.Result?.ToString();
if (vDianUa == null)
vDianUa = "";
return vDianUa;
}
#endregion
// api上货暂时注释
@@ -828,9 +1026,9 @@ namespace KJD.VDianForms
{
//DataManageBLL.WeiDianUploadQueueList.Clear();
//weiDianProductTable.RemoveAll();
//RefreshQueueCount();
lstTemuDBProductSelect.Clear();
ConfigHelper.SaveConfig("vdian_db_prod_upload_list", this.lstTemuDBProductSelect);
RefreshQueueCount();
NaiBa.Util.Helper.ConfigHelper.SaveConfig("vdian_db_prod_upload_list", this.lstTemuDBProductSelect);
}
}
@@ -863,9 +1061,18 @@ namespace KJD.VDianForms
var row = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(p => p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == shopEntity.ShopId);
if (row == null)
{
this.dgvShop.Rows.Add(0, shopEntity.ShopId, shopEntity.ShopName,
VDianUploadProductForm.sShopProductOnSaleCountDic.Keys.Contains(shopEntity.ShopId) ? VDianUploadProductForm.sShopProductOnSaleCountDic[shopEntity.ShopId] : "",
shopEntity.ApiAuth == "已授权" ? true : false, false, string.Empty);
Invoke(new Action(() =>
{
this.dgvShop.Rows.Add(
0,
shopEntity.ShopId,
shopEntity.ShopName,
VDianUploadProductForm.sShopProductOnSaleCountDic.Keys.Contains(shopEntity.ShopId) ? VDianUploadProductForm.sShopProductOnSaleCountDic[shopEntity.ShopId] : "",
shopEntity.ApiAuth == "已授权" ? true : false,
false,
shopEntity.LoginStatus == 1 ? "在线" : "掉线",
string.Empty);
}));
}
else
{
@@ -886,11 +1093,23 @@ namespace KJD.VDianForms
switch (headerText)
{
case "店铺名称":
FileHelper.OpenUrl(string.Format("https://weidian.com/?userid=", shopId));
//NaiBa.Util.Helper.FileHelper.OpenUrl(string.Format("https://weidian.com/?userid=", shopId));
{
VDianLoginForm.IsRun = true;
var vDian = GlobalConfig.VDianShopLoginList.FirstOrDefault(v => v.ShopId == shopId.ParseToString());
if (vDian != null)
{
VDianLoginForm vDianLoginForm = new VDianLoginForm(vDian, "manage");
//vDianLoginForm.vDianManageUrl = string.Format("https://weidian.com/?userid=", shopId);
vDianLoginForm.WindowState = FormWindowState.Maximized;
vDianLoginForm.ShowDialog();
}
VDianLoginForm.IsRun = false;
}
break;
case "上货":
if (dgvShop.Rows[e.RowIndex].Cells["colIsAuthorize"].Value.ParseToBool())
//if (dgvShop.Rows[e.RowIndex].Cells["colIsAuthorize"].Value.ParseToBool())
{
dgvShop.Rows[e.RowIndex].Cells["colIsUpload"].Value = !dgvShop.Rows[e.RowIndex].Cells["colIsUpload"].Value.ParseToBool();
if (dgvShop.Rows[e.RowIndex].Cells["colIsUpload"].Value.ParseToBool())
@@ -898,9 +1117,9 @@ namespace KJD.VDianForms
else
lstUpVDianShopId.Remove(shopId.ToString());
}
else
//else
{
BaseMsgForm.ShowInfo("店铺未授权");
//BaseMsgForm.ShowInfo("店铺未授权");
}
break;
}
@@ -918,12 +1137,13 @@ namespace KJD.VDianForms
dict.Add(8, 8);
dict.Add(10, 10);
dict.Add(15, 15);
//dict.Add(20, 20);
dict.Add(20, 20);
//dict.Add(30, 30);
//dict.Add(50, 50);
this.cmbThreadCount.DataSource = new BindingSource(dict, null);
this.cmbThreadCount.DisplayMember = "Value";
this.cmbThreadCount.ValueMember = "Key";
this.cmbThreadCount.SelectedIndex = 7;
}
public void RefreshQueueCount(int addCount = 0)
@@ -965,13 +1185,10 @@ namespace KJD.VDianForms
private void cmbThreadCount_SelectedIndexChanged(object sender, EventArgs e)
{
threadCount = this.cmbThreadCount.SelectedValue.ParseToInt();
if (threadCount > 0)
{
GlobalConfig.WeiDianUploadParam.ThreadCount = threadCount.ToString();
//StartUp.SaveWeiDianUploadSettingParam();
ConfigHelper.SaveConfig("vdian_upload_setting_param", GlobalConfig.WeiDianUploadParam);
NaiBa.Util.Helper.ConfigHelper.SaveConfig("vdian_upload_setting_param", GlobalConfig.WeiDianUploadParam);
}
}
@@ -1004,12 +1221,29 @@ namespace KJD.VDianForms
case "微店标题":
long vDianProductId = dgvProduct.Rows[e.RowIndex].Cells["colWeiDianProductId"].Value.ParseToLong();
FileHelper.OpenUrl(string.Format("https://weidian.com/item.html?itemID={0}", vDianProductId));
NaiBa.Util.Helper.FileHelper.OpenUrl(string.Format("https://weidian.com/item.html?itemID={0}", vDianProductId));
break;
case "操作":
dgvProduct.Rows.RemoveAt(e.RowIndex);
break;
case "上传店铺":
var shopId = dgvProduct.Rows[e.RowIndex].Cells["colUploadShopId"].Value.ParseToString();
if (!string.IsNullOrEmpty(shopId))
{
var vDian = GlobalConfig.VDianShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
if (vDian != null)
{
VDianLoginForm.IsRun = true;
VDianLoginForm vDianLoginForm = new VDianLoginForm(vDian, "manage");
//vDianLoginForm.vDianManageUrl = string.Format("https://weidian.com/?userid=", shopId);
vDianLoginForm.WindowState = FormWindowState.Maximized;
vDianLoginForm.ShowDialog();
VDianLoginForm.IsRun = false;
}
}
break;
}
}
@@ -1124,11 +1358,12 @@ namespace KJD.VDianForms
else
{
lstUpVDianShopId.Clear();
var list = GlobalConfig.VDianShopLoginList.Where(s => s.ApiAuth == "已授权").Select(ss => ss.ShopId);
lstUpVDianShopId.AddRange(list);
//var list = GlobalConfig.VDianShopLoginList.Where(s => s.ApiAuth == "已授权").Select(ss => ss.ShopId);
//lstUpVDianShopId.AddRange(list);
lstUpVDianShopId.AddRange(GlobalConfig.VDianShopLoginList.Select(ss => ss.ShopId));
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (list.Any(l => l == row.Cells["colShopId"]?.Value?.ToString()))
if (lstUpVDianShopId.Any(l => l == row.Cells["colShopId"]?.Value?.ToString()))
row.Cells["colIsUpload"].Value = true;
}
}
@@ -1140,28 +1375,56 @@ namespace KJD.VDianForms
if (labelClickTimes >= 6)
{
labelClickTimes = 0;
btnShowCef.Visible = !btnShowCef.Visible;
btnShowCef.Visible = true;
}
else
btnShowCef.Visible = false;
// 连续单击6次出现显示网页按钮
Task.Run(() =>
{
Thread.Sleep(5000);
if (labelClickTimes > 0)
{
labelClickTimes = 0;
}
});
}
private void btnShowCef_Click(object sender, EventArgs e)
{
//if (btnShowCef.Text == "显示网页")
//{
// cefId++;
// if (cefId >= lstCef.Count - 1)
// {
// cefId = lstCef.Count - 1;
// btnShowCef.Text = "隐藏网页";
// }
// if (cefId >= 0 && lstCef[cefId] != null)
// lstCef[cefId].BringToFront();
//}
//else
//{
// btnShowCef.Text = "显示网页";
// cefId = -1;
// foreach (var cefWebBrowser in lstCef)
// {
// if (cefWebBrowser != null)
// cefWebBrowser.SendToBack();
// }
//}
if (btnShowCef.Text == "显示网页")
{
cefId++;
if (cefId >= lstCef.Count - 1)
{
cefId = lstCef.Count - 1;
btnShowCef.Text = "隐藏网页";
}
if (cefId >= 0 && lstCef[cefId] != null)
lstCef[cefId].BringToFront();
btnShowCef.Text = "隐藏网页";
if (currentCef != null)
currentCef.BringToFront();
}
else
{
btnShowCef.Text = "显示网页";
cefId = -1;
foreach (var cefWebBrowser in lstCef)
foreach (var cefWebBrowser in dicShopCef.Values)
{
if (cefWebBrowser != null)
cefWebBrowser.SendToBack();
@@ -1174,5 +1437,11 @@ namespace KJD.VDianForms
VDianShopListForm vDianShopForm = new VDianShopListForm();
vDianShopForm.ShowDialog();
}
int moreSleep = 10;
private void txtSleep_TextChanged(object sender, EventArgs e)
{
moreSleep = txtSleep.Text.ParseToInt();
}
}
}
+203 -103
View File
@@ -30,14 +30,14 @@ namespace KJD.VDianForms
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.lblPriceRatio = new DevComponents.DotNetBar.LabelX();
this.lblPriceRatioUnit = new DevComponents.DotNetBar.LabelX();
@@ -73,6 +73,7 @@ namespace KJD.VDianForms
this.statusBarUpload = new TemuKJD.UserControls.StatusBarUserControl();
this.dgvProduct = new TemuKJD.UserComponent.DataGridViewXEx();
this.colUploadShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colUploadShop = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colProductPlatform = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colProductId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colProductName = new System.Windows.Forms.DataGridViewLinkColumn();
@@ -80,9 +81,9 @@ namespace KJD.VDianForms
this.colProductSaleCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colWeiDianProductId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colWeiDianProductName = new System.Windows.Forms.DataGridViewLinkColumn();
this.colProductPriceNew = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colUploadStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colCPSResult = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colUploadShop = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colUploadOperate = new System.Windows.Forms.DataGridViewLinkColumn();
this.dgvShop = new TemuKJD.UserComponent.DataGridViewXEx();
this.colId = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -91,6 +92,7 @@ namespace KJD.VDianForms
this.colProductCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colIsAuthorize = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colIsUpload = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colLoginStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.btnShowCef = new DevComponents.DotNetBar.ButtonX();
@@ -98,6 +100,10 @@ namespace KJD.VDianForms
this.txtPrefix = new DevComponents.DotNetBar.Controls.TextBoxX();
this.panel1 = new System.Windows.Forms.Panel();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.pbShopLoading = new System.Windows.Forms.PictureBox();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.labelX7 = new DevComponents.DotNetBar.LabelX();
this.txtSleep = new DevComponents.DotNetBar.Controls.TextBoxX();
this.groupBox3.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
@@ -110,6 +116,8 @@ namespace KJD.VDianForms
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbShopLoading)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit();
this.SuspendLayout();
//
// groupBox3
@@ -164,7 +172,7 @@ namespace KJD.VDianForms
this.txtPriceRatio.PreventEnterBeep = true;
this.txtPriceRatio.Size = new System.Drawing.Size(39, 23);
this.txtPriceRatio.TabIndex = 17;
this.txtPriceRatio.Text = "30";
this.txtPriceRatio.Text = "300";
//
// lblPriceBaseUnit
//
@@ -191,7 +199,7 @@ namespace KJD.VDianForms
this.txtPriceBase.PreventEnterBeep = true;
this.txtPriceBase.Size = new System.Drawing.Size(39, 23);
this.txtPriceBase.TabIndex = 20;
this.txtPriceBase.Text = "10";
this.txtPriceBase.Text = "0";
//
// lblPriceBase
//
@@ -207,19 +215,21 @@ namespace KJD.VDianForms
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtSleep);
this.groupBox1.Controls.Add(this.labelX7);
this.groupBox1.Controls.Add(this.btnClear2);
this.groupBox1.Controls.Add(this.btnStop);
this.groupBox1.Controls.Add(this.labelX3);
this.groupBox1.Controls.Add(this.cmbThreadCount);
this.groupBox1.Controls.Add(this.btnClear);
this.groupBox1.Controls.Add(this.lblQueueCount);
this.groupBox1.Controls.Add(this.labelX2);
this.groupBox1.Controls.Add(this.btnUpload);
this.groupBox1.Controls.Add(this.btnImport);
this.groupBox1.Controls.Add(this.labelX3);
this.groupBox1.ForeColor = System.Drawing.SystemColors.ControlText;
this.groupBox1.Location = new System.Drawing.Point(676, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(297, 155);
this.groupBox1.Size = new System.Drawing.Size(362, 155);
this.groupBox1.TabIndex = 100;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "操作";
@@ -272,12 +282,12 @@ namespace KJD.VDianForms
this.comboItem8,
this.comboItem9,
this.comboItem10});
this.cmbThreadCount.Location = new System.Drawing.Point(178, 36);
this.cmbThreadCount.Location = new System.Drawing.Point(175, 36);
this.cmbThreadCount.Name = "cmbThreadCount";
this.cmbThreadCount.Size = new System.Drawing.Size(47, 24);
this.cmbThreadCount.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.cmbThreadCount.TabIndex = 89;
this.cmbThreadCount.Text = "0";
this.cmbThreadCount.Text = "20";
this.cmbThreadCount.SelectedIndexChanged += new System.EventHandler(this.cmbThreadCount_SelectedIndexChanged);
//
// comboItem6
@@ -398,6 +408,7 @@ namespace KJD.VDianForms
this.btnGetProductCount.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnGetProductCount.TabIndex = 86;
this.btnGetProductCount.Text = "获取商品数量";
this.btnGetProductCount.Visible = false;
this.btnGetProductCount.Click += new System.EventHandler(this.btnGetProductCount_Click);
//
// btnRefreshShop
@@ -437,6 +448,7 @@ namespace KJD.VDianForms
this.labelX5.Size = new System.Drawing.Size(20, 23);
this.labelX5.TabIndex = 19;
this.labelX5.Text = "%";
this.labelX5.Visible = false;
//
// txtCPSRate
//
@@ -452,6 +464,7 @@ namespace KJD.VDianForms
this.txtCPSRate.Size = new System.Drawing.Size(30, 23);
this.txtCPSRate.TabIndex = 20;
this.txtCPSRate.Text = "10";
this.txtCPSRate.Visible = false;
//
// labelX1
//
@@ -465,6 +478,7 @@ namespace KJD.VDianForms
this.labelX1.Size = new System.Drawing.Size(120, 47);
this.labelX1.TabIndex = 23;
this.labelX1.Text = "开通分成推广金,请\r\n先去分成推广模块。";
this.labelX1.Visible = false;
//
// labelX6
//
@@ -477,6 +491,7 @@ namespace KJD.VDianForms
this.labelX6.Size = new System.Drawing.Size(71, 23);
this.labelX6.TabIndex = 21;
this.labelX6.Text = "推广金比例";
this.labelX6.Visible = false;
//
// chkCPS
//
@@ -490,35 +505,37 @@ namespace KJD.VDianForms
this.chkCPS.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.chkCPS.TabIndex = 22;
this.chkCPS.Text = "上货后设置推广金";
this.chkCPS.Visible = false;
//
// statusBarUpload
//
this.statusBarUpload.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.statusBarUpload.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBarUpload.Location = new System.Drawing.Point(2, 676);
this.statusBarUpload.Location = new System.Drawing.Point(2, 507);
this.statusBarUpload.Margin = new System.Windows.Forms.Padding(0);
this.statusBarUpload.Name = "statusBarUpload";
this.statusBarUpload.Size = new System.Drawing.Size(1038, 30);
this.statusBarUpload.Size = new System.Drawing.Size(1038, 25);
this.statusBarUpload.TabIndex = 105;
//
// dgvProduct
//
this.dgvProduct.AllowUserToAddRows = false;
dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
this.dgvProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9;
dataGridViewCellStyle17.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
this.dgvProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle17;
this.dgvProduct.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10;
dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle18.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle18.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle18.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle18.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle18;
this.dgvProduct.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvProduct.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colUploadShopId,
this.colUploadShop,
this.colProductPlatform,
this.colProductId,
this.colProductName,
@@ -526,34 +543,34 @@ namespace KJD.VDianForms
this.colProductSaleCount,
this.colWeiDianProductId,
this.colWeiDianProductName,
this.colProductPriceNew,
this.colUploadStatus,
this.colCPSResult,
this.colUploadShop,
this.colUploadOperate});
dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle11.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvProduct.DefaultCellStyle = dataGridViewCellStyle11;
dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle19.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvProduct.DefaultCellStyle = dataGridViewCellStyle19;
this.dgvProduct.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvProduct.EnableHeadersVisualStyles = false;
this.dgvProduct.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(215)))), ((int)(((byte)(229)))));
this.dgvProduct.Location = new System.Drawing.Point(0, 0);
this.dgvProduct.Name = "dgvProduct";
this.dgvProduct.ReadOnly = true;
dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvProduct.RowHeadersDefaultCellStyle = dataGridViewCellStyle12;
dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle20.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle20.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle20.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle20.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvProduct.RowHeadersDefaultCellStyle = dataGridViewCellStyle20;
this.dgvProduct.RowTemplate.Height = 23;
this.dgvProduct.Size = new System.Drawing.Size(651, 511);
this.dgvProduct.Size = new System.Drawing.Size(569, 339);
this.dgvProduct.TabIndex = 102;
this.dgvProduct.UseCustomBackgroundColor = true;
this.dgvProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvProduct_CellContentClick);
@@ -565,6 +582,12 @@ namespace KJD.VDianForms
this.colUploadShopId.ReadOnly = true;
this.colUploadShopId.Visible = false;
//
// colUploadShop
//
this.colUploadShop.HeaderText = "上传店铺";
this.colUploadShop.Name = "colUploadShop";
this.colUploadShop.ReadOnly = true;
//
// colProductPlatform
//
this.colProductPlatform.HeaderText = "商品平台类型";
@@ -589,10 +612,11 @@ namespace KJD.VDianForms
//
// colProductPrice
//
this.colProductPrice.HeaderText = "价格";
this.colProductPrice.HeaderText = "原价";
this.colProductPrice.Name = "colProductPrice";
this.colProductPrice.ReadOnly = true;
this.colProductPrice.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colProductPrice.Width = 80;
//
// colProductSaleCount
//
@@ -613,6 +637,13 @@ namespace KJD.VDianForms
this.colWeiDianProductName.ReadOnly = true;
this.colWeiDianProductName.Width = 200;
//
// colProductPriceNew
//
this.colProductPriceNew.HeaderText = "新价";
this.colProductPriceNew.Name = "colProductPriceNew";
this.colProductPriceNew.ReadOnly = true;
this.colProductPriceNew.Width = 80;
//
// colUploadStatus
//
this.colUploadStatus.HeaderText = "状态";
@@ -625,14 +656,9 @@ namespace KJD.VDianForms
this.colCPSResult.HeaderText = "推广金设置";
this.colCPSResult.Name = "colCPSResult";
this.colCPSResult.ReadOnly = true;
this.colCPSResult.Visible = false;
this.colCPSResult.Width = 150;
//
// colUploadShop
//
this.colUploadShop.HeaderText = "上传店铺";
this.colUploadShop.Name = "colUploadShop";
this.colUploadShop.ReadOnly = true;
//
// colUploadOperate
//
this.colUploadOperate.HeaderText = "操作";
@@ -645,17 +671,17 @@ namespace KJD.VDianForms
//
this.dgvShop.AllowUserToAddRows = false;
this.dgvShop.AllowUserToDeleteRows = false;
dataGridViewCellStyle13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle13;
dataGridViewCellStyle21.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249)))));
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle21;
this.dgvShop.BackgroundColor = System.Drawing.Color.White;
dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle14.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle14;
dataGridViewCellStyle22.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle22.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle22.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle22.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle22.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle22.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle22.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle22;
this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colId,
@@ -664,31 +690,32 @@ namespace KJD.VDianForms
this.colProductCount,
this.colIsAuthorize,
this.colIsUpload,
this.colLoginStatus,
this.colStatus});
dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle15.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle15.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle15.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle15.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle15.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.DefaultCellStyle = dataGridViewCellStyle15;
dataGridViewCellStyle23.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle23.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle23.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle23.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle23.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle23.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle23.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.DefaultCellStyle = dataGridViewCellStyle23;
this.dgvShop.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvShop.EnableHeadersVisualStyles = false;
this.dgvShop.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(215)))), ((int)(((byte)(229)))));
this.dgvShop.Location = new System.Drawing.Point(0, 0);
this.dgvShop.Name = "dgvShop";
this.dgvShop.ReadOnly = true;
dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle16.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle16.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle16.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle16.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle16.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvShop.RowHeadersDefaultCellStyle = dataGridViewCellStyle16;
dataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle24.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle24.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle24.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle24.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle24.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle24.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvShop.RowHeadersDefaultCellStyle = dataGridViewCellStyle24;
this.dgvShop.RowTemplate.Height = 23;
this.dgvShop.Size = new System.Drawing.Size(381, 511);
this.dgvShop.Size = new System.Drawing.Size(463, 339);
this.dgvShop.TabIndex = 101;
this.dgvShop.UseCustomBackgroundColor = true;
this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgvShop_CellContentClick);
@@ -721,6 +748,7 @@ namespace KJD.VDianForms
this.colProductCount.HeaderText = "商品数量";
this.colProductCount.Name = "colProductCount";
this.colProductCount.ReadOnly = true;
this.colProductCount.Visible = false;
this.colProductCount.Width = 80;
//
// colIsAuthorize
@@ -730,6 +758,7 @@ namespace KJD.VDianForms
this.colIsAuthorize.ReadOnly = true;
this.colIsAuthorize.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.colIsAuthorize.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colIsAuthorize.Visible = false;
this.colIsAuthorize.Width = 50;
//
// colIsUpload
@@ -740,6 +769,13 @@ namespace KJD.VDianForms
this.colIsUpload.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.colIsUpload.Width = 50;
//
// colLoginStatus
//
this.colLoginStatus.HeaderText = "登录";
this.colLoginStatus.Name = "colLoginStatus";
this.colLoginStatus.ReadOnly = true;
this.colLoginStatus.Width = 50;
//
// colStatus
//
this.colStatus.HeaderText = "状态";
@@ -771,7 +807,6 @@ namespace KJD.VDianForms
this.btnShowCef.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnShowCef.TabIndex = 33;
this.btnShowCef.Text = "显示网页";
this.btnShowCef.Visible = false;
this.btnShowCef.Click += new System.EventHandler(this.btnShowCef_Click);
//
// labelX4
@@ -785,6 +820,7 @@ namespace KJD.VDianForms
this.labelX4.Size = new System.Drawing.Size(58, 23);
this.labelX4.TabIndex = 15;
this.labelX4.Text = "标题前缀";
this.labelX4.Visible = false;
this.labelX4.Click += new System.EventHandler(this.labelX4_Click);
//
// txtPrefix
@@ -800,6 +836,7 @@ namespace KJD.VDianForms
this.txtPrefix.PreventEnterBeep = true;
this.txtPrefix.Size = new System.Drawing.Size(150, 23);
this.txtPrefix.TabIndex = 20;
this.txtPrefix.Visible = false;
//
// panel1
//
@@ -809,31 +846,86 @@ namespace KJD.VDianForms
this.panel1.Controls.Add(this.splitContainer1);
this.panel1.Location = new System.Drawing.Point(2, 162);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1036, 511);
this.panel1.Size = new System.Drawing.Size(1036, 339);
this.panel1.TabIndex = 109;
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.pbShopLoading);
this.splitContainer1.Panel1.Controls.Add(this.dgvShop);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.pbLoading);
this.splitContainer1.Panel2.Controls.Add(this.dgvProduct);
this.splitContainer1.Size = new System.Drawing.Size(1036, 511);
this.splitContainer1.SplitterDistance = 381;
this.splitContainer1.Size = new System.Drawing.Size(1036, 339);
this.splitContainer1.SplitterDistance = 463;
this.splitContainer1.TabIndex = 0;
//
// pbShopLoading
//
this.pbShopLoading.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pbShopLoading.Image = global::TemuKJD.Properties.Resources.loading_blue;
this.pbShopLoading.Location = new System.Drawing.Point(206, 144);
this.pbShopLoading.Name = "pbShopLoading";
this.pbShopLoading.Size = new System.Drawing.Size(50, 50);
this.pbShopLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pbShopLoading.TabIndex = 102;
this.pbShopLoading.TabStop = false;
this.pbShopLoading.Visible = false;
//
// pbLoading
//
this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue;
this.pbLoading.Location = new System.Drawing.Point(259, 144);
this.pbLoading.Name = "pbLoading";
this.pbLoading.Size = new System.Drawing.Size(50, 50);
this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pbLoading.TabIndex = 103;
this.pbLoading.TabStop = false;
this.pbLoading.Visible = false;
//
// labelX7
//
//
//
//
this.labelX7.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX7.Location = new System.Drawing.Point(231, 37);
this.labelX7.Name = "labelX7";
this.labelX7.Size = new System.Drawing.Size(68, 23);
this.labelX7.TabIndex = 93;
this.labelX7.Text = "上传休眠:";
//
// txtSleep
//
//
//
//
this.txtSleep.Border.Class = "TextBoxBorder";
this.txtSleep.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.txtSleep.DisabledBackColor = System.Drawing.Color.White;
this.txtSleep.Location = new System.Drawing.Point(294, 37);
this.txtSleep.Name = "txtSleep";
this.txtSleep.PreventEnterBeep = true;
this.txtSleep.Size = new System.Drawing.Size(39, 23);
this.txtSleep.TabIndex = 94;
this.txtSleep.Text = "10";
this.txtSleep.TextChanged += new System.EventHandler(this.txtSleep_TextChanged);
//
// VDianUploadProductForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1042, 708);
this.ClientSize = new System.Drawing.Size(1042, 533);
this.Controls.Add(this.panel1);
this.Controls.Add(this.groupBox5);
this.Controls.Add(this.groupBox4);
@@ -859,6 +951,8 @@ namespace KJD.VDianForms
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pbShopLoading)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).EndInit();
this.ResumeLayout(false);
}
@@ -899,25 +993,6 @@ namespace KJD.VDianForms
private DevComponents.DotNetBar.Controls.TextBoxX txtCPSRate;
private DevComponents.DotNetBar.LabelX labelX1;
private TemuKJD.UserComponent.DataGridViewXEx dgvProduct;
private System.Windows.Forms.DataGridViewTextBoxColumn colUploadShopId;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductPlatform;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductId;
private System.Windows.Forms.DataGridViewLinkColumn colProductName;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductPrice;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductSaleCount;
private System.Windows.Forms.DataGridViewTextBoxColumn colWeiDianProductId;
private System.Windows.Forms.DataGridViewLinkColumn colWeiDianProductName;
private System.Windows.Forms.DataGridViewTextBoxColumn colUploadStatus;
private System.Windows.Forms.DataGridViewTextBoxColumn colCPSResult;
private System.Windows.Forms.DataGridViewTextBoxColumn colUploadShop;
private System.Windows.Forms.DataGridViewLinkColumn colUploadOperate;
private System.Windows.Forms.DataGridViewTextBoxColumn colId;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopId;
private System.Windows.Forms.DataGridViewLinkColumn colShopName;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductCount;
private System.Windows.Forms.DataGridViewCheckBoxColumn colIsAuthorize;
private System.Windows.Forms.DataGridViewCheckBoxColumn colIsUpload;
private System.Windows.Forms.DataGridViewTextBoxColumn colStatus;
private System.Windows.Forms.GroupBox groupBox5;
private DevComponents.DotNetBar.LabelX labelX4;
private DevComponents.DotNetBar.Controls.TextBoxX txtPrefix;
@@ -925,5 +1000,30 @@ namespace KJD.VDianForms
private System.Windows.Forms.SplitContainer splitContainer1;
private DevComponents.DotNetBar.ButtonX btnShowCef;
private DevComponents.DotNetBar.ButtonX btnManageVDian;
private System.Windows.Forms.PictureBox pbShopLoading;
private System.Windows.Forms.PictureBox pbLoading;
private System.Windows.Forms.DataGridViewTextBoxColumn colUploadShopId;
private System.Windows.Forms.DataGridViewTextBoxColumn colUploadShop;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductPlatform;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductId;
private System.Windows.Forms.DataGridViewLinkColumn colProductName;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductPrice;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductSaleCount;
private System.Windows.Forms.DataGridViewTextBoxColumn colWeiDianProductId;
private System.Windows.Forms.DataGridViewLinkColumn colWeiDianProductName;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductPriceNew;
private System.Windows.Forms.DataGridViewTextBoxColumn colUploadStatus;
private System.Windows.Forms.DataGridViewTextBoxColumn colCPSResult;
private System.Windows.Forms.DataGridViewLinkColumn colUploadOperate;
private System.Windows.Forms.DataGridViewTextBoxColumn colId;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopId;
private System.Windows.Forms.DataGridViewLinkColumn colShopName;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductCount;
private System.Windows.Forms.DataGridViewCheckBoxColumn colIsAuthorize;
private System.Windows.Forms.DataGridViewCheckBoxColumn colIsUpload;
private System.Windows.Forms.DataGridViewTextBoxColumn colLoginStatus;
private System.Windows.Forms.DataGridViewTextBoxColumn colStatus;
private DevComponents.DotNetBar.Controls.TextBoxX txtSleep;
private DevComponents.DotNetBar.LabelX labelX7;
}
}
@@ -120,6 +120,9 @@
<metadata name="colUploadShopId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colUploadShop.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colProductPlatform.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -141,15 +144,15 @@
<metadata name="colWeiDianProductName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colProductPriceNew.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colUploadStatus.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colCPSResult.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colUploadShop.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colUploadOperate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -171,6 +174,9 @@
<metadata name="colIsUpload.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colLoginStatus.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colStatus.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -143,7 +143,7 @@ namespace TemuKJD.WXForms.AdminForms
}
var authInfo = lstShopAuthInfo.FirstOrDefault(sa => sa.ShopId == shop.ShopId);
if (idRefreshTodayHasGet || authInfo == null || authInfo?.AddTime.Date != DateTime.Now.Date)
if (idRefreshTodayHasGet || authInfo == null || authInfo?.UpdateTime.Date != DateTime.Now.Date)
{
lstShopAuthInfo.RemoveAll(sa => sa.ShopId == shop.ShopId);
var rst = WXUpload.GetApiServiceList(shop);
@@ -156,7 +156,7 @@ namespace TemuKJD.WXForms.AdminForms
return;
}
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = DateTime.Now });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = DateTime.Now });
Invoke(new Action(() => { BindShop(shop, selectIds, "授权查询失败"); }));
return;
}
@@ -167,13 +167,13 @@ namespace TemuKJD.WXForms.AdminForms
if (itemObj["serviceName"].ParseToString() == "店统领供应链-商品管理")
{
var expiresTick = itemObj["expireTime"].ParseToLong();
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) });
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
return;
}
}
// 没找到指定服务
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = DateTime.Now });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = DateTime.Now });
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
}
}
@@ -346,7 +346,7 @@ namespace TemuKJD.WXForms.ProductForms
}
var authInfo = lstShopAuthInfo.FirstOrDefault(sa => sa.ShopId == shop.ShopId);
if (idRefreshTodayHasGet || authInfo == null || authInfo?.AddTime.Date != DateTime.Now.Date)
if (idRefreshTodayHasGet || authInfo == null || authInfo?.UpdateTime.Date != DateTime.Now.Date)
{
lstShopAuthInfo.RemoveAll(sa => sa.ShopId == shop.ShopId);
var rst = WXUpload.GetApiServiceList(shop);
@@ -359,7 +359,7 @@ namespace TemuKJD.WXForms.ProductForms
return;
}
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = DateTime.Now });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = DateTime.Now });
Invoke(new Action(() => { BindShop(shop, selectIds, "授权查询失败"); }));
return;
}
@@ -370,13 +370,13 @@ namespace TemuKJD.WXForms.ProductForms
if (itemObj["serviceName"].ParseToString() == "店统领供应链-商品管理")
{
var expiresTick = itemObj["expireTime"].ParseToLong();
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) });
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
return;
}
}
// 没找到指定服务
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = DateTime.Now });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = DateTime.Now });
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
}
}
@@ -1002,7 +1002,7 @@ namespace TemuKJD.WXForms.ProductForms
KJDDBProduct kjdDbProd = selectProd.kjdDbProduct;
string errStr = "";
if (kjdDbProd == null)
kjdDbProd = GetProductDetail(selectProd.out_product_Id.ToString(), out errStr);
kjdDbProd = GetProductDetail(selectProd.out_product_Id.ToString(), out errStr, true);
if (kjdDbProd == null || kjdDbProd.id == 0)
{
if (kjdDbProd?.id == 0)
@@ -4028,9 +4028,9 @@ namespace TemuKJD.WXForms.ProductForms
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
}
//add_secret_spu_id_shop_id_map //测试id "2017522348787531778" FC4C8B7F3C6E4B029AD2A12D4D323B41
if (!string.IsNullOrEmpty(dbProd.secret_spu_id))
{
//add_secret_spu_id_shop_id_map //测试id "2017522348787531778" FC4C8B7F3C6E4B029AD2A12D4D323B41 // 老函数已作废
var url = BaseClass.BuildObjString("product/wx_add_secret_id_up_map");
var data = "";
Invoke(new Action(() =>
@@ -231,7 +231,7 @@ namespace TemuKJD.WXForms.ProductForms
}
var authInfo = lstShopAuthInfo.FirstOrDefault(sa => sa.ShopId == shop.ShopId);
if (idRefreshTodayHasGet || authInfo == null || authInfo?.AddTime.Date != DateTime.Now.Date)
if (idRefreshTodayHasGet || authInfo == null || authInfo?.UpdateTime.Date != DateTime.Now.Date)
{
lstShopAuthInfo.RemoveAll(sa => sa.ShopId == shop.ShopId);
var rst = WXUpload.GetApiServiceList(shop);
@@ -244,7 +244,7 @@ namespace TemuKJD.WXForms.ProductForms
return;
}
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = DateTime.Now });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = DateTime.Now });
Invoke(new Action(() => { BindShop(shop, selectIds, "授权查询失败"); }));
return;
}
@@ -255,13 +255,13 @@ namespace TemuKJD.WXForms.ProductForms
if (itemObj["serviceName"].ParseToString() == "店统领供应链-商品管理")
{
var expiresTick = itemObj["expireTime"].ParseToLong();
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) });
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
return;
}
}
// 没找到指定服务
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = DateTime.Now });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = DateTime.Now });
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
}
}
@@ -154,7 +154,7 @@ namespace TemuKJD.WXForms.ProductForms
}
var authInfo = lstShopAuthInfo.FirstOrDefault(sa => sa.ShopId == shop.ShopId);
if (idRefreshTodayHasGet || authInfo == null || authInfo?.AddTime.Date != DateTime.Now.Date)
if (idRefreshTodayHasGet || authInfo == null || authInfo?.UpdateTime.Date != DateTime.Now.Date)
{
lstShopAuthInfo.RemoveAll(sa => sa.ShopId == shop.ShopId);
var rst = WXUpload.GetApiServiceList(shop);
@@ -167,7 +167,7 @@ namespace TemuKJD.WXForms.ProductForms
return;
}
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = DateTime.Now });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = DateTime.Now });
Invoke(new Action(() => { BindShop(shop, selectIds, "授权查询失败"); }));
return;
}
@@ -178,13 +178,13 @@ namespace TemuKJD.WXForms.ProductForms
if (itemObj["serviceName"].ParseToString() == "店统领供应链-商品管理")
{
var expiresTick = itemObj["expireTime"].ParseToLong();
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) });
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
return;
}
}
// 没找到指定服务
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = DateTime.Now });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = DateTime.Now });
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
}
}
@@ -213,7 +213,7 @@ namespace TemuKJD.WXForms.ProductForms
}
var authInfo = lstShopAuthInfo.FirstOrDefault(sa => sa.ShopId == shop.ShopId);
if (idRefreshTodayHasGet || authInfo == null || authInfo?.AddTime.Date != DateTime.Now.Date)
if (idRefreshTodayHasGet || authInfo == null || authInfo?.UpdateTime.Date != DateTime.Now.Date)
{
lstShopAuthInfo.RemoveAll(sa => sa.ShopId == shop.ShopId);
var rst = WXUpload.GetApiServiceList(shop);
@@ -226,7 +226,7 @@ namespace TemuKJD.WXForms.ProductForms
return;
}
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = DateTime.Now });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = DateTime.Now });
Invoke(new Action(() => { BindShop(shop, selectIds, "授权查询失败"); }));
return;
}
@@ -237,13 +237,13 @@ namespace TemuKJD.WXForms.ProductForms
if (itemObj["serviceName"].ParseToString() == "店统领供应链-商品管理")
{
var expiresTick = itemObj["expireTime"].ParseToLong();
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) });
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
return;
}
}
// 没找到指定服务
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = DateTime.Now });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = DateTime.Now });
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
}
}
@@ -152,7 +152,7 @@ namespace TemuKJD.WXForms.ProductForms
}
var authInfo = lstShopAuthInfo.FirstOrDefault(sa => sa.ShopId == shop.ShopId);
if (idRefreshTodayHasGet || authInfo == null || authInfo?.AddTime.Date != DateTime.Now.Date)
if (idRefreshTodayHasGet || authInfo == null || authInfo?.UpdateTime.Date != DateTime.Now.Date)
{
lstShopAuthInfo.RemoveAll(sa => sa.ShopId == shop.ShopId);
var rst = WXUpload.GetApiServiceList(shop);
@@ -165,7 +165,7 @@ namespace TemuKJD.WXForms.ProductForms
return;
}
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = DateTime.Now });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = DateTime.Now });
Invoke(new Action(() => { BindShop(shop, selectIds, "授权查询失败"); }));
return;
}
@@ -176,13 +176,13 @@ namespace TemuKJD.WXForms.ProductForms
if (itemObj["serviceName"].ParseToString() == "店统领供应链-商品管理")
{
var expiresTick = itemObj["expireTime"].ParseToLong();
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) });
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
return;
}
}
// 没找到指定服务
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, AddTime = DateTime.Now, ExpiresTime = DateTime.Now });
lstShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = DateTime.Now });
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
}
}
+60 -27
View File
@@ -55,6 +55,7 @@ namespace TemuKJD.WXForms.ProductForms
this.btnSetShop = new DevComponents.DotNetBar.PanelEx();
this.btnSelect = new DevComponents.DotNetBar.PanelEx();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.lblRelation = new System.Windows.Forms.Label();
this.txtCatBoundLessThan = new System.Windows.Forms.TextBox();
this.txtCatBoundMoreThan = new System.Windows.Forms.TextBox();
this.chkCatBoundLessThan = new TemuKJD.UserComponent.UcCheckBox(this.components);
@@ -75,6 +76,7 @@ namespace TemuKJD.WXForms.ProductForms
this.cmbGroupFilter = new System.Windows.Forms.ComboBox();
this.cmbSourceType = new System.Windows.Forms.ComboBox();
this.lblSourceType = new System.Windows.Forms.Label();
this.cmbRelation = new System.Windows.Forms.ComboBox();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.btnStopStop = new DevComponents.DotNetBar.PanelEx();
this.pnlSetShop = new System.Windows.Forms.Panel();
@@ -196,10 +198,10 @@ namespace TemuKJD.WXForms.ProductForms
this.lblSetShop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.lblSetShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblSetShop.ForeColor = System.Drawing.Color.DarkOrange;
this.lblSetShop.Location = new System.Drawing.Point(1094, 45);
this.lblSetShop.Location = new System.Drawing.Point(1206, 45);
this.lblSetShop.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.lblSetShop.Name = "lblSetShop";
this.lblSetShop.Size = new System.Drawing.Size(326, 17);
this.lblSetShop.Size = new System.Drawing.Size(214, 17);
this.lblSetShop.TabIndex = 718;
this.lblSetShop.Text = "指定店铺:";
this.lblSetShop.TextAlign = System.Drawing.ContentAlignment.TopRight;
@@ -271,6 +273,7 @@ namespace TemuKJD.WXForms.ProductForms
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.Controls.Add(this.lblRelation, 8, 1);
this.tableLayoutPanel1.Controls.Add(this.txtCatBoundLessThan, 5, 1);
this.tableLayoutPanel1.Controls.Add(this.txtCatBoundMoreThan, 3, 1);
this.tableLayoutPanel1.Controls.Add(this.chkCatBoundLessThan, 4, 1);
@@ -291,6 +294,7 @@ namespace TemuKJD.WXForms.ProductForms
this.tableLayoutPanel1.Controls.Add(this.cmbGroupFilter, 9, 0);
this.tableLayoutPanel1.Controls.Add(this.cmbSourceType, 7, 1);
this.tableLayoutPanel1.Controls.Add(this.lblSourceType, 6, 1);
this.tableLayoutPanel1.Controls.Add(this.cmbRelation, 9, 1);
this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 4);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 3;
@@ -300,13 +304,25 @@ namespace TemuKJD.WXForms.ProductForms
this.tableLayoutPanel1.Size = new System.Drawing.Size(1193, 105);
this.tableLayoutPanel1.TabIndex = 679;
//
// lblRelation
//
this.lblRelation.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.lblRelation.AutoSize = true;
this.lblRelation.Location = new System.Drawing.Point(870, 44);
this.lblRelation.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.lblRelation.Name = "lblRelation";
this.lblRelation.Size = new System.Drawing.Size(68, 17);
this.lblRelation.TabIndex = 884;
this.lblRelation.Text = "数据转换:";
this.lblRelation.Visible = false;
//
// txtCatBoundLessThan
//
this.txtCatBoundLessThan.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.txtCatBoundLessThan.Location = new System.Drawing.Point(525, 41);
this.txtCatBoundLessThan.Location = new System.Drawing.Point(515, 41);
this.txtCatBoundLessThan.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.txtCatBoundLessThan.Name = "txtCatBoundLessThan";
this.txtCatBoundLessThan.Size = new System.Drawing.Size(151, 23);
this.txtCatBoundLessThan.Size = new System.Drawing.Size(146, 23);
this.txtCatBoundLessThan.TabIndex = 883;
this.txtCatBoundLessThan.Text = "100000";
this.txtCatBoundLessThan.Visible = false;
@@ -314,10 +330,10 @@ namespace TemuKJD.WXForms.ProductForms
// txtCatBoundMoreThan
//
this.txtCatBoundMoreThan.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.txtCatBoundMoreThan.Location = new System.Drawing.Point(298, 41);
this.txtCatBoundMoreThan.Location = new System.Drawing.Point(293, 41);
this.txtCatBoundMoreThan.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.txtCatBoundMoreThan.Name = "txtCatBoundMoreThan";
this.txtCatBoundMoreThan.Size = new System.Drawing.Size(151, 23);
this.txtCatBoundMoreThan.Size = new System.Drawing.Size(146, 23);
this.txtCatBoundMoreThan.TabIndex = 882;
this.txtCatBoundMoreThan.Text = "1000";
this.txtCatBoundMoreThan.Visible = false;
@@ -325,7 +341,7 @@ namespace TemuKJD.WXForms.ProductForms
// chkCatBoundLessThan
//
this.chkCatBoundLessThan.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.chkCatBoundLessThan.Location = new System.Drawing.Point(458, 42);
this.chkCatBoundLessThan.Location = new System.Drawing.Point(448, 42);
this.chkCatBoundLessThan.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
this.chkCatBoundLessThan.Name = "chkCatBoundLessThan";
this.chkCatBoundLessThan.Size = new System.Drawing.Size(64, 21);
@@ -337,7 +353,7 @@ namespace TemuKJD.WXForms.ProductForms
// chkCatBoundMoreThan
//
this.chkCatBoundMoreThan.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.chkCatBoundMoreThan.Location = new System.Drawing.Point(231, 42);
this.chkCatBoundMoreThan.Location = new System.Drawing.Point(226, 42);
this.chkCatBoundMoreThan.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
this.chkCatBoundMoreThan.Name = "chkCatBoundMoreThan";
this.chkCatBoundMoreThan.Size = new System.Drawing.Size(64, 21);
@@ -353,7 +369,7 @@ namespace TemuKJD.WXForms.ProductForms
this.btnSearch.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSearch.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSearch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSearch.Location = new System.Drawing.Point(1091, 5);
this.btnSearch.Location = new System.Drawing.Point(1090, 5);
this.btnSearch.Name = "btnSearch";
this.btnSearch.Size = new System.Drawing.Size(46, 25);
this.btnSearch.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -377,7 +393,7 @@ namespace TemuKJD.WXForms.ProductForms
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(1143, 5);
this.pnlEmpty.Location = new System.Drawing.Point(1142, 5);
this.pnlEmpty.Name = "pnlEmpty";
this.pnlEmpty.Size = new System.Drawing.Size(46, 25);
this.pnlEmpty.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -404,10 +420,10 @@ namespace TemuKJD.WXForms.ProductForms
this.cmbCat3.DropDownWidth = 1;
this.cmbCat3.FormattingEnabled = true;
this.cmbCat3.IntegralHeight = false;
this.cmbCat3.Location = new System.Drawing.Point(733, 7);
this.cmbCat3.Location = new System.Drawing.Point(718, 5);
this.cmbCat3.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbCat3.Name = "cmbCat3";
this.cmbCat3.Size = new System.Drawing.Size(151, 25);
this.cmbCat3.Size = new System.Drawing.Size(146, 25);
this.cmbCat3.TabIndex = 811;
this.cmbCat3.Text = "全部";
this.cmbCat3.SelectedIndexChanged += new System.EventHandler(this.cmbCat3_SelectedIndexChanged);
@@ -417,7 +433,7 @@ namespace TemuKJD.WXForms.ProductForms
//
this.label17.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(682, 9);
this.label17.Location = new System.Drawing.Point(667, 9);
this.label17.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(51, 17);
@@ -432,10 +448,10 @@ namespace TemuKJD.WXForms.ProductForms
this.cmbCat2.DropDownWidth = 1;
this.cmbCat2.FormattingEnabled = true;
this.cmbCat2.IntegralHeight = false;
this.cmbCat2.Location = new System.Drawing.Point(525, 7);
this.cmbCat2.Location = new System.Drawing.Point(515, 5);
this.cmbCat2.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbCat2.Name = "cmbCat2";
this.cmbCat2.Size = new System.Drawing.Size(151, 25);
this.cmbCat2.Size = new System.Drawing.Size(146, 25);
this.cmbCat2.TabIndex = 804;
this.cmbCat2.Text = "全部";
this.cmbCat2.SelectedIndexChanged += new System.EventHandler(this.cmbCat2_SelectedIndexChanged);
@@ -445,7 +461,7 @@ namespace TemuKJD.WXForms.ProductForms
//
this.label14.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(474, 9);
this.label14.Location = new System.Drawing.Point(464, 9);
this.label14.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(51, 17);
@@ -460,10 +476,10 @@ namespace TemuKJD.WXForms.ProductForms
this.cmbCat1.DropDownWidth = 1;
this.cmbCat1.FormattingEnabled = true;
this.cmbCat1.IntegralHeight = false;
this.cmbCat1.Location = new System.Drawing.Point(298, 7);
this.cmbCat1.Location = new System.Drawing.Point(293, 7);
this.cmbCat1.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbCat1.Name = "cmbCat1";
this.cmbCat1.Size = new System.Drawing.Size(151, 25);
this.cmbCat1.Size = new System.Drawing.Size(146, 25);
this.cmbCat1.TabIndex = 805;
this.cmbCat1.Text = "全部";
this.cmbCat1.SelectedIndexChanged += new System.EventHandler(this.cmbCat1_SelectedIndexChanged);
@@ -473,7 +489,7 @@ namespace TemuKJD.WXForms.ProductForms
//
this.label2.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(247, 9);
this.label2.Location = new System.Drawing.Point(242, 9);
this.label2.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(51, 17);
@@ -486,7 +502,7 @@ namespace TemuKJD.WXForms.ProductForms
this.txtProdName.Location = new System.Drawing.Point(71, 6);
this.txtProdName.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.txtProdName.Name = "txtProdName";
this.txtProdName.Size = new System.Drawing.Size(151, 23);
this.txtProdName.Size = new System.Drawing.Size(146, 23);
this.txtProdName.TabIndex = 427;
//
// label3
@@ -523,7 +539,7 @@ namespace TemuKJD.WXForms.ProductForms
this.cmbWxSafe.Location = new System.Drawing.Point(71, 42);
this.cmbWxSafe.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbWxSafe.Name = "cmbWxSafe";
this.cmbWxSafe.Size = new System.Drawing.Size(151, 25);
this.cmbWxSafe.Size = new System.Drawing.Size(146, 25);
this.cmbWxSafe.TabIndex = 676;
this.cmbWxSafe.Text = "安全+未校验";
//
@@ -531,7 +547,7 @@ namespace TemuKJD.WXForms.ProductForms
//
this.lblGroup.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.lblGroup.AutoSize = true;
this.lblGroup.Location = new System.Drawing.Point(890, 9);
this.lblGroup.Location = new System.Drawing.Point(894, 9);
this.lblGroup.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.lblGroup.Name = "lblGroup";
this.lblGroup.Size = new System.Drawing.Size(44, 17);
@@ -543,10 +559,10 @@ namespace TemuKJD.WXForms.ProductForms
//
this.cmbGroupFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.cmbGroupFilter.FormattingEnabled = true;
this.cmbGroupFilter.Location = new System.Drawing.Point(934, 5);
this.cmbGroupFilter.Location = new System.Drawing.Point(938, 5);
this.cmbGroupFilter.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbGroupFilter.Name = "cmbGroupFilter";
this.cmbGroupFilter.Size = new System.Drawing.Size(151, 25);
this.cmbGroupFilter.Size = new System.Drawing.Size(146, 25);
this.cmbGroupFilter.TabIndex = 653;
this.cmbGroupFilter.Visible = false;
//
@@ -564,10 +580,10 @@ namespace TemuKJD.WXForms.ProductForms
"机会商品",
"以图搜品",
"外部数据"});
this.cmbSourceType.Location = new System.Drawing.Point(733, 42);
this.cmbSourceType.Location = new System.Drawing.Point(718, 40);
this.cmbSourceType.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbSourceType.Name = "cmbSourceType";
this.cmbSourceType.Size = new System.Drawing.Size(151, 25);
this.cmbSourceType.Size = new System.Drawing.Size(146, 25);
this.cmbSourceType.TabIndex = 654;
this.cmbSourceType.Text = "厂商直采";
this.cmbSourceType.Visible = false;
@@ -578,7 +594,7 @@ namespace TemuKJD.WXForms.ProductForms
//
this.lblSourceType.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.lblSourceType.AutoSize = true;
this.lblSourceType.Location = new System.Drawing.Point(689, 44);
this.lblSourceType.Location = new System.Drawing.Point(674, 44);
this.lblSourceType.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.lblSourceType.Name = "lblSourceType";
this.lblSourceType.Size = new System.Drawing.Size(44, 17);
@@ -586,6 +602,21 @@ namespace TemuKJD.WXForms.ProductForms
this.lblSourceType.Text = "来源:";
this.lblSourceType.Visible = false;
//
// cmbRelation
//
this.cmbRelation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.cmbRelation.FormattingEnabled = true;
this.cmbRelation.Items.AddRange(new object[] {
"",
"是",
"否"});
this.cmbRelation.Location = new System.Drawing.Point(938, 40);
this.cmbRelation.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbRelation.Name = "cmbRelation";
this.cmbRelation.Size = new System.Drawing.Size(146, 25);
this.cmbRelation.TabIndex = 882;
this.cmbRelation.Visible = false;
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -1681,5 +1712,7 @@ namespace TemuKJD.WXForms.ProductForms
private System.Windows.Forms.TextBox txtCatBoundMoreThan;
private UserComponent.UcCheckBox chkCatBoundLessThan;
public System.Windows.Forms.ComboBox cmbSourceType;
public System.Windows.Forms.ComboBox cmbRelation;
public System.Windows.Forms.Label lblRelation;
}
}
@@ -341,6 +341,10 @@ namespace TemuKJD.WXForms.ProductForms
"&search_group=" + cmbGroupFilter.Text.Trim() +
"&search_prod_name=" + txtProdName.Text.Trim() +
"&wx_safe_status=" + cmbWxSafe.Text.Trim().Replace("安全+未校验", "安全商品,未校验").Replace("违规商品", "");
if (cmbRelation.Text == "否")
data += "&is_relation=0";
else if (cmbRelation.Text == "是")
data += "&is_relation=1";
//if (chkEditTime.Checked)
//{
@@ -1018,5 +1022,10 @@ namespace TemuKJD.WXForms.ProductForms
this.Hide();
e.Cancel = true;
}
private void chkNotRelation_CheckedChanged(object sender, EventArgs e)
{
}
}
}
+4 -4
View File
@@ -56,7 +56,7 @@ namespace TemuKJD.WXForms.ShopForms
localShop.ApiAuthInfoList = new List<AuthInfo>();
localShop.ApiAuthInfoList.AddRange(serverShop.ApiAuthInfoList);
localShop.BuyApiAuth.AccessToken = serverShop.BuyApiAuth.AccessToken;
localShop.BuyApiAuth.AddTime = serverShop.BuyApiAuth.AddTime;
localShop.BuyApiAuth.UpdateTime = serverShop.BuyApiAuth.UpdateTime;
localShop.BuyApiAuth.AppKey = serverShop.BuyApiAuth.AppKey;
localShop.BuyApiAuth.ExpiresTime = serverShop.BuyApiAuth.ExpiresTime;
localShop.BuyApiAuth.RefreshToken = serverShop.BuyApiAuth.RefreshToken;
@@ -142,7 +142,7 @@ namespace TemuKJD.WXForms.ShopForms
AppKey = appkey,
AccessToken = BaseRegex.GetStringJson(ref shopStr, "access_token"),
RefreshToken = BaseRegex.GetStringJson(ref shopStr, "refresh_token"),
AddTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(),
UpdateTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(),
ExpiresTime = BaseRegex.GetStringJson(ref shopStr, "expires_in").ParseToDateTime(),
});
}
@@ -155,7 +155,7 @@ namespace TemuKJD.WXForms.ShopForms
AppKey = appkey,
AccessToken = BaseRegex.GetStringJson(ref shopStr, "access_token"),
RefreshToken = BaseRegex.GetStringJson(ref shopStr, "refresh_token"),
AddTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(),
UpdateTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime(),
ExpiresTime = BaseRegex.GetStringJson(ref shopStr, "expires_in").ParseToDateTime(),
});
}
@@ -164,7 +164,7 @@ namespace TemuKJD.WXForms.ShopForms
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.UpdateTime = BaseRegex.GetStringJson(ref shopStr, "add_time").ParseToDateTime();
shop.BuyApiAuth.ExpiresTime = BaseRegex.GetStringJson(ref shopStr, "expires_in").ParseToDateTime();
}
}
+113 -30
View File
@@ -44,6 +44,7 @@ namespace TemuKJD.WXForms.TalkForms
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BuyerOrderListForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.chkPause = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.btnCheck = new DevComponents.DotNetBar.PanelEx();
this.btnRefresh = new DevComponents.DotNetBar.PanelEx();
this.btnStopStop = new DevComponents.DotNetBar.PanelEx();
@@ -78,6 +79,10 @@ namespace TemuKJD.WXForms.TalkForms
this.panelEx3 = new DevComponents.DotNetBar.PanelEx();
this.panelEx2 = new DevComponents.DotNetBar.PanelEx();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.panel2 = new System.Windows.Forms.Panel();
this.btnRestore = new DevComponents.DotNetBar.PanelEx();
this.txtOrderSnFilter = new System.Windows.Forms.TextBox();
this.btnFilterOrder = new DevComponents.DotNetBar.PanelEx();
this.dgvPddBuyerOrder = new TemuKJD.UserComponent.DataGridViewEx();
this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colOBuyerId = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -104,10 +109,9 @@ namespace TemuKJD.WXForms.TalkForms
this.dtpStartTime = new System.Windows.Forms.DateTimePicker();
this.label14 = new System.Windows.Forms.Label();
this.dtpEndTime = new System.Windows.Forms.DateTimePicker();
this.lblCurrentShop = new System.Windows.Forms.Label();
this.chkOnlyShowCurrentShop = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.lblCurrentShop = new System.Windows.Forms.Label();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.chkPause = new TemuKJD.UserComponent.UcCheckBox(this.components);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -123,6 +127,7 @@ namespace TemuKJD.WXForms.TalkForms
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvPddBuyerOrder)).BeginInit();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
@@ -155,6 +160,17 @@ namespace TemuKJD.WXForms.TalkForms
this.splitContainer1.SplitterDistance = 78;
this.splitContainer1.TabIndex = 1;
//
// chkPause
//
this.chkPause.AutoSize = true;
this.chkPause.Location = new System.Drawing.Point(246, 41);
this.chkPause.Name = "chkPause";
this.chkPause.Size = new System.Drawing.Size(51, 21);
this.chkPause.TabIndex = 937;
this.chkPause.Text = "暂停";
this.chkPause.UseVisualStyleBackColor = true;
this.chkPause.CheckedChanged += new System.EventHandler(this.chkPause_CheckedChanged);
//
// btnCheck
//
this.btnCheck.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
@@ -586,10 +602,10 @@ namespace TemuKJD.WXForms.TalkForms
this.splitContainer3.Panel2.Controls.Add(this.panelEx3);
this.splitContainer3.Panel2.Controls.Add(this.panelEx2);
this.splitContainer3.Panel2.Controls.Add(this.panelEx1);
this.splitContainer3.Panel2.Controls.Add(this.dgvPddBuyerOrder);
this.splitContainer3.Panel2.Controls.Add(this.panel2);
this.splitContainer3.Panel2.Controls.Add(this.tableLayoutPanel1);
this.splitContainer3.Panel2.Controls.Add(this.lblCurrentShop);
this.splitContainer3.Panel2.Controls.Add(this.chkOnlyShowCurrentShop);
this.splitContainer3.Panel2.Controls.Add(this.lblCurrentShop);
this.splitContainer3.Size = new System.Drawing.Size(1430, 657);
this.splitContainer3.SplitterDistance = 372;
this.splitContainer3.TabIndex = 8;
@@ -671,12 +687,85 @@ namespace TemuKJD.WXForms.TalkForms
this.panelEx1.Visible = false;
this.panelEx1.Click += new System.EventHandler(this.panelEx1_Click);
//
// panel2
//
this.panel2.Controls.Add(this.btnRestore);
this.panel2.Controls.Add(this.txtOrderSnFilter);
this.panel2.Controls.Add(this.btnFilterOrder);
this.panel2.Controls.Add(this.dgvPddBuyerOrder);
this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel2.Location = new System.Drawing.Point(0, 312);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(1054, 345);
this.panel2.TabIndex = 908;
//
// btnRestore
//
this.btnRestore.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnRestore.CanvasColor = System.Drawing.SystemColors.Control;
this.btnRestore.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnRestore.DisabledBackColor = System.Drawing.Color.Empty;
this.btnRestore.Location = new System.Drawing.Point(318, 312);
this.btnRestore.Name = "btnRestore";
this.btnRestore.Size = new System.Drawing.Size(61, 23);
this.btnRestore.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnRestore.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnRestore.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnRestore.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.btnRestore.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnRestore.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.btnRestore.Style.GradientAngle = 90;
this.btnRestore.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.btnRestore.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnRestore.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnRestore.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnRestore.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnRestore.TabIndex = 907;
this.btnRestore.Text = "还原";
this.btnRestore.Click += new System.EventHandler(this.btnRestore_Click);
//
// txtOrderSnFilter
//
this.txtOrderSnFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtOrderSnFilter.Location = new System.Drawing.Point(3, 312);
this.txtOrderSnFilter.Name = "txtOrderSnFilter";
this.txtOrderSnFilter.Size = new System.Drawing.Size(242, 23);
this.txtOrderSnFilter.TabIndex = 903;
//
// btnFilterOrder
//
this.btnFilterOrder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnFilterOrder.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnFilterOrder.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnFilterOrder.DisabledBackColor = System.Drawing.Color.Empty;
this.btnFilterOrder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnFilterOrder.Location = new System.Drawing.Point(251, 312);
this.btnFilterOrder.Name = "btnFilterOrder";
this.btnFilterOrder.Size = new System.Drawing.Size(61, 23);
this.btnFilterOrder.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnFilterOrder.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnFilterOrder.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnFilterOrder.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnFilterOrder.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnFilterOrder.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnFilterOrder.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnFilterOrder.Style.GradientAngle = 90;
this.btnFilterOrder.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnFilterOrder.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnFilterOrder.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnFilterOrder.TabIndex = 902;
this.btnFilterOrder.Text = "筛选";
this.btnFilterOrder.Click += new System.EventHandler(this.btnFilterOrder_Click);
//
// dgvPddBuyerOrder
//
this.dgvPddBuyerOrder.AllowUserToAddRows = false;
this.dgvPddBuyerOrder.AllowUserToDeleteRows = false;
dataGridViewCellStyle9.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvPddBuyerOrder.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9;
this.dgvPddBuyerOrder.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.dgvPddBuyerOrder.AutoRowNumber = true;
this.dgvPddBuyerOrder.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvPddBuyerOrder.BackgroundColor = System.Drawing.Color.White;
@@ -705,13 +794,12 @@ namespace TemuKJD.WXForms.TalkForms
this.colOExpressId,
this.colOMsg,
this.colSend});
this.dgvPddBuyerOrder.Dock = System.Windows.Forms.DockStyle.Bottom;
this.dgvPddBuyerOrder.Location = new System.Drawing.Point(0, 357);
this.dgvPddBuyerOrder.Location = new System.Drawing.Point(2, 3);
this.dgvPddBuyerOrder.MultiSelectCheckBox = true;
this.dgvPddBuyerOrder.Name = "dgvPddBuyerOrder";
this.dgvPddBuyerOrder.ReadOnly = true;
this.dgvPddBuyerOrder.RowTemplate.Height = 23;
this.dgvPddBuyerOrder.Size = new System.Drawing.Size(1054, 300);
this.dgvPddBuyerOrder.Size = new System.Drawing.Size(1049, 300);
this.dgvPddBuyerOrder.TabIndex = 886;
this.dgvPddBuyerOrder.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvPddBuyerOrder_CellContentClick);
//
@@ -996,6 +1084,18 @@ namespace TemuKJD.WXForms.TalkForms
this.dtpEndTime.TabIndex = 813;
this.dtpEndTime.Visible = false;
//
// chkOnlyShowCurrentShop
//
this.chkOnlyShowCurrentShop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chkOnlyShowCurrentShop.AutoSize = true;
this.chkOnlyShowCurrentShop.Location = new System.Drawing.Point(30, 498);
this.chkOnlyShowCurrentShop.Name = "chkOnlyShowCurrentShop";
this.chkOnlyShowCurrentShop.Size = new System.Drawing.Size(135, 21);
this.chkOnlyShowCurrentShop.TabIndex = 885;
this.chkOnlyShowCurrentShop.Text = "仅显示当前店铺订单";
this.chkOnlyShowCurrentShop.UseVisualStyleBackColor = true;
this.chkOnlyShowCurrentShop.Visible = false;
//
// lblCurrentShop
//
this.lblCurrentShop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -1010,18 +1110,6 @@ namespace TemuKJD.WXForms.TalkForms
this.lblCurrentShop.TextAlign = System.Drawing.ContentAlignment.TopRight;
this.lblCurrentShop.Visible = false;
//
// chkOnlyShowCurrentShop
//
this.chkOnlyShowCurrentShop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chkOnlyShowCurrentShop.AutoSize = true;
this.chkOnlyShowCurrentShop.Location = new System.Drawing.Point(30, 498);
this.chkOnlyShowCurrentShop.Name = "chkOnlyShowCurrentShop";
this.chkOnlyShowCurrentShop.Size = new System.Drawing.Size(135, 21);
this.chkOnlyShowCurrentShop.TabIndex = 885;
this.chkOnlyShowCurrentShop.Text = "仅显示当前店铺订单";
this.chkOnlyShowCurrentShop.UseVisualStyleBackColor = true;
this.chkOnlyShowCurrentShop.Visible = false;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
@@ -1033,17 +1121,6 @@ namespace TemuKJD.WXForms.TalkForms
this.statusBar.Size = new System.Drawing.Size(1438, 25);
this.statusBar.TabIndex = 5;
//
// chkPause
//
this.chkPause.AutoSize = true;
this.chkPause.Location = new System.Drawing.Point(246, 41);
this.chkPause.Name = "chkPause";
this.chkPause.Size = new System.Drawing.Size(51, 21);
this.chkPause.TabIndex = 937;
this.chkPause.Text = "暂停";
this.chkPause.UseVisualStyleBackColor = true;
this.chkPause.CheckedChanged += new System.EventHandler(this.chkPause_CheckedChanged);
//
// BuyerOrderListForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1078,6 +1155,8 @@ namespace TemuKJD.WXForms.TalkForms
this.splitContainer3.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
this.splitContainer3.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvPddBuyerOrder)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
@@ -1152,5 +1231,9 @@ namespace TemuKJD.WXForms.TalkForms
private System.Windows.Forms.DataGridViewTextBoxColumn colOMsg;
private System.Windows.Forms.DataGridViewLinkColumn colSend;
private UserComponent.UcCheckBox chkPause;
private System.Windows.Forms.Panel panel2;
private DevComponents.DotNetBar.PanelEx btnRestore;
private System.Windows.Forms.TextBox txtOrderSnFilter;
private DevComponents.DotNetBar.PanelEx btnFilterOrder;
}
}
+41 -11
View File
@@ -168,11 +168,16 @@ namespace TemuKJD.WXForms.TalkForms
private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
{
if (url.StartsWith("https://mobile.yangkeduo.com/orders.html?type=3&order_index=0"))
{
var url1 = url;
//if (responseData.Contains("260415-279781076570828"))
//{
}
if (url.StartsWith("https://mobile.yangkeduo.com/orders.html?type=3"))
//}
//if (url1.StartsWith("https://mobile.yangkeduo.com/orders.html?type=3&order_index=0"))
//{
//}
if (url1.StartsWith("https://mobile.yangkeduo.com/orders.html?type=3")) //https://mobile.yangkeduo.com/orders.html?type=3
{
Task.Run(() =>
{
@@ -181,8 +186,11 @@ namespace TemuKJD.WXForms.TalkForms
{
var jsonData = BaseRegex.GetJsonObjStrJson(ref data, "ordersStore")?.FirstOrDefault();
var nickName = BaseRegex.GetStringJson(ref data, "nickName");
var buyerId = GlobalConfig.BuyerLoginList.FirstOrDefault(b => b.buyer_nick == nickName)?.buyer_id;
if (!string.IsNullOrEmpty(jsonData) && !string.IsNullOrEmpty(nickName) && !string.IsNullOrEmpty(buyerId))
var uid = BaseRegex.GetStringJson(ref data, "uid");
var buyerId = GlobalConfig.BuyerLoginList.FirstOrDefault(b => b.buyer_id == uid)?.buyer_id;
if (buyerId.IsNullOrEmpty())
buyerId = GlobalConfig.BuyerLoginList.FirstOrDefault(b => b.buyer_nick == nickName)?.buyer_id;
if (!string.IsNullOrEmpty(jsonData) && !string.IsNullOrEmpty(buyerId))
{
var ordersStr = BaseRegex.GetJsonObjStrJson(ref jsonData, "initOdersList")?.FirstOrDefault();
if (ordersStr != null && ordersStr.StartsWith("{\"3\":"))
@@ -194,7 +202,7 @@ namespace TemuKJD.WXForms.TalkForms
}
});
}
if (url.StartsWith("https://mobile.yangkeduo.com/orders.html?type=2"))
if (url1.StartsWith("https://mobile.yangkeduo.com/orders.html?type=2"))
{
Task.Run(() =>
{
@@ -216,11 +224,11 @@ namespace TemuKJD.WXForms.TalkForms
}
});
}
if (url.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/aristotle/order_list_v3"))
if (url1.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/aristotle/order_list_v3"))
{
Task.Run(() =>
{
CefReadBuyerOrder(url, responseData);
CefReadBuyerOrder(url1, responseData);
});
}
}
@@ -895,6 +903,11 @@ namespace TemuKJD.WXForms.TalkForms
if (resetSendStatus)
order.sendStatus = "";
if (order.order_sn.Contains("-465578"))
{
}
if (order.sendStatus == "已发送")
{
return;
@@ -950,8 +963,8 @@ namespace TemuKJD.WXForms.TalkForms
private void panelEx3_Click(object sender, EventArgs e)
{
dgvPddBuyerOrder.Visible = !dgvPddBuyerOrder.Visible;
if (dgvPddBuyerOrder.Visible == false)
panel2.Visible = !panel2.Visible;
if (panel2.Visible == false)
panelEx3.Text = "打开";
else
panelEx3.Text = "折叠";
@@ -982,6 +995,23 @@ namespace TemuKJD.WXForms.TalkForms
PauseTick = nextGetOrderTime - DateTime.Now;
}
private void btnFilterOrder_Click(object sender, EventArgs e)
{
foreach(DataGridViewRow row in dgvPddBuyerOrder.Rows)
{
if (row.Cells["colOPddOrderSn"].Value.ParseToString().Contains(txtOrderSnFilter.Text.Trim()))
row.Visible = true;
else
row.Visible = false;
}
}
private void btnRestore_Click(object sender, EventArgs e)
{
txtOrderSnFilter.Text = "";
btnFilterOrder_Click(null, null);
}
}
public class YkdBuyerOrder