diff --git a/AllBase/AllBase.csproj b/AllBase/AllBase.csproj
index 747b2a4..91bb89e 100644
--- a/AllBase/AllBase.csproj
+++ b/AllBase/AllBase.csproj
@@ -65,7 +65,7 @@
DEBUG;TRACE
true
full
- x86
+ x64
false
prompt
MinimumRecommendedRules.ruleset
@@ -85,7 +85,7 @@
true
- bin\x64\Debug\
+ ..\bin\
DEBUG;TRACE
true
full
@@ -97,7 +97,7 @@
false
- bin\x64\Release\
+ ..\bin\
true
true
pdbonly
diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs
index 7a2b7f2..bcc859c 100644
--- a/AllBase/BaseClass.cs
+++ b/AllBase/BaseClass.cs
@@ -27,7 +27,7 @@ namespace AllBase
///
/// 版本ID
///
- public static int VersionCount = 1195;
+ public static int VersionCount = 1200;
public static string MainPath = "29wx";
//public static string MainPath = "29wx";
//public static string MainPath = "29pdd";
@@ -126,7 +126,7 @@ namespace AllBase
public static decimal MinPrice = 0;
public static decimal MinBackMoney = 0;
public static decimal Price = 5;
- public static int TimeOut = 30;
+ public static int TimeOut = 45;
public static int ThreadCount = 3;
public static int MainCatId = 0;
///
diff --git a/AllBase/Model/Result/KJDDBProduct.cs b/AllBase/Model/Result/KJDDBProduct.cs
index 4a0fb10..1f12e6e 100644
--- a/AllBase/Model/Result/KJDDBProduct.cs
+++ b/AllBase/Model/Result/KJDDBProduct.cs
@@ -56,8 +56,17 @@ namespace AllBase.Model.Result
public string sku_edit_json { get; set; }
public string sku_secret_json { get; set; }
public string wx_img_map_json { get; set; }
- public int sku_img_replace_id { get; set; }
+ ///
+ /// 数据库商品的 替换图片id(拼多多用), 功能已废弃,代码暂时未移除
+ ///
+ public int? sku_img_replace_id { get; set; }
+ ///
+ /// 数据库商品的 替换图片base64编码(拼多多用), 功能已废弃,代码暂时未移除
+ ///
public string sku_img_replace_base64 { get; set; }
+ ///
+ /// 数据库商品的 替换图片url(拼多多用),目前用作临时变量
+ ///
public string sku_img_replace_url { get; set; }
public string main_img { get; set; }
public DateTime add_time { get; set; }
@@ -68,6 +77,9 @@ namespace AllBase.Model.Result
/// (某个店铺)上传次数
///
public int select_count { get; set; }
+ ///
+ /// temu 商品选品记录
+ ///
public int select_total_count { get; set; }
///
/// Temu 采集来源 0母店采集 1前端直采
diff --git a/DllReference/NaiBa.CefHelper.x64.138.dll b/DllReference/NaiBa.CefHelper.x64.138.dll
new file mode 100644
index 0000000..2bbdcbc
Binary files /dev/null and b/DllReference/NaiBa.CefHelper.x64.138.dll differ
diff --git a/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs b/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs
index 1f1677c..21ccfb3 100644
--- a/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs
+++ b/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs
@@ -80,7 +80,7 @@ namespace KJD_Web.BLL.BXX
}
if (add_user_name != null && add_user_name != "admin")
{
- Thread.Sleep(2000);
+ Thread.Sleep(1000);
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
@@ -89,6 +89,8 @@ namespace KJD_Web.BLL.BXX
if (add_user_name != null && add_user_name != "admin")
{
+
+
sql = "select count(*) from bxx.product where is_del=0 and add_user_name='" + add_user_name + "'";
var count = mySql.ExecuteRowCount(sql);
if (!string.IsNullOrEmpty(mySql.Message) || count > 100000)
@@ -121,7 +123,12 @@ namespace KJD_Web.BLL.BXX
sql = "INSERT INTO bxx.product(";
sql += "from_shop_id,from_shop_name,offline_supplier_id,offline_supplier_name,spu_id,skc_id,real_coid,real_spu_id,main_cat_id,main_cat_name,cat_id,";
- sql += "cat_name,price_text,product_name,ext_code,main_img,product_json,size_json,notes,product_get_type,sale_count,sale_count_text,special_prod_type,";
+ sql += "cat_name,price_text,product_name,ext_code,main_img,product_json,size_json,notes,product_get_type,";
+ if (sale_count != null)
+ {
+ sql += "sale_count,";
+ }
+ sql += "sale_count_text,special_prod_type,";
sql += "distribution_set,ban_wx,ban_pdd,add_time,mdy_time,";
if (add_user_name != null)
sql += "add_user_name,";
@@ -133,8 +140,12 @@ namespace KJD_Web.BLL.BXX
sql += ") ";
sql += "values ('" + from_shop_id + "','" + from_shop_name + "','" + offline_supplier_id + "','" + offline_supplier_name + "','" + spu_id + "','" +
skc_id + "','" + real_coid + "','" + real_spu_id + "','" + main_cat_id + "','" + main_cat_name + "','" + cat_id + "','" + cat_name + "','" +
- price_text + "','" + product_name + "','" + ext_code + "','" + main_img + "',@product_json,@size_json,'" + notes + "','" + product_get_type + "','" +
- sale_count + "','" + sale_count_text + "','" + special_prod_type + "'," + distribution_set.ParseToInt() + "," + ban_wx + "," + ban_pdd + ",";
+ price_text + "','" + product_name + "','" + ext_code + "','" + main_img + "',@product_json,@size_json,'" + notes + "','" + product_get_type + "',";
+ if (sale_count != null)
+ {
+ sql += "'" + sale_count + "',";
+ }
+ sql += "'" + sale_count_text + "','" + special_prod_type + "'," + distribution_set.ParseToInt() + "," + ban_wx + "," + ban_pdd + ",";
sql += "'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
sql += "'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
if (add_user_name != null)
@@ -594,11 +605,10 @@ 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("'", "\\'");
if (special_prod_type.IsNullOrEmpty())
- special_prod_type = "普通商品,书籍";
+ special_prod_type = "普通商品";
var is_supplier_prod_ok = RegexUtils.GetStringQuery(ref inputData, "is_supplier_prod_ok")?.Replace("'", "\\'");
var has_wx_cat = RegexUtils.GetStringQuery(ref inputData, "has_wx_cat")?.Replace("'", "\\'");
var send_to_out_server = RegexUtils.GetStringQuery(ref inputData, "send_to_out_server")?.Replace("'", "\\'");
- var has_send_to_out_server = RegexUtils.GetStringQuery(ref inputData, "has_send_to_out_server")?.Replace("'", "\\'");
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("'", "\\'");
@@ -622,14 +632,11 @@ namespace KJD_Web.BLL.BXX
List paramLst = new List();
string sql = " select count(*) from bxx.product p ";
- //if (!string.IsNullOrEmpty(wx_safe_status))
- // sql += " FORCE INDEX (index_wx_safe_status) ";
//sql += " LEFT JOIN bxx.jst_supplier_ban_platform b ON (p.skc_id=b.coid or p.real_coid=b.coid)" +
sql += " WHERE p.is_del=0";
string where = "";
- //where += " AND (b.ban_wx IS NULL OR b.ban_wx=0)";
if (!string.IsNullOrEmpty(from_shop_id))
where += " and p.from_shop_id ='" + from_shop_id + "'";
if (!string.IsNullOrEmpty(from_shop_name))
@@ -644,21 +651,7 @@ namespace KJD_Web.BLL.BXX
where += " and p.product_get_type in ('" + product_get_type.Replace(",", "','") + "')";
if (!string.IsNullOrEmpty(wx_safe_status))
where += " and p.wx_safe_status in ('" + wx_safe_status.Replace(",", "','") + "')";
- //if (!string.IsNullOrEmpty(wx_safe_status))
- //{
- // where += " and (";
- // var index = 0;
- // foreach (var status in wx_safe_status.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries))
- // {
- // index++;
- // if (index == 1)
- // where += " p.wx_safe_status='" + status + "'";
- // else
- // where += " or p.wx_safe_status='" + status + "'";
- // }
- // where += ") ";
- //}
- if (!string.IsNullOrEmpty(special_prod_type)/* && special_prod_type != "普通商品,书籍,爆款数据"*/)
+ if (!string.IsNullOrEmpty(special_prod_type)/* && special_prod_type != "普通商品,爆款数据"*/)
where += " and p.special_prod_type in ('" + special_prod_type.Replace(",", "','") + "')";
if (!string.IsNullOrWhiteSpace(search_spu))
@@ -669,13 +662,13 @@ namespace KJD_Web.BLL.BXX
where += " and p.spu_id like '" + search_spu + "%'";
}
if (!string.IsNullOrWhiteSpace(search_skc))
- where += " and p.skc_id like '%" + search_skc + "%'";
+ where += " and p.skc_id like '" + search_skc + "%'";
if (!string.IsNullOrWhiteSpace(search_cat))
- where += " and p.cat_name like '%" + search_cat + "%'";
+ where += " and p.cat_name like '" + search_cat + "%'";
if (!string.IsNullOrWhiteSpace(search_cat1))
- where += " and p.main_cat_name like '%" + search_cat1 + "%'";
+ where += " and p.main_cat_name like '" + search_cat1 + "%'";
if (!string.IsNullOrWhiteSpace(search_ext_code))
- where += " and p.ext_code like '%" + search_ext_code + "%'";
+ where += " and p.ext_code like '" + search_ext_code + "%'";
if (!string.IsNullOrWhiteSpace(search_prod_name))
{
var searchProdNameWords = search_prod_name.Split(new string[] { ",", ",", ";", ";", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);
@@ -701,10 +694,10 @@ namespace KJD_Web.BLL.BXX
if (search_group == "无分组")
where += " and (p.group is null or p.group = '')";
else
- where += " and p.group like '%" + search_group + "%'";
+ where += " and p.group like '" + search_group + "%'";
}
if (!string.IsNullOrWhiteSpace(search_notes))
- where += " and p.notes like '%" + search_notes + "%'";
+ where += " and p.notes like '" + search_notes + "%'";
if (!string.IsNullOrWhiteSpace(wx_cat_1))
where += " and p.wx_cat_1 in (" + wx_cat_1 + ")";
@@ -717,25 +710,13 @@ namespace KJD_Web.BLL.BXX
if (!string.IsNullOrEmpty(has_wx_cat))
{
- //if (has_wx_cat.ToLower() == "true")
- // where += " and wx_cat_leaf is NOT NULL and wx_cat_3 IS NOT NULL";
- //else
- // where += " and (wx_cat_leaf is NULL OR wx_cat_3 IS NULL)";
-
if (has_wx_cat.ToLower() == "true")
- where += " and wx_cat_3 IS NOT NULL";
+ where += " and p.wx_cat_3 >= 0";
else
- where += " and wx_cat_3 IS NULL";
+ where += " and p.wx_cat_3 IS NULL";
}
if (!string.IsNullOrEmpty(send_to_out_server))
- where += " and send_to_out_server=" + send_to_out_server;
- else if (!string.IsNullOrEmpty(has_send_to_out_server))
- {
- if (has_send_to_out_server.ToLower() == "true")
- where += " and send_to_out_server=1";
- else
- where += " and send_to_out_server!=1";
- }
+ where += " and p.send_to_out_server in (" + send_to_out_server + ")";
// 供应商货源是否已完成初始设置
if (!string.IsNullOrEmpty(is_supplier_prod_ok))
{
@@ -744,17 +725,26 @@ namespace KJD_Web.BLL.BXX
//else
// where += " and (wx_cat_leaf IS NULL or send_to_out_server=0 or delivery_fee_set=0 or after_sale_set=0 or distribution_set=0)";
if (is_supplier_prod_ok == "1" || is_supplier_prod_ok == "是" || is_supplier_prod_ok == "已设置")
- where += " and wx_cat_leaf IS NOT NULL and send_to_out_server IN (1,127) and distribution_set IN (1,127)";
+ where += " and p.wx_cat_3 IS NOT NULL and p.send_to_out_server IN (1,127) and p.distribution_set IN (1,127)";
else
- where += " and (wx_cat_leaf IS NULL or send_to_out_server NOT IN (1,127) or distribution_set NOT IN (1,127))";
+ where += " and (p.wx_cat_3 IS NULL or p.send_to_out_server NOT IN (1,127) or p.distribution_set NOT IN (1,127))";
}
+ if (!where.Contains("send_to_out_server"))
+ {
+ //where += " and p.send_to_out_server IN (0,1,127)";
+ }
+ if (!where.Contains("distribution_set"))
+ {
+ //where += " and p.distribution_set IN (0,1,2,127)";
+ }
+
if (!string.IsNullOrEmpty(real_coid))
{
- where += " and real_coid='" + real_coid + "'";
+ where += " and p.real_coid='" + real_coid + "'";
}
if (!string.IsNullOrEmpty(has_wx_format))
{
- where += " and has_wx_format='" + has_wx_format + "'";
+ where += " and p.has_wx_format='" + has_wx_format + "'";
}
if (!string.IsNullOrEmpty(problem_prod_data))
{
@@ -798,11 +788,6 @@ namespace KJD_Web.BLL.BXX
}
sql += where;
- if (sql.Contains("15288888888"))
- {
-
- }
-
var count = 0;
if (isDetail || is_not_count)
count = 1;
@@ -818,54 +803,19 @@ namespace KJD_Web.BLL.BXX
{
if (isDetail)
sql = " SELECT p.*" +
- //" ,s.img_base64" +
- //" ,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" +
- //" LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
- //" LEFT JOIN bxx.jst_supplier_ban_platform b ON (p.skc_id=b.coid or p.real_coid=b.coid)" +
- " where p.is_del=0";
- else if (string.IsNullOrEmpty(get_select_count))
- 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.is_relation,p.view_uv,p.add_user_name" +
- //" ,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" +
- //" LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
- //" LEFT JOIN bxx.jst_supplier_ban_platform b ON (p.skc_id=b.coid or p.real_coid=b.coid)" +
" where p.is_del=0";
else
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.main_img,p.notes,p.add_time,p.mdy_time,p.fission_words,p.head_words,p.end_words,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.is_relation,p.view_uv,p.add_user_name" +
- //" ,s.img_url" +
- //" ,e.ext_code_price," +
- //" COUNT(se.id) AS select_count" +
" FROM bxx.product p" +
- //" LEFT JOIN bxx.sku_img_replace s ON p.sku_img_replace_id=s.id" +
- //" LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
- //" LEFT JOIN bxx.product_select se ON p.id=se.out_product_id AND se.shop_id='" + select_shop_id + "' " +
" WHERE p.is_del=0";
-
//where子句
sql += where;
- if (sql.Contains("15288888888"))
- {
-
- }
-
-
- if (!isDetail && !string.IsNullOrEmpty(get_select_count))
- sql += " group by p.id";
- if (sort_field == "select_total_count")
- sql += " order by p.select_total_count desc, p.id desc";
- else if (sort_field == "view_uv")
+ if (sort_field == "view_uv")
sql += " order by p.view_uv desc, p.id desc";
else
sql += " order by p.id desc";
@@ -907,12 +857,10 @@ namespace KJD_Web.BLL.BXX
mdy_time = Convert.ToDateTime(row["mdy_time"]),
notes = row["notes"].ToString(),
group = row["group"].ToString(),
- select_total_count = row["select_total_count"].ParseToInt(),
+ //select_total_count = row["select_total_count"].ParseToInt(),
end_words = row["end_words"].ParseToString(),
fission_words = row["fission_words"].ParseToString(),
head_words = row["head_words"].ParseToString(),
- sku_img_replace_id = row["sku_img_replace_id"].ParseToInt(),
- //sku_img_replace_url = row["img_url"].ToString(),
product_get_type_text = row["product_get_type"].ToString(),
view_uv = row["view_uv"].ParseToNullableInt(),
sale_count = row["sale_count"].ParseToInt(),
@@ -936,8 +884,6 @@ namespace KJD_Web.BLL.BXX
prod.sku_secret_json = row["sku_secret_json"].ToString();
prod.fission_imgs = row["fission_imgs"].ToString();
prod.has_wx_format = row["has_wx_format"].ParseToNullableString(); // 微信回采
- //prod.sku_img_replace_base64 = row["img_base64"].ToString();
- //prod.sku_img_replace_url = row["img_url"].ToString();
prod.wx_img_map_json = row["wx_img_map_json"].ToString();
problem_prod_data = row["problem_prod_data"].IsNullOrEmpty() ? null : row["problem_prod_data"].ParseToString();
@@ -1733,11 +1679,18 @@ namespace KJD_Web.BLL.BXX
var wx_cat_1 = RegexUtils.GetStringQuery(ref inputData, "wx_cat_1")?.Replace("'", "\\'");
var wx_cat_2 = RegexUtils.GetStringQuery(ref inputData, "wx_cat_2")?.Replace("'", "\\'");
var wx_cat_3 = RegexUtils.GetStringQuery(ref inputData, "wx_cat_3")?.Replace("'", "\\'");
- var product_get_type = RegexUtils.GetStringQuery(ref inputData, "product_get_type")?.Replace("'", "\\'");
var wx_safe_status = RegexUtils.GetStringQuery(ref inputData, "wx_safe_status")?.Replace("'", "\\'");
var special_prod_type = RegexUtils.GetStringQuery(ref inputData, "special_prod_type")?.Replace("'", "\\'");
if (special_prod_type.IsNullOrEmpty())
- special_prod_type = "普通商品,书籍";
+ special_prod_type = "普通商品";
+ var product_get_type = RegexUtils.GetStringQuery(ref inputData, "product_get_type")?.Replace("'", "\\'");
+ var is学员数据 = false;
+ if (product_get_type == "学员数据")
+ {
+ is学员数据 = true;
+ product_get_type = "多多外部数据,微信小店,微信店采";
+ special_prod_type = "普通商品,爆款数据";
+ }
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") == "true"; // 不计数
var prod_count = RegexUtils.GetStringQuery(ref inputData, "prod_count").ParseToInt();
@@ -1747,6 +1700,8 @@ namespace KJD_Web.BLL.BXX
var ban_wx = RegexUtils.GetStringQuery(ref inputData, "ban_wx")?.Replace("'", "\\'");
var ban_pdd = RegexUtils.GetStringQuery(ref inputData, "ban_pdd")?.Replace("'", "\\'");
var add_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'");
+ if (is学员数据)
+ add_user_name = "admin";
var no_fission_words = RegexUtils.GetStringQuery(ref inputData, "no_fission_words").ParseToBool(); // 未裂变标题
var fission_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_words"))?.Replace("'", "\\'");
@@ -1806,22 +1761,37 @@ namespace KJD_Web.BLL.BXX
{
where += " and p.wx_cat_3 in (" + wx_cat_3 + ")";
}
+ string where1 = "";
+ string where2 = "";
if (!string.IsNullOrEmpty(product_get_type))
- where += " and p.product_get_type in ('" + product_get_type.Replace(",", "','") + "')";
+ {
+ where1 = " and p.product_get_type in ('" + product_get_type.Replace(",", "','") + "')";
+ if (is学员数据)
+ {
+ // 多多外部数据20% 微信小店数据30% 微信店采50%
+ //where2 = " and (RAND() < 0.066 AND product_get_type = '多多外部数据' OR RAND() < 0.3 AND product_get_type = '微信小店' OR RAND() <= 1 AND product_get_type = '微信店采') ";
+ where2 = " and (RAND() < 0.055 AND product_get_type = '多多外部数据' OR RAND() < 0.39 AND product_get_type = '微信小店' OR RAND() <= 1 AND product_get_type = '微信店采') ";
+ }
+ where += where1;
+ }
if (!string.IsNullOrEmpty(wx_safe_status))
where += " and p.wx_safe_status in ('" + wx_safe_status.Replace(",", "','") + "')";
//if (!string.IsNullOrEmpty(special_prod_type)) // 普通商品 爆款数据
// where += " and p.special_prod_type ='" + special_prod_type + "'";
- if (!string.IsNullOrEmpty(special_prod_type)/* && special_prod_type != "普通商品,书籍,爆款数据"*/)
+ if (!string.IsNullOrEmpty(special_prod_type)/* && special_prod_type != "普通商品,爆款数据"*/)
where += " and p.special_prod_type in ('" + special_prod_type.Replace(",", "','") + "')";
// 供应商货源是否已完成初始设置
if (!string.IsNullOrEmpty(is_supplier_prod_ok))
{
if (is_supplier_prod_ok == "1" || is_supplier_prod_ok == "是" || is_supplier_prod_ok == "已设置")
- where += " AND wx_cat_leaf IS NOT NULL AND send_to_out_server IN (1,127) and distribution_set IN (1,127)";
+ where += " AND wx_cat_leaf > 0 AND send_to_out_server IN (1,127) and distribution_set IN (1,127)";
else
where += " AND (wx_cat_leaf IS NULL OR send_to_out_server NOT IN (1,127) OR distribution_set NOT IN (1,127))";
}
+ else
+ {
+ where += " AND send_to_out_server IN (0,1,127) and distribution_set IN (0,1,2,127)";
+ }
if (!add_days_less.IsNullOrZero())
{
where += " and add_time > '" + DateTime.Now.AddDays(-add_days_less.ParseToInt()).ToString("yyyy-MM-dd") + "'";
@@ -1838,10 +1808,18 @@ namespace KJD_Web.BLL.BXX
{
where += " and p.ban_wx=" + ban_wx;
}
+ else
+ {
+ where += " and p.ban_wx in (0,1) ";
+ }
if (ban_pdd != null)
{
where += " and p.ban_pdd=" + ban_pdd;
}
+ else
+ {
+ where += " and p.ban_pdd in (0,1) ";
+ }
if (!string.IsNullOrEmpty(add_user_name))
{
add_user_name = "'" + string.Join("','", add_user_name.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
@@ -1857,11 +1835,13 @@ namespace KJD_Web.BLL.BXX
}
sql += where;
- int count = prod_count;
+ int count = prod_count;
if (product_get_type == "厂商直采" && count > 1000)
count = (count / 2.0).ParseToInt();
+ if (is学员数据 && count >= 450)
+ count = (count / 3.0).ParseToInt();
if (!is_not_count)
- {
+ {
count = mySql.ExecuteRowCount(sql);
Thread.Sleep(1500);
}
@@ -1873,6 +1853,11 @@ namespace KJD_Web.BLL.BXX
}
else
{
+ if (is学员数据)
+ {
+ where = where.Replace(where1, where2);
+ }
+
sql = " SELECT p.id" +
" FROM bxx.product p" +
//" LEFT JOIN bxx.jst_supplier_ban_platform b ON (p.skc_id=b.coid OR p.real_coid=b.coid)" +
@@ -1956,6 +1941,8 @@ namespace KJD_Web.BLL.BXX
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
if (product_get_type == "厂商直采" && count > 500)
count = (count * 2.0).ParseToInt();
+ if (is学员数据 && count >= 150)
+ count = (count * 3.0).ParseToInt();
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
}
catch (Exception ex)
@@ -2264,7 +2251,6 @@ namespace KJD_Web.BLL.BXX
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
string img_md5 = RegexUtils.GetStringQuery(ref inputData, "img_md5");
string img_base64 = RegexUtils.GetStringQuery(ref inputData, "img_base64");
- //string product_db_id = RegexUtils.GetStringQuery(ref inputData, "product_db_id");
string img_url = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "img_url"));
string img_type = RegexUtils.GetStringQuery(ref inputData, "img_type")?.Replace("'", "\\'");
string img_group = RegexUtils.GetStringQuery(ref inputData, "img_group")?.Replace("'", "\\'");
@@ -2274,7 +2260,6 @@ namespace KJD_Web.BLL.BXX
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
- //int sku_img_replace_id = 0;
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
@@ -2290,10 +2275,6 @@ namespace KJD_Web.BLL.BXX
}
if (rst > 0)
{
- //sku_img_replace_id = (int)rst;
- //sql = "update bxx.product set sku_img_replace_id= "+ sku_img_replace_id + " where id=" + product_db_id + ";";
-
- //bRst = mySql.ExecuteNonQuery(sql);
bRst = true;
}
mySql.Close();
@@ -2307,40 +2288,6 @@ namespace KJD_Web.BLL.BXX
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
- public string MdyProdSkuImgReplaceId(string inputData)
- {
- if (!string.IsNullOrEmpty(inputData))
- {
- var time = 0;
- int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
- string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
- if (time1 != EncrypUtil.Encryption(time))
- return "{\"code\":50000,\"msg\":\"校验失败\"}";
-
- string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
- string product_db_id = RegexUtils.GetStringQuery(ref inputData, "product_db_id");
- string img_db_id = RegexUtils.GetStringQuery(ref inputData, "img_db_id");
-
- if (string.IsNullOrEmpty(user_name))
- {
- return "{\"code\":500,\"msg\":\"没有用户名\"}";
- }
-
- string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
- MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "";
-
- sql = "update bxx.product set sku_img_replace_id= " + img_db_id + " where id=" + product_db_id + ";";
-
- var bRst = mySql.ExecuteNonQuery(sql);
- mySql.Close();
- if (bRst)
- return "{\"code\":200,\"msg\":\"success\"}";
- return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
- }
- return "{\"code\":19999,\"msg\":\"输入为空\"}";
- }
-
public string MdySkuImgReplace(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
@@ -2450,473 +2397,6 @@ namespace KJD_Web.BLL.BXX
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
-
- ///
- /// 添加用户选择商品
- ///
- ///
- ///
- ///
- public string AddUserSelectProduct(string inputData, bool isAdmin = false)
- {
- if (!string.IsNullOrEmpty(inputData))
- {
- var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
- string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
- if (time1 != EncrypUtil.Encryption(time))
- return "{\"code\":50000,\"msg\":\"校验失败\"}";
-
- var out_product_Id = RegexUtils.GetStringQuery(ref inputData, "out_product_id")?.Replace("'", "\\'");
- var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
- var shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account")?.Replace("'", "\\'");
- var user_name = RegexUtils.GetStringQuery(ref inputData, "main_user_name")?.Replace("'", "\\'");
- var sub_user_name = RegexUtils.GetStringQuery(ref inputData, "sub_user_name")?.Replace("'", "\\'");
- var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
- var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
- var add_product_remaining = RegexUtils.GetStringQuery(ref inputData, "add_product_remaining").ParseToInt();
- var add_fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_fission_product_name").ParseToString())?.Replace("'", "\\'");
-
- if (string.IsNullOrEmpty(user_name))
- {
- return "{\"code\":500,\"msg\":\"没有用户名\"}";
- }
- if (string.IsNullOrEmpty(shop_id))
- {
- return "{\"code\":500,\"msg\":\"没有店铺信息\"}";
- }
-
-
- string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
- MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "insert into bxx.product_select " +
- "(out_product_Id,shop_id,shop_account,user_name,sub_user_name,notes,status,fission_product_name,add_time,mdy_time) values " +
- "('" + out_product_Id + "','" + shop_id + "','" + shop_account + "','" + user_name + "','" + sub_user_name + "','" +
- notes + "','" + status + "','" + add_fission_product_name + "','" +
- DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
- DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
- if (add_product_remaining > 0)
- {
- add_product_remaining = add_product_remaining - 1;
- sql += "\r\n";
- //sql += "update bxx.shop set add_product_remaining=" + add_product_remaining + " where shop_id='" + shop_id + "';";
- sql += "update bxx.product set select_total_count=select_total_count+1 where id=" + out_product_Id + ";";
- //sql += "update bxx.shop_add_prod_count set add_product_remaining=" + add_product_remaining + " where shop_id='" + shop_id + "';";
- sql += "INSERT INTO bxx.shop_add_prod_count(shop_id, add_product_remaining) VALUES('" + shop_id + "'," + add_product_remaining + ")" +
- "ON DUPLICATE KEY UPDATE add_product_remaining=VALUES(add_product_remaining)";
- }
- var rst = mySql.ExecuteNonQuery(sql);
- mySql.Close();
- if (rst)
- {
- return "{\"code\":200,\"msg\":\"success\"}";
- }
- else
- {
- return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
- }
- }
- return "{\"code\":19999,\"msg\":\"输入为空\"}";
- }
-
- public string MdyUserSelectProductStatus(string inputData, bool isAdmin = false)
- {
- if (!string.IsNullOrEmpty(inputData))
- {
- var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
- string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
- if (time1 != EncrypUtil.Encryption(time))
- return "{\"code\":50000,\"msg\":\"校验失败\"}";
-
- var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
- var draft_id = RegexUtils.GetStringQuery(ref inputData, "draft_id")?.Replace("'", "\\'");
- var up_spu_id = RegexUtils.GetStringQuery(ref inputData, "up_spu_id")?.Replace("'", "\\'");
- var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
- var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
- var add_times = RegexUtils.GetStringQuery(ref inputData, "add_times")?.Replace("'", "\\'");
-
- long l_draft_id = draft_id.ParseToLong();
- long l_spu_map_table_id = l_draft_id % 128;
- long l_select_map_table_id = id.ParseToLong() % 64;
-
- string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
- MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "";
- // 使用事务一次提交多个sql操作
- //sql += "set @@autocommit=0;\r\n";
- sql += "START TRANSACTION;\r\n";
- if (!string.IsNullOrEmpty(up_spu_id) && !string.IsNullOrEmpty(draft_id))
- {
- sql += "insert into kjd_map.spu_map_" + l_spu_map_table_id +
- " (draft_id,from_spu_id,shop_id) values(" + draft_id + "," + up_spu_id + ",'" + shop_id + "');\r\n";
- // temu商品反复上传后记录一件选品商品上传的所有DraftId记录,pdd不需要
- //sql += "insert into kjd_map.product_select_map_" + l_select_map_table_id +
- // " (product_id,product_select_db_id,shop_id) values(" + draft_id + "," + id + ",'" + shop_id + "');\r\n";
- }
- sql += "update bxx.product_select set";
- if (draft_id != null)
- sql += " draft_id='" + draft_id + "',";
- if (status != null)
- sql += " status='" + status + "',";
- if (status == "已上传")
- sql += " add_times=add_times+1,";
- sql += " mdy_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
- sql = sql.TrimEnd(',');
- sql += " where id=" + id + ";\r\n";
- var rst = mySql.ExecuteNonQuery(sql);
- string errMsg = mySql.Message;
- if (string.IsNullOrEmpty(errMsg))
- sql = "COMMIT;";
- else
- sql = "ROLLBACK;";
- mySql.ExecuteNonQuery(sql);
- mySql.Close();
- if (rst)
- {
- return "{\"code\":200,\"msg\":\"success\"}";
- }
- else
- {
- return "{\"code\":500,\"msg\":\"" + errMsg + "\"}";
- }
- }
- return "{\"code\":19999,\"msg\":\"输入为空\"}";
- }
-
- public string GetUserSelectProductList(string inputData, bool isAdmin = false)
- {
- if (!string.IsNullOrEmpty(inputData))
- {
- var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
- string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
- if (time1 != EncrypUtil.Encryption(time))
- return "{\"code\":50000,\"msg\":\"校验失败\"}";
-
- var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
- if (string.IsNullOrEmpty(user_name))
- {
- return "{\"code\":500,\"msg\":\"没有用户名\"}";
- }
-
- var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "\\'");
- var search_shop_id = RegexUtils.GetStringQuery(ref inputData, "search_shop_id")?.Replace("'", "\\'");
- var search_shop_account = RegexUtils.GetStringQuery(ref inputData, "search_shop_account")?.Replace("'", "\\'");
- var search_spu = RegexUtils.GetStringQuery(ref inputData, "search_spu")?.Replace("'", "\\'");
- var search_skc = RegexUtils.GetStringQuery(ref inputData, "search_skc")?.Replace("'", "\\'");
- var search_cat1 = RegexUtils.GetStringQuery(ref inputData, "search_cat1")?.Replace("'", "\\'");
- var search_cat = RegexUtils.GetStringQuery(ref inputData, "search_cat")?.Replace("'", "\\'");
- var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'");
- var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'");
- var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'");
- var search_user_notes = RegexUtils.GetStringQuery(ref inputData, "search_user_notes")?.Replace("'", "\\'");
- var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'");
- var search_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "search_sub_sa_name")?.Replace("'", "\\'");
- var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
- var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
-
- var no_sub_sa = RegexUtils.GetStringQuery(ref inputData, "no_sub_sa")?.Replace("'", "\\'");
-
- int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
- int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
-
- string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
- MysqlUtils mySql = new MysqlUtils(conn);
-
- string sql = "select count(s.id) from bxx.product_select s " +
- "left join bxx.product p on s.out_product_id=p.id " +
- "left join bxx.user u on s.operate_sub_sa_name=u.user_name " +
- "where 1=1";
-
- string where = "";
- if (!isAdmin)
- where += " and (s.user_name='" + user_name + "' or s.sub_user_name like'%" + user_name + "%')";
- if (!string.IsNullOrEmpty(operate_sub_sa_name))
- {
- where += " and s.operate_sub_sa_name = '" + operate_sub_sa_name + "'";
- }
- if (no_sub_sa == "true")
- where += " and s.operate_sub_sa_name is null";
- if (!string.IsNullOrEmpty(search_db_ids))
- where += " and s.id in (" + search_db_ids + ")";
- if (!string.IsNullOrEmpty(shop_ids))
- where += " and s.shop_id in (" + shop_ids + ")";
- if (!string.IsNullOrWhiteSpace(status))
- where += " and s.status = '" + status + "'";
- if (!string.IsNullOrWhiteSpace(search_shop_id))
- where += " and s.shop_id like '%" + search_shop_id + "%'";
- if (!string.IsNullOrWhiteSpace(search_shop_account))
- where += " and s.shop_account like '%" + search_shop_account + "%'";
- if (!string.IsNullOrWhiteSpace(search_notes))
- {
- //核价成功 重复 核价成功(重复)
- if (search_notes == "无备注")
- where += " and s.notes = ''";
- else if (search_notes == "重复")
- where += " and s.notes like '%重复%' and s.notes not like '%核价成功%' and s.notes not like '%核价通过%'";
- else if (search_notes == "核价成功")
- where += " and (s.notes like '%核价成功%' or s.notes like '%核价通过%') and s.notes not like '%重复%'";
- else if (search_notes == "核价成功(重复)")
- where += " and (s.notes like '%核价成功%' or s.notes like '%核价通过%') and s.notes like '%重复%'";
- else
- where += " and s.notes like '%" + search_notes + "%'";
- }
- if (!string.IsNullOrWhiteSpace(search_user_notes))
- where += " and s.user_notes like '%" + search_user_notes + "%'";
-
- where += " and p.id_del=0";
- if (!string.IsNullOrWhiteSpace(search_spu))
- where += " and p.spu_id like '%" + search_spu + "%'";
- if (!string.IsNullOrWhiteSpace(search_skc))
- where += " and p.skc_id like '%" + search_skc + "%'";
- if (!string.IsNullOrWhiteSpace(search_cat1))
- where += " and p.main_cat_name like '%" + search_cat1 + "%'";
- if (!string.IsNullOrWhiteSpace(search_cat))
- where += " and p.cat_name like '%" + search_cat + "%'";
- if (!string.IsNullOrWhiteSpace(search_ext_code))
- where += " and p.ext_code like '%" + search_ext_code + "%'";
- if (!string.IsNullOrWhiteSpace(search_prod_name))
- where += " and p.product_name like '%" + search_prod_name + "%'";
- if (!string.IsNullOrEmpty(search_sub_sa_name))
- {
- where += " and (s.operate_sub_sa_name like '%" + search_sub_sa_name + "%'";
- where += " or u.nick_name like '%" + operate_sub_sa_name + "%')";
- }
-
- sql += where;
-
- var count = mySql.ExecuteRowCount(sql);
-
- DataTable dt;
- if (count == 0)
- {
- dt = new DataTable();
- }
- else
- {
- //if (isDetail)
- //sql = "select * from bxx.product_select where 1=1";
- //else
- sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," +
- "s.sub_user_name,s.notes,s.user_notes,s.status,s.draft_id,s.add_times,s.add_time,s.mdy_time," +
- "s.fission_product_name,s.operate_sub_sa_name,s.add_sub_sa_time," +
- "p.from_shop_id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.group" +
- "u.nick_name as operate_sub_sa_nick " +
- "from bxx.product_select s left join bxx.product p on s.out_product_id=p.id " +
- "left join bxx.user u on u.user_name=s.operate_sub_sa_name " +
- "where 1=1";
-
- sql += where; // where子句
-
- sql += " order by id desc";
- sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
- dt = mySql.ExecuteDataTable(sql);
- }
-
- mySql.Close();
- if (dt != null)
- {
- try
- {
- List productLst = new List();
- foreach (DataRow row in dt.Rows)
- {
- ProductSelectResultParam prodSelect = new ProductSelectResultParam()
- {
- id = row["id"].ParseToInt(),
- out_product_Id = row["out_product_Id"].ParseToString(),
- shop_account = row["shop_account"].ParseToString(),
- shop_id = row["shop_id"].ParseToString(),
- status = row["status"].ParseToString(),
- sub_user_name = row["sub_user_name"].ParseToString(),
- user_name = row["user_name"].ParseToString(),
- cat_id = row["cat_id"].ParseToString(),
- cat_name = row["cat_name"].ParseToString(),
- product_name = row["product_name"].ParseToString(),
- main_img = row["main_img"].ParseToString(),
- group = row["group"].ToString(),
- ext_code = row["ext_code"].ParseToString(),
- add_time = Convert.ToDateTime(row["add_time"]),
- mdy_time = Convert.ToDateTime(row["mdy_time"]),
- notes = row["notes"].ParseToString(),
- draft_id = row["draft_id"].ParseToString(),
- add_times = row["add_times"].ParseToInt(),
- skc_id = row["skc_id"].ToString(),
- spu_id = row["spu_id"].ToString(),
- operate_sub_sa_name = row["operate_sub_sa_name"].ToString(),
- operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString(),
- fission_product_name = row["fission_product_name"].ToString(),
- user_notes = row["user_notes"].ToString(),
- from_shop_id = row["from_shop_id"].ToString(),
- //product_json = row["product_json"].ToString(),
- //size_json = row["size_json"].ToString(),
- };
- prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?;
- productLst.Add(prodSelect);
- }
- var data = JsonUtils.SerializeObjectToString(productLst);
- return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
- }
- catch (Exception ex)
- {
- return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
- }
- }
- else
- {
- return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
- }
- }
- return "{\"code\":19999,\"msg\":\"输入为空\"}";
- }
-
- public string DelSelectProd(string inputData)
- {
- if (!string.IsNullOrEmpty(inputData))
- {
- var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
- string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
- if (time1 != EncrypUtil.Encryption(time))
- return "{\"code\":50000,\"msg\":\"校验失败\"}";
-
- var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
- if (string.IsNullOrEmpty(user_name))
- {
- return "{\"code\":500,\"msg\":\"没有用户名\"}";
- }
-
- var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
- if (string.IsNullOrEmpty(id))
- {
- return "{\"code\":500,\"msg\":\"删除失败:请指定要删除的数据!\"}";
- }
-
- string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
- MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "delete from bxx.product_select where id='" + id + "'";
-
- var rst = mySql.ExecuteNonQuery(sql);
- mySql.Close();
- if (rst)
- {
- return "{\"code\":200,\"msg\":\"success\"}";
- }
- else
- return "{\"code\":500,\"msg\":\"删除失败:" + mySql.Message + "\"}";
- }
- return "{\"code\":19999,\"msg\":\"输入为空\"}";
- }
-
- ///
- /// 设置上传商品的二级超管
- ///
- ///
- public string SetSelectProductSubSa(string inputData)
- {
- if (!string.IsNullOrEmpty(inputData))
- {
- var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
- string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
- if (time1 != EncrypUtil.Encryption(time))
- return "{\"code\":50000,\"msg\":\"校验失败\"}";
-
- var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
- if (string.IsNullOrEmpty(user_name))
- {
- return "{\"code\":50001,\"msg\":\"没有用户名\"}";
- }
-
- var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
- var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'");
- var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
- var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
-
- if (string.IsNullOrEmpty(id) && string.IsNullOrEmpty(shop_id))
- {
- return "{\"code\":50002,\"msg\":\"未选择任何待上传\"}";
- }
-
- string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
- MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "update bxx.product_select set";
- if (operate_sub_sa_name != null)
- sql += " operate_sub_sa_name='" + operate_sub_sa_name + "',";
- sql += " add_sub_sa_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
- sql = sql.TrimEnd(',');
- if (!string.IsNullOrEmpty(id))
- sql += " where id in (" + id + ")";
- else if (!string.IsNullOrEmpty(shop_id))
- sql += " where shop_id in ('" + shop_id.Replace(",","','") + "')";
- else
- sql += " where 1=2";
- if(!string.IsNullOrEmpty(status))
- sql += " and status='" + status + "';";
- var rst = mySql.ExecuteNonQuery(sql);
- mySql.Close();
- if (rst)
- {
- return "{\"code\":200,\"msg\":\"success\"}";
- }
- else
- {
- return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
- }
- }
- return "{\"code\":19999,\"msg\":\"输入为空\"}";
- }
-
- public string MdyProductSelectNotes(string inputData, bool isAdmin = false)
- {
- if (!string.IsNullOrEmpty(inputData))
- {
- var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
- string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
- if (time1 != EncrypUtil.Encryption(time))
- return "{\"code\":50000,\"msg\":\"校验失败\"}";
-
- var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
- var id = RegexUtils.GetStringQuery(ref inputData, "db_id");
- string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"));
- string user_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_notes"));
- string fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_product_name"));
-
- if (string.IsNullOrEmpty(user_name))
- {
- return "{\"code\":500,\"msg\":\"没有用户名\"}";
- }
-
- string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
- MysqlUtils mySql = new MysqlUtils(conn);
- string sql = "update bxx.product_select set";
- if (notes != null)
- sql += " notes=@notes,";
- if (user_notes != null)
- sql += " user_notes=@user_notes,";
- if (fission_product_name != null)
- sql += " fission_product_name=@fission_product_name,";
- sql = sql.TrimEnd(',');
- sql += " where id=@id;";
-
- List paramLst = new List();
- paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@id", Value = id, });
- paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@fission_product_name", Value = fission_product_name, });
- paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@user_notes", Value = user_notes, });
- paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
-
- var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
- mySql.Close();
- if (rst)
- {
- return "{\"code\":200,\"msg\":\"success\"}";
- }
- else
- {
- return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}";
- }
- }
- return "{\"code\":19999,\"msg\":\"输入为空\"}";
- }
-
-
-
public string WxApiGetWxAllCate(string inputData)
{
diff --git a/KJDService/KJD_WebService/BLL/KJD/UpdateManage.cs b/KJDService/KJD_WebService/BLL/KJD/UpdateManage.cs
index dc29b16..0bb1118 100644
--- a/KJDService/KJD_WebService/BLL/KJD/UpdateManage.cs
+++ b/KJDService/KJD_WebService/BLL/KJD/UpdateManage.cs
@@ -72,6 +72,12 @@ namespace KJD_Web.BLL
var UpdateExeChk = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExeChk"].ConnectionString;
var LowVersion = System.Configuration.ConfigurationManager.ConnectionStrings["LowVersion"].ConnectionString;
+ int MaxVersion = 999999;
+ //if (version <= 1198)
+ // MaxVersion = 1198;
+ if (version <= 1159)
+ MaxVersion = 1159;
+
if (version > LowVersion.ParseToInt())
{
if (path != null)
@@ -86,7 +92,7 @@ namespace KJD_Web.BLL
foreach (var f in file)
{
var v = Path.GetFileName(f).Replace("Update29wx", "").Replace(".zip", "").ParseToInt();
- if (v > versionTmp && v <= serverVersion.ParseToInt())
+ if (v > versionTmp && v <= serverVersion.ParseToInt() && v <= MaxVersion)
{
versionTmp = v;
}
@@ -105,7 +111,7 @@ namespace KJD_Web.BLL
foreach (var f in file)
{
var v = Path.GetFileName(f).Replace("Update29pdd", "").Replace(".zip", "").ParseToInt();
- if (v > versionTmp && v <= serverVersion.ParseToInt())
+ if (v > versionTmp && v <= serverVersion.ParseToInt() && v <= MaxVersion)
{
versionTmp = v;
}
@@ -124,8 +130,8 @@ namespace KJD_Web.BLL
}
}
- if (serverVersion.ParseToInt() > 1159)
- serverVersion = 1159.ToString();
+ if (serverVersion.ParseToInt() > MaxVersion)
+ serverVersion = MaxVersion.ParseToString();
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
"\",\"exe_address\":\"" + UpdateExe + "\",\"file_address\":\"" + UpdateNewUrl + "Update" + serverVersion + ".zip\"}";
}
diff --git a/KJDService/KJD_WebService/BLL/WXXD/WXOrderManage.cs b/KJDService/KJD_WebService/BLL/WXXD/WXOrderManage.cs
index ccc47b2..fbe77ca 100644
--- a/KJDService/KJD_WebService/BLL/WXXD/WXOrderManage.cs
+++ b/KJDService/KJD_WebService/BLL/WXXD/WXOrderManage.cs
@@ -781,5 +781,49 @@ namespace KJD_Web.BLL.WXXD
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
+
+ ///
+ /// 修改中转仓订单信息,临时补救
+ ///
+ ///
+ ///
+ public string WXUpdateErpAllocatedOrderNo(string inputData)
+ {
+ if (!string.IsNullOrEmpty(inputData))
+ {
+ if (!WXUserManage.GetSign(inputData))
+ return "{\"code\":999,\"msg\":\"校验失败\"}";
+ var timeCalc = DateTime.Now;
+
+ int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
+ int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(200);
+ string out_order_no = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "out_order_no"))?.Replace("'", "\\'");
+ string pre_allocated_order_no = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "pre_allocated_order_no"))?.Replace("'", "\\'");
+ if (string.IsNullOrEmpty(out_order_no))
+ return "{\"code\":500,\"msg\":\"订单外部ID信息不能为空\"}";
+
+ string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
+ MysqlUtils mySql = new MysqlUtils(conn);
+
+ string sql = "";
+ var count = -1;
+
+ sql = " update `erp`.`oms_wei_external_procurement_log` set ";
+ if (!string.IsNullOrEmpty(pre_allocated_order_no))
+ sql += " pre_allocated_order_no=" + pre_allocated_order_no + ",";
+ sql = sql.TrimEnd(',');
+ sql += " where out_order_no = '" + out_order_no + "';";
+
+ count = mySql.ExecuteAffectedRows(sql);
+ mySql.Close();
+
+ if (!string.IsNullOrEmpty(mySql.Message))
+ {
+ return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"affected_rows\":" + count + "}";
+ }
+ return "{\"code\":200,\"msg\":\"success\",\"affected_rows\":" + count + "}";
+ }
+ return "{\"code\":19999,\"msg\":\"输入为空\"}";
+ }
}
}
\ No newline at end of file
diff --git a/KJDService/KJD_WebService/BLL/WXXD/WXProductManage.cs b/KJDService/KJD_WebService/BLL/WXXD/WXProductManage.cs
index 2f14c45..6201563 100644
--- a/KJDService/KJD_WebService/BLL/WXXD/WXProductManage.cs
+++ b/KJDService/KJD_WebService/BLL/WXXD/WXProductManage.cs
@@ -23,163 +23,6 @@ namespace KJD_Web.BLL.WXXD
public string WXGetPDDProductList(string inputData, bool isDetail = false)
{
return new BLL.BXX.BXXProductManage().GetProductList(inputData, isDetail);
-
- //if (!string.IsNullOrEmpty(inputData))
- //{
- // var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
- // string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
- // if (time1 != EncrypUtil.Encryption(time))
- // return "{\"code\":50000,\"msg\":\"校验失败\"}";
-
- // var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'","\\'");
- // var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
- // var search_spu = RegexUtils.GetStringQuery(ref inputData, "search_spu")?.Replace("'", "\\'");
- // var search_skc = RegexUtils.GetStringQuery(ref inputData, "search_skc")?.Replace("'", "\\'");
- // var search_cat = RegexUtils.GetStringQuery(ref inputData, "search_cat")?.Replace("'", "\\'");
- // var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'");
- // var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'");
- // var search_group = RegexUtils.GetStringQuery(ref inputData, "search_group")?.Replace("'", "\\'");
- // var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'");
- // var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'");
- // var get_select_count = RegexUtils.GetStringQuery(ref inputData, "get_select_count")?.Replace("'", "\\'");
- // var select_shop_id = RegexUtils.GetStringQuery(ref inputData, "select_shop_id")?.Replace("'", "\\'");
- // var from_shop_id = RegexUtils.GetStringQuery(ref inputData, "from_shop_id")?.Replace("'", "\\'");
- // var sort_field = RegexUtils.GetStringQuery(ref inputData, "sort_field")?.Replace("'", "\\'");
-
- // int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
- // int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
-
- // string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
- // MysqlUtils mySql = new MysqlUtils(conn);
-
- // string sql = "select count(id) from bxx.product p where p.is_del=0";
-
- // string where = "";
- // if (!string.IsNullOrWhiteSpace(search_spu))
- // where += " and p.spu_id like '%" + search_spu + "%'";
- // if (!string.IsNullOrWhiteSpace(search_skc))
- // where += " and p.skc_id like '%" + search_skc + "%'";
- // if (!string.IsNullOrWhiteSpace(search_cat))
- // where += " and p.cat_name like '%" + search_cat + "%'";
- // if (!string.IsNullOrWhiteSpace(search_ext_code))
- // where += " and p.ext_code like '%" + search_ext_code + "%'";
- // if (!string.IsNullOrWhiteSpace(search_prod_name))
- // where += " and p.product_name like '%" + search_prod_name + "%'";
- // if (!string.IsNullOrWhiteSpace(search_group))
- // where += " and p.group like '%" + search_group + "%'";
- // if (!string.IsNullOrWhiteSpace(search_notes))
- // where += " and p.notes like '%" + search_notes + "%'";
- // if (!string.IsNullOrEmpty(from_shop_id))
- // where += " and p.from_shop_id ='" + from_shop_id + "'";
- // if (!string.IsNullOrEmpty(search_db_ids))
- // where += " and p.id in (" + search_db_ids + ")";
- // sql += where;
-
- // var count = mySql.ExecuteRowCount(sql);
-
- // DataTable dt;
- // if (count == 0)
- // {
- // dt = new DataTable();
- // }
- // else
- // {
- // if (isDetail)
- // sql = "select p.*,s.img_base64,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" +
- // " LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
- // " where p.is_del=0";
- // else if (string.IsNullOrEmpty(get_select_count))
- // 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,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" +
- // " LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
- // " where p.is_del=0";
- // else
- // 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,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" +
- // " WHERE p.is_del=0";
-
- // //where子句
- // sql += where;
-
- // if (!isDetail && !string.IsNullOrEmpty(get_select_count))
- // sql += " group by p.id";
- // if (sort_field == "select_total_count")
- // sql += " order by p.select_total_count desc, p.id desc";
- // else
- // sql += " order by p.id desc";
- // sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
- // dt = mySql.ExecuteDataTable(sql);
- // }
-
- // mySql.Close();
- // if (dt != null)
- // {
- // try
- // {
- // List productLst = new List();
- // foreach (DataRow row in dt.Rows)
- // {
- // DBProductResultParam prod = new DBProductResultParam
- // {
- // id = Convert.ToInt32(row["id"]),
- // from_shop_id = row["from_shop_id"].ToString(),
- // skc_id = row["skc_id"].ToString(),
- // spu_id = row["spu_id"].ToString(),
- // cat_id = row["cat_id"].ToString(),
- // cat_name = row["cat_name"].ToString(),
- // product_name = row["product_name"].ToString(),
- // main_img = row["main_img"].ToString(),
- // ext_code = row["ext_code"].ToString(),
- // ext_code_price = row["ext_code_price"].IsNullOrEmpty() ? new int?() : row["ext_code_price"].ParseToInt(),
- // price_text = row["price_text"].ToString(),
- // //product_json = row["product_json"].ToString(),
- // //size_json = row["size_json"].ToString(),
- // add_time = Convert.ToDateTime(row["add_time"]),
- // mdy_time = Convert.ToDateTime(row["mdy_time"]),
- // notes = row["notes"].ToString(),
- // group = row["group"].ToString(),
- // select_total_count = row["select_total_count"].ParseToInt(),
- // end_words = row["end_words"].ParseToString(),
- // fission_words = row["fission_words"].ParseToString(),
- // head_words = row["head_words"].ParseToString(),
- // sku_img_replace_id = row["sku_img_replace_id"].ParseToInt(),
- // sku_img_replace_url = row["img_url"].ToString(),
- // product_get_type_text = row["product_get_type"].ToString(),
- // };
- // if (isDetail)
- // {
- // prod.product_json = row["product_json"].ToString();
- // prod.size_json = row["size_json"].ToString();
- // prod.sku_edit_json = row["sku_edit_json"].ToString();
- // prod.sku_img_replace_base64 = row["img_base64"].ToString();
- // //prod.sku_img_replace_url = row["img_url"].ToString();
- // }
- // if (!string.IsNullOrEmpty(get_select_count))
- // {
- // prod.select_count = row["select_count"].ParseToInt();
- // }
- // productLst.Add(prod);
- // }
- // var data = JsonUtils.SerializerObjectToString(productLst);
- // return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
- // }
- // catch (Exception ex)
- // {
- // return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
- // }
- // }
- // else
- // {
- // return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
- // }
- //}
- //return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string WXGetPDDProductGroups(string inputData)
diff --git a/KJDService/KJD_WebService/BXXProductService.asmx.cs b/KJDService/KJD_WebService/BXXProductService.asmx.cs
index b20a349..d0a5ef0 100644
--- a/KJDService/KJD_WebService/BXXProductService.asmx.cs
+++ b/KJDService/KJD_WebService/BXXProductService.asmx.cs
@@ -325,18 +325,6 @@ namespace KJD_Web
Context.Response.End();
}
- [WebMethod]
- public void mdy_prod_sku_img_replace_id()
- {
- string jsontext = GetRequestJsonString();
-
- var result = jsontext;
- result = new BXXProductManage().MdyProdSkuImgReplaceId(jsontext);
-
- Context.Response.Write(result);
- Context.Response.End();
- }
-
[WebMethod]
public void mdy_sku_img_replace()
{
@@ -385,91 +373,6 @@ namespace KJD_Web
Context.Response.End();
}
- [WebMethod]
- public void add_user_select_product()
- {
- string jsontext = GetRequestJsonString();
-
- var result = jsontext;
- result = new BXXProductManage().AddUserSelectProduct(jsontext);
-
- Context.Response.Write(result);
- Context.Response.End();
- }
-
- [WebMethod]
- public void mdy_user_select_product_status()
- {
- string jsontext = GetRequestJsonString();
-
- var result = jsontext;
- result = new BXXProductManage().MdyUserSelectProductStatus(jsontext);
-
- Context.Response.Write(result);
- Context.Response.End();
- }
-
- [WebMethod]
- public void get_user_select_product_list()
- {
- string jsontext = GetRequestJsonString();
-
- var result = jsontext;
- result = new BXXProductManage().GetUserSelectProductList(jsontext);
-
- Context.Response.Write(result);
- Context.Response.End();
- }
-
-
- [WebMethod]
- public void admin_get_user_select_product_list()
- {
- string jsontext = GetRequestJsonString();
-
- var result = jsontext;
- result = new BXXProductManage().GetUserSelectProductList(jsontext, true);
-
- Context.Response.Write(result);
- Context.Response.End();
- }
-
- [WebMethod]
- public void del_select_product()
- {
- string jsontext = GetRequestJsonString();
-
- var result = jsontext;
- result = new BXXProductManage().DelSelectProd(jsontext);
-
- Context.Response.Write(result);
- Context.Response.End();
- }
-
- [WebMethod]
- public void set_select_product_sub_sa()
- {
- string jsontext = GetRequestJsonString();
-
- var result = jsontext;
- result = new BXXProductManage().SetSelectProductSubSa(jsontext);
-
- Context.Response.Write(result);
- Context.Response.End();
- }
-
- [WebMethod]
- public void mdy_product_select_notes()
- {
- string jsontext = GetRequestJsonString();
-
- var result = jsontext;
- result = new BXXProductManage().MdyProductSelectNotes(jsontext);
-
- Context.Response.Write(result);
- Context.Response.End();
- }
-
[WebMethod]
public void get_wx_tokens()
{
diff --git a/KJDService/KJD_WebService/KJD_WebService.csproj.user b/KJDService/KJD_WebService/KJD_WebService.csproj.user
index 4bcdc04..c789fae 100644
--- a/KJDService/KJD_WebService/KJD_WebService.csproj.user
+++ b/KJDService/KJD_WebService/KJD_WebService.csproj.user
@@ -1,4 +1,4 @@
-
+
true
diff --git a/KJDService/KJD_WebService/Model/DBProductResultParam.cs b/KJDService/KJD_WebService/Model/DBProductResultParam.cs
index 325ddc4..264167a 100644
--- a/KJDService/KJD_WebService/Model/DBProductResultParam.cs
+++ b/KJDService/KJD_WebService/Model/DBProductResultParam.cs
@@ -71,9 +71,9 @@ namespace KJD_Web.Model
///
public string sku_secret_json { get; set; }
public string wx_img_map_json { get; set; }
- public int sku_img_replace_id { get; set; }
- public string sku_img_replace_base64 { get; set; }
- public string sku_img_replace_url { get; set; }
+ //public int sku_img_replace_id { get; set; }
+ //public string sku_img_replace_base64 { get; set; }
+ //public string sku_img_replace_url { get; set; }
public string main_img { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
diff --git a/KJDService/KJD_WebService/WXOrderService.asmx.cs b/KJDService/KJD_WebService/WXOrderService.asmx.cs
index 4f889f0..5546b1c 100644
--- a/KJDService/KJD_WebService/WXOrderService.asmx.cs
+++ b/KJDService/KJD_WebService/WXOrderService.asmx.cs
@@ -128,7 +128,7 @@ namespace KJD_Web
}
///
- /// 获取中转仓订单信息
+ /// 修改中转仓物流信息
///
[WebMethod]
public void wx_update_erp_order_express()
@@ -138,6 +138,20 @@ namespace KJD_Web
var result = jsontext;
result = new WXOrderManage().WXUpdateErpOrderExpress(jsontext);
+ Context.Response.Write(result);
+ Context.Response.End();
+ }
+ ///
+ /// 修改中转仓取号状态
+ ///
+ [WebMethod]
+ public void wx_update_erp_allocated_order_no()
+ {
+ string jsontext = GetRequestJsonString();
+
+ var result = jsontext;
+ result = new WXOrderManage().WXUpdateErpAllocatedOrderNo(jsontext);
+
Context.Response.Write(result);
Context.Response.End();
}
diff --git a/PackTools/package260701wx x64.nsi b/PackTools/package260701wx x64.nsi
index 084d727..6aeaa81 100644
--- a/PackTools/package260701wx x64.nsi
+++ b/PackTools/package260701wx x64.nsi
@@ -6,7 +6,8 @@
!define PRODUCT_PUBLISHER "29¹©ӦÁ´Èí¼þÖÆ×÷×é"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\29¹©ӦÁ´.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
-!define PRODUCT_UNINST_ROOT_KEY "HKLM"
+;!define PRODUCT_UNINST_ROOT_KEY "HKLM" ;ÐèҪ¹ÜÀíԱȨÏÞ
+!define PRODUCT_UNINST_ROOT_KEY "HKCU"
!define BUILD_PATH "D:\Project\TEMU¿羳´ïºǫ́¹ÜÀí\KJD Cef138\PackTools"
!define BIN_PATH "D:\Project\TEMU¿羳´ïºǫ́¹ÜÀí\KJD Cef138\Bin"
@@ -35,7 +36,26 @@ SetCompressor lzma
; °²װ¹ý³ÌҳÃæ
!insertmacro MUI_PAGE_INSTFILES
; °²װÍê³ÉҳÃæ
-!define MUI_FINISHPAGE_RUN "$INSTDIR\29¹©ӦÁ´.exe"
+;!define MUI_FINISHPAGE_RUN "$INSTDIR\29¹©ӦÁ´.exe" ;win10ֱ½ÓÆô¶¯»á˫¿ª£¬ÒÔϸÄΪʹÓú¯ÊýÆô¶¯
+;!define MUI_FINISHPAGE_RUN "exe_file" ;ָ¶¨ҪÔËÐеĿÉִÐÐÎļþ·¾¶£¨Èç $INSTDIR\MyApp.exe£©¡£ÎļþÃûº¬¿ոñʱÎÞÐè¼ÓÒýºÅ ¡£
+;!define MUI_FINISHPAGE_RUN_TEXT "text" ;ÉèÖø´ѡ¿òÅԵÄÏÔʾÎı¾£¨ÀýÈ磺¡°Á¢¼´ÔËÐÐÎҵÄӦÓá±£©¡£
+;!define MUI_FINISHPAGE_RUN_PARAMETERS "params" ;´«ÈëÔËÐвÎÊý¡£Èô²ÎÊýº¬˫Òýºţ¬ÐèÓà \" תÒå ¡£
+;!define MUI_FINISHPAGE_RUN_NOTCHECKED ;ĬÈϲ»ѡÖиø´ѡ¿´ĬÈϲ»ÔËÐУ©¡£
+;!define MUI_FINISHPAGE_RUN_FUNCTION "func_name" ;Ìæ´úֱ½ÓÔËÐÐ exe£¬¸ÄΪµ÷ÓÃ×Զ¨Òå NSIS º¯Êý£¨´Ëʱ MUI_FINISHPAGE_RUN ¿ɲ»´ø²ÎÊý£©£¬ÊʺÏÐèִÐжಽµij¡¾° ¡£
+;ʾÀý================================================================================================================
+;!include "MUI2.nsh"
+
+;!define MUI_FINISHPAGE_RUN "$INSTDIR\MyApp.exe"
+;!define MUI_FINISHPAGE_RUN_TEXT "Æô¶¯ӦÓóÌÐò"
+;!define MUI_FINISHPAGE_RUN_PARAMETERS "/silent"
+;;!define MUI_FINISHPAGE_RUN_NOTCHECKED
+
+;!insertmacro MUI_PAGE_FINISH
+;ʾÀý½áÊø============================================================================================================
+
+!define MUI_FINISHPAGE_RUN
+;°²װº¯Êý¶¨Òå
+!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchExe"
!insertmacro MUI_PAGE_FINISH
; °²װжÔعý³ÌҳÃæ
@@ -53,7 +73,9 @@ SetCompressor lzma
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "29¹©ӦÁ´-ÐÅСµê¹ÜÀí¹¤¾ß.exe"
InstallDir "$PROGRAMFILES\29¹©ӦÁ´-ÐÅСµê¹ÜÀí¹¤¾ß"
-InstallDirRegKey HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
+;InstallDir "D:\29¹©ӦÁ´-ÐÅСµê¹ÜÀí¹¤¾ß"
+;InstallDirRegKey HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
+InstallDirRegKey HKCU "${PRODUCT_UNINST_KEY}" "UninstallString"
ShowInstDetails show
ShowUnInstDetails show
BrandingText "29¹©ӦÁ´-ÐÅСµê¹ÜÀí¹¤¾߰²װ³ÌÐò"
@@ -82,7 +104,8 @@ SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
- WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\29¹©ӦÁ´.exe"
+ ;WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\29¹©ӦÁ´.exe"
+ WriteRegStr HKCU "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\29¹©ӦÁ´.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\29¹©ӦÁ´.exe"
@@ -96,6 +119,20 @@ Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
+;functionҪд×Ösection֮ºó
+Function LaunchExe
+ ;ExecShell "" "$INSTDIR\${PRODUCT_NAME}.exe"
+ ; Æô¶¯Ö÷³ÌÐò£¬ExecWait »áµȴý³ÌÐòÆô¶¯ºóÔټÌÐø£¨ÍƼöÓÃÓÚȷ±£Æô¶¯³ɹ¦£©
+ ;ExecWait '"$INSTDIR\YourApp.exe"' // µȴýҲ¿ÉÒÔÓÃÀ´µ¯³ö±ØҪ×é¼þ°²װʱµȴý°²װÍê³ÉÔټÌÐøÔËÐа²װ³ÌÐò¡£
+ ; ÈôϣÍû°²װ³ÌÐòÁ¢¼´¹رնø²»µȴý£¬¿ÉʹÓà Exec
+ ;Exec '"$INSTDIR\29¹©ӦÁ´.exe"'
+ Exec "$INSTDIR\29¹©ӦÁ´.exe"
+ ; ÒÔÆÕͨÓû§ȨÏÞÆô¶¯³Ìдʹ°²װ°üÊǹÜÀíԱȨÏޣ©
+ ;System::Call 'shell32::ShellExecute(i 0, t"open", t"explorer.exe", t"/e,$INSTDIR\start.bat", t"", i 0)'
+ ;Exec "$INSTDIR\start.bat"
+FunctionEnd
+
+
/******************************
* ÒÔÏÂÊǰ²װ³ÌÐòµÄжÔز¿·Ö *
******************************/
@@ -131,7 +168,8 @@ Section Uninstall
RMDir /r "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
- DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
+ ;DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
+ DeleteRegKey HKCU "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd
diff --git a/TEMUKJD CEFv138.sln b/TEMUKJD CEFv138.sln
index 029eea3..703d13c 100644
--- a/TEMUKJD CEFv138.sln
+++ b/TEMUKJD CEFv138.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
-VisualStudioVersion = 16.0.32802.440
+VisualStudioVersion = 16.0.36128.20
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AllBase", "AllBase\AllBase.csproj", "{6461D807-B1C8-45F0-B388-E0CA1A418DE0}"
EndProject
@@ -19,27 +19,28 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Debug|x64.ActiveCfg = Debug|x86
- {6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Debug|x64.Build.0 = Debug|x86
+ {6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Debug|Any CPU.ActiveCfg = Debug|x64
+ {6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Debug|Any CPU.Build.0 = Debug|x64
+ {6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Debug|x64.ActiveCfg = Debug|x64
+ {6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Debug|x64.Build.0 = Debug|x64
{6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Debug|x86.ActiveCfg = Debug|x86
{6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Debug|x86.Build.0 = Debug|x86
{6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Release|Any CPU.Build.0 = Release|Any CPU
- {6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Release|x64.ActiveCfg = Release|x86
+ {6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Release|x64.ActiveCfg = Release|x64
+ {6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Release|x64.Build.0 = Release|x64
{6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Release|x86.ActiveCfg = Release|x86
{6461D807-B1C8-45F0-B388-E0CA1A418DE0}.Release|x86.Build.0 = Release|x86
- {38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Debug|x64.ActiveCfg = Debug|Any CPU
- {38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Debug|x64.Build.0 = Debug|Any CPU
+ {38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Debug|Any CPU.ActiveCfg = Debug|x64
+ {38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Debug|Any CPU.Build.0 = Debug|x64
+ {38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Debug|x64.ActiveCfg = Debug|x64
+ {38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Debug|x64.Build.0 = Debug|x64
{38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Debug|x86.ActiveCfg = Debug|x86
{38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Debug|x86.Build.0 = Debug|x86
{38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Release|Any CPU.Build.0 = Release|Any CPU
- {38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Release|x64.ActiveCfg = Release|Any CPU
- {38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Release|x64.Build.0 = Release|Any CPU
+ {38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Release|x64.ActiveCfg = Release|x64
+ {38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Release|x64.Build.0 = Release|x64
{38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Release|x86.ActiveCfg = Release|x86
{38E74D4C-2D8D-47D2-8A23-417C3C57ADE5}.Release|x86.Build.0 = Release|x86
{B8EE868D-56CD-4647-BBA5-04BEF24FF9F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -50,8 +51,8 @@ Global
{B8EE868D-56CD-4647-BBA5-04BEF24FF9F6}.Debug|x86.Build.0 = Debug|Any CPU
{B8EE868D-56CD-4647-BBA5-04BEF24FF9F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B8EE868D-56CD-4647-BBA5-04BEF24FF9F6}.Release|Any CPU.Build.0 = Release|Any CPU
- {B8EE868D-56CD-4647-BBA5-04BEF24FF9F6}.Release|x64.ActiveCfg = Release|Any CPU
- {B8EE868D-56CD-4647-BBA5-04BEF24FF9F6}.Release|x64.Build.0 = Release|Any CPU
+ {B8EE868D-56CD-4647-BBA5-04BEF24FF9F6}.Release|x64.ActiveCfg = Release|x64
+ {B8EE868D-56CD-4647-BBA5-04BEF24FF9F6}.Release|x64.Build.0 = Release|x64
{B8EE868D-56CD-4647-BBA5-04BEF24FF9F6}.Release|x86.ActiveCfg = Release|Any CPU
{B8EE868D-56CD-4647-BBA5-04BEF24FF9F6}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
diff --git a/TEMUKJD/ChangeForm.cs b/TEMUKJD/ChangeForm.cs
index 4885a4e..aa4c34e 100644
--- a/TEMUKJD/ChangeForm.cs
+++ b/TEMUKJD/ChangeForm.cs
@@ -1,15 +1,17 @@
-using System;
+using AllBase;
+using AllBase.Helper;
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
+using System.IO;
using System.Linq;
+using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
-using AllBase;
-using AllBase.Helper;
//using TemuKJD.ChatForms;
//using TemuKJD.DashBoardForms;
using TemuKJD.BaseForms;
@@ -62,6 +64,11 @@ namespace TemuKJD
pnlChat.Visible = false;
//pnlUpload_Click(null, null);
}
+ if (BaseClass.ForbiddenPage.Contains("拍单"))
+ {
+ pnlPurchase.Visible = false;
+ //pnlUpload_Click(null, null);
+ }
}
this.pnlChat.StyleMouseOver.BorderColor.Color = GlobalConfig.BorderColor;
this.pnlUploadGoods.StyleMouseOver.BorderColor.Color = GlobalConfig.BorderColor;
@@ -87,21 +94,45 @@ namespace TemuKJD
Hide();
}
+ [DllImport("user32.dll")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ static extern bool SetForegroundWindow(IntPtr hWnd);
private void panel3_Click(object sender, EventArgs e)
{
try
{
- Process p = new Process();
- p.StartInfo.FileName = "FindLittleRabbitOrder.exe";
- p.StartInfo.Arguments = BaseClass.UserName + " " + BaseClass.PassWord;
- p.StartInfo.UseShellExecute = true;
- p.StartInfo.Verb = "runas";
- p.Start();
- Process.GetCurrentProcess().Kill();
+ if (File.Exists("29WxFindOrder.exe"))
+ {
+ Process p = new Process();
+ p.StartInfo.FileName = "29WxFindOrder.exe";
+ //p.StartInfo.Arguments = "user_name:" + BaseClass.UserName + " " + "user_name:" + BaseClass.PassWord;
+ p.StartInfo.Arguments = BaseClass.UserName + " " + BaseClass.PassWord;
+ // 新版cef不能使用管理员权限启动,否则win10下会报错
+ //p.StartInfo.UseShellExecute = true;
+ p.StartInfo.UseShellExecute = false;
+ // "runas" 权限继承主程序
+ //p.StartInfo.Verb = "runas";
+
+ p.Start();
+
+ // 强制客服窗口打开时在最上层,win10可能会导致错误
+ p.WaitForInputIdle();
+ IntPtr hWnd = p.MainWindowHandle;
+ if (hWnd != IntPtr.Zero)
+ {
+ // 尝试将窗口设为最顶层窗口
+ SetForegroundWindow(hWnd);
+ }
+
+ Process.GetCurrentProcess().Kill();
+ }
+ else
+ {
+ BaseMsgForm.ShowInfo("未找到拍单程序启动文件");
+ }
}
catch
{
- BaseMsgForm.ShowInfo("未找到拍单王启动文件");
}
}
diff --git a/TEMUKJD/ChangeForm.designer.cs b/TEMUKJD/ChangeForm.designer.cs
index da6b12f..adda5e1 100644
--- a/TEMUKJD/ChangeForm.designer.cs
+++ b/TEMUKJD/ChangeForm.designer.cs
@@ -30,7 +30,7 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChangeForm));
this.panel4 = new DevComponents.DotNetBar.PanelEx();
- this.panel3 = new DevComponents.DotNetBar.PanelEx();
+ this.pnlPurchase = new DevComponents.DotNetBar.PanelEx();
this.label1 = new System.Windows.Forms.Label();
this.pnlUploadGoods = new DevComponents.DotNetBar.PanelEx();
this.panel1 = new DevComponents.DotNetBar.PanelEx();
@@ -54,19 +54,18 @@
this.panel4.Visible = false;
this.panel4.Click += new System.EventHandler(this.panel4_Click);
//
- // panel3
+ // pnlPurchase
//
- this.panel3.Cursor = System.Windows.Forms.Cursors.Hand;
- this.panel3.DisabledBackColor = System.Drawing.Color.Empty;
- this.panel3.Location = new System.Drawing.Point(44, 171);
- this.panel3.Name = "panel3";
- this.panel3.Size = new System.Drawing.Size(104, 37);
- this.panel3.Style.BackgroundImage = global::TemuKJD.Properties.Resources.choice_buyer_blast;
- this.panel3.StyleMouseOver.Border = DevComponents.DotNetBar.eBorderType.RaisedInner;
- this.panel3.StyleMouseOver.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(157)))), ((int)(((byte)(235)))));
- this.panel3.TabIndex = 2;
- this.panel3.Visible = false;
- this.panel3.Click += new System.EventHandler(this.panel3_Click);
+ this.pnlPurchase.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.pnlPurchase.DisabledBackColor = System.Drawing.Color.Empty;
+ this.pnlPurchase.Location = new System.Drawing.Point(34, 143);
+ this.pnlPurchase.Name = "pnlPurchase";
+ this.pnlPurchase.Size = new System.Drawing.Size(172, 65);
+ this.pnlPurchase.Style.BackgroundImage = global::TemuKJD.Properties.Resources.choice_buyer_blast;
+ this.pnlPurchase.StyleMouseOver.Border = DevComponents.DotNetBar.eBorderType.RaisedInner;
+ this.pnlPurchase.StyleMouseOver.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(157)))), ((int)(((byte)(235)))));
+ this.pnlPurchase.TabIndex = 2;
+ this.pnlPurchase.Click += new System.EventHandler(this.panel3_Click);
//
// label1
//
@@ -109,7 +108,7 @@
//
this.pnlExtend.Cursor = System.Windows.Forms.Cursors.Hand;
this.pnlExtend.DisabledBackColor = System.Drawing.Color.Empty;
- this.pnlExtend.Location = new System.Drawing.Point(171, 171);
+ this.pnlExtend.Location = new System.Drawing.Point(300, 128);
this.pnlExtend.Name = "pnlExtend";
this.pnlExtend.Size = new System.Drawing.Size(104, 37);
this.pnlExtend.Style.BackgroundImage = global::TemuKJD.Properties.Resources.choice_extend;
@@ -138,7 +137,7 @@
this.panel2.Controls.Add(this.pnlExtend);
this.panel2.Controls.Add(this.label1);
this.panel2.Controls.Add(this.pnlChat);
- this.panel2.Controls.Add(this.panel3);
+ this.panel2.Controls.Add(this.pnlPurchase);
this.panel2.Controls.Add(this.panel4);
this.panel2.Controls.Add(this.pnlUploadGoods);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -170,7 +169,7 @@
private DevComponents.DotNetBar.PanelEx panel1;
private DevComponents.DotNetBar.PanelEx pnlUploadGoods;
- private DevComponents.DotNetBar.PanelEx panel3;
+ private DevComponents.DotNetBar.PanelEx pnlPurchase;
private DevComponents.DotNetBar.PanelEx panel4;
private DevComponents.DotNetBar.PanelEx pnlChat;
private DevComponents.DotNetBar.PanelEx pnlExtend;
diff --git a/TEMUKJD/KJD.csproj b/TEMUKJD/KJD.csproj
index fe776df..b487916 100644
--- a/TEMUKJD/KJD.csproj
+++ b/TEMUKJD/KJD.csproj
@@ -34,7 +34,7 @@
true
- AnyCPU
+ x64
true
full
false
@@ -43,7 +43,7 @@
prompt
4
false
- true
+ false
AnyCPU
@@ -57,6 +57,26 @@
29common_icon.ico
+
+ true
+ ..\bin\
+ DEBUG;TRACE
+ full
+ AnyCPU
+ 7.3
+ prompt
+ false
+
+
+ ..\bin\
+ TRACE
+ true
+ pdbonly
+ x64
+ 7.3
+ prompt
+ true
+
..\packages\CefSharp.Common.138.0.340\lib\net462\CefSharp.dll
@@ -74,7 +94,8 @@
..\DllReference\FiddlerCore4.dll
-
+
+ False
..\DllReference\NaiBa.CefHelper.138.dll
diff --git a/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.cs b/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.cs
index 3f22c4d..d6cde18 100644
--- a/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.cs
+++ b/TEMUKJD/KJDForms/AdminForms/AdminCardCodeForm.cs
@@ -17,7 +17,7 @@ using Work;
namespace TemuKJD.KJDForms.AdminForms
{
- public partial class AdminCardCodeForm : Form
+ public partial class AdminCardCodeForm : BaseForm
{
public List lstCardCodeInfo = new List();
public AdminCardCodeForm()
diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.Designer.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.Designer.cs
index c0cd3ed..07d451b 100644
--- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.Designer.cs
+++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.Designer.cs
@@ -49,16 +49,8 @@
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label8 = new System.Windows.Forms.Label();
this.txtNotes = new DevComponents.DotNetBar.Controls.TextBoxX();
- this.pnlSkuOption = new System.Windows.Forms.Panel();
- this.label9 = new System.Windows.Forms.Label();
- this.btnBookImg = new DevComponents.DotNetBar.PanelEx();
- this.pictureBox2 = new System.Windows.Forms.PictureBox();
- this.buttonEx1 = new TemuKJD.UserControls.ButtonEx();
- this.btnSelect = new TemuKJD.UserControls.ButtonEx();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
- this.pnlSkuOption.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
this.SuspendLayout();
//
// panel2
@@ -83,7 +75,6 @@
this.panel2.Controls.Add(this.pictureBox1);
this.panel2.Controls.Add(this.label8);
this.panel2.Controls.Add(this.txtNotes);
- this.panel2.Controls.Add(this.pnlSkuOption);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(1, 33);
this.panel2.Name = "panel2";
@@ -137,7 +128,7 @@
this.txtFissionWords.Multiline = true;
this.txtFissionWords.Name = "txtFissionWords";
this.txtFissionWords.ScrollBars = System.Windows.Forms.ScrollBars.Both;
- this.txtFissionWords.Size = new System.Drawing.Size(337, 93);
+ this.txtFissionWords.Size = new System.Drawing.Size(337, 211);
this.txtFissionWords.TabIndex = 402;
this.txtFissionWords.WatermarkText = "一行一个";
//
@@ -315,95 +306,6 @@
this.txtNotes.Size = new System.Drawing.Size(337, 47);
this.txtNotes.TabIndex = 385;
//
- // pnlSkuOption
- //
- this.pnlSkuOption.Controls.Add(this.label9);
- this.pnlSkuOption.Controls.Add(this.btnBookImg);
- this.pnlSkuOption.Controls.Add(this.pictureBox2);
- this.pnlSkuOption.Controls.Add(this.buttonEx1);
- this.pnlSkuOption.Controls.Add(this.btnSelect);
- this.pnlSkuOption.Location = new System.Drawing.Point(10, 483);
- this.pnlSkuOption.Name = "pnlSkuOption";
- this.pnlSkuOption.Size = new System.Drawing.Size(417, 147);
- this.pnlSkuOption.TabIndex = 661;
- //
- // label9
- //
- this.label9.AutoSize = true;
- this.label9.Location = new System.Drawing.Point(8, 10);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(68, 17);
- this.label9.TabIndex = 404;
- this.label9.Text = "SKU替换图";
- //
- // btnBookImg
- //
- this.btnBookImg.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
- this.btnBookImg.Cursor = System.Windows.Forms.Cursors.Hand;
- this.btnBookImg.DisabledBackColor = System.Drawing.Color.Empty;
- this.btnBookImg.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnBookImg.Location = new System.Drawing.Point(332, 5);
- this.btnBookImg.Name = "btnBookImg";
- this.btnBookImg.Size = new System.Drawing.Size(85, 26);
- this.btnBookImg.Style.Alignment = System.Drawing.StringAlignment.Center;
- this.btnBookImg.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
- this.btnBookImg.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
- this.btnBookImg.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
- this.btnBookImg.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
- this.btnBookImg.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
- this.btnBookImg.Style.ForeColor.Color = System.Drawing.Color.White;
- this.btnBookImg.Style.GradientAngle = 90;
- this.btnBookImg.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
- this.btnBookImg.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
- this.btnBookImg.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
- this.btnBookImg.TabIndex = 654;
- this.btnBookImg.Text = "生成书籍图片";
- this.btnBookImg.Visible = false;
- this.btnBookImg.Click += new System.EventHandler(this.btnBookImg_Click);
- //
- // pictureBox2
- //
- this.pictureBox2.Location = new System.Drawing.Point(154, 5);
- this.pictureBox2.Name = "pictureBox2";
- this.pictureBox2.Size = new System.Drawing.Size(136, 136);
- this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
- this.pictureBox2.TabIndex = 405;
- this.pictureBox2.TabStop = false;
- this.pictureBox2.Click += new System.EventHandler(this.pictureBox2_Click);
- //
- // buttonEx1
- //
- this.buttonEx1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
- this.buttonEx1.Cursor = System.Windows.Forms.Cursors.Hand;
- this.buttonEx1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.buttonEx1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.buttonEx1.ForeColor = System.Drawing.Color.White;
- this.buttonEx1.Location = new System.Drawing.Point(79, 114);
- this.buttonEx1.Margin = new System.Windows.Forms.Padding(2);
- this.buttonEx1.Name = "buttonEx1";
- this.buttonEx1.Size = new System.Drawing.Size(70, 26);
- this.buttonEx1.TabIndex = 406;
- this.buttonEx1.Text = "上传图片";
- this.buttonEx1.UseVisualStyleBackColor = false;
- this.buttonEx1.Visible = false;
- this.buttonEx1.Click += new System.EventHandler(this.buttonEx1_Click);
- //
- // btnSelect
- //
- this.btnSelect.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
- this.btnSelect.Cursor = System.Windows.Forms.Cursors.Hand;
- this.btnSelect.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnSelect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnSelect.ForeColor = System.Drawing.Color.White;
- this.btnSelect.Location = new System.Drawing.Point(79, 5);
- this.btnSelect.Margin = new System.Windows.Forms.Padding(2);
- this.btnSelect.Name = "btnSelect";
- this.btnSelect.Size = new System.Drawing.Size(70, 26);
- this.btnSelect.TabIndex = 407;
- this.btnSelect.Text = "选择图片";
- this.btnSelect.UseVisualStyleBackColor = false;
- this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
- //
// PDDDBProdEditForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -419,9 +321,6 @@
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
- this.pnlSkuOption.ResumeLayout(false);
- this.pnlSkuOption.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
this.ResumeLayout(false);
}
@@ -444,13 +343,7 @@
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtHeadWords;
private System.Windows.Forms.Label label5;
- private System.Windows.Forms.PictureBox pictureBox2;
- private System.Windows.Forms.Label label9;
- private UserControls.ButtonEx buttonEx1;
- private UserControls.ButtonEx btnSelect;
private DevComponents.DotNetBar.PanelEx btnEditDetail;
- private DevComponents.DotNetBar.PanelEx btnBookImg;
- public System.Windows.Forms.Panel pnlSkuOption;
public System.Windows.Forms.TextBox txtExtCode;
public System.Windows.Forms.TextBox txtProductName;
public System.Windows.Forms.Label lblSkcId;
diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.cs
index 9e44b9a..4825d6a 100644
--- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.cs
+++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.cs
@@ -53,16 +53,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
if (prodTmp != null)
dbProd = prodTmp;
}
- //var prodTmp = GetProductDetail(dbProd.id.ToString());
- //dbProd.sku_img_replace_base64 = prodTmp.sku_img_replace_base64;
- //dbProd.sku_img_replace_url = prodTmp.sku_img_replace_url;
- if (!string.IsNullOrWhiteSpace(dbProd.sku_img_replace_url))
- this.pictureBox2.ImageLocation = dbProd.sku_img_replace_url;
- else if (!string.IsNullOrWhiteSpace(dbProd.sku_img_replace_base64))
- this.pictureBox2.Image = Base64ChangeImgUrl.Base64ToImage(dbProd.sku_img_replace_base64); // Convert.FromBase64String(dbProd.sku_img_replace_base64);
-
- //if (dbProd.product_get_type_text == "厂商直采" || dbProd.product_get_type_text == "微信店采")
- //btnEditDetail.Text = "查看商品SKU";
}
}
@@ -153,100 +143,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
}
- private void buttonEx1_Click(object sender, EventArgs e)
- {
- string text = "";
- OpenFileDialog openFileDialog = new OpenFileDialog();
- openFileDialog.Multiselect = false;
- // 设置过滤条件,只显示文本文件
- openFileDialog.Filter = "图片文件 (*.jpeg;*.jpg;*.png)|*.jpeg;*.jpg;*.png|All files (*.*)|*.*";
- // 显示对话框并获取结果
- if (openFileDialog.ShowDialog() == DialogResult.OK)
- {
- try
- {
- string filePath = openFileDialog.FileName;
- //using (Image image = Image.FromFile(filePath))
- //{
- // // 现在你可以使用image对象进行各种操作,比如绘制、保存等
- // //Console.WriteLine("Image loaded successfully.");
- // this.pictureBox2.Image = image;
- //}
- Image image = Image.FromFile(filePath);
- this.pictureBox2.Image = image;
-
- string imgBase64 = "";
- using (MemoryStream memoryStream = new MemoryStream())
- {
- image.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);
- byte[] imageBytes = memoryStream.ToArray();
- imgBase64 = Convert.ToBase64String(imageBytes);
- }
- string img_md5 = BaseClass.GetMd5(imgBase64);
-
- var url = BaseClass.BuildPDDObjString("product/add_sku_img_replace");
- var data = UserLogin.GetSignaturex() +
- "&product_db_id=" + dbProd.id;
- data += "&img_base64=" + imgBase64;
- data += "&img_md5=" + img_md5;
- var html = GetHtml.PostUtf8(url, data);
- if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
- html = GetHtml.PostUtf8(url, data);
- if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
- html = GetHtml.PostUtf8(url, data);
- if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
- {
- BaseMsgForm.ShowError("商品图片编辑失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg"));
- }
- else
- {
- dbProd.sku_img_replace_base64 = imgBase64;
- dbProd.sku_img_replace_id = BaseRegex.GetIntJson(ref html, "sku_img_replace_id");
- }
- }
- catch (Exception ex)
- {
- //Console.WriteLine("An error occurred: " + ex.Message);
- BaseMsgForm.ShowError("打开自定义图片失败 " + ex.Message);
- return;
- }
- }
- }
-
- private void pictureBox2_Click(object sender, EventArgs e)
- {
- ShowImgForm imgFrom = new ShowImgForm(pictureBox2.Image);
- imgFrom.ShowDialog();
- }
-
- private void btnSelect_Click(object sender, EventArgs e)
- {
- PDDDBProdImgListForm imgListForm = new PDDDBProdImgListForm("select");
- imgListForm.ShowDialog();
- if (imgListForm.SelectDbImgId > 0)
- {
- var url = BaseClass.BuildPDDObjString("product/mdy_prod_sku_img_replace_id");
- var data = UserLogin.GetSignaturex() +
- "&product_db_id=" + dbProd.id;
- data += "&img_db_id=" + imgListForm.SelectDbImgId;
- var html = GetHtml.PostUtf8(url, data);
- if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
- html = GetHtml.PostUtf8(url, data);
- if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
- html = GetHtml.PostUtf8(url, data);
- if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
- {
- BaseMsgForm.ShowError("商品图片编辑失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg"));
- }
- else
- {
- this.pictureBox2.ImageLocation = imgListForm.SelectDbImgUrl;
- dbProd.sku_img_replace_id = imgListForm.SelectDbImgId;
- dbProd.sku_img_replace_url = imgListForm.SelectDbImgUrl;
- }
- }
- }
-
private void btnEditDetail_Click(object sender, EventArgs e)
{
bool canEdit = true;
@@ -322,65 +218,5 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
editDetailForm.ShowDialog();
}
-
- private void btnBookImg_Click(object sender, EventArgs e)
- {
- var prodJson = this.dbProd.product_json;
- var prodInfo = JsonHelper.DeserializeJsonToObject(prodJson);
- if (prodInfo != null)
- {
- string publisher = "出版社:" + new List () { "技术出版社", "文化出版社", "美术出版社" }[Randomx.GetId(3)];
- string isbn = "ISBN:";
- string bookName = "书名:";
- string bookPrice = "定价:" + prodInfo.detail.sku.Max(s => s.multi_price) * 0.01;
- string author = "作者:王老师";
- string publishTime = "出版时间:" + DateTime.Now.AddMonths(-3);
- string edition = "版次:1";
- string binding = "装帧:平装";
-
- foreach (var propInfo in prodInfo.property.goods_properties)
- {
- if (propInfo.name.Contains("出版社名称"))
- publisher = "出版社:" + propInfo.values.FirstOrDefault()?.value;
- else if (propInfo.name.Contains("ISBN"))
- isbn = "ISBN:" + propInfo.values.FirstOrDefault()?.value;
- else if (propInfo.name.Contains("书名"))
- bookName = "书名:" + propInfo.values.FirstOrDefault()?.value;
- else if (propInfo.name.Contains("定价"))
- bookPrice = "定价:" + propInfo.values.FirstOrDefault()?.value;
- else if (propInfo.name.Contains("作者"))
- author = "作者:" + propInfo.values.FirstOrDefault()?.value;
- else if (propInfo.name.Contains("出版时间"))
- publishTime = "出版时间:" + propInfo.values.FirstOrDefault()?.value;
- else if (propInfo.name.Contains("版次"))
- edition = "版次:" + propInfo.values.FirstOrDefault()?.value;
- else if (propInfo.name.Contains("装帧"))
- binding = "装帧:" + propInfo.values.FirstOrDefault()?.value;
- }
-
- var bookStr = publisher + "\r\n" + "\r\n" +
- isbn + "\r\n" + "\r\n" +
- bookName + "\r\n" + "\r\n" +
- bookPrice + "\r\n" + "\r\n" +
- author + "\r\n" + "\r\n" +
- publishTime + "\r\n" + "\r\n" +
- edition + "\r\n" + "\r\n" +
- binding;
-
- var imageBg = new Bitmap(800, 800);
- using (Graphics g = Graphics.FromImage(imageBg))
- {
- g.Clear(Color.White);
- //Font font = new Font("宋体", 15, FontStyle.Bold);
- Font font = new Font("微软雅黑", 15, FontStyle.Regular);
- Brush textBrush = Brushes.Black;
- g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
- RectangleF rectF = new RectangleF(80, 80, 800 - 80, 800 - 80);
- g.DrawString(bookStr, font, textBrush, rectF);
- }
- ShowImgForm imgFrom = new ShowImgForm(imageBg);
- imgFrom.ShowDialog();
- }
- }
}
}
diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.cs
index 005dd44..066c9b3 100644
--- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.cs
+++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.cs
@@ -414,7 +414,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
if (!string.IsNullOrEmpty(cmbExportToOutServer.Text))
{
- //data += "&has_send_to_out_server=" + (cmbExportToOutServer.Text.Trim() == "是").ParseToString().ToLower();
if (cmbExportToOutServer.Text.Trim() == "是")
data += "&send_to_out_server=1";
else if (cmbExportToOutServer.Text.Trim() == "否")
@@ -422,6 +421,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
else if (cmbExportToOutServer.Text.Trim() == "导出未拉回")
data += "&send_to_out_server=2";
}
+ else
+ {
+ data += "&send_to_out_server=0,1,2";
+ }
if (cmbSourceType.Text.Trim() != "全部")
{
@@ -627,7 +630,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
PDDDBProdEditForm editForm = new PDDDBProdEditForm(dbProduct);
if (BaseClass.MainPath != "29pdd")
{
- editForm.pnlSkuOption.Visible = false;
editForm.txtProductName.ReadOnly = true;
editForm.txtExtCode.ReadOnly = true;
editForm.lblSkcId.Text = "仓库编码";
@@ -1317,19 +1319,37 @@ namespace TemuKJD.PDDForms.ProductSelectForms
void GetProdWxCat(List dbProdLst)
{
+ var taskCount = Math.Min(5, GlobalConfig.ShopLoginList.Count);
+ List tList = new List();
foreach (var prod in dbProdLst)
{
- if (cancellationTokenSource.IsCancellationRequested)
- break;
-
- Invoke(new Action(() =>
+ var t = Task.Run(() =>
{
- this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + 1);
- this.statusBar.lblTaskStatus.Text = "正在识别微信类目 " + this.statusBar.pgbTaskProgress.Value + "/" + dbProdLst.Count;
- }));
+ if (cancellationTokenSource.IsCancellationRequested)
+ return;
- var row = dgvDbProduct.Rows.Cast().FirstOrDefault(r => r.Cells["col_spu_id"].Value.ParseToString() == prod.spu_id);
- GetProdWxCat(prod, row);
+ Invoke(new Action(() =>
+ {
+ this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + 1);
+ this.statusBar.lblTaskStatus.Text = "正在识别微信类目 " + this.statusBar.pgbTaskProgress.Value + "/" + dbProdLst.Count;
+ }));
+
+ var row = dgvDbProduct.Rows.Cast().FirstOrDefault(r => r.Cells["col_spu_id"].Value.ParseToString() == prod.spu_id);
+ GetProdWxCat(prod, row);
+ });
+ tList.Add(t);
+
+ while (tList.Count >= taskCount)
+ {
+ Thread.Sleep(50);
+ tList.RemoveAll(ta => ta.IsFaulted || ta.IsCanceled || ta.IsCompleted);
+ }
+ }
+
+ while (tList.Count > 0)
+ {
+ Thread.Sleep(200);
+ tList.RemoveAll(ta => ta.IsFaulted || ta.IsCanceled || ta.IsCompleted);
}
}
@@ -1337,27 +1357,41 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
var shop = GlobalConfig.ShopLoginList.OrderBy(x => Guid.NewGuid()).FirstOrDefault();
WXShopTokenInfo token = WXDBProdUploadForm.lstWXShopTokenInfo.FirstOrDefault(t => t.shopId == shop.ShopId);
- if (token == null)
- token = new WXShopTokenInfo();
- if (token.isExpire || string.IsNullOrEmpty(token.accessToken))
+ for (int i = 0; i < 5; i++)
{
- AuthInfo auth = GlobalConfig.lstWxShopAuthInfo.FirstOrDefault(sa => sa.ShopId == shop.ShopId);
- //if (auth != null && auth.ExpiresTime > DateTime.Now.AddMinutes(5))
+ if (token == null)
+ token = new WXShopTokenInfo();
+ if (token.isExpire || string.IsNullOrEmpty(token.accessToken))
{
- token = new WxApiBLL().GetShopWxToken(shop);
-
- if (!string.IsNullOrEmpty(token.accessToken))
+ AuthInfo auth = GlobalConfig.lstWxShopAuthInfo.FirstOrDefault(sa => sa.ShopId == shop.ShopId);
+ //if (auth != null && auth.ExpiresTime > DateTime.Now.AddMinutes(5))
{
- WXDBProdUploadForm.lstWXShopTokenInfo.RemoveAll(t => t.shopId == shop.ShopId);
- WXDBProdUploadForm.lstWXShopTokenInfo.Add(token);
- NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_shop_token_list", WXDBProdUploadForm.lstWXShopTokenInfo);
+ token = new WxApiBLL().GetShopWxToken(shop);
+
+ if (!string.IsNullOrEmpty(token.accessToken))
+ {
+ WXDBProdUploadForm.lstWXShopTokenInfo.RemoveAll(t => t.shopId == shop.ShopId);
+ WXDBProdUploadForm.lstWXShopTokenInfo.Add(token);
+ NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_shop_token_list", WXDBProdUploadForm.lstWXShopTokenInfo);
+ }
}
}
+ // 如果店铺token不可用,随机获取一个上传图片的accessToken
+ if (token == null || token.isExpire || string.IsNullOrEmpty(token.accessToken))
+ {
+ // 获取微信accessToken
+ //token = new WxApiBLL().GetRandomWxToken();
+
+ shop = GlobalConfig.ShopLoginList.OrderBy(x => Guid.NewGuid()).FirstOrDefault();
+ token = WXDBProdUploadForm.lstWXShopTokenInfo.FirstOrDefault(t => t.shopId == shop.ShopId);
+ continue;
+ }
+ else
+ {
+ break;
+ }
}
- // 如果店铺token不可用,随机获取一个上传图片的accessToken
- if (token == null || token.isExpire || string.IsNullOrEmpty(token.accessToken))
- // 获取微信accessToken
- token = new WxApiBLL().GetRandomWxToken();
+
try
{
JObject obj = new JObject();
@@ -1657,7 +1691,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
row.Cells["colMainCate"].Value = mainCatName;
row.Cells["col_cat_name"].Value = catName;
- row.Cells["colCatBound"].Value = GlobalConfig.WxCatBoundList.FirstOrDefault(cb => cb.leaf_id == dbProd.wx_cat_leaf)?.cat_bound;
+ if (row.Cells.Cast().FirstOrDefault(c => c.OwningColumn.Name == "colCatBound") is DataGridViewCell boundCell)
+ boundCell.Value = GlobalConfig.WxCatBoundList.FirstOrDefault(cb => cb.leaf_id == dbProd.wx_cat_leaf)?.cat_bound;
}));
}
}
diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadForm.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadForm.cs
index 7ecfc30..8307ac8 100644
--- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadForm.cs
+++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadForm.cs
@@ -874,12 +874,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
if (kjdDbProd?.id == 0)
{
prod.status = "已清除";
- //var empty_url = BaseClass.BuildObjString("product/mdy_user_select_product_status");
- //var empty_data = UserLogin.GetSignaturex() +
- // "&select_add_time=" + prod.add_time.ToString("yyyy-MM-dd HH:mm:ss") +
- // "&db_id=" + prod.id +
- // "&status=已清除";
- //GetHtml.PostUtf8(empty_url, empty_data);
}
Invoke(new Action(() =>
diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadSelectCacheForm.Designer.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadSelectCacheForm.Designer.cs
index b338359..d219d58 100644
--- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadSelectCacheForm.Designer.cs
+++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadSelectCacheForm.Designer.cs
@@ -39,6 +39,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.dgvSelectProduct = new TemuKJD.UserComponent.DataGridViewEx();
this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colId = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.colGetType = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSpuId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colProductSkcPic = new System.Windows.Forms.DataGridViewImageColumn();
@@ -143,6 +144,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.dgvSelectProduct.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colCheck,
this.colId,
+ this.colGetType,
this.colSpuId,
this.colImgUrl,
this.colProductSkcPic,
@@ -154,6 +156,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ColDelete});
this.dgvSelectProduct.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvSelectProduct.Location = new System.Drawing.Point(5, 0);
+ this.dgvSelectProduct.MultiSelectCheckBox = true;
this.dgvSelectProduct.Name = "dgvSelectProduct";
this.dgvSelectProduct.ReadOnly = true;
this.dgvSelectProduct.RowTemplate.Height = 23;
@@ -178,6 +181,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colId.ReadOnly = true;
this.colId.Width = 45;
//
+ // colGetType
+ //
+ this.colGetType.HeaderText = "来源";
+ this.colGetType.Name = "colGetType";
+ this.colGetType.ReadOnly = true;
+ this.colGetType.Visible = false;
+ //
// colSpuId
//
this.colSpuId.HeaderText = "商品ID";
@@ -243,14 +253,15 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ColDelete.ReadOnly = true;
this.ColDelete.Width = 75;
//
- // PDDDBProdUserSelectCacheForm
+ // PDDDBProdUploadSelectCacheForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1112, 600);
this.Controls.Add(this.splitContainer1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.Name = "PDDDBProdUserSelectCacheForm";
+ this.KeyPreview = true;
+ this.Name = "PDDDBProdUploadSelectCacheForm";
this.Text = "待上传商品";
this.TitleText = "待上传商品";
this.Load += new System.EventHandler(this.PDDDBProdUserSelectCacheForm_Load);
@@ -275,6 +286,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private DevComponents.DotNetBar.PanelEx btnClearDgv;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck;
private System.Windows.Forms.DataGridViewTextBoxColumn colId;
+ private System.Windows.Forms.DataGridViewTextBoxColumn colGetType;
private System.Windows.Forms.DataGridViewLinkColumn colSpuId;
private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colProductSkcPic;
diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadSelectCacheForm.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadSelectCacheForm.cs
index 3f24007..88c602b 100644
--- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadSelectCacheForm.cs
+++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadSelectCacheForm.cs
@@ -29,6 +29,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private void PDDDBProdUserSelectCacheForm_Load(object sender, EventArgs e)
{
+ if (BaseClass.UserName == "15288888888")
+ {
+ dgvSelectProduct.Columns["colGetType"].Visible = true;
+ }
if (BaseClass.MainPath == "29pdd")
{
dgvSelectProduct.Columns["colBound"].Visible = false;
@@ -45,6 +49,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
int rowIndex = this.dgvSelectProduct.Rows.Add(
false,
prodSelect.id,
+ prodSelect.product_get_type_text,
BaseClass.SaLevel > 0 ? prodSelect.spu_id : prodSelect.spu_id.ParseToString().GetHashCode().ParseToString().Trim('-'),
prodSelect.main_img,
DataGridViewExtension.defaultBitmap,
diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadSelectCacheForm.resx b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadSelectCacheForm.resx
index a066be7..0bc9aec 100644
--- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadSelectCacheForm.resx
+++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUploadSelectCacheForm.resx
@@ -123,6 +123,9 @@
True
+
+ True
+
True
diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopBrowserObject.cs b/TEMUKJD/PDDForms/ShopForms/PDDShopBrowserObject.cs
index 2aa05dc..4580dec 100644
--- a/TEMUKJD/PDDForms/ShopForms/PDDShopBrowserObject.cs
+++ b/TEMUKJD/PDDForms/ShopForms/PDDShopBrowserObject.cs
@@ -565,171 +565,6 @@ namespace TemuKJD.PDDForms.ShopForms
return "";
}
- ///
- /// 第三方获取商品并直接提交到第三方待上传列表
- ///
- ///
- ///
- ///
- public string getThirdProduct(string sProdId, string supplierId)
- {
- var prodId = sProdId.ParseToLong();
- if (prodId <= 0)
- {
- BaseMsgForm.ShowError("商品Id不存在!");
- return "failed";
- }
- var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == supplierId.ParseToString());
- if (string.IsNullOrEmpty(supplierId) || shop == null)
- {
- BaseMsgForm.ShowError("店铺不存在!");
- return "failed";
- }
-
- Task.Run(() =>
- {
- try
- {
- var sourceShop = shop;
- var sourceProdId = prodId;
- string success_err_msg = "";
- string errorMsg = "";
- var html = GetPddProdCommitId(sourceShop, sourceProdId.ToString());
- if (!html.Contains("\"success\":true") || !html.Contains("\"result\""))
- {
- var errMsg = BaseRegex.GetStringJson(ref html, "error_msg");
- if (string.IsNullOrEmpty(errMsg))
- errMsg = html;
- OnInfoReceived("商品获取失败!" + errMsg);
- return;
- }
- var commitId = BaseRegex.GetStringJson(ref html, "goods_commit_id");
- if (string.IsNullOrEmpty(commitId))
- {
- OnInfoReceived("商品获取失败!商品提交编号获取失败!");
- return;
- }
- html = GetPddProdDetail(sourceShop, sourceProdId.ToString(), commitId);
-
- JObject obj = JObject.Parse(html);
- var result = JsonHelper.SerializeObject(obj["result"]);
- var sizeRst = "";
- PDDProductDetailInfo product = JsonHelper.DeserializeJsonToObject(result);
- if (product == null)
- {
- OnInfoReceived("商品获取失败!商品数据格式获取失败!");
- return;
- }
-
- //拼多多暂时注释尺码
- //if (product.sizeTemplateId > 0)
- //{
- // html = SizeSpecQuery(sourceShop, sourceProdId.ToString(), product.sizeTemplateId.ToString());
- // if (!html.Contains("\"success\":true"))
- // {
- // success_err_msg += " 尺码表获取失败!" + BaseRegex.GetStringJson(ref html, "errorMsg");
- // }
- // else
- // {
- // obj = JObject.Parse(html);
- // sizeRst = JsonHelper.SerializeObject(obj["result"]);
- // }
- //}
-
- List shopLst = new List();
- PDDShopListForm.Instance.Invoke(new Action(() =>
- {
- PDDThirdProdSelectAddShopForm shopForm = new PDDThirdProdSelectAddShopForm();
- shopForm.ShowDialog();
- shopLst.AddRange(shopForm.lstSelectShop);
- }));
- if (shopLst.Count == 0)
- {
- OnInfoReceived("库存上传操作取消或未选择上传店铺!");
- return;
- }
-
- string main_img = "";
- //if (string.IsNullOrEmpty(main_img))
- // main_img = product.image_url;
- //if (string.IsNullOrEmpty(main_img))
- // main_img = product.hd_thumb_url;
- //if (string.IsNullOrEmpty(main_img))
- // main_img = product.thumb_url;
- if (string.IsNullOrEmpty(main_img))
- main_img = (product.galleries?.FirstOrDefault(img => img.type == 1)?.url).ParseToString();
- if (string.IsNullOrEmpty(main_img))
- main_img = (product.galleries?.FirstOrDefault()?.url).ParseToString();
- var url = BaseClass.BuildObjString("product_third/add_product");
- var data = UserLogin.GetSignaturex() +
- "&from_shop_id=" + shop.ShopId +
- "&spu_id=" + product.goods_id.ParseToString() +
- "&skc_id=" + product.goods_id.ParseToString() +
- "&cat_id=" + (product.cat_id).ParseToString() +
- "&cat_name=" + HttpUtility.UrlEncode((product.cats?.LastOrDefault(c => !string.IsNullOrEmpty(c))).ParseToString(), Encoding.UTF8) +
- "&ext_code=" + HttpUtility.UrlEncode(product.out_goods_sn, Encoding.UTF8) +
- "&product_name=" + HttpUtility.UrlEncode(product.goods_name, Encoding.UTF8) +
- "&product_json=" + HttpUtility.UrlEncode(result, Encoding.UTF8) +
- "&size_json=" + HttpUtility.UrlEncode(sizeRst, Encoding.UTF8) +
- "&main_img=" + HttpUtility.UrlEncode(main_img, Encoding.UTF8);
- html = GetHtml.PostUtf8(url, data);
- //if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
- // html = GetHtml.PostUtf8(url, data);
- //if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
- // html = GetHtml.PostUtf8(url, data);
- if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
- {
- errorMsg = "库存商品保存失败!请检查网络连接:" +
- BaseRegex.GetStringJson(ref html, "msg").ParseToString().Replace("'", "\\'").Replace("\"", "\\\"");
- }
- var id = BaseRegex.GetLongJson(ref html, "id");
- if (id == 0)
- goto end;
-
- foreach (var addProdShop in shopLst)
- {
- url = BaseClass.BuildObjString("product_third/add_user_select_product");
- data = UserLogin.GetSignaturex() +
- "&out_product_id=" + id +
- "&shop_id=" + addProdShop.ShopId +
- "&shop_account=" + addProdShop.ShopAccount +
- "&main_user_name=" + addProdShop.UserName +
- "&sub_user_name=" + addProdShop.SubUserName +
- "&add_product_remaining=" + addProdShop.AddProductRemaining +
- "&status=待上传";
- html = GetHtml.PostUtf8(url, data);
- if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
- html = GetHtml.PostUtf8(url, data);
- if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
- html = GetHtml.PostUtf8(url, data);
- if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
- {
- errorMsg += product?.goods_id + " " + BaseRegex.GetStringJson(ref html, "msg") + "; ";
- }
- else
- {
- addProdShop.AddProductRemaining = addProdShop.AddProductRemaining - 1;
- }
- }
- end:;
- if (!string.IsNullOrEmpty(errorMsg))
- {
- OnInfoReceived(errorMsg);
- }
- else
- {
- OnInfoReceived("库存上传保存成功!" + success_err_msg);
- }
- }
- catch (Exception ex)
- {
- OnInfoReceived("发生错误:" + ex.Message);
- }
- });
-
- return "success";
- }
-
TemuCat GetCat(TemuDetailProductInfo product)
{
if (product == null)
diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.cs b/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.cs
index c59f7da..7459ba1 100644
--- a/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.cs
+++ b/TEMUKJD/PDDForms/ShopForms/PDDShopLoginForm.cs
@@ -564,47 +564,6 @@ namespace TemuKJD.PDDForms.ShopForms
sb.Append("CefSharp.BindObjectAsync('shopObj');");
sb.Append("})();");
cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sb.ToString());
-
- // 库存上传按钮 pdd不需要
- if (1 == 2 && currentUrl.StartsWith("https://mms.pinduoduo.com/goods/goods_list"))
- {
- Task.Run(() => {
- string sAddInputJs = @"
- document.addEventListener('wheel', function(event) {
- // 检查滚动方向
- //if (event.deltaY < 0) {
- // console.log('向上滚动');
- //} else {
- // console.log('向下滚动');
- //}
- // 或者使用 event.deltaX 来检查水平滚动
- //if (event.deltaX < 0) {
- // console.log('向左滚动');
- //} else if (event.deltaX > 0) {
- // console.log('向右滚动');
- //}
-
- // 阻止默认的滚动行为(如果有需要)
- //event.preventDefault();
-
- addGetProdButton();
- });
- addGetProdButton();
-
- function addGetProdButton() {
- var productLst = document.getElementsByClassName('goods-id');
- for(i=0; i= 0) {
- var sSpuId = addBtnItem.innerText.replace('\r','').replace('\n','').replace('ID: ', '');
- addBtnItem.outerHTML = addBtnItem.outerHTML.replace("""");
- }
- }
- }";
- cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sAddInputJs);
- });
- }
}
//public Func
pdbonly
@@ -40,7 +41,7 @@
true
- bin\x64\Debug\
+ ..\bin\
DEBUG;TRACE
full
x64
@@ -48,7 +49,7 @@
MinimumRecommendedRules.ruleset
- bin\x64\Release\
+ ..\bin\
TRACE
true
pdbonly