diff --git a/AllBase/AllBase.csproj b/AllBase/AllBase.csproj
index ed9fa38..8511dd9 100644
--- a/AllBase/AllBase.csproj
+++ b/AllBase/AllBase.csproj
@@ -190,6 +190,7 @@
+
@@ -253,6 +254,8 @@
+
+
diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs
index e919ec3..5e1576b 100644
--- a/AllBase/BaseClass.cs
+++ b/AllBase/BaseClass.cs
@@ -27,7 +27,7 @@ namespace AllBase
///
/// 版本ID
///
- public static int VersionCount = 801;
+ public static int VersionCount = 806;
//public static int VersionCount = 613;
///
diff --git a/AllBase/Helper/GlobalConfig.cs b/AllBase/Helper/GlobalConfig.cs
index b12f5db..b469ae0 100644
--- a/AllBase/Helper/GlobalConfig.cs
+++ b/AllBase/Helper/GlobalConfig.cs
@@ -3,6 +3,7 @@ using AllBase.Model.Param.ProductManage;
using AllBase.Model.Param.ShopManage;
using AllBase.Model.Param.TemuProductManage;
using AllBase.Model.Result;
+using AllBase.Model.Result.WXResult;
using NaiBa.Util;
using System;
using System.Collections.Generic;
@@ -18,6 +19,9 @@ namespace AllBase.Helper
/// 店铺列表
///
public static ConcurrentList ShopLoginList { get; set; } = new ConcurrentList();
+
+ public static ConcurrentList WxTokenList { get; set; } = new ConcurrentList();
+ public static ConcurrentList WxCatList { get; set; } = new ConcurrentList();
///
/// 店铺设置参数
///
diff --git a/AllBase/Model/Param/OutServerGoodsParam.cs b/AllBase/Model/Param/OutServerGoodsParam.cs
new file mode 100644
index 0000000..fe4ca32
--- /dev/null
+++ b/AllBase/Model/Param/OutServerGoodsParam.cs
@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AllBase.Model.Param
+{
+ ///
+ /// 从供应商网站采集后保存到外部服务器的产品数据格式
+ ///
+ public class OutServerGoodsParam
+ {
+ ///
+ /// 仓库商品ID
+ ///
+ public string warehouseGoodsId { get; set; } // "46251545HSISG656DF89D",
+ ///
+ /// 仓库资料编码
+ ///
+ public string spuCode { get; set; } // "85295413687",
+ ///
+ /// 商品标题
+ ///
+ public string title { get; set; } // "帆布包女大容量通勤手提拉链袋可折叠购物袋帆布袋文艺百搭",
+ ///
+ /// 商品副标题
+ ///
+ public string subTitle { get; set; } // "帆布包女大容量通勤手提拉链袋可折叠购物袋帆布袋文艺百搭",
+ ///
+ /// 商品主图
+ ///
+ public string headImg { get; set; } // "https://images-1259706103.cos.ap-nanjing.myqcloud.com/20251019/068bb3c355a583c33c0bb41f7d1ae740.jpg",
+ ///
+ /// 商品主图列表
+ ///
+ public string headImgs { get; set; } // "[\"https://images-1259706103.cos.ap-nanjing.myqcloud.com/20251019/068bb3c355a583c33c0bb41f7d1ae740.jpg\",\"https://images-1259706103.cos.ap-nanjing.myqcloud.com/20251019/0d1f5a11791e3c5903b708677b307624.jpeg\",\"https://images-1259706103.cos.ap-nanjing.myqcloud.com/20251019/624299b9363b393f1febc89f8219991f.jpg\",\"https://images-1259706103.cos.ap-nanjing.myqcloud.com/20251019/8d18cfc34b68f3b8183f1825c1249e1d.jpg\",\"https://images-1259706103.cos.ap-nanjing.myqcloud.com/20251019/7795ba1aedcee0a1b88ec4c622e5d3ad.jpg\"]",
+ ///
+ /// 商品详情文字描述
+ ///
+ public string descText { get; set; } // null,
+ ///
+ /// 商品详情图片(列表)
+ ///
+ public string descImgs { get; set; } // "[\"https://images-1259706103.cos.ap-nanjing.myqcloud.com/20251019/2b11d434705d01c9e68653ae68772a08.jpg\",\"https://images-1259706103.cos.ap-nanjing.myqcloud.com/20251019/bfaf9b80f70ee98ed1fd0ca50a3102f2.jpg\",\"https://images-1259706103.cos.ap-nanjing.myqcloud.com/20251019/feca6e9e1aed5c958b7c3ae11ba448d4.jpg\",\"https://images-1259706103.cos.ap-nanjing.myqcloud.com/20251019/fcaa5015cfd304f9ed409270c836b9ae.jpg\",\"https://images-1259706103.cos.ap-nanjing.myqcloud.com/20251019/859603a9a322fa61dcaef33076089e16.png\"]",
+ ///
+ /// 类目ID
+ ///
+ public string categoryId { get; set; } // "",
+ ///
+ /// 备注
+ ///
+ public string remark { get; set; } // "",
+ ///
+ /// 状态1销售中2已下架
+ ///
+ public int? status { get; set; } = 1;
+ ///
+ /// 扩展状态:0-待完善,1-其他(有ext数据填写1)
+ ///
+ public int? ext_status { get; set; } = 0;
+ ///
+ /// 供应商
+ ///
+ public string supplier { get; set; } // "广如供应链",
+ ///
+ /// 供应商ID
+ ///
+ public string supplierId { get; set; } // "110",
+ ///
+ /// 创建人
+ ///
+ public string createBy { get; set; } // "",
+ public string createTime { get; set; } // "2025-10-19 22:35:28",
+ public string updateBy { get; set; } // null,
+ public string updateTime { get; set; } // null,
+ ///
+ /// 0正常 1删除
+ ///
+ public int? isDelete { get; set; } = 0;
+ ///
+ /// 发货类型10自营发货20供应商发货
+ ///
+ public int? shipType { get; set; } = 20;
+ ///
+ /// 仓库编号
+ ///
+ public string warehouseNum { get; set; } // "11625838",
+ ///
+ /// 商户ID
+ ///
+ public string merchantId { get; set; } // "10",
+ public string platformCode { get; set; } // "WEISHOP",
+ }
+}
diff --git a/AllBase/Model/Result/KJDDBProduct.cs b/AllBase/Model/Result/KJDDBProduct.cs
index f4698c0..b70e240 100644
--- a/AllBase/Model/Result/KJDDBProduct.cs
+++ b/AllBase/Model/Result/KJDDBProduct.cs
@@ -22,6 +22,10 @@ namespace AllBase.Model.Result
public string cat_id { get; set; }
public string main_cat_name { get; set; }
public string cat_name { get; set; }
+ public long? wx_cat_1 { get; set; }
+ public long? wx_cat_2 { get; set; }
+ public long? wx_cat_3 { get; set; }
+ public long? wx_cat_leaf { get; set; }
///
/// 拼多多母店价格
///
diff --git a/AllBase/Model/Result/WXResult/WXShopTokenInfo.cs b/AllBase/Model/Result/WXResult/WXShopTokenInfo.cs
new file mode 100644
index 0000000..6d1b7f7
--- /dev/null
+++ b/AllBase/Model/Result/WXResult/WXShopTokenInfo.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AllBase.Model.Result.WXResult
+{
+ public class WXShopTokenInfo
+ {
+ public string shopId { get; set; } // "1960967267443618234",
+ public string shopName { get; set; } // "夜笙供应链",
+ public int? type { get; set; } // 500,
+ public int? markupRate { get; set; } // 10,
+ public string accessToken { get; set; } // "100_cw6r7-hhGaLKG7ndv558eO_3z3-5PokAG8d0Y1vc3Rczd3FuIqkefdaqVj5CNtkCYtMbTYvhnwJ7-JkBVQVe9nE0KK5SBI8AlfA7E0_sTtqcwMqKAXoCj1X4h3sjZIMX84dboC-PfzlI0wh0ADHeAHDSVZ"
+ public DateTime mdyTime { get; set; }
+ public bool isExpire { get { return mdyTime.AddMinutes(115) < DateTime.Now; } }
+
+ }
+}
diff --git a/AllBase/Model/Result/WXResult/WxCatInfo.cs b/AllBase/Model/Result/WXResult/WxCatInfo.cs
new file mode 100644
index 0000000..5fa7d06
--- /dev/null
+++ b/AllBase/Model/Result/WXResult/WxCatInfo.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AllBase.Model.Result.WXResult
+{
+ public class WxCatInfo
+ {
+ public string cat_id { get; set; } // "545263",
+ public string name { get; set; } // "防晒面罩/防晒口罩/脸基尼",
+ public string f_cat_id { get; set; } // "10000189",
+ public int level { get; set; } // 3,
+ public bool leaf { get; set; } // true,
+ public bool is_local_life { get; set; } // false
+ }
+}
diff --git a/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs b/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs
index 676493e..1242929 100644
--- a/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs
+++ b/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs
@@ -3,6 +3,8 @@ using KJD_Web.Model.ShopModel;
using KJD_Web.Utils;
using MySql.Data.MySqlClient;
using NaiBa.Util.Extension;
+using NaiBa.Util.Helper;
+using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -30,6 +32,7 @@ namespace KJD_Web.BLL.BXX
string offline_supplier_id = RegexUtils.GetStringQuery(ref inputData, "offline_supplier_id")?.Replace("'", "\\'");
string offline_supplier_name = RegexUtils.GetStringQuery(ref inputData, "offline_supplier_name")?.Replace("'", "\\'");
string spu_id = RegexUtils.GetStringQuery(ref inputData, "spu_id")?.Replace("'", "\\'");
+ //厂商直采微信商品使用skcid存储coid数据
string skc_id = RegexUtils.GetStringQuery(ref inputData, "skc_id")?.Replace("'", "\\'");
string price_text = RegexUtils.GetStringQuery(ref inputData, "price_text")?.Replace("'", "\\'");
string main_cat_id = RegexUtils.GetStringQuery(ref inputData, "main_cat_id")?.Replace("'", "\\'");
@@ -38,8 +41,8 @@ namespace KJD_Web.BLL.BXX
string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name"))?.Replace("'", "\\'");
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"))?.Replace("'", "\\'");
string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name"))?.Replace("'", "\\'");
- string product_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_json"))?.Replace("'", "\\'");
- string size_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "size_json"))?.Replace("'", "\\'");
+ string product_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_json"));
+ string size_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "size_json"));
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img"))?.Replace("'", "\\'");
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'");
string product_get_type = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_get_type"))?.Replace("'", "\\'");
@@ -70,11 +73,15 @@ namespace KJD_Web.BLL.BXX
"add_time,mdy_time) " +
"values ('" + from_shop_id + "','" + from_shop_name + "','" + offline_supplier_id + "','" + offline_supplier_name + "','" + spu_id + "','" +
skc_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 + "','" +
+ ext_code + "','" + main_img + "',@product_json,@size_json,'" + notes + "','" + product_get_type + "','" +
sale_count + "','" + sale_count_text + "','" + special_prod_type + "'," + distribution_set.ParseToInt() + ",'" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
- var rst = mySql.ExecuteNonQuery(sql);
+
+ List paramLst = new List();
+ paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_json", Value = product_json, });
+ paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "size_json", Value = size_json, });
+ var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
@@ -112,8 +119,8 @@ namespace KJD_Web.BLL.BXX
string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name"))?.Replace("'", "\\'");
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"))?.Replace("'", "\\'");
string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name"))?.Replace("'", "\\'");
- string product_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_json"))?.Replace("'", "\\'");
- string size_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "size_json"))?.Replace("'", "\\'");
+ string product_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_json"));
+ string size_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "size_json"));
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img"))?.Replace("'", "\\'");
string group = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "group"))?.Replace("'", "\\'");
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'");
@@ -121,7 +128,10 @@ namespace KJD_Web.BLL.BXX
string sale_count_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sale_count_text"))?.Replace("'", "\\'");
string wx_safe_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_safe_status"))?.Replace("'", "\\'");
string special_prod_type = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "special_prod_type"))?.Replace("'", "\\'");
- string wx_cate = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_cate"))?.Replace("'", "\\'");
+ string wx_cat_1 = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_cat_1"))?.Replace("'", "\\'");
+ string wx_cat_2 = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_cat_2"))?.Replace("'", "\\'");
+ string wx_cat_3 = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_cat_3"))?.Replace("'", "\\'");
+ string wx_cat_leaf = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_cat_leaf"))?.Replace("'", "\\'");
string delivery_fee_set = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "delivery_fee_set"))?.Replace("'", "\\'");
string after_sale_set = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "after_sale_set"))?.Replace("'", "\\'");
string distribution_set = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "distribution_set"))?.Replace("'", "\\'");
@@ -161,9 +171,9 @@ namespace KJD_Web.BLL.BXX
if (main_img != null)
sql += " p.main_img='" + main_img + "',";
if (product_json != null)
- sql += " p.product_json='" + product_json + "',";
+ sql += " p.product_json=@product_json,";
if (size_json != null)
- sql += " p.size_json='" + size_json + "',";
+ sql += " p.size_json=@size_json,";
if (group != null)
sql += " p.group='" + group + "',";
if (notes != null)
@@ -176,8 +186,14 @@ namespace KJD_Web.BLL.BXX
sql += " p.wx_safe_status='" + wx_safe_status + "',";
if (special_prod_type != null && special_prod_type != "")
sql += " p.special_prod_type='" + special_prod_type + "',";
- if (wx_cate != null)
- sql += " p.wx_cate='" + wx_cate + "',";
+ if (wx_cat_1 != null)
+ sql += " p.wx_cat_1=" + wx_cat_1 + ",";
+ if (wx_cat_2 != null)
+ sql += " p.wx_cat_2=" + wx_cat_2 + ",";
+ if (wx_cat_3 != null)
+ sql += " p.wx_cat_3=" + wx_cat_3 + ",";
+ if (wx_cat_leaf != null)
+ sql += " p.wx_cat_leaf=" + wx_cat_leaf + ",";
if (delivery_fee_set != null)
sql += " p.delivery_fee_set='" + delivery_fee_set + "',";
if (after_sale_set != null)
@@ -187,7 +203,12 @@ namespace KJD_Web.BLL.BXX
sql += " p.mdy_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
sql = sql.TrimEnd(',');
sql += " where spu_id='" + spu_id + "';";
- var rst = mySql.ExecuteNonQuery(sql);
+
+ List paramLst = new List();
+ paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_json", Value = product_json, });
+ paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "size_json", Value = size_json, });
+
+ var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
@@ -230,6 +251,7 @@ namespace KJD_Web.BLL.BXX
var wx_safe_status = RegexUtils.GetStringQuery(ref inputData, "wx_safe_status")?.Replace("'", "\\'");
var special_prod_type = RegexUtils.GetStringQuery(ref inputData, "special_prod_type")?.Replace("'", "\\'");
var is_supplier_prod_ok = RegexUtils.GetStringQuery(ref inputData, "is_supplier_prod_ok")?.Replace("'", "\\'");
+ var has_wx_cat = RegexUtils.GetStringQuery(ref inputData, "has_wx_cat")?.Replace("'", "\\'");
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
@@ -267,13 +289,20 @@ namespace KJD_Web.BLL.BXX
where += " and p.group like '%" + search_group + "%'";
if (!string.IsNullOrWhiteSpace(search_notes))
where += " and p.notes like '%" + search_notes + "%'";
+ if (!string.IsNullOrEmpty(has_wx_cat))
+ {
+ if (has_wx_cat == "true")
+ where += " and wx_cat_leaf is NOT NULL";
+ else
+ where += " and wx_cat_leaf is NULL";
+ }
// 供应商货源是否已完成初始设置
if (!string.IsNullOrEmpty(is_supplier_prod_ok))
{
if (is_supplier_prod_ok == "1" || is_supplier_prod_ok == "已设置")
- where += " and wx_cate!='' and delivery_fee_set=1 and after_sale_set=1 and distribution_set=1";
+ where += " and wx_cat_leaf IS NOT NULL and send_to_out_server=1 and delivery_fee_set=1 and after_sale_set=1 and distribution_set=1";
else
- where += " and (wx_cate='' or delivery_fee_set=0 or after_sale_set=0 or distribution_set=0)";
+ 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)";
}
sql += where;
@@ -294,7 +323,8 @@ namespace KJD_Web.BLL.BXX
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_cate," +
+ " 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," +
" 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" +
@@ -303,7 +333,8 @@ namespace KJD_Web.BLL.BXX
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,p.wx_safe_status,p.sale_count,p.sale_count_text,p.special_prod_type,p.from_shop_name,p.wx_cate" +
+ " 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" +
" 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" +
@@ -341,7 +372,10 @@ namespace KJD_Web.BLL.BXX
spu_id = row["spu_id"].ToString(),
cat_id = row["cat_id"].ToString(),
cat_name = row["cat_name"].ToString(),
- wx_cate = row["wx_cate"].ToString(),
+ wx_cat_1 = row["wx_cat_1"].ToString(),
+ wx_cat_2 = row["wx_cat_2"].ToString(),
+ wx_cat_3 = row["wx_cat_3"].ToString(),
+ wx_cat_leaf = row["wx_cat_leaf"].ToString(),
product_name = row["product_name"].ToString(),
main_img = row["main_img"].ToString(),
ext_code = row["ext_code"].ToString(),
@@ -661,9 +695,9 @@ namespace KJD_Web.BLL.BXX
if (!string.IsNullOrEmpty(is_supplier_prod_ok))
{
if (is_supplier_prod_ok == "1" || is_supplier_prod_ok == "已设置")
- where += " and wx_cate!='' and delivery_fee_set=1 and after_sale_set=1 and distribution_set=1";
+ where += " and wx_cat_leaf IS NOT NULL and send_to_out_server=1 and delivery_fee_set=1 and after_sale_set=1 and distribution_set=1";
else
- where += " and (wx_cate='' or delivery_fee_set=0 or after_sale_set=0 or distribution_set=0)";
+ 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)";
}
sql += where;
@@ -677,8 +711,10 @@ namespace KJD_Web.BLL.BXX
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.group,p.notes,p.add_time,p.mdy_time,p.select_total_count,p.product_get_type,p.sale_count,p.sale_count_text," +
- "p.fission_words,p.head_words,p.end_words,p.wx_safe_status,p.special_prod_type from bxx.product p where p.is_del=0";
+ " p.product_name,p.main_img,p.group,p.notes,p.add_time,p.mdy_time,p.select_total_count,p.product_get_type,p.sale_count,p.sale_count_text," +
+ " p.fission_words,p.head_words,p.end_words,p.wx_safe_status,p.special_prod_type,p.wx_cat_1,p.wx_cat_2,p.wx_cat_3," +
+ " p.wx_cat_leaf" +
+ " from bxx.product p where p.is_del=0";
//where子句
sql += where;
@@ -706,6 +742,10 @@ namespace KJD_Web.BLL.BXX
cat_name = row["cat_name"].ToString(),
main_cat_id = row["main_cat_id"].ToString(),
main_cat_name = row["main_cat_name"].ToString(),
+ wx_cat_1 = row["wx_cat_1"].ToString(),
+ wx_cat_2 = row["wx_cat_2"].ToString(),
+ wx_cat_3 = row["wx_cat_3"].ToString(),
+ wx_cat_leaf = row["wx_cat_leaf"].ToString(),
price_text = row["price_text"].ToString(),
product_name = row["product_name"].ToString(),
main_img = row["main_img"].ToString(),
@@ -1646,6 +1686,120 @@ namespace KJD_Web.BLL.BXX
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
+
+ public string GetWxTokens(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 id = (RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'")).ParseToInt();
+ if (id == 0)
+ id = 1;
+
+ string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
+ MysqlUtils mySql = new MysqlUtils(conn);
+ string sql = "select tokens,mdy_time from wxxd.wx_token WHERE id=" + id + ";";
+ var rst = mySql.ExecuteDataTableRow(sql);
+ mySql.Close();
+
+ if (!string.IsNullOrEmpty(mySql.Message))
+ {
+ return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
+ }
+
+ try
+ {
+ string tokens = rst["tokens"].ParseToString();
+ var mdyTime = Convert.ToDateTime(rst["mdy_time"]);
+ if (mdyTime.AddMinutes(115) < DateTime.Now)
+ {
+ var tokenRst = HttpUtils.e57GetResponse("https://po.e57.cn/prod-api/api/sys-api/system/open/api/shop/list?userName=阿杰账户", "");
+ if (!tokenRst.Contains("\"code\":0"))
+ tokenRst = HttpUtils.e57GetResponse("https://po.e57.cn/prod-api/api/sys-api/system/open/api/shop/list?userName=阿杰账户", "");
+ if (!tokenRst.Contains("\"code\":0"))
+ {
+ var errMsg = RegexUtils.GetStringJson(ref tokenRst, "msg");
+ if (string.IsNullOrEmpty(errMsg))
+ errMsg = tokenRst;
+ return "{\"code\":500,\"msg\":\"" + errMsg + "\"}";
+ }
+ mdyTime = DateTime.Now;
+ tokens = JsonUtils.SerializerObjectToString(JObject.Parse(tokenRst)["list"]);
+
+ conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
+ mySql = new MysqlUtils(conn);
+ sql = "update wxxd.wx_token set tokens='" + tokens + "' where id=1;";
+ bool su = mySql.ExecuteNonQuery(sql);
+ mySql.Close();
+
+ if (!string.IsNullOrEmpty(mySql.Message))
+ {
+ return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
+ }
+ }
+ return "{\"code\":200,\"tokens\":" + tokens + ",\"mdy_time\":\"" + mdyTime.ToString("yyyy-MM-dd HH:mm:ss") + "\"}";
+ }
+ catch (Exception ex)
+ {
+ return "{\"code\":500,\"msg\":\"" + ex.Message + "\"}";
+ }
+ }
+ return "{\"code\":19999,\"msg\":\"输入为空\"}";
+ }
+
+ public string GetWxAllCate(string inputData)
+ {
+ if (!string.IsNullOrEmpty(inputData))
+ {
+ //var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
+ //string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
+ //if (time1 != EncrypUtil.Encryption(time))
+ // return "{\"code\":50000,\"msg\":\"校验失败\"}";
+ string token = RegexUtils.GetStringQuery(ref inputData, "token", true);
+ return HttpUtils.WxApiGetResponse("https://api.weixin.qq.com/shop/ec/category/all?access_token=" + token, "");
+ }
+ return "{\"code\":19999,\"msg\":\"输入为空\"}";
+ }
+
+ public string WxApiCategoryClassify(string inputData)
+ {
+ if (!string.IsNullOrEmpty(inputData))
+ {
+ var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
+ string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
+ if (time1 != EncrypUtil.Encryption(time))
+ return "{\"code\":50000,\"msg\":\"校验失败\"}";
+
+ string post_data = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "post_data"));
+ string token = RegexUtils.GetStringQuery(ref inputData, "token");
+
+ return HttpUtils.WxApiPostResponse("https://api.weixin.qq.com/channels/ec/product/category/classify?access_token=" + token, post_data, "");
+ }
+ return "{\"code\":19999,\"msg\":\"输入为空\"}";
+ }
+
+ public string WxApiUploadImage(string inputData)
+ {
+ if (!string.IsNullOrEmpty(inputData))
+ {
+ var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
+ string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
+ if (time1 != EncrypUtil.Encryption(time))
+ return "{\"code\":50000,\"msg\":\"校验失败\"}";
+
+ string post_data = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "post_data"));
+ string token = RegexUtils.GetStringQuery(ref inputData, "token");
+
+ //https://api.weixin.qq.com/shop/ec/basics/img/upload?access_token=ACCESS_TOKEN&upload_type=1&resp_type=1
+ return HttpUtils.WxApiPostResponse("https://api.weixin.qq.com/shop/ec/basics/img/upload?access_token=" + token +
+ "&upload_type=1&resp_type=1", post_data, "");
+ }
+ return "{\"code\":19999,\"msg\":\"输入为空\"}";
+ }
}
}
diff --git a/KJDService/KJD_WebService/BXXProductService.asmx.cs b/KJDService/KJD_WebService/BXXProductService.asmx.cs
index 09cc23e..f655edb 100644
--- a/KJDService/KJD_WebService/BXXProductService.asmx.cs
+++ b/KJDService/KJD_WebService/BXXProductService.asmx.cs
@@ -348,5 +348,53 @@ namespace KJD_Web
Context.Response.Write(result);
Context.Response.End();
}
+
+ [WebMethod]
+ public void get_wx_all_cate()
+ {
+ string jsontext = GetRequestJsonString();
+
+ var result = jsontext;
+ result = new BXXProductManage().GetWxAllCate(jsontext);
+
+ Context.Response.Write(result);
+ Context.Response.End();
+ }
+
+ [WebMethod]
+ public void get_wx_tokens()
+ {
+ string jsontext = GetRequestJsonString();
+
+ var result = jsontext;
+ result = new BXXProductManage().GetWxTokens(jsontext);
+
+ Context.Response.Write(result);
+ Context.Response.End();
+ }
+
+ [WebMethod]
+ public void wx_api_category_classify()
+ {
+ string jsontext = GetRequestJsonString();
+
+ var result = jsontext;
+ result = new BXXProductManage().WxApiCategoryClassify(jsontext);
+
+ Context.Response.Write(result);
+ Context.Response.End();
+ }
+
+ [WebMethod]
+ public void wx_api_upload_image()
+ {
+ string jsontext = GetRequestJsonString();
+
+ var result = jsontext;
+ result = new BXXProductManage().WxApiUploadImage(jsontext);
+
+ Context.Response.Write(result);
+ Context.Response.End();
+ }
}
}
diff --git a/KJDService/KJD_WebService/KJD_WebService.csproj b/KJDService/KJD_WebService/KJD_WebService.csproj
index aa64d2c..d7301ac 100644
--- a/KJDService/KJD_WebService/KJD_WebService.csproj
+++ b/KJDService/KJD_WebService/KJD_WebService.csproj
@@ -114,6 +114,7 @@
+
WXProductService.asmx
Component
diff --git a/KJDService/KJD_WebService/KJD_WebService.csproj.user b/KJDService/KJD_WebService/KJD_WebService.csproj.user
index 4bcdc04..1b87364 100644
--- a/KJDService/KJD_WebService/KJD_WebService.csproj.user
+++ b/KJDService/KJD_WebService/KJD_WebService.csproj.user
@@ -8,7 +8,7 @@
- Release|Any CPU
+ Debug|Any CPU
ShowAllFiles
diff --git a/KJDService/KJD_WebService/Model/DBProductResultParam.cs b/KJDService/KJD_WebService/Model/DBProductResultParam.cs
index c1d2527..30c3acf 100644
--- a/KJDService/KJD_WebService/Model/DBProductResultParam.cs
+++ b/KJDService/KJD_WebService/Model/DBProductResultParam.cs
@@ -21,7 +21,10 @@ namespace KJD_Web.Model
public string cat_id { get; set; }
public string main_cat_name { get; set; }
public string cat_name { get; set; }
- public string wx_cate { get; set; }
+ public string wx_cat_1 { get; set; }
+ public string wx_cat_2 { get; set; }
+ public string wx_cat_3 { get; set; }
+ public string wx_cat_leaf { get; set; }
///
/// 母店价格
///
diff --git a/KJDService/KJD_WebService/Utils/HttpUtils.cs b/KJDService/KJD_WebService/Utils/HttpUtils.cs
new file mode 100644
index 0000000..aa968b6
--- /dev/null
+++ b/KJDService/KJD_WebService/Utils/HttpUtils.cs
@@ -0,0 +1,178 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.IO.Compression;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Web;
+
+namespace KJD_Web.Utils
+{
+ public class HttpUtils
+ {
+ public static string WxApiPostResponse(string _url, string _data, string referer)
+ {
+ HttpWebResponse response = null;
+ string result;
+ try
+ {
+ string url = _url;
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+
+ request.KeepAlive = true;
+ request.Headers.Set(HttpRequestHeader.CacheControl, "max-age=0");
+ request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36";
+ request.ContentType = "application/json";
+ request.Accept = "*/*";
+ request.Referer = referer;
+ request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
+ request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
+
+ request.Method = "POST";
+ request.ServicePoint.Expect100Continue = false;
+
+ string body = _data;
+ byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
+ request.ContentLength = postBytes.Length;
+ Stream stream = request.GetRequestStream();
+ stream.Write(postBytes, 0, postBytes.Length);
+ stream.Close();
+
+ response = (HttpWebResponse)request.GetResponse();
+ }
+ catch (WebException ex)
+ {
+ if (ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ response = (HttpWebResponse)ex.Response;
+ result = ReadResponse(response);
+ return result;
+ }
+ else return ex.Message;
+ }
+ catch (Exception e)
+ {
+ if (response != null) response.Close();
+ return e.Message;
+ }
+ result = ReadResponse(response);
+ return result;
+ }
+
+ public static string WxApiGetResponse(string _url, string referer)
+ {
+ HttpWebResponse response = null;
+ string result;
+ try
+ {
+ string url = _url;
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+
+ request.KeepAlive = true;
+ request.Headers.Set(HttpRequestHeader.CacheControl, "max-age=0");
+ request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36";
+ request.ContentType = "application/json";
+ request.Accept = "*/*";
+ request.Referer = referer;
+ request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
+ request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
+
+ response = (HttpWebResponse)request.GetResponse();
+ }
+ catch (WebException ex)
+ {
+ if (ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ response = (HttpWebResponse)ex.Response;
+ result = ReadResponse(response);
+ return result;
+ }
+ else return ex.Message;
+ }
+ catch (Exception e)
+ {
+ if (response != null) response.Close();
+ return e.Message;
+ }
+ result = ReadResponse(response);
+ return result;
+ }
+
+ public static string e57GetResponse(string _url, string referer)
+ {
+ HttpWebResponse response = null;
+ string result;
+ try
+ {
+ string url = _url;
+
+ HttpWebRequest request;
+ if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
+ {
+ ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
+ ServicePointManager.SecurityProtocol =
+ ServicePointManager.SecurityProtocol | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
+ request = WebRequest.Create(url) as HttpWebRequest;
+ request.ProtocolVersion = HttpVersion.Version10;
+ }
+ else
+ request = (HttpWebRequest)WebRequest.Create(url);
+
+ request.KeepAlive = true;
+ request.Headers.Add("sec-ch-ua", @"""Not(A:Brand"";v=""8"", ""Chromium"";v=""144"", ""Google Chrome"";v=""144""");
+ request.Headers.Add("sec-ch-ua-mobile", @"?0");
+ request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
+ request.Headers.Add("Upgrade-Insecure-Requests", @"1");
+ request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36";
+ request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7";
+ request.Headers.Add("Sec-Fetch-Site", @"none");
+ request.Headers.Add("Sec-Fetch-Mode", @"navigate");
+ request.Headers.Add("Sec-Fetch-User", @"?1");
+ request.Headers.Add("Sec-Fetch-Dest", @"document");
+ request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
+ request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
+
+ response = (HttpWebResponse)request.GetResponse();
+ }
+ catch (WebException ex)
+ {
+ if (ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ response = (HttpWebResponse)ex.Response;
+ result = ReadResponse(response);
+ return result;
+ }
+ else return ex.Message;
+ }
+ catch (Exception e)
+ {
+ if (response != null) response.Close();
+ return e.Message;
+ }
+ result = ReadResponse(response);
+ return result;
+ }
+
+ public static string ReadResponse(HttpWebResponse response)
+ {
+ using (Stream responseStream = response.GetResponseStream())
+ {
+ Stream streamToRead = responseStream;
+ if (response.ContentEncoding.ToLower().Contains("gzip"))
+ {
+ streamToRead = new GZipStream(streamToRead, CompressionMode.Decompress);
+ }
+ else if (response.ContentEncoding.ToLower().Contains("deflate"))
+ {
+ streamToRead = new DeflateStream(streamToRead, CompressionMode.Decompress);
+ }
+
+ using (StreamReader streamReader = new StreamReader(streamToRead, Encoding.UTF8))
+ {
+ return streamReader.ReadToEnd();
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/KJDService/KJD_WebService/Utils/RegexUtils.cs b/KJDService/KJD_WebService/Utils/RegexUtils.cs
index f4a406b..8ba3a6e 100644
--- a/KJDService/KJD_WebService/Utils/RegexUtils.cs
+++ b/KJDService/KJD_WebService/Utils/RegexUtils.cs
@@ -1,6 +1,8 @@
-using System;
+using MySqlX.XDevAPI.Common;
+using System;
using System.Collections.Generic;
using System.Linq;
+using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
@@ -621,13 +623,16 @@ namespace KJD_Web.Utils
///
///
///
- public static string GetStringQuery(ref string queryString, string key)
+ public static string GetStringQuery(ref string queryString, string key, bool isGetJson = false)
{
List strLst = queryString.Split('&').ToList();
var temp = strLst.FirstOrDefault(s => s.StartsWith(key + "="));
if (temp != null)
temp = ("&" + temp).Replace("&" + key + "=", "");
+ if (temp == null && isGetJson)
+ temp = GetStringJson(ref queryString, key);
+
//queryString = "&" + queryString;
//int nIndex = queryString.IndexOf("&" + key + "=");
//if (nIndex == -1)
diff --git a/TEMUKJD/BLL/WxApiBLL.cs b/TEMUKJD/BLL/WxApiBLL.cs
new file mode 100644
index 0000000..b600c2c
--- /dev/null
+++ b/TEMUKJD/BLL/WxApiBLL.cs
@@ -0,0 +1,37 @@
+using AllBase;
+using AllBase.Helper;
+using AllBase.Model.Result.WXResult;
+using NaiBa.Util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TemuKJD.BaseForms;
+using Work;
+
+namespace TemuKJD.BLL
+{
+ public class WxApiBLL
+ {
+ public string GetWxToken()
+ {
+ if (GlobalConfig.WxTokenList.Count == 0 || GlobalConfig.WxTokenList.Any(t => t.isExpire == true))
+ {
+ var url = BaseClass.BuildPDDObjString("product/get_wx_tokens");
+ var data = UserLogin.GetSignaturex();
+ var html = GetHtml.PostUtf8(url, data);
+ if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
+ {
+ BaseMsgForm.ShowError("获取类目失败,请重试!" + BaseRegex.GetStringJson(ref html, "msg"));
+ return "";
+ }
+ var tokenStr = JsonHelper.SerializeObject(JsonHelper.JObjectParse(html)["tokens"].FirstOrDefault());
+ GlobalConfig.WxTokenList = new ConcurrentList();
+ GlobalConfig.WxTokenList.AddRange(JsonHelper.DeserializeJsonToList(tokenStr));
+ }
+
+ return GlobalConfig.WxTokenList.OrderBy(x => Guid.NewGuid()).FirstOrDefault()?.accessToken;
+ }
+ }
+}
diff --git a/TEMUKJD/KJD.csproj b/TEMUKJD/KJD.csproj
index e98c642..0317579 100644
--- a/TEMUKJD/KJD.csproj
+++ b/TEMUKJD/KJD.csproj
@@ -125,6 +125,7 @@
+
diff --git a/TEMUKJD/MainForm.cs b/TEMUKJD/MainForm.cs
index e4081fc..d923479 100644
--- a/TEMUKJD/MainForm.cs
+++ b/TEMUKJD/MainForm.cs
@@ -46,6 +46,7 @@ using TemuKJD.KJDForms.JITForms;
using TemuKJD.WXForms.ShopForms;
using TemuKJD.WXForms.AdminForms;
using TemuKJD.WXForms.ProductForms;
+using AllBase.Model.Result.WXResult;
namespace TemuKJD
{
@@ -303,6 +304,32 @@ namespace TemuKJD
//ViolateManageForm.GetAllViolateRuleName();
//GetShopViolation();
//});
+
+ Task.Run(()=>
+ {
+ ReadWxCate();
+ });
+ }
+
+ void ReadWxCate()
+ {
+ string filePath = Path.Combine(Environment.CurrentDirectory, "temp\\wxCat");
+ if (!File.Exists(filePath))
+ return;
+ using (StreamReader sr = new StreamReader(filePath, System.Text.Encoding.UTF8))
+ {
+ try
+ {
+ string cateStr = sr.ReadToEnd().Trim();
+ GlobalConfig.WxCatList.AddRange(JsonHelper.DeserializeJsonToList(cateStr));
+ }
+ catch (Exception ex)
+ {
+ BaseMsgForm.ShowError("商品列表获取失败:" + ex.Message);
+ }
+ if (GlobalConfig.WxCatList == null)
+ GlobalConfig.WxCatList = new ConcurrentList();
+ }
}
public void SetTitle()
diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.cs
index cfd77a4..ca99498 100644
--- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.cs
+++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdEditForm.cs
@@ -48,7 +48,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
if(string.IsNullOrWhiteSpace(dbProd?.product_json))
{
- var prodTmp = GetProductDetail(dbProd.id.ToString());
+ var prodTmp = GetPddProductDetail(dbProd.id.ToString());
if (prodTmp != null)
dbProd = prodTmp;
}
@@ -100,14 +100,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms
imgFrom.ShowDialog();
}
- public KJDDBProduct GetProductDetail(string prodDbId)
+ public static KJDDBProduct GetPddProductDetail(string prodDbId)
{
if (string.IsNullOrEmpty(prodDbId))
return new KJDDBProduct();
List list = new List();
- var url = BaseClass.BuildObjString("product/get_product_detail_list");
+ var url = BaseClass.BuildPDDObjString("product/get_product_detail_list");
var data = "";
data = UserLogin.GetSignaturex() + "&search_db_ids=" + prodDbId;
diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.Designer.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.Designer.cs
index cb8a368..5d9eac4 100644
--- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.Designer.cs
+++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.Designer.cs
@@ -37,8 +37,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDDDBProdListForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+ this.cmbWxCat = new System.Windows.Forms.ComboBox();
+ this.label12 = new System.Windows.Forms.Label();
+ this.btnGetProdWxCate = new DevComponents.DotNetBar.PanelEx();
this.cmbSetWxSafe = new System.Windows.Forms.ComboBox();
this.btnSetWxSafe = new DevComponents.DotNetBar.PanelEx();
this.btnImport = new DevComponents.DotNetBar.PanelEx();
@@ -77,6 +81,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnSetGroup = new DevComponents.DotNetBar.PanelEx();
this.label7 = new System.Windows.Forms.Label();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
+ this.btnGetAllCate = new DevComponents.DotNetBar.PanelEx();
this.pnlEditExtCodePrice = new System.Windows.Forms.Panel();
this.lblExtCode = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
@@ -148,6 +153,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// splitContainer1.Panel1
//
+ this.splitContainer1.Panel1.Controls.Add(this.cmbWxCat);
+ this.splitContainer1.Panel1.Controls.Add(this.label12);
+ this.splitContainer1.Panel1.Controls.Add(this.btnGetProdWxCate);
this.splitContainer1.Panel1.Controls.Add(this.cmbSetWxSafe);
this.splitContainer1.Panel1.Controls.Add(this.btnSetWxSafe);
this.splitContainer1.Panel1.Controls.Add(this.btnImport);
@@ -171,6 +179,57 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.splitContainer1.SplitterDistance = 76;
this.splitContainer1.TabIndex = 1;
//
+ // cmbWxCat
+ //
+ this.cmbWxCat.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.cmbWxCat.FormattingEnabled = true;
+ this.cmbWxCat.Items.AddRange(new object[] {
+ "",
+ "有",
+ "无"});
+ this.cmbWxCat.Location = new System.Drawing.Point(676, 9);
+ this.cmbWxCat.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
+ this.cmbWxCat.Name = "cmbWxCat";
+ this.cmbWxCat.Size = new System.Drawing.Size(49, 25);
+ this.cmbWxCat.TabIndex = 802;
+ this.cmbWxCat.Text = "无";
+ //
+ // label12
+ //
+ this.label12.Anchor = System.Windows.Forms.AnchorStyles.Right;
+ this.label12.AutoSize = true;
+ this.label12.Location = new System.Drawing.Point(619, 13);
+ this.label12.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
+ this.label12.Name = "label12";
+ this.label12.Size = new System.Drawing.Size(68, 17);
+ this.label12.TabIndex = 801;
+ this.label12.Text = "微信类目:";
+ //
+ // btnGetProdWxCate
+ //
+ this.btnGetProdWxCate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnGetProdWxCate.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
+ this.btnGetProdWxCate.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnGetProdWxCate.DisabledBackColor = System.Drawing.Color.Empty;
+ this.btnGetProdWxCate.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.btnGetProdWxCate.Location = new System.Drawing.Point(731, 9);
+ this.btnGetProdWxCate.Name = "btnGetProdWxCate";
+ this.btnGetProdWxCate.Size = new System.Drawing.Size(84, 25);
+ this.btnGetProdWxCate.Style.Alignment = System.Drawing.StringAlignment.Center;
+ this.btnGetProdWxCate.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
+ this.btnGetProdWxCate.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
+ this.btnGetProdWxCate.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
+ this.btnGetProdWxCate.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
+ this.btnGetProdWxCate.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
+ this.btnGetProdWxCate.Style.ForeColor.Color = System.Drawing.Color.White;
+ this.btnGetProdWxCate.Style.GradientAngle = 90;
+ this.btnGetProdWxCate.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
+ this.btnGetProdWxCate.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
+ this.btnGetProdWxCate.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
+ this.btnGetProdWxCate.TabIndex = 781;
+ this.btnGetProdWxCate.Text = "微信类目识别";
+ this.btnGetProdWxCate.Click += new System.EventHandler(this.btnGetProdWxCate_Click);
+ //
// cmbSetWxSafe
//
this.cmbSetWxSafe.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -180,7 +239,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"安全商品",
"违规商品",
"未校验"});
- this.cmbSetWxSafe.Location = new System.Drawing.Point(750, 44);
+ this.cmbSetWxSafe.Location = new System.Drawing.Point(861, 43);
this.cmbSetWxSafe.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbSetWxSafe.Name = "cmbSetWxSafe";
this.cmbSetWxSafe.Size = new System.Drawing.Size(85, 25);
@@ -193,7 +252,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnSetWxSafe.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSetWxSafe.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSetWxSafe.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnSetWxSafe.Location = new System.Drawing.Point(837, 44);
+ this.btnSetWxSafe.Location = new System.Drawing.Point(948, 43);
this.btnSetWxSafe.Name = "btnSetWxSafe";
this.btnSetWxSafe.Size = new System.Drawing.Size(84, 25);
this.btnSetWxSafe.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -218,7 +277,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnImport.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnImport.DisabledBackColor = System.Drawing.Color.Empty;
this.btnImport.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnImport.Location = new System.Drawing.Point(1045, 26);
+ this.btnImport.Location = new System.Drawing.Point(1048, 43);
this.btnImport.Name = "btnImport";
this.btnImport.Size = new System.Drawing.Size(84, 25);
this.btnImport.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -350,7 +409,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tableLayoutPanel1.Size = new System.Drawing.Size(727, 71);
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(609, 71);
this.tableLayoutPanel1.TabIndex = 679;
//
// cmbSpProdType
@@ -361,17 +420,17 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"",
"普通商品",
"书籍"});
- this.cmbSpProdType.Location = new System.Drawing.Point(444, 43);
+ this.cmbSpProdType.Location = new System.Drawing.Point(381, 40);
this.cmbSpProdType.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbSpProdType.Name = "cmbSpProdType";
- this.cmbSpProdType.Size = new System.Drawing.Size(70, 25);
+ this.cmbSpProdType.Size = new System.Drawing.Size(49, 25);
this.cmbSpProdType.TabIndex = 677;
//
// label11
//
this.label11.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.label11.AutoSize = true;
- this.label11.Location = new System.Drawing.Point(376, 44);
+ this.label11.Location = new System.Drawing.Point(313, 44);
this.label11.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(68, 17);
@@ -388,17 +447,17 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"厂商直采",
"机会商品",
"外部数据"});
- this.cmbSourceType.Location = new System.Drawing.Point(300, 43);
+ this.cmbSourceType.Location = new System.Drawing.Point(258, 40);
this.cmbSourceType.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbSourceType.Name = "cmbSourceType";
- this.cmbSourceType.Size = new System.Drawing.Size(70, 25);
+ this.cmbSourceType.Size = new System.Drawing.Size(49, 25);
this.cmbSourceType.TabIndex = 654;
//
// label10
//
this.label10.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label10.AutoSize = true;
- this.label10.Location = new System.Drawing.Point(256, 44);
+ this.label10.Location = new System.Drawing.Point(214, 44);
this.label10.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(44, 17);
@@ -422,14 +481,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.txtSPU.Location = new System.Drawing.Point(60, 6);
this.txtSPU.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.txtSPU.Name = "txtSPU";
- this.txtSPU.Size = new System.Drawing.Size(70, 23);
+ this.txtSPU.Size = new System.Drawing.Size(49, 23);
this.txtSPU.TabIndex = 434;
//
// label2
//
this.label2.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(136, 9);
+ this.label2.Location = new System.Drawing.Point(115, 9);
this.label2.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(44, 17);
@@ -439,17 +498,17 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// txtCat
//
this.txtCat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
- this.txtCat.Location = new System.Drawing.Point(180, 6);
+ this.txtCat.Location = new System.Drawing.Point(159, 6);
this.txtCat.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.txtCat.Name = "txtCat";
- this.txtCat.Size = new System.Drawing.Size(70, 23);
+ this.txtCat.Size = new System.Drawing.Size(49, 23);
this.txtCat.TabIndex = 425;
//
// label3
//
this.label3.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(256, 9);
+ this.label3.Location = new System.Drawing.Point(214, 9);
this.label3.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(44, 17);
@@ -459,17 +518,17 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// txtProdName
//
this.txtProdName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
- this.txtProdName.Location = new System.Drawing.Point(300, 6);
+ this.txtProdName.Location = new System.Drawing.Point(258, 6);
this.txtProdName.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.txtProdName.Name = "txtProdName";
- this.txtProdName.Size = new System.Drawing.Size(70, 23);
+ this.txtProdName.Size = new System.Drawing.Size(49, 23);
this.txtProdName.TabIndex = 427;
//
// label4
//
this.label4.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(400, 9);
+ this.label4.Location = new System.Drawing.Point(337, 9);
this.label4.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(44, 17);
@@ -479,17 +538,17 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// txtExtCode
//
this.txtExtCode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
- this.txtExtCode.Location = new System.Drawing.Point(444, 6);
+ this.txtExtCode.Location = new System.Drawing.Point(381, 6);
this.txtExtCode.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.txtExtCode.Name = "txtExtCode";
- this.txtExtCode.Size = new System.Drawing.Size(70, 23);
+ this.txtExtCode.Size = new System.Drawing.Size(49, 23);
this.txtExtCode.TabIndex = 429;
//
// label6
//
this.label6.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(544, 9);
+ this.label6.Location = new System.Drawing.Point(460, 9);
this.label6.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(44, 17);
@@ -503,9 +562,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.cmbSort.Items.AddRange(new object[] {
"入库时间",
"认领总数"});
- this.cmbSort.Location = new System.Drawing.Point(591, 7);
+ this.cmbSort.Location = new System.Drawing.Point(507, 5);
this.cmbSort.Name = "cmbSort";
- this.cmbSort.Size = new System.Drawing.Size(67, 25);
+ this.cmbSort.Size = new System.Drawing.Size(46, 25);
this.cmbSort.TabIndex = 448;
this.cmbSort.Text = "入库时间";
//
@@ -516,9 +575,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnSearch.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSearch.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSearch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnSearch.Location = new System.Drawing.Point(664, 5);
+ this.btnSearch.Location = new System.Drawing.Point(559, 5);
this.btnSearch.Name = "btnSearch";
- this.btnSearch.Size = new System.Drawing.Size(56, 25);
+ this.btnSearch.Size = new System.Drawing.Size(46, 25);
this.btnSearch.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnSearch.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSearch.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
@@ -551,14 +610,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.txtNotes.Location = new System.Drawing.Point(60, 41);
this.txtNotes.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.txtNotes.Name = "txtNotes";
- this.txtNotes.Size = new System.Drawing.Size(70, 23);
+ this.txtNotes.Size = new System.Drawing.Size(49, 23);
this.txtNotes.TabIndex = 439;
//
// lblGroup
//
this.lblGroup.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblGroup.AutoSize = true;
- this.lblGroup.Location = new System.Drawing.Point(136, 44);
+ this.lblGroup.Location = new System.Drawing.Point(115, 44);
this.lblGroup.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.lblGroup.Name = "lblGroup";
this.lblGroup.Size = new System.Drawing.Size(44, 17);
@@ -569,10 +628,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.cmbGroupFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.cmbGroupFilter.FormattingEnabled = true;
- this.cmbGroupFilter.Location = new System.Drawing.Point(180, 43);
+ this.cmbGroupFilter.Location = new System.Drawing.Point(159, 40);
this.cmbGroupFilter.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbGroupFilter.Name = "cmbGroupFilter";
- this.cmbGroupFilter.Size = new System.Drawing.Size(70, 25);
+ this.cmbGroupFilter.Size = new System.Drawing.Size(49, 25);
this.cmbGroupFilter.TabIndex = 653;
//
// cmbWxSafe
@@ -584,17 +643,17 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"安全商品",
"违规商品",
"未校验"});
- this.cmbWxSafe.Location = new System.Drawing.Point(588, 43);
+ this.cmbWxSafe.Location = new System.Drawing.Point(504, 40);
this.cmbWxSafe.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbWxSafe.Name = "cmbWxSafe";
- this.cmbWxSafe.Size = new System.Drawing.Size(70, 25);
+ this.cmbWxSafe.Size = new System.Drawing.Size(49, 25);
this.cmbWxSafe.TabIndex = 676;
//
// lblWxSafe
//
this.lblWxSafe.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblWxSafe.AutoSize = true;
- this.lblWxSafe.Location = new System.Drawing.Point(520, 44);
+ this.lblWxSafe.Location = new System.Drawing.Point(436, 44);
this.lblWxSafe.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0);
this.lblWxSafe.Name = "lblWxSafe";
this.lblWxSafe.Size = new System.Drawing.Size(68, 17);
@@ -607,9 +666,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.pnlEmpty.CanvasColor = System.Drawing.SystemColors.Control;
this.pnlEmpty.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.pnlEmpty.DisabledBackColor = System.Drawing.Color.Empty;
- this.pnlEmpty.Location = new System.Drawing.Point(664, 40);
+ this.pnlEmpty.Location = new System.Drawing.Point(559, 40);
this.pnlEmpty.Name = "pnlEmpty";
- this.pnlEmpty.Size = new System.Drawing.Size(56, 25);
+ this.pnlEmpty.Size = new System.Drawing.Size(46, 25);
this.pnlEmpty.Style.Alignment = System.Drawing.StringAlignment.Center;
this.pnlEmpty.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.pnlEmpty.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
@@ -623,7 +682,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.pnlEmpty.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.pnlEmpty.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.pnlEmpty.TabIndex = 431;
- this.pnlEmpty.Text = "清空条件";
+ this.pnlEmpty.Text = "清空";
this.pnlEmpty.Click += new System.EventHandler(this.pnlEmpty_Click);
//
// btnExportTxt
@@ -658,7 +717,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnDelSelect.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnDelSelect.DisabledBackColor = System.Drawing.Color.Empty;
this.btnDelSelect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnDelSelect.Location = new System.Drawing.Point(941, 26);
+ this.btnDelSelect.Location = new System.Drawing.Point(1048, 9);
this.btnDelSelect.Name = "btnDelSelect";
this.btnDelSelect.Size = new System.Drawing.Size(84, 25);
this.btnDelSelect.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -680,7 +739,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.cmbGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cmbGroup.FormattingEnabled = true;
- this.cmbGroup.Location = new System.Drawing.Point(750, 10);
+ this.cmbGroup.Location = new System.Drawing.Point(861, 9);
this.cmbGroup.Name = "cmbGroup";
this.cmbGroup.Size = new System.Drawing.Size(85, 25);
this.cmbGroup.TabIndex = 640;
@@ -692,7 +751,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnSetGroup.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSetGroup.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSetGroup.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnSetGroup.Location = new System.Drawing.Point(837, 10);
+ this.btnSetGroup.Location = new System.Drawing.Point(948, 9);
this.btnSetGroup.Name = "btnSetGroup";
this.btnSetGroup.Size = new System.Drawing.Size(84, 25);
this.btnSetGroup.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -731,6 +790,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// splitContainer2.Panel1
//
+ this.splitContainer2.Panel1.Controls.Add(this.btnGetAllCate);
this.splitContainer2.Panel1.Controls.Add(this.pnlEditExtCodePrice);
this.splitContainer2.Panel1.Controls.Add(this.pbLoading);
this.splitContainer2.Panel1.Controls.Add(this.txtSKC);
@@ -747,6 +807,31 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.splitContainer2.SplitterDistance = 577;
this.splitContainer2.TabIndex = 0;
//
+ // btnGetAllCate
+ //
+ this.btnGetAllCate.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
+ this.btnGetAllCate.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnGetAllCate.DisabledBackColor = System.Drawing.Color.Empty;
+ this.btnGetAllCate.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.btnGetAllCate.Location = new System.Drawing.Point(15, 33);
+ this.btnGetAllCate.Name = "btnGetAllCate";
+ this.btnGetAllCate.Size = new System.Drawing.Size(84, 25);
+ this.btnGetAllCate.Style.Alignment = System.Drawing.StringAlignment.Center;
+ this.btnGetAllCate.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
+ this.btnGetAllCate.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
+ this.btnGetAllCate.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
+ this.btnGetAllCate.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
+ this.btnGetAllCate.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
+ this.btnGetAllCate.Style.ForeColor.Color = System.Drawing.Color.White;
+ this.btnGetAllCate.Style.GradientAngle = 90;
+ this.btnGetAllCate.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
+ this.btnGetAllCate.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
+ this.btnGetAllCate.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
+ this.btnGetAllCate.TabIndex = 777;
+ this.btnGetAllCate.Text = "取微信全类目";
+ this.btnGetAllCate.Visible = false;
+ this.btnGetAllCate.Click += new System.EventHandler(this.btnGetAllCate_Click);
+ //
// pnlEditExtCodePrice
//
this.pnlEditExtCodePrice.Anchor = System.Windows.Forms.AnchorStyles.None;
@@ -1025,6 +1110,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colSkuReplaceImg.ReadOnly = true;
this.colSkuReplaceImg.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSkuReplaceImg.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+ this.colSkuReplaceImg.Visible = false;
//
// col_spu_id
//
@@ -1041,6 +1127,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// col_cat_name
//
+ dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.col_cat_name.DefaultCellStyle = dataGridViewCellStyle4;
this.col_cat_name.HeaderText = "类目";
this.col_cat_name.Name = "col_cat_name";
this.col_cat_name.ReadOnly = true;
@@ -1105,16 +1193,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// col_notes
//
- dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.col_notes.DefaultCellStyle = dataGridViewCellStyle4;
+ dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.col_notes.DefaultCellStyle = dataGridViewCellStyle5;
this.col_notes.HeaderText = "备注";
this.col_notes.Name = "col_notes";
this.col_notes.ReadOnly = true;
//
// colHeadWords
//
- dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.colHeadWords.DefaultCellStyle = dataGridViewCellStyle5;
+ dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.colHeadWords.DefaultCellStyle = dataGridViewCellStyle6;
this.colHeadWords.HeaderText = "标题前缀";
this.colHeadWords.Name = "colHeadWords";
this.colHeadWords.ReadOnly = true;
@@ -1122,8 +1210,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// colEndWords
//
- dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.colEndWords.DefaultCellStyle = dataGridViewCellStyle6;
+ dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.colEndWords.DefaultCellStyle = dataGridViewCellStyle7;
this.colEndWords.HeaderText = "标题后缀";
this.colEndWords.Name = "colEndWords";
this.colEndWords.ReadOnly = true;
@@ -1131,8 +1219,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// colFissionWords
//
- dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.colFissionWords.DefaultCellStyle = dataGridViewCellStyle7;
+ dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.colFissionWords.DefaultCellStyle = dataGridViewCellStyle8;
this.colFissionWords.HeaderText = "裂变词";
this.colFissionWords.Name = "colFissionWords";
this.colFissionWords.ReadOnly = true;
@@ -1203,12 +1291,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucSplitPage1.CurrentPage = 1;
this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right;
this.ucSplitPage1.IsShowPageSize = true;
- this.ucSplitPage1.Location = new System.Drawing.Point(1024, 0);
+ this.ucSplitPage1.Location = new System.Drawing.Point(985, 0);
this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0);
this.ucSplitPage1.Name = "ucSplitPage1";
this.ucSplitPage1.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0);
- this.ucSplitPage1.PageSize = 50;
- this.ucSplitPage1.Size = new System.Drawing.Size(414, 25);
+ this.ucSplitPage1.PageSize = 100;
+ this.ucSplitPage1.Size = new System.Drawing.Size(453, 25);
this.ucSplitPage1.TabIndex = 6;
this.ucSplitPage1.TotalPage = 1;
//
@@ -1313,6 +1401,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private DevComponents.DotNetBar.PanelEx btnSetWxSafe;
private System.Windows.Forms.ComboBox cmbSpProdType;
private System.Windows.Forms.Label label11;
+ private DevComponents.DotNetBar.PanelEx btnGetAllCate;
+ private DevComponents.DotNetBar.PanelEx btnGetProdWxCate;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn col_db_id;
private System.Windows.Forms.DataGridViewTextBoxColumn colFromShopId;
@@ -1344,5 +1434,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private System.Windows.Forms.DataGridViewLinkColumn col_edit;
private System.Windows.Forms.DataGridViewLinkColumn col_delete;
private System.Windows.Forms.DataGridViewLinkColumn col_select_product;
+ private System.Windows.Forms.ComboBox cmbWxCat;
+ private System.Windows.Forms.Label label12;
}
}
\ No newline at end of file
diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.cs
index 47158a1..2a801f6 100644
--- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.cs
+++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.cs
@@ -1,6 +1,8 @@
using AllBase;
+using AllBase.Helper;
using AllBase.Model.Result;
using AllBase.Model.Result.PDDResult;
+using AllBase.Model.Result.WXResult;
using NaiBa.Util;
using NaiBa.Util.Extension;
using Newtonsoft.Json.Linq;
@@ -155,6 +157,39 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
foreach (var prod in lstTemuDbProduct)
{
+ string catName = prod.cat_name;
+ if (prod.wx_cat_leaf != null)
+ {
+ var catN = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == prod.wx_cat_leaf.ParseToString())?.name;
+ if (!string.IsNullOrEmpty(catN))
+ {
+ catName = catN;
+ }
+ }
+ if (prod.wx_cat_3 != null)
+ {
+ var catN = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == prod.wx_cat_3.ParseToString())?.name;
+ if (!string.IsNullOrEmpty(catN))
+ {
+ catName = catN + " >> " + catName;
+ }
+ }
+ if (prod.wx_cat_2 != null)
+ {
+ var catN = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == prod.wx_cat_2.ParseToString())?.name;
+ if (!string.IsNullOrEmpty(catN))
+ {
+ catName = catN + " >> " + catName;
+ }
+ }
+ if (prod.wx_cat_1 != null)
+ {
+ var catN = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == prod.wx_cat_1.ParseToString())?.name;
+ if (!string.IsNullOrEmpty(catN))
+ {
+ catName = catN + " >> " + catName;
+ }
+ }
Invoke(new Action(() =>
{
int rowIndex = this.dgvDbProduct.Rows.Add(
@@ -168,7 +203,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
DataGridViewExtension.defaultBitmap,
prod.spu_id,
prod.skc_id,
- prod.cat_name,
+ catName,
prod.ext_code,
prod.group,
prod.price_text, // 母店价格
@@ -279,6 +314,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"&search_prod_name=" + txtProdName.Text.Trim() +
"&wx_safe_status=" + cmbWxSafe.Text.Trim() +
"&special_prod_type=" + cmbSpProdType.Text.Trim();
+ if(!string.IsNullOrEmpty(cmbWxCat.Text))
+ {
+ data += "&has_wx_cat=" + (cmbWxCat.Text.Trim() == "有").ParseToString().ToLower();
+ }
+
if (cmbSourceType.Text.Trim() != "全部")
{
data += "&product_get_type=" + cmbSourceType.Text.Trim();
@@ -390,7 +430,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
imgFrom.ShowDialog();
break;
case "认领":
- Task.Run(() => { SelectProduct(new KJDDBProduct[] { dbProduct }); });
+ //Task.Run(() => { SelectProduct(new KJDDBProduct[] { dbProduct }); });
break;
case "编辑":
this.lblExtCodePrice.Text = "调整货号 " + dgvDbProduct.Rows[e.RowIndex].Cells["col_ext_code"].Value.ParseToString() + " 价格";
@@ -406,162 +446,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
}
- private void SelectProduct(KJDDBProduct[] prods)
- {
- if (shop == null)
- {
- BaseMsgForm.ShowError("店铺不能为空!");
- return;
- }
- if (prods == null || prods.Count() == 0)
- {
- BaseMsgForm.ShowError("认领商品不能为空!");
- return;
- }
-
- Invoke(new Action(() =>
- {
- this.pbLoading.Visible = true;
- this.statusBar.lblTaskStatus.Text = "正在认领...";
- this.statusBar.pgbTaskProgress.Maximum = prods.Length;
- this.statusBar.UpdateProgressBar(0);
- }));
-
- string errorMsg = "";
-
- foreach (var prod in prods)
- {
- Invoke(new Action(() =>
- {
- this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + 1);
- }));
-
- if (prod == null)
- {
- errorMsg += "prod null; ";
- continue;
- }
-
- if (shop.AddProductRemaining <=0)
- {
- if (!errorMsg.Contains("本月商品认领限额已用完"))
- errorMsg += " 本月商品认领限额已用完,请下个月再操作!";
- continue;
- }
-
- try
- {
- var fissionProductName = GetFissionProductName(prod);
-
- var url = BaseClass.BuildObjString("product/add_user_select_product");
- var data = UserLogin.GetSignaturex() +
- "&out_product_id=" + prod.id +
- "&shop_id=" + shop.ShopId +
- "&shop_account=" + shop.ShopAccount +
- "&main_user_name=" + shop.UserName +
- "&sub_user_name=" + shop.SubUserName +
- "&add_product_remaining=" + shop.AddProductRemaining +
- "&add_fission_product_name=" + GetHtml.UrlEncodeUtf8(fissionProductName) +
- "&status=待上传";
- 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"))
- {
- errorMsg += prod.spu_id + " " + BaseRegex.GetStringJson(ref html, "msg") + "; ";
- }
- else
- {
- prod.select_count++;
- prod.select_total_count++;
- Invoke(new Action(() =>
- {
- var row = this.dgvDbProduct.Rows.Cast().FirstOrDefault(r => r.Cells["col_db_id"].Value.ParseToInt() == prod.id);
- if (row != null)
- {
- row.Cells["colAddTimes"].Value = prod.select_count;
- row.Cells["colSelectTotalCount"].Value = prod.select_total_count;
- }
- }));
- shop.AddProductRemaining = shop.AddProductRemaining - 1;
- }
- }
- catch (Exception ex) {
- errorMsg += ex.Message + "; ";
- }
- }
- if (!string.IsNullOrEmpty(errorMsg))
- {
- Invoke(new Action(() =>
- {
- BaseMsgForm.ShowError("认领商品失败,请重试!\r\n" + errorMsg.Trim());
- }));
- }
- else
- {
- Invoke(new Action(() =>
- {
- BaseMsgForm.ShowInfo("认领商品成功!");
- }));
- }
- Invoke(new Action(() =>
- {
- this.pbLoading.Visible = false;
- this.statusBar.lblTaskStatus.Text = "认领完成";
- this.statusBar.UpdateProgressBar(prods.Length);
- }));
- }
-
- public static string GetFissionProductName(KJDDBProduct prod)
- {
-
- string headWords = "";
- if (!string.IsNullOrWhiteSpace(prod.head_words))
- {
- var numberRegex = BaseRegex.GetMatchRegex(prod.head_words.Trim(), "\\d{1,9}");
- var numbers = numberRegex.Cast().Select(m => m.Value.ParseToInt()).ToList();
- //var numbers = prod.head_words.Split(new string[] { "-", "个" }, StringSplitOptions.RemoveEmptyEntries).Select(w => w.ParseToInt()).ToList();
- int minNum = 5;
- int maxNum = 19;
- if (numbers.Count > 0 && numbers[0] > 0)
- {
- minNum = numbers[0];
- if (numbers.Count > 1 && numbers[1] > 0)
- {
- maxNum = numbers[1];
- }
- if (maxNum < minNum)
- {
- maxNum = minNum;
- }
- headWords += Randomx.GetId(minNum, maxNum + 1) + prod.head_words.Trim().Replace(minNum + "-" + maxNum, "");
- }
- }
-
- //string endWords = string.IsNullOrEmpty(prod.end_words) ? "适合不同的搭配风格" : prod.end_words;
- string endWords = string.IsNullOrWhiteSpace(prod.end_words) ? "" : prod.end_words;
-
- List fissionLst = new List();
- fissionLst.AddRange(prod.fission_words.ParseToString().Split(new string[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries));
- string centerWords = ",";
- while (fissionLst.Count > 0)
- {
- int id = Randomx.GetId(fissionLst.Count);
- var fissionTxt = fissionLst[id];
- fissionLst.RemoveAt(id);
- var allTxt = headWords + prod.product_name + centerWords + fissionTxt + "," + endWords;
- byte[] bytes = Encoding.GetEncoding("gb2312").GetBytes(allTxt);
- if (bytes.Length > 250)
- {
- break;
- }
- centerWords += fissionTxt + ",";
- }
- return (headWords + prod.product_name + centerWords + endWords).Trim(',');
- }
-
private void DeleteProduct(string dbId, bool isUpdate = true)
{
var url = BaseClass.BuildPDDObjString("product/del_db_product");
@@ -594,7 +478,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
this.btnSelect.Enabled = false;
Task.Run(() => {
- SelectProduct(prodList);
+ //SelectProduct(prodList);
Invoke(new Action(() =>
{
this.btnSelect.Enabled = true;
@@ -1065,5 +949,225 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
}
}
+
+ private void btnGetAllCate_Click(object sender, EventArgs e)
+ {
+ new WxApiBLL().GetWxToken();
+
+ var url1 = BaseClass.BuildPDDObjString("product/get_wx_all_cate");
+ var data1 = UserLogin.GetSignaturex();
+ data1 += "&token=" + GlobalConfig.WxTokenList.OrderBy(x => Guid.NewGuid()).FirstOrDefault()?.accessToken;
+ var html1 = GetHtml.PostUtf8(url1, data1);
+
+ var catDataObj = JsonHelper.JObjectParse(html1)["cats_v2"];
+ var catDataObjLst = JsonHelper.JObjectParse(html1)["cats_v2"].Take(10).ToList();
+ GlobalConfig.WxCatList.Clear();
+ foreach (var catAndQuaObj in catDataObj)
+ {
+ foreach (var catObj in catAndQuaObj["cat_and_qua"])
+ {
+ WxCatInfo catInfo = new WxCatInfo()
+ {
+ cat_id = catObj["cat"]["cat_id"].ParseToString(),
+ f_cat_id = catObj["cat"]["f_cat_id"].ParseToString(),
+ is_local_life = catObj["cat"]["is_local_life"].ParseToBool(),
+ leaf = catObj["cat"]["leaf"].ParseToBool(),
+ level = catObj["cat"]["level"].ParseToInt(),
+ name = catObj["cat"]["name"].ParseToString(),
+ };
+
+ if (!GlobalConfig.WxCatList.Any(c => c.cat_id == catInfo.cat_id))
+ GlobalConfig.WxCatList.Add(catInfo);
+ }
+ }
+ var catV2Str = JsonHelper.SerializeObject(GlobalConfig.WxCatList);
+ }
+
+ private void btnGetProdWxCate_Click(object sender, EventArgs e)
+ {
+ var lstProdId = dgvDbProduct.Rows.Cast().Where(row
+ => row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["col_spu_id"]?.Value.ToString()).ToList();
+ var prodList = this.lstTemuDbProduct.Where(p => lstProdId.Contains(p.spu_id)).ToArray();
+ if (prodList.Length == 0)
+ return;
+
+ this.statusBar.pgbTaskProgress.Maximum = prodList.Length;
+ this.statusBar.UpdateProgressBar(0);
+ this.pbLoading.Visible = true;
+ Task.Run(() =>
+ {
+ try
+ {
+ GetProdWxCat(prodList);
+ }
+ catch (Exception ex)
+ {
+ BaseMsgForm.ShowError(ex.Message);
+ }
+ // 刷新结果
+ SearchDbProd(this.ucSplitPage1.CurrentPage);
+ Invoke(new Action(() =>
+ {
+ pbLoading.Visible = false;
+ BaseMsgForm.ShowInfo("操作完成!");
+ }));
+ });
+ }
+
+ void GetProdWxCat(KJDDBProduct[] prodList)
+ {
+ foreach (var prod in prodList)
+ {
+ // 获取微信accessToken
+ var token = new WxApiBLL().GetWxToken();
+ try
+ {
+ JObject obj = new JObject();
+ obj["req_type"] = 1;
+ obj["head_imgs"] = new JArray();
+
+ var dbProd = PDDDBProdEditForm.GetPddProductDetail(prod.id.ParseToString());
+ var prodObj = JsonHelper.JObjectParse(dbProd.product_json);
+ List mainImgLst = new List();
+ if (!prodObj["jstProd"].IsNullOrEmpty())
+ {
+ var jstProd = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(prodObj["jstProd"]));
+ mainImgLst = jstProd.itemMainImage.Take(3).ToList();
+ foreach (var img in mainImgLst)
+ {
+ var urlImg = BaseClass.BuildPDDObjString("product/wx_api_upload_image");
+ var upDate = UserLogin.GetSignaturex();
+ upDate += "&token=" + token;
+ upDate += "&post_data=" + GetHtml.UrlEncodeUtf8("{\"img_url\":\"" + img + "\"}");
+ var upDateRst = GetHtml.PostUtf8(urlImg, upDate);
+ var upImgUrl = BaseRegex.GetStringJson(ref upDateRst, "img_url");
+ (obj["head_imgs"] as JArray).Add(upImgUrl);
+ }
+
+ obj["title"] = jstProd.itemName;
+ string post_data = JsonHelper.SerializeObject(obj);
+
+ var url1 = BaseClass.BuildPDDObjString("product/wx_api_category_classify");
+ var data1 = UserLogin.GetSignaturex();
+ data1 += "&token=" + token;
+ data1 += "&post_data=" + GetHtml.UrlEncodeUtf8(post_data);
+ var html1 = GetHtml.PostUtf8(url1, data1);
+ var catId = BaseRegex.GetStringJson(ref html1, "cat_id");
+
+ var jCatFirstLst = JsonHelper.JObjectParse(html1)["categories"].FirstOrDefault()["cats"] as JArray;
+ int index = 0;
+ foreach (JObject jCatObj in jCatFirstLst)
+ {
+ index++;
+ if (index == 1)
+ {
+ var catStr = jCatObj["cat_info"]["cat_id"].ParseToString();
+ dbProd.wx_cat_1 = catStr.ParseToLong();
+ dbProd.main_cat_id = catStr;
+ dbProd.main_cat_name = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == dbProd.wx_cat_1.ParseToString()).name;
+ }
+ if (index == 2)
+ {
+ var catStr = jCatObj["cat_info"]["cat_id"].ParseToString();
+ dbProd.wx_cat_2 = catStr.ParseToLong();
+ var wxCat = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == dbProd.wx_cat_2.ParseToString()).name;
+ }
+ if (index == 3)
+ {
+ var catStr = jCatObj["cat_info"]["cat_id"].ParseToString();
+ dbProd.wx_cat_3 = catStr.ParseToLong();
+ var wxCat = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == dbProd.wx_cat_3.ParseToString()).name;
+ }
+ if (index == jCatFirstLst.Count)
+ {
+ var catStr = jCatObj["cat_info"]["cat_id"].ParseToString();
+ dbProd.wx_cat_leaf = catStr.ParseToLong();
+ dbProd.cat_id = catStr;
+ dbProd.cat_name = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == dbProd.wx_cat_leaf.ParseToString()).name;
+ }
+ }
+ }
+
+ if (dbProd.wx_cat_1 != null && dbProd.wx_cat_leaf != null)
+ {
+ var row = dgvDbProduct.Rows.Cast().FirstOrDefault(r => r.Cells["col_spu_id"].Value.ParseToString() == dbProd.spu_id);
+
+ var url = BaseClass.BuildPDDObjString("product/mdy_product");
+ var data = Work.UserLogin.GetSignaturex() +
+ "&spu_id=" + dbProd.spu_id +
+ "&wx_cat_1=" + dbProd.wx_cat_1 +
+ "&wx_cat_2=" + dbProd.wx_cat_2 +
+ "&wx_cat_3=" + dbProd.wx_cat_3 +
+ "&wx_cat_leaf=" + dbProd.wx_cat_leaf +
+ "&cat_id=" + dbProd.cat_id +
+ "&cat_name=" + HttpUtility.UrlEncode(dbProd.cat_name, Encoding.UTF8) +
+ "&main_cat_id=" + dbProd.main_cat_id +
+ "&main_cat_name=" + HttpUtility.UrlEncode(dbProd.main_cat_name, Encoding.UTF8);
+ 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"))
+ {
+ if (row != null)
+ Invoke(new Action(() =>
+ {
+ row.Cells["col_cat_name"].Value = "类目获取失败" + BaseRegex.GetStringJson(ref html, "msg");
+ }));
+ }
+ else
+ {
+ if (row != null)
+ {
+ string catName = dbProd.cat_name;
+ if (dbProd.wx_cat_leaf != null)
+ {
+ var catN = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == dbProd.wx_cat_leaf.ParseToString())?.name;
+ if (!string.IsNullOrEmpty(catN))
+ {
+ catName = catN;
+ }
+ }
+ if (dbProd.wx_cat_3 != null)
+ {
+ var catN = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == dbProd.wx_cat_3.ParseToString())?.name;
+ if (!string.IsNullOrEmpty(catN))
+ {
+ catName = catN + " >> " + catName;
+ }
+ }
+ if (dbProd.wx_cat_2 != null)
+ {
+ var catN = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == dbProd.wx_cat_2.ParseToString())?.name;
+ if (!string.IsNullOrEmpty(catN))
+ {
+ catName = catN + " >> " + catName;
+ }
+ }
+ if (prod.wx_cat_1 != null)
+ {
+ var catN = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == dbProd.wx_cat_1.ParseToString())?.name;
+ if (!string.IsNullOrEmpty(catN))
+ {
+ catName = catN + " >> " + catName;
+ }
+ }
+ Invoke(new Action(() =>
+ {
+ row.Cells["col_cat_name"].Value = catName;
+ }));
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ }
+
+ Invoke(new Action(() =>
+ {
+ this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + 1);
+ }));
+ }
+ }
}
}
diff --git a/TEMUKJD/ToolForms/GetJuShuitanProdForm.Designer.cs b/TEMUKJD/ToolForms/GetJuShuitanProdForm.Designer.cs
index 56b8a34..237fab4 100644
--- a/TEMUKJD/ToolForms/GetJuShuitanProdForm.Designer.cs
+++ b/TEMUKJD/ToolForms/GetJuShuitanProdForm.Designer.cs
@@ -107,7 +107,7 @@ namespace TemuKJD.ToolForms
this.tabControl1.Multiline = true;
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
- this.tabControl1.Size = new System.Drawing.Size(1904, 469);
+ this.tabControl1.Size = new System.Drawing.Size(1404, 470);
this.tabControl1.TabIndex = 0;
//
// tabPage1
@@ -117,7 +117,7 @@ namespace TemuKJD.ToolForms
this.tabPage1.Location = new System.Drawing.Point(4, 28);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage1.Size = new System.Drawing.Size(1896, 437);
+ this.tabPage1.Size = new System.Drawing.Size(1396, 438);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " 商品页面 ";
this.tabPage1.UseVisualStyleBackColor = true;
@@ -136,7 +136,7 @@ namespace TemuKJD.ToolForms
this.splitContainer2.Panel1.Controls.Add(this.btnNext);
this.splitContainer2.Panel1.Controls.Add(this.btnPrev);
this.splitContainer2.Panel1.Controls.Add(this.txtAddress);
- this.splitContainer2.Size = new System.Drawing.Size(1888, 429);
+ this.splitContainer2.Size = new System.Drawing.Size(1388, 430);
this.splitContainer2.SplitterDistance = 26;
this.splitContainer2.TabIndex = 6;
//
@@ -167,7 +167,7 @@ namespace TemuKJD.ToolForms
this.txtAddress.Location = new System.Drawing.Point(64, 3);
this.txtAddress.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.txtAddress.Name = "txtAddress";
- this.txtAddress.Size = new System.Drawing.Size(1824, 23);
+ this.txtAddress.Size = new System.Drawing.Size(1324, 23);
this.txtAddress.TabIndex = 7;
this.txtAddress.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtAddress_KeyDown);
//
@@ -363,8 +363,8 @@ namespace TemuKJD.ToolForms
this.splitContainer1.Panel2.Controls.Add(this.btnSaveCookie);
this.splitContainer1.Panel2.Controls.Add(this.btnImportCookie);
this.splitContainer1.Panel2.Controls.Add(this.label2);
- this.splitContainer1.Size = new System.Drawing.Size(1904, 561);
- this.splitContainer1.SplitterDistance = 469;
+ this.splitContainer1.Size = new System.Drawing.Size(1404, 561);
+ this.splitContainer1.SplitterDistance = 470;
this.splitContainer1.SplitterWidth = 3;
this.splitContainer1.TabIndex = 4;
//
@@ -446,7 +446,7 @@ namespace TemuKJD.ToolForms
this.chkSkip.AutoSize = true;
this.chkSkip.Checked = true;
this.chkSkip.CheckState = System.Windows.Forms.CheckState.Checked;
- this.chkSkip.Location = new System.Drawing.Point(1560, 33);
+ this.chkSkip.Location = new System.Drawing.Point(1060, 33);
this.chkSkip.Name = "chkSkip";
this.chkSkip.Size = new System.Drawing.Size(171, 21);
this.chkSkip.TabIndex = 942;
@@ -457,7 +457,7 @@ namespace TemuKJD.ToolForms
//
this.chkOverride.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chkOverride.AutoSize = true;
- this.chkOverride.Location = new System.Drawing.Point(1736, 33);
+ this.chkOverride.Location = new System.Drawing.Point(1236, 33);
this.chkOverride.Name = "chkOverride";
this.chkOverride.Size = new System.Drawing.Size(171, 21);
this.chkOverride.TabIndex = 920;
@@ -468,7 +468,7 @@ namespace TemuKJD.ToolForms
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(817, 8);
+ this.label1.Location = new System.Drawing.Point(317, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(32, 17);
this.label1.TabIndex = 898;
@@ -483,7 +483,7 @@ namespace TemuKJD.ToolForms
"抖音",
"淘宝",
"微信"});
- this.cmbPlatformType.Location = new System.Drawing.Point(849, 4);
+ this.cmbPlatformType.Location = new System.Drawing.Point(349, 4);
this.cmbPlatformType.Name = "cmbPlatformType";
this.cmbPlatformType.Size = new System.Drawing.Size(67, 25);
this.cmbPlatformType.TabIndex = 897;
@@ -497,7 +497,7 @@ namespace TemuKJD.ToolForms
this.cmbSaleCount.Items.AddRange(new object[] {
"7日销量≥",
"30日销量≥"});
- this.cmbSaleCount.Location = new System.Drawing.Point(1120, 4);
+ this.cmbSaleCount.Location = new System.Drawing.Point(620, 4);
this.cmbSaleCount.Name = "cmbSaleCount";
this.cmbSaleCount.Size = new System.Drawing.Size(76, 25);
this.cmbSaleCount.TabIndex = 875;
@@ -511,7 +511,7 @@ namespace TemuKJD.ToolForms
this.btnStopStop.CanvasColor = System.Drawing.SystemColors.Control;
this.btnStopStop.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnStopStop.DisabledBackColor = System.Drawing.Color.Empty;
- this.btnStopStop.Location = new System.Drawing.Point(1559, 58);
+ this.btnStopStop.Location = new System.Drawing.Point(1059, 58);
this.btnStopStop.Name = "btnStopStop";
this.btnStopStop.Size = new System.Drawing.Size(83, 23);
this.btnStopStop.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -537,7 +537,7 @@ namespace TemuKJD.ToolForms
this.btnSaveDb.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSaveDb.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSaveDb.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnSaveDb.Location = new System.Drawing.Point(1814, 58);
+ this.btnSaveDb.Location = new System.Drawing.Point(1314, 58);
this.btnSaveDb.Name = "btnSaveDb";
this.btnSaveDb.Size = new System.Drawing.Size(83, 23);
this.btnSaveDb.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -562,7 +562,7 @@ namespace TemuKJD.ToolForms
this.btnGetDetail.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnGetDetail.DisabledBackColor = System.Drawing.Color.Empty;
this.btnGetDetail.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnGetDetail.Location = new System.Drawing.Point(1729, 58);
+ this.btnGetDetail.Location = new System.Drawing.Point(1229, 58);
this.btnGetDetail.Name = "btnGetDetail";
this.btnGetDetail.Size = new System.Drawing.Size(83, 23);
this.btnGetDetail.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -585,7 +585,7 @@ namespace TemuKJD.ToolForms
this.statusBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.statusBar.Location = new System.Drawing.Point(817, 60);
+ this.statusBar.Location = new System.Drawing.Point(317, 60);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(740, 25);
@@ -595,7 +595,7 @@ namespace TemuKJD.ToolForms
//
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(1015, 8);
+ this.label4.Location = new System.Drawing.Point(515, 8);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(44, 17);
this.label4.TabIndex = 810;
@@ -604,7 +604,7 @@ namespace TemuKJD.ToolForms
// txtPageEnd
//
this.txtPageEnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.txtPageEnd.Location = new System.Drawing.Point(1059, 5);
+ this.txtPageEnd.Location = new System.Drawing.Point(559, 5);
this.txtPageEnd.Name = "txtPageEnd";
this.txtPageEnd.Size = new System.Drawing.Size(43, 23);
this.txtPageEnd.TabIndex = 809;
@@ -614,7 +614,7 @@ namespace TemuKJD.ToolForms
// txtPageStart
//
this.txtPageStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.txtPageStart.Location = new System.Drawing.Point(966, 5);
+ this.txtPageStart.Location = new System.Drawing.Point(466, 5);
this.txtPageStart.Name = "txtPageStart";
this.txtPageStart.Size = new System.Drawing.Size(43, 23);
this.txtPageStart.TabIndex = 808;
@@ -625,7 +625,7 @@ namespace TemuKJD.ToolForms
//
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(922, 8);
+ this.label3.Location = new System.Drawing.Point(422, 8);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(44, 17);
this.label3.TabIndex = 807;
@@ -638,7 +638,7 @@ namespace TemuKJD.ToolForms
this.btnCollect.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCollect.DisabledBackColor = System.Drawing.Color.Empty;
this.btnCollect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnCollect.Location = new System.Drawing.Point(1644, 58);
+ this.btnCollect.Location = new System.Drawing.Point(1144, 58);
this.btnCollect.Name = "btnCollect";
this.btnCollect.Size = new System.Drawing.Size(83, 23);
this.btnCollect.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -660,7 +660,7 @@ namespace TemuKJD.ToolForms
//
this.line1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.line1.ForeColor = System.Drawing.SystemColors.AppWorkspace;
- this.line1.Location = new System.Drawing.Point(796, 7);
+ this.line1.Location = new System.Drawing.Point(296, 7);
this.line1.Name = "line1";
this.line1.Size = new System.Drawing.Size(25, 74);
this.line1.TabIndex = 790;
@@ -670,7 +670,7 @@ namespace TemuKJD.ToolForms
// txtSupplierName
//
this.txtSupplierName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.txtSupplierName.Location = new System.Drawing.Point(1292, 5);
+ this.txtSupplierName.Location = new System.Drawing.Point(792, 5);
this.txtSupplierName.Name = "txtSupplierName";
this.txtSupplierName.ReadOnly = true;
this.txtSupplierName.Size = new System.Drawing.Size(605, 23);
@@ -679,7 +679,7 @@ namespace TemuKJD.ToolForms
// txtFilterSaleCount
//
this.txtFilterSaleCount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.txtFilterSaleCount.Location = new System.Drawing.Point(1199, 5);
+ this.txtFilterSaleCount.Location = new System.Drawing.Point(699, 5);
this.txtFilterSaleCount.Name = "txtFilterSaleCount";
this.txtFilterSaleCount.Size = new System.Drawing.Size(43, 23);
this.txtFilterSaleCount.TabIndex = 787;
@@ -693,7 +693,7 @@ namespace TemuKJD.ToolForms
this.btnRefreshCookie.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnRefreshCookie.DisabledBackColor = System.Drawing.Color.Empty;
this.btnRefreshCookie.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnRefreshCookie.Location = new System.Drawing.Point(671, 57);
+ this.btnRefreshCookie.Location = new System.Drawing.Point(171, 57);
this.btnRefreshCookie.Name = "btnRefreshCookie";
this.btnRefreshCookie.Size = new System.Drawing.Size(125, 25);
this.btnRefreshCookie.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -719,7 +719,7 @@ namespace TemuKJD.ToolForms
this.txtCookie.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.txtCookie.Multiline = true;
this.txtCookie.Name = "txtCookie";
- this.txtCookie.Size = new System.Drawing.Size(664, 78);
+ this.txtCookie.Size = new System.Drawing.Size(164, 78);
this.txtCookie.TabIndex = 766;
this.txtCookie.Text = "填写cookie后点击导入cookie并刷新";
//
@@ -730,7 +730,7 @@ namespace TemuKJD.ToolForms
this.btnSaveCookie.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSaveCookie.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSaveCookie.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnSaveCookie.Location = new System.Drawing.Point(671, 30);
+ this.btnSaveCookie.Location = new System.Drawing.Point(171, 30);
this.btnSaveCookie.Name = "btnSaveCookie";
this.btnSaveCookie.Size = new System.Drawing.Size(125, 25);
this.btnSaveCookie.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -755,7 +755,7 @@ namespace TemuKJD.ToolForms
this.btnImportCookie.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnImportCookie.DisabledBackColor = System.Drawing.Color.Empty;
this.btnImportCookie.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnImportCookie.Location = new System.Drawing.Point(671, 3);
+ this.btnImportCookie.Location = new System.Drawing.Point(171, 3);
this.btnImportCookie.Name = "btnImportCookie";
this.btnImportCookie.Size = new System.Drawing.Size(125, 25);
this.btnImportCookie.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -777,7 +777,7 @@ namespace TemuKJD.ToolForms
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(1248, 8);
+ this.label2.Location = new System.Drawing.Point(748, 8);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(44, 17);
this.label2.TabIndex = 789;
@@ -786,7 +786,7 @@ namespace TemuKJD.ToolForms
// GetJuShuitanProdForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
- this.ClientSize = new System.Drawing.Size(1904, 561);
+ this.ClientSize = new System.Drawing.Size(1404, 561);
this.Controls.Add(this.splitContainer1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "GetJuShuitanProdForm";
diff --git a/TEMUKJD/ToolForms/GetJuShuitanProdForm.cs b/TEMUKJD/ToolForms/GetJuShuitanProdForm.cs
index bc8d008..3a7e773 100644
--- a/TEMUKJD/ToolForms/GetJuShuitanProdForm.cs
+++ b/TEMUKJD/ToolForms/GetJuShuitanProdForm.cs
@@ -490,13 +490,17 @@ namespace TemuKJD.ToolForms
private void btnSaveDb_Click(object sender, EventArgs e)
{
+ Task.Run(() => { });
//"&product_get_type=" + HttpUtility.UrlEncode("厂商直采", Encoding.UTF8);
ConcurrentList rowLst = new ConcurrentList();
rowLst.AddRange(dgvProduct.Rows.Cast().Where(r => r.Cells["colCheck"].Value.ParseToBool() == true));
+ if (cancellationTokenSource == null || cancellationTokenSource.IsCancellationRequested)
+ cancellationTokenSource = new CancellationTokenSource();
+
this.pbLoading.Visible = true;
- Task.Run(() =>
+ var t = Task.Run(() =>
{
List cookieList = CEFBrowser.GetCookieList(".scm121.com", cefWebBrowser.GetCookieManager(null));
var shop = new ShopLoginInfo();
@@ -572,6 +576,8 @@ namespace TemuKJD.ToolForms
"&product_name=" + HttpUtility.UrlEncode(prod.dbProduct.product_name, Encoding.UTF8) +
"&product_json=" + HttpUtility.UrlEncode(dbProd.product_json, Encoding.UTF8) +
"&size_json=" + HttpUtility.UrlEncode(dbProd.size_json, Encoding.UTF8) +
+ "&sale_count=" + dbProd.sale_count +
+ "&sale_count_text=" + HttpUtility.UrlEncode(dbProd.sale_count_text, Encoding.UTF8) +
"&main_img=" + HttpUtility.UrlEncode(dbProd.main_img, Encoding.UTF8) +
"&product_get_type=" + HttpUtility.UrlEncode("厂商直采", Encoding.UTF8);
if (SetPartnerSpuRst.Contains("\"success\":true"))
@@ -730,7 +736,8 @@ namespace TemuKJD.ToolForms
var jObj = JsonHelper.JObjectParse(getDetailRst)["data"];
prod.dbProduct.cat_id = jObj["catId"].ParseToString();
prod.dbProduct.main_cat_id = jObj["categoryData"].FirstOrDefault().ParseToString();
- prod.dbProduct.product_json = "{\"pddData\":" + JsonHelper.SerializeObject(jObj) + ",\"jstProd\":" + prod.jstProductJson + "}";
+ var prodDataJson = JsonHelper.SerializeObject(jObj);
+ prod.dbProduct.product_json = "{\"pddData\":" + prodDataJson + ",\"jstProd\":" + prod.jstProductJson + "}";
var priceMin = jObj["skuInfo"]["goodsSkuDetail"].Min(s => s["supplyPrice"].ParseToDecimal());
var priceMax = jObj["skuInfo"]["goodsSkuDetail"].Max(s => s["supplyPrice"].ParseToDecimal());
prod.dbProduct.price_text = priceMin + "-" + priceMax;
diff --git a/Work/Initialization.cs b/Work/Initialization.cs
index 5d0da5f..ddd51d3 100644
--- a/Work/Initialization.cs
+++ b/Work/Initialization.cs
@@ -20,6 +20,7 @@ using System.Collections;
using System.Linq;
using System.Threading.Tasks;
using NaiBa.Util.Extension;
+using System.IO.Compression;
namespace Work
{
@@ -704,6 +705,17 @@ offCountPara,false;offProductPara,100;IrregularitiesPara,true;noNeerPara,true;no
if (GetHtml.DownloadFile(BaseClass.ServerUrl + "/Download/Sound/" + "9527.wav", fileName + ".bak"))
FileBase.Move(fileName + ".bak", fileName);
}
+ //ZipFile.ExtractToDirectory(tempFile, upTempPath);
+ //File.Delete(tempFile);
+ if (!FileBase.Exists("temp\\wxCat"))
+ {
+ if(GetHtml.DownloadFile(BaseClass.ServerUrl + "/Download/" + "wxCat.zip", "temp\\wxCat.dll" + ".bak"))
+ {
+ FileBase.Move("temp\\wxCat.dll" + ".bak", "temp\\wxCat.zip");
+ ZipFile.ExtractToDirectory(Path.Combine(Environment.CurrentDirectory, "temp\\wxCat.zip"), Path.Combine(Environment.CurrentDirectory, "temp"));
+ File.Delete(Path.Combine(Environment.CurrentDirectory, "temp\\wxCat.zip"));
+ }
+ }
/*
List files = new List();
diff --git a/Work/Work.csproj b/Work/Work.csproj
index a3a36ea..33ca326 100644
--- a/Work/Work.csproj
+++ b/Work/Work.csproj
@@ -110,6 +110,7 @@
..\DllReference\System.Data.SQLite.DLL
+