diff --git a/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs b/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs
index 60f8388..2ecd86c 100644
--- a/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs
+++ b/KJDService/KJD_WebService/BLL/BXX/BXXProductManage.cs
@@ -505,6 +505,8 @@ namespace KJD_Web.BLL.BXX
var sort_field = RegexUtils.GetStringQuery(ref inputData, "sort_field")?.Replace("'", "\\'");
var wx_safe_status = RegexUtils.GetStringQuery(ref inputData, "wx_safe_status")?.Replace("'", "\\'");
var special_prod_type = RegexUtils.GetStringQuery(ref inputData, "special_prod_type")?.Replace("'", "\\'");
+ if (special_prod_type.IsNullOrEmpty())
+ special_prod_type = "普通商品,书籍";
var is_supplier_prod_ok = RegexUtils.GetStringQuery(ref inputData, "is_supplier_prod_ok")?.Replace("'", "\\'");
var has_wx_cat = RegexUtils.GetStringQuery(ref inputData, "has_wx_cat")?.Replace("'", "\\'");
var send_to_out_server = RegexUtils.GetStringQuery(ref inputData, "send_to_out_server")?.Replace("'", "\\'");
@@ -563,7 +565,7 @@ namespace KJD_Web.BLL.BXX
// where += ") ";
//}
if (!string.IsNullOrEmpty(special_prod_type))
- where += " and p.special_prod_type ='" + special_prod_type + "'";
+ where += " and p.special_prod_type in ('" + special_prod_type.Replace(",", "','") + "')";
if (!string.IsNullOrWhiteSpace(search_spu))
{
diff --git a/KJDService/KJD_WebService/KJD_WebService.csproj b/KJDService/KJD_WebService/KJD_WebService.csproj
index 42f473c..987c748 100644
--- a/KJDService/KJD_WebService/KJD_WebService.csproj
+++ b/KJDService/KJD_WebService/KJD_WebService.csproj
@@ -75,6 +75,7 @@
+
@@ -132,8 +133,18 @@
+
+
+
+ WXProdHot.aspx
+ ASPXCodeBehind
+
+
+ WXProdHot.aspx
+
WXProd.aspx
+ ASPXCodeBehind
WXProd.aspx
diff --git a/KJDService/KJD_WebService/Upload/Prod/BaseClass.cs b/KJDService/KJD_WebService/Upload/Prod/BaseClass.cs
new file mode 100644
index 0000000..3f04d58
--- /dev/null
+++ b/KJDService/KJD_WebService/Upload/Prod/BaseClass.cs
@@ -0,0 +1,54 @@
+using KJD_Web.Utils;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace KJD_Web.Upload.Prod
+{
+
+ public class BaseClass
+ {
+ public static string BuildPDDObjString(string file, bool IsLoginDef = false)
+ {
+ string LoginApiUrl = "http://1.13.195.131:9001";
+ string MainPath = "kuajingda";
+ return LoginApiUrl + "/bxx_" + file + "?obj=" + MainPath + "/bxx_" + file;
+ }
+
+ public static int TimeDifferent = 0;
+ public static int VersionCount = 99999999;
+ public static int CompanyId = 1;
+ public static string CompanyName = "1";
+ public static string UserKey = "1";
+ public static string Mobile = "18888888888";
+ public static string UserName = "18888888888";
+ public static string ShopId = "18888888888";
+ public static string ShopName = "18888888888";
+ }
+
+ public class UserLogin
+ {
+ ///
+ /// 获取签名字符串,新版
+ ///
+ ///
+ public static string GetSignaturex()
+ {
+ return GetSignaturex(BaseClass.ShopId, BaseClass.ShopName);
+ }
+ public static string GetSignaturex(string shopId, string shopName)
+ {
+ if (string.IsNullOrEmpty(shopId))
+ shopId = "11111111";
+ if (string.IsNullOrEmpty(shopName))
+ shopName = "wx11111111";
+ int time = TimeUtils.DateTimeToTimestampSeconds(DateTime.Now) + BaseClass.TimeDifferent;
+ string time1 = EncrypUtil.Encryption(time);
+ return "time=" + time + "&code=" + time1 + "&NbCodeVersion=1" + "&version=" + BaseClass.VersionCount +
+ "&company_id=" + BaseClass.CompanyId + "&company=" + HtmlUtils.UrlEncodeUtf8(BaseClass.CompanyName) +
+ "&user_name=" + BaseClass.UserName + "&user_key=" + BaseClass.UserKey + "&mobile=" + BaseClass.Mobile +
+ "&sid=" + shopId + "&shop=" + HtmlUtils.UrlEncodeUtf8(shopName);
+ }
+ }
+}
\ No newline at end of file
diff --git a/KJDService/KJD_WebService/Upload/Prod/BaseWxProd.cs b/KJDService/KJD_WebService/Upload/Prod/BaseWxProd.cs
new file mode 100644
index 0000000..2793530
--- /dev/null
+++ b/KJDService/KJD_WebService/Upload/Prod/BaseWxProd.cs
@@ -0,0 +1,408 @@
+using KJD_Web.Utils;
+using KJD_WebService.Model.WxModel;
+using NaiBa.Util.Extension;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Web;
+
+namespace KJD_Web.Upload.Prod
+{
+ public class BaseWxProd
+ {
+ public string getProd(string prodStr, string special_prod_type = null)
+ {
+ var reducePer = 0m;
+ var realPricePer = 1m - reducePer * 0.01m;
+ if (realPricePer < 0.1m)
+ realPricePer = 0.1m;
+
+ WXClientProductInfoLite wxClientProd = new WXClientProductInfoLite();
+
+ var str_lst = RegexUtils.GetJsonObjStrJson(ref prodStr, "product_key");
+ try
+ {
+ var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
+ wxClientProd.product_key = JsonUtils.DeserializeJsonToObject(regex_str);
+ if (wxClientProd.product_key == null)
+ return "解析失败product_key";
+ }
+ catch
+ {
+ return "解析失败product_key";
+ }
+
+ //商品详情格式
+ wxClientProd.info = new wx_client_prod_info();
+
+ //主标题
+ wxClientProd.info.title = RegexUtils.GetStringJson(ref prodStr, "title");
+ if (wxClientProd.info.title.IsNullOrEmpty())
+ return "解析失败title";
+
+ //副标题
+ wxClientProd.info.sub_title = RegexUtils.GetStringJson(ref prodStr, "sub_title");
+
+ str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "head_img");
+ try
+ {
+ var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
+ wxClientProd.info.head_img = JsonUtils.DeserializeJsonToListNullable(regex_str);
+ if (wxClientProd.info.head_img == null)
+ return "解析失败head_img";
+ }
+ catch
+ {
+ return "解析失败head_img";
+ }
+
+ var nodeCatId = RegexUtils.GetStringJson(ref prodStr, "nodeCatId");
+
+ str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "category");
+ try
+ {
+ var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
+ wxClientProd.info.category = JsonUtils.DeserializeJsonToListNullable(regex_str);
+ if (wxClientProd.info.category != null && !str_lst.IsNullOrEmpty() && !wxClientProd.info.category.Any(c => c.catIdStr == nodeCatId))
+ {
+ wxClientProd.info.category.Add(new wx_client_category() { catId = nodeCatId, cat_id = nodeCatId });
+ }
+ //if (wxClientProd.info.category == null)
+ // return "解析失败";
+ }
+ catch
+ {
+ return "解析失败category";
+ }
+
+ str_lst = RegexUtils.GetJsonObjStrJson(ref prodStr, "detail");
+ try
+ {
+ var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
+ wxClientProd.info.detail = JsonUtils.DeserializeJsonToObjectNullable(regex_str);
+ if (wxClientProd.info.detail == null)
+ {
+ wxClientProd.info.detail = new wx_client_prod_detail();
+ wxClientProd.info.detail.detail_img.Add(wxClientProd.info.head_img.FirstOrDefault());
+ }
+
+ //if (wxClientProd.info.detail == null)
+ // return "解析失败";
+ }
+ catch
+ {
+ return "解析失败detail";
+ }
+
+ str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "param");
+ try
+ {
+ var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
+ wxClientProd.info.param = JsonUtils.DeserializeJsonToListNullable(regex_str);
+ if (wxClientProd.info.param == null)
+ wxClientProd.info.param = new List();
+ //if (wxClientProd.info.param == null)
+ // return "解析失败";
+ }
+ catch
+ {
+ return "解析失败param";
+ }
+
+ //品牌id
+ wxClientProd.info.brand_id = RegexUtils.GetStringJson(ref prodStr, "brand_id");
+ //if (wxClientProd.info.brand_id.IsNullOrEmpty())
+ // return "解析失败";
+
+ str_lst = RegexUtils.GetJsonObjStrJson(ref prodStr, "sku_id_list");
+ try
+ {
+ var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
+ wxClientProd.info.sku_id_list = JsonUtils.DeserializeJsonToObjectNullable(regex_str);
+ //if (wxClientProd.info.sku_id_list == null)
+ // return "解析失败";
+ }
+ catch
+ {
+ return "解析失败sku_id_list";
+ }
+
+ str_lst = RegexUtils.GetJsonObjStrJson(ref prodStr, "sku_list");
+ try
+ {
+ var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
+ wxClientProd.info.sku_list = JsonUtils.DeserializeJsonToObjectNullable(regex_str);
+ //if (wxClientProd.info.sku_list == null)
+ // return "解析失败";
+ }
+ catch
+ {
+ return "解析失败sku_list";
+ }
+
+ if (wxClientProd.info.sku_list == null)
+ {
+ str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "sku_info");
+ try
+ {
+ var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
+ var sku_infos = JsonUtils.DeserializeJsonToListNullable(regex_str);
+ if (sku_infos != null)
+ {
+ wxClientProd.info.sku_list = new wx_sku();
+ wxClientProd.info.sku_list.sku_info = sku_infos;
+ }
+ }
+ catch
+ {
+ return "解析失败sku_info";
+ }
+ }
+
+ // 佣金商品 根据折扣价格和佣金比例减去佣金
+ if (wxClientProd.info.sku_list != null)
+ {
+ foreach (var sku in wxClientProd.info.sku_list.sku_info)
+ {
+ sku.price = (sku.price - (sku.price - sku.discounted_price) * (1m - realPricePer)).ParseToInt();
+ }
+ }
+
+ str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "product_sale_attrs");
+ try
+ {
+ var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
+ wxClientProd.info.product_sale_attrs = JsonUtils.DeserializeJsonToListNullable(regex_str);
+ //if (wxClientProd.info.product_sale_attrs == null)
+ // return "解析失败";
+ }
+ catch
+ {
+ return "解析失败product_sale_attrs";
+ }
+
+
+ //总销量
+ wxClientProd.info.total_sold_num = RegexUtils.GetStringJson(ref prodStr, "total_sold_num");
+ //if (wxClientProd.info.total_sold_num.IsNullOrEmpty())
+ // return "解析失败";
+
+ str_lst = RegexUtils.GetJsonObjStrJson(ref prodStr, "service_desc");
+ try
+ {
+ var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
+ wxClientProd.info.service_desc = JsonUtils.DeserializeJsonToObjectNullable(regex_str);
+ //if (wxClientProd.info.service_desc == null)
+ // return "解析失败";
+ }
+ catch
+ {
+ return "解析失败service_desc";
+ }
+
+ str_lst = RegexUtils.GetJsonObjStrJson(ref prodStr, "express_info");
+ try
+ {
+ var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
+ wxClientProd.info.express_info = JsonUtils.DeserializeJsonToObjectNullable(regex_str);
+ //if (wxClientProd.info.express_info == null)
+ // return;
+ }
+ catch
+ {
+ return "解析失败express_info";
+ }
+
+ str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "headVideoInfo");
+ try
+ {
+ var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
+ wxClientProd.info.headVideoInfo = JsonUtils.DeserializeJsonToListNullable(regex_str);
+ //if (wxClientProd.info.headVideoInfo == null)
+ // return "解析失败";
+ }
+ catch
+ {
+ return "解析失败headVideoInfo";
+ }
+
+ str_lst = RegexUtils.GetJsonObjStrJson(ref prodStr, "afterSaleInfo");
+ try
+ {
+ var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
+ wxClientProd.info.afterSaleInfo = JsonUtils.DeserializeJsonToObjectNullable