微信app采集
This commit is contained in:
1 parent
52220daa8b
commit
2f61dc1cdd
67 files changed
+6197
-1118
No files matched your search
@@ -175,7 +175,7 @@ namespace KJD_Web.BLL.BXX
|
||||
};
|
||||
priceList.Add(price);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(priceList);
|
||||
var data = JsonUtils.SerializeObjectToString(priceList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -548,7 +548,7 @@ namespace KJD_Web.BLL.BXX
|
||||
};
|
||||
purchasePriceList.Add(price);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(purchasePriceList);
|
||||
var data = JsonUtils.SerializeObjectToString(purchasePriceList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -742,7 +742,7 @@ namespace KJD_Web.BLL.BXX
|
||||
};
|
||||
priceList.Add(price);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(priceList);
|
||||
var data = JsonUtils.SerializeObjectToString(priceList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -308,7 +308,7 @@ namespace KJD_Web.BLL.BXX
|
||||
productLst.Add(prod);
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializerObjectToString(productLst, jsonSetting);
|
||||
var data = JsonUtils.SerializeObjectToString(productLst, jsonSetting);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + productLst.Count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -348,6 +348,7 @@ namespace KJD_Web.BLL.BXX
|
||||
var wx_cat_1 = RegexUtils.GetStringQuery(ref inputData, "wx_cat_1")?.Replace("'", "\\'");
|
||||
var wx_cat_2 = RegexUtils.GetStringQuery(ref inputData, "wx_cat_2")?.Replace("'", "\\'");
|
||||
var wx_cat_3 = RegexUtils.GetStringQuery(ref inputData, "wx_cat_3")?.Replace("'", "\\'");
|
||||
var wx_cat_leaf = RegexUtils.GetStringQuery(ref inputData, "wx_cat_leaf")?.Replace("'", "\\'");
|
||||
var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'");
|
||||
var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'");
|
||||
var search_group = RegexUtils.GetStringQuery(ref inputData, "search_group")?.Replace("'", "\\'");
|
||||
@@ -433,6 +434,8 @@ namespace KJD_Web.BLL.BXX
|
||||
where += " and p.wx_cat_2 in (" + wx_cat_2 + ")";
|
||||
if (!string.IsNullOrWhiteSpace(wx_cat_3))
|
||||
where += " and p.wx_cat_3 in (" + wx_cat_3 + ")";
|
||||
if (!string.IsNullOrWhiteSpace(wx_cat_leaf))
|
||||
where += " and p.wx_cat_leaf in (" + wx_cat_leaf + ")";
|
||||
|
||||
if (!string.IsNullOrEmpty(has_wx_cat))
|
||||
{
|
||||
@@ -623,7 +626,7 @@ namespace KJD_Web.BLL.BXX
|
||||
productLst.Add(prod);
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializerObjectToString(productLst, jsonSetting);
|
||||
var data = JsonUtils.SerializeObjectToString(productLst, jsonSetting);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -765,7 +768,7 @@ namespace KJD_Web.BLL.BXX
|
||||
wxProdComplateArr.Add(wxProdComplateObj);
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializerObjectToString(wxProdComplateArr, jsonSetting);
|
||||
var data = JsonUtils.SerializeObjectToString(wxProdComplateArr, jsonSetting);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + wxProdComplateArr.Count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -937,7 +940,7 @@ namespace KJD_Web.BLL.BXX
|
||||
productLst.Add(prod);
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializerObjectToString(productLst, jsonSetting);
|
||||
var data = JsonUtils.SerializeObjectToString(productLst, jsonSetting);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + productLst.Count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -1063,6 +1066,61 @@ namespace KJD_Web.BLL.BXX
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string GetProductMainCates(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
//string sql = "SELECT DISTINCT p.cat_name FROM `bxx`.`product` p where p.is_del=0";
|
||||
string sql = "SELECT DISTINCT p.main_cat_name FROM `bxx`.`product` p where p.is_del=0";
|
||||
|
||||
string where = "";
|
||||
sql += where;
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
string group_data = "";
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
group_data += row["main_cat_name"].ToString() + ",";
|
||||
}
|
||||
var data = group_data.Trim(',');
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":\"" + data + "\"}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "{\"code\":50002,\"msg\":\"" + ex.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询商品替换sku
|
||||
/// </summary>
|
||||
@@ -1139,7 +1197,7 @@ namespace KJD_Web.BLL.BXX
|
||||
}
|
||||
skuImgReplaceLst.Add(skuImgReplace);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(skuImgReplaceLst);
|
||||
var data = JsonUtils.SerializeObjectToString(skuImgReplaceLst);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -1355,7 +1413,7 @@ namespace KJD_Web.BLL.BXX
|
||||
productLst.Add(prod);
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializerObjectToString(productLst, jsonSetting);
|
||||
var data = JsonUtils.SerializeObjectToString(productLst, jsonSetting);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
if (product_get_type == "厂商直采" && count > 500)
|
||||
count *= 3;
|
||||
@@ -1450,7 +1508,7 @@ namespace KJD_Web.BLL.BXX
|
||||
{
|
||||
imgs.Add(row["img_url"].ToString());
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(imgs);
|
||||
var data = JsonUtils.SerializeObjectToString(imgs);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -2116,7 +2174,7 @@ namespace KJD_Web.BLL.BXX
|
||||
prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?;
|
||||
productLst.Add(prodSelect);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
var data = JsonUtils.SerializeObjectToString(productLst);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -2748,7 +2806,7 @@ namespace KJD_Web.BLL.BXX
|
||||
productLst.Add(prod);
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializerObjectToString(productLst, jsonSetting);
|
||||
var data = JsonUtils.SerializeObjectToString(productLst, jsonSetting);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace KJD_Web.BLL.BXX
|
||||
}
|
||||
productLst.Add(prod);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
var data = JsonUtils.SerializeObjectToString(productLst);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -622,7 +622,7 @@ namespace KJD_Web.BLL.BXX
|
||||
prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?;
|
||||
productLst.Add(prodSelect);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
var data = JsonUtils.SerializeObjectToString(productLst);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -184,7 +184,7 @@ namespace KJD_Web.BLL.BXX
|
||||
}
|
||||
}
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
|
||||
|
||||
//return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
@@ -362,7 +362,7 @@ namespace KJD_Web.BLL.BXX
|
||||
}
|
||||
}
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
|
||||
|
||||
//return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
@@ -455,7 +455,7 @@ namespace KJD_Web.BLL.BXX
|
||||
};
|
||||
shopList.Add(shop);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
@@ -504,7 +504,7 @@ namespace KJD_Web.BLL.BXX
|
||||
};
|
||||
shopList.Add(shop);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace KJD_Web.BLL.BXX
|
||||
{
|
||||
user.company_name = "-";
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(user);
|
||||
var data = JsonUtils.SerializeObjectToString(user);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
return "{\"code\":1,\"msg\":\"用户名或密码错误\"}";
|
||||
@@ -145,7 +145,7 @@ namespace KJD_Web.BLL.BXX
|
||||
}
|
||||
userList.Add(user);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(userList);
|
||||
var data = JsonUtils.SerializeObjectToString(userList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
@@ -283,7 +283,7 @@ namespace KJD_Web.BLL.BXX
|
||||
}
|
||||
userList.Add(user);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(userList);
|
||||
var data = JsonUtils.SerializeObjectToString(userList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ namespace KJD_Web.BLL.DYXD
|
||||
}
|
||||
}
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
|
||||
|
||||
//return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
@@ -362,7 +362,7 @@ namespace KJD_Web.BLL.DYXD
|
||||
}
|
||||
}
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
|
||||
|
||||
//return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
@@ -455,7 +455,7 @@ namespace KJD_Web.BLL.DYXD
|
||||
};
|
||||
shopList.Add(shop);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
@@ -504,7 +504,7 @@ namespace KJD_Web.BLL.DYXD
|
||||
};
|
||||
shopList.Add(shop);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace KJD_Web.BLL.DYXD
|
||||
{
|
||||
user.company_name = "-";
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(user);
|
||||
var data = JsonUtils.SerializeObjectToString(user);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
return "{\"code\":1,\"msg\":\"用户名或密码错误\"}";
|
||||
@@ -150,7 +150,7 @@ namespace KJD_Web.BLL.DYXD
|
||||
}
|
||||
userList.Add(user);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(userList);
|
||||
var data = JsonUtils.SerializeObjectToString(userList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
@@ -288,7 +288,7 @@ namespace KJD_Web.BLL.DYXD
|
||||
}
|
||||
userList.Add(user);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(userList);
|
||||
var data = JsonUtils.SerializeObjectToString(userList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ namespace KJD_Web.BLL
|
||||
};
|
||||
orderLst.Add(prod);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(orderLst);
|
||||
var data = JsonUtils.SerializeObjectToString(orderLst);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace KJD_Web.BLL
|
||||
};
|
||||
priceList.Add(price);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(priceList);
|
||||
var data = JsonUtils.SerializeObjectToString(priceList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -548,7 +548,7 @@ namespace KJD_Web.BLL
|
||||
};
|
||||
purchasePriceList.Add(price);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(purchasePriceList);
|
||||
var data = JsonUtils.SerializeObjectToString(purchasePriceList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace KJD_Web.BLL
|
||||
var group = row["group"].ToString();
|
||||
groupNameLst.Add(group);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(groupNameLst);
|
||||
var data = JsonUtils.SerializeObjectToString(groupNameLst);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -292,7 +292,7 @@ namespace KJD_Web.BLL
|
||||
}
|
||||
productLst.Add(prod);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
var data = JsonUtils.SerializeObjectToString(productLst);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -877,7 +877,7 @@ namespace KJD_Web.BLL
|
||||
prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?;
|
||||
productLst.Add(prodSelect);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
var data = JsonUtils.SerializeObjectToString(productLst);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -1256,7 +1256,7 @@ namespace KJD_Web.BLL
|
||||
};
|
||||
dbIdMapProductIdLst.Add(dbIdMapProductId);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(dbIdMapProductIdLst);
|
||||
var data = JsonUtils.SerializeObjectToString(dbIdMapProductIdLst);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -1347,7 +1347,7 @@ namespace KJD_Web.BLL
|
||||
};
|
||||
draftIdMapUpSpuIdLst.Add(draftIdMapUpSpuId);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(draftIdMapUpSpuIdLst);
|
||||
var data = JsonUtils.SerializeObjectToString(draftIdMapUpSpuIdLst);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + -1 + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -1589,7 +1589,7 @@ namespace KJD_Web.BLL
|
||||
//}
|
||||
skuImgLst.Add(img);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(skuImgLst);
|
||||
var data = JsonUtils.SerializeObjectToString(skuImgLst);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace KJD_Web.BLL
|
||||
}
|
||||
productLst.Add(prod);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
var data = JsonUtils.SerializeObjectToString(productLst);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -316,7 +316,7 @@ namespace KJD_Web.BLL
|
||||
}
|
||||
productLst.Add(prod);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
var data = JsonUtils.SerializeObjectToString(productLst);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -433,7 +433,7 @@ namespace KJD_Web.BLL
|
||||
}
|
||||
productLst.Add(prod);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
var data = JsonUtils.SerializeObjectToString(productLst);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -1084,7 +1084,7 @@ namespace KJD_Web.BLL
|
||||
prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?;
|
||||
productLst.Add(prodSelect);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
var data = JsonUtils.SerializeObjectToString(productLst);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -1451,7 +1451,7 @@ namespace KJD_Web.BLL
|
||||
};
|
||||
dbIdMapProductIdLst.Add(dbIdMapProductId);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(dbIdMapProductIdLst);
|
||||
var data = JsonUtils.SerializeObjectToString(dbIdMapProductIdLst);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace KJD_Web.BLL
|
||||
}
|
||||
}
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
|
||||
|
||||
//return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
@@ -367,7 +367,7 @@ namespace KJD_Web.BLL
|
||||
}
|
||||
}
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
|
||||
|
||||
//return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
@@ -459,7 +459,7 @@ namespace KJD_Web.BLL
|
||||
};
|
||||
shopList.Add(shop);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
@@ -507,7 +507,7 @@ namespace KJD_Web.BLL
|
||||
};
|
||||
shopList.Add(shop);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
@@ -926,7 +926,7 @@ namespace KJD_Web.BLL
|
||||
};
|
||||
cardCodeList.Add(cardCode);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(cardCodeList);
|
||||
var data = JsonUtils.SerializeObjectToString(cardCodeList);
|
||||
|
||||
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace KJD_Web.BLL
|
||||
{
|
||||
user.company_name = "-";
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(user);
|
||||
var data = JsonUtils.SerializeObjectToString(user);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
return "{\"code\":1,\"msg\":\"用户名或密码错误\"}";
|
||||
@@ -149,7 +149,7 @@ namespace KJD_Web.BLL
|
||||
}
|
||||
userList.Add(user);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(userList);
|
||||
var data = JsonUtils.SerializeObjectToString(userList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
@@ -295,7 +295,7 @@ namespace KJD_Web.BLL
|
||||
}
|
||||
userList.Add(user);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(userList);
|
||||
var data = JsonUtils.SerializeObjectToString(userList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,57 +236,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
|
||||
public string WXGetPDDProductCates(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
//string sql = "SELECT DISTINCT p.cat_name FROM `bxx`.`product` p where p.is_del=0";
|
||||
string sql = "SELECT DISTINCT p.main_cat_name FROM `bxx`.`product` p where p.is_del=0";
|
||||
|
||||
string where = "";
|
||||
sql += where;
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
string group_data = "";
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
group_data += row["main_cat_name"].ToString() + ",";
|
||||
}
|
||||
var data = group_data.Trim(',');
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":\"" + data + "\"}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "{\"code\":50002,\"msg\":\"" + ex.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
return new BXX.BXXProductManage().GetProductMainCates(inputData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -565,7 +515,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
};
|
||||
prodSecretIdMapLst.Add(idMap);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(prodSecretIdMapLst);
|
||||
var data = JsonUtils.SerializeObjectToString(prodSecretIdMapLst);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -611,7 +561,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT coid FROM `wxxd`.`after_sale` where coid='" + coid + "'";
|
||||
string sql = "SELECT coid FROM `wxxd`.`after_sale` where coid='" + coid + "' and is_del=0";
|
||||
|
||||
string where = "";
|
||||
sql += where;
|
||||
@@ -634,7 +584,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
sql += ", supplier_name=@supplier_name ";
|
||||
if (type != null)
|
||||
sql += ", type=@type ";
|
||||
sql += " WHERE coid=@coid;";
|
||||
sql += " WHERE coid=@coid and is_del=0;";
|
||||
}
|
||||
|
||||
List<MySqlParameter> paramLst = new List<MySqlParameter>();
|
||||
@@ -661,6 +611,11 @@ namespace KJD_Web.BLL.WXXD
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上货实时获取
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public string WXGetAfterSale(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
@@ -683,7 +638,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT * FROM `wxxd`.`after_sale` where coid='" + coid + "'";
|
||||
string sql = "SELECT * FROM `wxxd`.`after_sale` where coid='" + coid + "' and is_del=0";
|
||||
|
||||
string where = "";
|
||||
sql += where;
|
||||
@@ -719,6 +674,11 @@ namespace KJD_Web.BLL.WXXD
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 售后列表管理
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public string WXGetAfterSaleList(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
@@ -741,6 +701,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
string type = RegexUtils.GetStringQuery(ref inputData, "type")?.Replace("'", "\\'");
|
||||
string supplier_name = RegexUtils.GetStringQuery(ref inputData, "supplier_name")?.Replace("'", "\\'");
|
||||
string detail = RegexUtils.GetStringQuery(ref inputData, "detail")?.Replace("'", "\\'");
|
||||
string isDel = RegexUtils.GetStringQuery(ref inputData, "isDel")?.Replace("'", "\\'");
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
@@ -756,6 +717,12 @@ namespace KJD_Web.BLL.WXXD
|
||||
where += " and supplier_name='" + supplier_name + "'";
|
||||
if (detail != null)
|
||||
where += " and after_sale_json like '%" + detail + "%'";
|
||||
|
||||
if (isDel == "true")
|
||||
where += " and is_del>0";
|
||||
else
|
||||
where += " and is_del=0";
|
||||
|
||||
sql += where;
|
||||
sql += ";";
|
||||
|
||||
@@ -795,7 +762,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
});
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializerObjectToString(WXAddressInfoLst, jsonSetting);
|
||||
var data = JsonUtils.SerializeObjectToString(WXAddressInfoLst, jsonSetting);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -835,7 +802,8 @@ namespace KJD_Web.BLL.WXXD
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "delete from wxxd.after_sale where coid='" + coid + "'";
|
||||
//string sql = "delete from wxxd.after_sale where coid='" + coid + "' and is_del=false";
|
||||
string sql = "update wxxd.after_sale set is_del=" + RandomUtils.GetId(1, Int32.MaxValue) + " where coid='" + coid + "' and is_del=false";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
|
||||
//return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
@@ -367,7 +367,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
}
|
||||
}
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
|
||||
|
||||
//return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
@@ -461,7 +461,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
};
|
||||
shopList.Add(shop);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
@@ -511,7 +511,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
};
|
||||
shopList.Add(shop);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(shopList);
|
||||
var data = JsonUtils.SerializeObjectToString(shopList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
@@ -828,7 +828,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
return "{\"code\":500,\"msg\":\"" + errMsg + "\"}";
|
||||
}
|
||||
mdyTime = DateTime.Now;
|
||||
tokens = JsonUtils.SerializerObjectToString(JObject.Parse(tokenRst)["list"]);
|
||||
tokens = JsonUtils.SerializeObjectToString(JObject.Parse(tokenRst)["list"]);
|
||||
|
||||
conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
mySql = new MysqlUtils(conn);
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
{
|
||||
user.company_name = "-";
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(user);
|
||||
var data = JsonUtils.SerializeObjectToString(user);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
return "{\"code\":1,\"msg\":\"用户名或密码错误\"}";
|
||||
@@ -153,7 +153,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
}
|
||||
userList.Add(user);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(userList);
|
||||
var data = JsonUtils.SerializeObjectToString(userList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
@@ -295,7 +295,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
}
|
||||
userList.Add(user);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(userList);
|
||||
var data = JsonUtils.SerializeObjectToString(userList);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"c\":\"" + EncrypUtil.Encryption(r2) + "\"}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,6 +242,17 @@ namespace KJD_Web
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void get_pdd_product_cates()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXProductManage().GetProductMainCates(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
[WebMethod]
|
||||
public void get_product_cates()
|
||||
{
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Upload\Prod\WXProd.aspx" />
|
||||
<Content Include="WXProductService.asmx" />
|
||||
<Content Include="WXShopService.asmx" />
|
||||
<Content Include="DYShopService.asmx" />
|
||||
@@ -116,9 +117,23 @@
|
||||
<Compile Include="BLL\WXXD\WXShopManage.cs" />
|
||||
<Compile Include="BLL\WXXD\WXUserManage.cs" />
|
||||
<Compile Include="Model\JSTDownProdSkuInfo.cs" />
|
||||
<Compile Include="Model\PddModel\PDDMaterialInfo.cs" />
|
||||
<Compile Include="Model\PddModel\PDDProductDecorationInfo.cs" />
|
||||
<Compile Include="Model\PddModel\PDDSizeSpecInfo.cs" />
|
||||
<Compile Include="Model\PddModel\PDDProductDetailInfo.cs" />
|
||||
<Compile Include="Model\PddModel\PDDProductInfo.cs" />
|
||||
<Compile Include="Model\PddModel\PDDProductPropertyInfo.cs" />
|
||||
<Compile Include="Model\ShopModel\JSTListProductSkuInfo.cs" />
|
||||
<Compile Include="Model\WXAddressInfo.cs" />
|
||||
<Compile Include="Model\WxModel\WXClientProductInfoLite.cs" />
|
||||
<Compile Include="Model\WxModel\WXGetEditProductInfoLite.cs" />
|
||||
<Compile Include="Model\WxProdSecretSpuIdShopIdMapParam.cs" />
|
||||
<Compile Include="Upload\Prod\WXProd.aspx.cs">
|
||||
<DependentUpon>WXProd.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Upload\Prod\WXProd.aspx.designer.cs">
|
||||
<DependentUpon>WXProd.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utils\HttpUtils.cs" />
|
||||
<Compile Include="Utils\RandomUtils.cs" />
|
||||
<Compile Include="WXProductService.asmx.cs">
|
||||
|
||||
@@ -103,4 +103,9 @@ namespace KJD_Web.Model
|
||||
public string has_wx_format { get; set; }
|
||||
public string standby3 { get; set; }
|
||||
}
|
||||
|
||||
public class KJDDBProduct : DBProductResultParam
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace KJD_WebService.Model
|
||||
{
|
||||
public class PDDMaterialInfo
|
||||
{
|
||||
public long? latest_material_id { get; set; }
|
||||
public string latest_material { get; set; }
|
||||
public int? check_status { get; set; }
|
||||
public object check_comment { get; set; }
|
||||
public string online_material { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace KJD_WebService.Model
|
||||
{
|
||||
public class PDDProductDecorationInfo
|
||||
{
|
||||
public long? goods_id { get; set; }
|
||||
public long? goods_commit_id { get; set; }
|
||||
public long? mall_id { get; set; }
|
||||
public List<PDDProdfloorItem> floor_list { get; set; } = new List<PDDProdfloorItem>();
|
||||
public long? create_time { get; set; }
|
||||
public long? update_time { get; set; }
|
||||
}
|
||||
|
||||
public class PDDProdfloorItem
|
||||
{
|
||||
public long? floor_id { get; set; }
|
||||
public string key { get; set; }
|
||||
public string type { get; set; }
|
||||
public int? priority { get; set; }
|
||||
public List<PDDProdContentItem> content_list { get; set; }
|
||||
public object check_status { get; set; }
|
||||
public object check_id { get; set; }
|
||||
public object check_name { get; set; }
|
||||
public object comment { get; set; }
|
||||
public object if_have_template { get; set; }
|
||||
public object floor_status { get; set; }
|
||||
public object template_id { get; set; }
|
||||
public object template_type { get; set; }
|
||||
public object template_json { get; set; }
|
||||
}
|
||||
|
||||
public class PDDProdContentItem
|
||||
{
|
||||
public string img_url { get; set; }
|
||||
public long? file_id { get; set; }
|
||||
public int? height { get; set; }
|
||||
public int? width { get; set; }
|
||||
public int? file_status { get; set; }
|
||||
public object goods_id { get; set; }
|
||||
public object goods_name { get; set; }
|
||||
public object show_price { get; set; }
|
||||
public object status { get; set; }
|
||||
public object min_on_sale_group_price { get; set; }
|
||||
public string text { get; set; }
|
||||
public object hot_zone_list { get; set; }
|
||||
public text_module_detail_item text_module_details { get; set; }
|
||||
public object activity_sn { get; set; }
|
||||
public object combine_buy_element_dtolist { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class text_module_detail_item
|
||||
{
|
||||
public int? font_size { get; set; }
|
||||
public string font_color { get; set; }
|
||||
public int font_family { get; set; }
|
||||
public string align { get; set; }
|
||||
public string background_color { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,331 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace KJD_WebService.Model
|
||||
{
|
||||
public class PDDProductDetailInfo
|
||||
{
|
||||
public long? id { get; set; }
|
||||
public long? goods_id { get; set; }
|
||||
public int? check_status { get; set; }
|
||||
public int? commit_deleted { get; set; }
|
||||
public string owner { get; set; }
|
||||
public int? is_shop { get; set; }
|
||||
public string goods_sn { get; set; }
|
||||
public string out_goods_sn { get; set; }
|
||||
public int? is_folt { get; set; }
|
||||
public string warm_tips { get; set; }
|
||||
public object fabric { get; set; }
|
||||
|
||||
|
||||
public object fabric_content { get; set; }
|
||||
public long? cost_template_id { get; set; }
|
||||
public int? cat_id { get; set; }
|
||||
public long? mall_id { get; set; }
|
||||
public string goods_name { get; set; }
|
||||
public string tiny_name { get; set; }
|
||||
public string goods_desc { get; set; }
|
||||
public string share_desc { get; set; }
|
||||
public List<object> list_desc { get; set; }
|
||||
|
||||
public int? market_price { get; set; }
|
||||
public string thumb_url { get; set; }
|
||||
public string image_url { get; set; }
|
||||
public string hd_thumb_url { get; set; }
|
||||
public List<object> allowed_region { get; set; }
|
||||
|
||||
|
||||
public int? region_limit { get; set; }
|
||||
public int? goods_type { get; set; }
|
||||
public object country { get; set; }
|
||||
public int? country_id { get; set; }
|
||||
public string goods_name_prefix { get; set; }
|
||||
public int? origin_country_id { get; set; }
|
||||
public string origin_country_name { get; set; }
|
||||
public object size_spec_id { get; set; }
|
||||
public object size_parent_spec_id { get; set; }
|
||||
public string warehouse { get; set; }
|
||||
public int? event_type { get; set; }
|
||||
public int? is_app { get; set; }
|
||||
public int? is_pre_sale { get; set; }
|
||||
public int? pre_sale_time { get; set; }
|
||||
public int? is_sku_pre_sale { get; set; }
|
||||
public int? is_refundable { get; set; }
|
||||
public int? is_customs { get; set; }
|
||||
public int? is_wms { get; set; }
|
||||
public string customs { get; set; }
|
||||
public int? is_bangdan { get; set; }
|
||||
public long? shipment_limit_second { get; set; }
|
||||
public int? quick_refund { get; set; }
|
||||
public group_item groups { get; set; }
|
||||
public commit_extension_item commit_extension { get; set; }
|
||||
public List<gallery_item> galleries { get; set; }
|
||||
public List<object> goods_commit_check { get; set; }
|
||||
public mall_info_item mall_info { get; set; }
|
||||
public List<sku_item> sku { get; set; }
|
||||
|
||||
|
||||
public object reject_status { get; set; }
|
||||
public object reject_reason { get; set; }
|
||||
public object paper_net_weight { get; set; }
|
||||
public object paper_length { get; set; }
|
||||
public object paper_width { get; set; }
|
||||
public object paper_plies_num { get; set; }
|
||||
public int? second_hand { get; set; }
|
||||
public int? source { get; set; }
|
||||
public bool is_card_secret { get; set; }
|
||||
public bool is_only_for_remote_area { get; set; }
|
||||
public int? invoice_status { get; set; }
|
||||
public object invoice_mode { get; set; }
|
||||
public object client_id { get; set; }
|
||||
public int? quan_guo_lian_bao { get; set; }
|
||||
public int? zhi_huan_bu_xiu { get; set; }
|
||||
public object song_huo_ru_hu { get; set; }
|
||||
public object shang_men_an_zhuang { get; set; }
|
||||
public object song_huo_an_zhuang { get; set; }
|
||||
public object mai_jia_zi_ti { get; set; }
|
||||
public object sf_markup_template_sn { get; set; }
|
||||
public long? min_group_price { get; set; }
|
||||
public long? max_group_price { get; set; }
|
||||
public int? must_check_type { get; set; }
|
||||
public object goods_property_list { get; set; }
|
||||
public object is_small_group { get; set; }
|
||||
public int? submit_time { get; set; }
|
||||
public int? oversea_type { get; set; }
|
||||
public object oversea_goods { get; set; }
|
||||
public int? is_general_trade { get; set; }
|
||||
public int? bad_fruit_claim { get; set; }
|
||||
public string bad_claim_text { get; set; }
|
||||
public int? allergy_refund { get; set; }
|
||||
public int? lack_of_weight_claim { get; set; }
|
||||
public int? delivery_one_day { get; set; }
|
||||
public object delivery_type { get; set; }
|
||||
public int? goods_pattern { get; set; }
|
||||
public int? customizable { get; set; }
|
||||
public int? is_group_pre_sale { get; set; }
|
||||
public object elec_goods_attributes { get; set; }
|
||||
public schedule_sale_item schedule_sale { get; set; }
|
||||
|
||||
public object goods_trade_attr { get; set; }
|
||||
public object goods_travel_attr { get; set; }
|
||||
public object sku_type { get; set; }
|
||||
public int? is_goods_decoration { get; set; }
|
||||
public List<object> goods_srv_templates { get; set; }
|
||||
|
||||
public object card_verification_list { get; set; }
|
||||
public object transport_type_list { get; set; }
|
||||
public object out_source_type { get; set; }
|
||||
public object out_source_goods_id { get; set; }
|
||||
public object is_all_weight_same { get; set; }
|
||||
public bool? is_spring_festival_open_tag { get; set; }
|
||||
public int? two_pieces_discount { get; set; }
|
||||
|
||||
public instruction_vo_item instruction_vo { get; set; }
|
||||
public object local_service_id_list { get; set; }
|
||||
public object shop_group_id { get; set; }
|
||||
public object shop_group_name { get; set; }
|
||||
public int? is_refundable_fifteen_day { get; set; }
|
||||
public int? is_warranty_one_year { get; set; }
|
||||
public long? created_at { get; set; }
|
||||
public int? privacy_delivery { get; set; }
|
||||
public object invoice_mode_sub_type { get; set; }
|
||||
public bool? is_two_num_group { get; set; }
|
||||
public extend_warranty_dto_item extend_warranty_dto { get; set; }
|
||||
public int? is_sku_shipment { get; set; }
|
||||
public List<object> qualification_id_list { get; set; }
|
||||
public int? is_certificate_provide { get; set; }
|
||||
public int? thawed_refund { get; set; }
|
||||
public int? damage_claim { get; set; }
|
||||
public int? is_wp_service { get; set; }
|
||||
public int? is_size_change_casually { get; set; }
|
||||
public string owner_name { get; set; }
|
||||
public bool? show_activity_price { get; set; }
|
||||
public object appeal_status { get; set; }
|
||||
public object can_appeal { get; set; }
|
||||
|
||||
public List<int?> cat_ids { get; set; }
|
||||
public List<string> cats { get; set; }
|
||||
|
||||
public bool? is_draft { get; set; }
|
||||
public int? third_type { get; set; }
|
||||
public int? estimate_quantity { get; set; }
|
||||
public int? last_commit_check_status { get; set; }
|
||||
public bool? is_deposit { get; set; }
|
||||
public object gold_price_template_id { get; set; }
|
||||
public object gold_price_type { get; set; }
|
||||
public int? processing_charges { get; set; }
|
||||
public object processing_charges_type { get; set; }
|
||||
public object is_gold_price_matched { get; set; }
|
||||
public object shoes_template_id { get; set; }
|
||||
public object spu_id { get; set; }
|
||||
public object spu_version { get; set; }
|
||||
public object is_goods_copy { get; set; }
|
||||
public int? promised_delivery_seconds { get; set; }
|
||||
public int? community_group_buying { get; set; }
|
||||
public int? purchase_info_supply { get; set; }
|
||||
public int? same_city_template_id { get; set; }
|
||||
public object goods_certificate { get; set; }
|
||||
public int? is_customized { get; set; }
|
||||
public string name_prefix { get; set; }
|
||||
public object business_source_type { get; set; }
|
||||
public object creator_name { get; set; }
|
||||
public object reason { get; set; }
|
||||
public object app_id { get; set; }
|
||||
public object app_name { get; set; }
|
||||
public int? user_source { get; set; }
|
||||
public object check_type { get; set; }
|
||||
}
|
||||
|
||||
public class group_item
|
||||
{
|
||||
public int? single_price { get; set; }
|
||||
public int? group_price { get; set; }
|
||||
public object carnival_price { get; set; }
|
||||
public int? customer_num { get; set; }
|
||||
public int? buy_limit { get; set; } //999999
|
||||
public int? order_limit { get; set; } //999999
|
||||
public string regular_limit { get; set; }
|
||||
public object regular_limit_duration { get; set; }
|
||||
public object min_num_of_order { get; set; }
|
||||
public int? community_group_buying { get; set; } = 0;
|
||||
}
|
||||
|
||||
|
||||
public class commit_extension_item
|
||||
{
|
||||
public int? id { get; set; }
|
||||
public int? goods_commit_id { get; set; }
|
||||
public int? start_production_date { get; set; }
|
||||
public int? end_production_date { get; set; }
|
||||
public string production_license { get; set; }
|
||||
public string production_standard_number { get; set; }
|
||||
public int? shelf_life { get; set; }
|
||||
public string out_goods_sn { get; set; }
|
||||
public object created_at { get; set; }
|
||||
public object updated_at { get; set; }
|
||||
}
|
||||
|
||||
public class gallery_item
|
||||
{
|
||||
public string url { get; set; }
|
||||
public int? width { get; set; }
|
||||
public int? height { get; set; }
|
||||
// 图片类型 1 主图 2 详情图 3视频
|
||||
public int? type { get; set; }
|
||||
public object source { get; set; }
|
||||
public object status { get; set; }
|
||||
public object video_url { get; set; }
|
||||
public object file_id { get; set; }
|
||||
public object is_deleted { get; set; }
|
||||
public object check_comment { get; set; }
|
||||
public object origin_url { get; set; }
|
||||
}
|
||||
|
||||
public class mall_info_item {
|
||||
public string mall_name { get; set; }
|
||||
}
|
||||
|
||||
public class sku_edit_item : sku_item
|
||||
{
|
||||
public string thumb_md5 { get; set; }
|
||||
}
|
||||
|
||||
public class sku_item
|
||||
{
|
||||
public long? id { get; set; }
|
||||
public long? sku_id { get; set; }
|
||||
public object sku_sn { get; set; }
|
||||
public int? carnival_price { get; set; }
|
||||
public int? init_quantity { get; set; }
|
||||
public int? is_onsale { get; set; }
|
||||
public int? limit_quantity { get; set; } = 999999; // 999999 max
|
||||
public int? multi_price { get; set; }
|
||||
public object multi_price_in_yuan { get; set; }
|
||||
public int? price { get; set; }
|
||||
public object price_in_yuan { get; set; }
|
||||
public int? quantity { get; set; }
|
||||
public int? reserve_quantity { get; set; }
|
||||
public int? weight { get; set; }
|
||||
public string thumb_url { get; set; }
|
||||
public long? thumb_url_file_id { get; set; }
|
||||
public object thumb_url_status { get; set; }
|
||||
public object thumb_url_is_deleted { get; set; }
|
||||
public int? quantity_delta { get; set; }
|
||||
public List<spec_item> spec { get; set; }
|
||||
// 货号
|
||||
public string out_sku_sn { get; set; }
|
||||
public object batch_id { get; set; }
|
||||
public int? priority { get; set; }
|
||||
public int? ware_id { get; set; }
|
||||
public object ware_biz_type { get; set; } // null
|
||||
public object advice_price { get; set; }
|
||||
public object length { get; set; }
|
||||
public oversea_sku_item oversea_sku { get; set; }
|
||||
public object cspu_id { get; set; }
|
||||
public object child_skus { get; set; }
|
||||
public long? ref_sku_commit_id { get; set; }
|
||||
public object start_time { get; set; }
|
||||
public object end_time { get; set; }
|
||||
public object sku_srv_templates { get; set; }
|
||||
public object calendar_rule_id { get; set; }
|
||||
public object hot_live_group { get; set; }
|
||||
public int? pre_sale_time { get; set; }
|
||||
public object out_source_sku_id { get; set; }
|
||||
public object dd_grocery_sku_params { get; set; }
|
||||
public object sku_extended_attribute_dtos { get; set; }
|
||||
public object sku_basic_property_dtos { get; set; }
|
||||
public object spec_note_map { get; set; }
|
||||
public object delivery_schedule_dtos { get; set; }
|
||||
public List<object> shipment_limit_second_list { get; set; }
|
||||
public string sku69_code { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class spec_item
|
||||
{
|
||||
public long? parent_id { get; set; }
|
||||
public string parent_name { get; set; }
|
||||
public long? spec_id { get; set; }
|
||||
public string spec_name { get; set; }
|
||||
public object spec_note { get; set; }
|
||||
public object bundle_spec_list { get; set; }
|
||||
public object sku_combination { get; set; }
|
||||
public object is_custom { get; set; }
|
||||
}
|
||||
|
||||
public class oversea_sku_item
|
||||
{
|
||||
public object specifications { get; set; }
|
||||
public object measurement_code { get; set; }
|
||||
public object measurement_unit { get; set; }
|
||||
public object taxation { get; set; }
|
||||
public object record_id_list { get; set; }
|
||||
}
|
||||
|
||||
public class schedule_sale_item
|
||||
{
|
||||
public int? sale_type { get; set; }
|
||||
public object sale_time_fixed { get; set; }
|
||||
public object sale_time { get; set; }
|
||||
public object price_show { get; set; }
|
||||
public object price_desc { get; set; }
|
||||
}
|
||||
|
||||
public class instruction_vo_item
|
||||
{
|
||||
public object template_id { get; set; }
|
||||
public int? template_status { get; set; }
|
||||
public object template_name { get; set; }
|
||||
public object rejected_reason { get; set; }
|
||||
}
|
||||
|
||||
public class extend_warranty_dto_item
|
||||
{
|
||||
public int? extend_warranty { get; set; }
|
||||
public object extend_warranty_year { get; set; }
|
||||
public object extend_warranty_range { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace KJD_WebService.Model
|
||||
{
|
||||
public class PDDProductInfo
|
||||
{
|
||||
public PDDProductDetailInfo detail { get; set; }
|
||||
public PDDSizeSpecInfo size { get; set; }
|
||||
public PDDProductDecorationInfo decoration { get; set; }
|
||||
public PDDProductPropertyInfo property { get; set; }
|
||||
/// <summary>
|
||||
/// 白底图
|
||||
/// </summary>
|
||||
public PDDMaterialInfo material1 { get; set; }
|
||||
/// <summary>
|
||||
/// 长图
|
||||
/// </summary>
|
||||
public PDDMaterialInfo material3 { get; set; }
|
||||
public object source_json { get; set; }
|
||||
public string sale_count { get; set; }
|
||||
public string sale_count_text { get; set; }
|
||||
|
||||
|
||||
|
||||
public string chance_id { get; set; }
|
||||
public string chance_refere { get; set; } // 记录机会商品提交的refere
|
||||
public string chance_tab { get; set; } // 记录机会商品提交的tab
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace KJD_WebService.Model
|
||||
{
|
||||
public class PDDProductPropertyInfo
|
||||
{
|
||||
public List<goods_propertie_item> goods_properties { get; set; }
|
||||
public object sku_properties { get; set; }
|
||||
}
|
||||
|
||||
public class goods_propertie_item
|
||||
{
|
||||
public string name { get; set; }
|
||||
public int? ref_pid { get; set; }
|
||||
public List<value_item> values { get; set; }
|
||||
/// <summary>
|
||||
/// 对应微信输入类型
|
||||
/// </summary>
|
||||
//public int? wx_input_type { get; set; }
|
||||
}
|
||||
public class value_item
|
||||
{
|
||||
public long? vid { get; set; }
|
||||
public string value { get; set; }
|
||||
public string unit { get; set; }
|
||||
public string raw_value { get; set; }
|
||||
public table_info_vo_info table_info_vo { get; set; }
|
||||
}
|
||||
|
||||
public class table_info_vo_info
|
||||
{
|
||||
public List<table_value_info> table_value_list { get; set; }
|
||||
}
|
||||
|
||||
public class table_value_info
|
||||
{
|
||||
public string value { get; set; } // "100.0",
|
||||
public string unit { get; set; } // "%",
|
||||
public int? column_type { get; set; } // 1
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace KJD_WebService.Model
|
||||
{
|
||||
//public class PDDSizeSpecInfo
|
||||
//{
|
||||
// public long? id { get; set; }
|
||||
// public int? extendType { get; set; }
|
||||
//}
|
||||
//public class SizeContentItem
|
||||
//{
|
||||
// public string picUrl { get; set; }
|
||||
//}
|
||||
|
||||
public class GroupsItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int? id { get; set; }
|
||||
/// <summary>
|
||||
/// 中国码
|
||||
/// </summary>
|
||||
public string name { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public bool? required { get; set; }
|
||||
}
|
||||
|
||||
public class ElementItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int? id { get; set; }
|
||||
/// <summary>
|
||||
/// 肩宽(cm)
|
||||
/// </summary>
|
||||
public string name { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public bool? required { get; set; }
|
||||
}
|
||||
|
||||
public class MetaItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<GroupsItem> groups { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<ElementItem> elements { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<string> batchableElementIds { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class RecordItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Dictionary<string, string> values { get; set; }
|
||||
}
|
||||
|
||||
public class ContentItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public MetaItem meta { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<RecordItem> records { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string picUrl { get; set; }
|
||||
}
|
||||
|
||||
public class PDDSizeSpecInfo
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public long? id { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int? extendType { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public ContentItem content { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int? classId { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public bool? reusable { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int? status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace KJD_WebService.Model.WxModel
|
||||
{
|
||||
public class WXClientProductInfoLite
|
||||
{
|
||||
public wx_client_prod_key product_key { get; set; }
|
||||
|
||||
public wx_client_prod_info info { get; set; }
|
||||
|
||||
public List<WXProductSkuInfoLite> productSkus { get; set; }
|
||||
}
|
||||
|
||||
public class wx_client_prod_info
|
||||
{
|
||||
public string title { get; set; } // "2026新款情侣棒球帽立体C字母刺绣显脸小时尚百搭休闲韩版大头围鸭舌帽",
|
||||
public string sub_title { get; set; } // "2025新款C字母立体刺绣棒球帽",
|
||||
/// <summary>
|
||||
/// 主图列表
|
||||
/// </summary>
|
||||
public List<string> head_img { get; set; } // ["https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/64f0a5760000484b151963b6bb81bc1e000000a000004f50", ...]
|
||||
public List<wx_client_category> category { get; set; } // { "cat_id": "6093" }
|
||||
/// <summary>
|
||||
/// 商品详情(图)
|
||||
/// </summary>
|
||||
public wx_client_prod_detail detail { get; set; }
|
||||
/// <summary>
|
||||
/// 商品属性
|
||||
/// </summary>
|
||||
public List<wx_client_param> param { get; set; }
|
||||
/// <summary>
|
||||
/// 品牌id
|
||||
/// </summary>
|
||||
public string brand_id { get; set; } // "10250056"
|
||||
public wx_client_sku_id_list sku_id_list { get; set; }
|
||||
public wx_sku sku_list { get; set; }
|
||||
public List<wx_client_product_sale_attr> product_sale_attrs { get; set; }
|
||||
/// <summary>
|
||||
/// 总销量
|
||||
/// </summary>
|
||||
public string total_sold_num { get; set; } // "46631"
|
||||
public wx_client_service_desc service_desc { get; set; }
|
||||
public wx_client_express_info express_info { get; set; }
|
||||
public List<wx_client_head_video_info> headVideoInfo { get; set; }
|
||||
|
||||
public object afterSaleInfo { get; set; }
|
||||
public List<object> deliveryExpressFee { get; set; }
|
||||
public List<object> templateInfo { get; set; }
|
||||
public string spuCode { get; set; }
|
||||
}
|
||||
|
||||
public class wx_client_express_info
|
||||
{
|
||||
public string template_id { get; set; } // "243911370004",
|
||||
public string product_id { get; set; } // "10000066623849",
|
||||
public int? piece { get; set; } // 1,
|
||||
public int? weight { get; set; } // 0,
|
||||
public int? price { get; set; } // 5980
|
||||
}
|
||||
|
||||
public class wx_client_service_desc
|
||||
{
|
||||
public string desc { get; set; } // "(麻烦阿姐阿哥们,带纸箱邮寄过去的一定记得用纸盒邮寄回,袋子邮寄的,带袋子寄回,拒收到付件,拒收自提件)"
|
||||
}
|
||||
|
||||
public class wx_client_sku_id_list
|
||||
{
|
||||
public List<string> sku_ids { get; set; } //[ "1597139289", "1597121531", "1597127451", "1597113890", "1597119654" ]
|
||||
}
|
||||
|
||||
public class wx_client_prod_key
|
||||
{
|
||||
public string product_id { get; set; } // "10000066623849",
|
||||
public string appid { get; set; } // "wx62cca7dc2354b687"
|
||||
}
|
||||
|
||||
public class wx_client_head_video_info
|
||||
{
|
||||
public string videoUrl { get; set; } // "https://wst.wxapp.tc.qq.com/162/20302/snssvpdownload/SH/reserved/0bc3yya5qaabfaaeaq6thjt2nrwd3ddadwaa.f100001.mp4?wdis_k=7cdc03c564ae62499c03d8034036e65c4405cd2d&wdis_t=1773699072&appid=none&scene=0&ext=eyJjaSI6MTAwMDY5LCJjczBjIjoxNywiY3MwbyI6NDA1MzAsImNzMWMiOjQsImNzMW8iOjExMDQ0OSwicnMiOiIyNDIwNDozIn0",
|
||||
public string videoHeadImg { get; set; } // "https://wst.wxapp.tc.qq.com/162/20302/snssvpdownload/SH/reserved/0bc3yya5qaabfaaeaq6thjt2nrwd3ddadwaa.f1400_0.jpeg?wdis_k=7f202df2767ca6d4b8cec6f52d1706ea8e497708&wdis_t=1773699072&appid=none&scene=0&ext=eyJjaSI6MTAwMDY5LCJjczBjIjoxNywiY3MwbyI6NDA1MzAsImNzMWMiOjQsImNzMW8iOjExMDQ0OSwicnMiOiIyNDIwNDozIn0",
|
||||
public int? videoLen { get; set; } // 24,
|
||||
public string videoSize { get; set; } // "0",
|
||||
public int? videoSource { get; set; } // 0,
|
||||
public int? videoFormat { get; set; } // 0,
|
||||
public string playableVideoUrl { get; set; } // "https://wst.wxapp.tc.qq.com/162/20302/snssvpdownload/SH/reserved/0bc3yya5qaabfaaeaq6thjt2nrwd3ddadwaa.f100001.mp4?wdis_k=7cdc03c564ae62499c03d8034036e65c4405cd2d&wdis_t=1773699072&appid=none&scene=0&ext=eyJjaSI6MTAwMDY5LCJjczBjIjoxNywiY3MwbyI6NDA1MzAsImNzMWMiOjQsImNzMW8iOjExMDQ0OSwicnMiOiIyNDIwNDozIn0",
|
||||
public int? videoWidth { get; set; } // 1080,
|
||||
public int? videoHeight { get; set; } // 1080,
|
||||
public string videoH265Url { get; set; } // "https://wst.wxapp.tc.qq.com/162/20302/snssvpdownload/SH/reserved/0bc3yya5qaabfaaeaq6thjt2nrwd3ddadwaa.f100003.mp4?wdis_k=057570644d9b72ff0c62e85b1c54cf0f0a8b42f6&wdis_t=1773699072&appid=none&scene=0&ext=eyJjaSI6MTAwMDY5LCJjczBjIjoxNywiY3MwbyI6NDA1MzAsImNzMWMiOjQsImNzMW8iOjExMDQ0OSwicnMiOiIyNDIwNDozIn0",
|
||||
public int? videoH265Width { get; set; } // 720,
|
||||
public int? videoH265Height { get; set; } // 720
|
||||
}
|
||||
|
||||
public class wx_client_product_sale_attr
|
||||
{
|
||||
public string key { get; set; } // "颜色"
|
||||
public List<wx_client_product_sale_attr_item> items { get; set; }
|
||||
public bool? has_img { get; set; }
|
||||
}
|
||||
|
||||
public class wx_client_product_sale_attr_item
|
||||
{
|
||||
public string value { get; set; } // "卡其色"
|
||||
public string img_url { get; set; } // "https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/64eb0fd5000f2ca50a23b45f3567b01e000000a100004f50"
|
||||
public List<string> sku_ids { get; set; } // [ "1597139289" ]
|
||||
}
|
||||
|
||||
public class wx_sku
|
||||
{
|
||||
public List<wx_client_sku_info> sku_info { get; set; }
|
||||
public string min_price_sku_id { get; set; } // "1597139289"
|
||||
public string default_selected_sku_id { get; set; } // "1597139289"
|
||||
}
|
||||
|
||||
public class wx_client_sku_info
|
||||
{
|
||||
public string sku_id { get; set; } // "1597139289",
|
||||
public int? price { get; set; } // 5980,
|
||||
public bool? is_discounted { get; set; } // true,
|
||||
public int? discounted_price { get; set; } // 2990,
|
||||
public int? origin_price { get; set; } // 5980,
|
||||
}
|
||||
|
||||
public class wx_client_prod_detail
|
||||
{
|
||||
/// <summary>
|
||||
/// 详情图
|
||||
/// </summary>
|
||||
public List<string> detail_img { get; set; } // ["https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/64f21d2b00009e7a156bc7cd6d63b01e000000a000004f50", ...]
|
||||
public List<string> detailImg { get; set; } // ["https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/64f21d2b00009e7a156bc7cd6d63b01e000000a000004f50", ...]
|
||||
public List<string> detail_img_real { get { return detail_img == null ? detailImg : detail_img; } }
|
||||
public string desc { get; set; } // "纯萃美2025新款情侣棒球帽立体C字母刺绣显脸小时尚百搭休闲网红款韩版大头围硬顶鸭舌帽男女同款"
|
||||
///// <summary>
|
||||
/////
|
||||
///// </summary>
|
||||
//public List<string> detailImg { get; set; }
|
||||
///// <summary>
|
||||
///// 纯萃美2025新款情侣棒球帽立体C字母刺绣显脸小时尚百搭休闲网红款韩版大头围硬顶鸭舌帽男女同款
|
||||
///// </summary>
|
||||
//public string desc { get; set; }
|
||||
}
|
||||
|
||||
public class wx_client_param
|
||||
{
|
||||
public List<wx_client_category> categorys { get; set; }
|
||||
}
|
||||
|
||||
public class wx_client_category
|
||||
{
|
||||
public string catIdStr { get { return cat_id.IsNullOrEmpty() ? catId : cat_id; } } // "0",
|
||||
public string cat_id { get; set; } // "0",
|
||||
public string catId { get; set; } // "0",
|
||||
public string name { get; set; } // "主要材质", "C字母刺绣"
|
||||
public string f_cat_id { get; set; } // "0",
|
||||
public string brand_cat { get; set; } // "0",
|
||||
public wx_client_cat_info cat_info { get; set; }
|
||||
}
|
||||
|
||||
public class wx_client_cat_info
|
||||
{
|
||||
public int? is_required { get; set; } // 1,
|
||||
public int? is_customize { get; set; } // 0,
|
||||
public int? input_type { get; set; } // 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace KJD_WebService.Model.WxModel
|
||||
{
|
||||
public class WXGetEditProductInfoLite
|
||||
{
|
||||
public WXProductInfo product { get; set; }
|
||||
public WXAfterSaleAddressInfo address { get; set; }
|
||||
}
|
||||
|
||||
public class WXAfterSaleAddressInfo
|
||||
{
|
||||
public string addressId { get; set; } // "69496256002",
|
||||
public string name { get; set; } // "",
|
||||
public WXAddressInfo addressInfo { get; set; }
|
||||
}
|
||||
|
||||
public class WXAddressInfo
|
||||
{
|
||||
public string userName { get; set; } // "王总",
|
||||
public string postalCode { get; set; } // "",
|
||||
public string provinceName { get; set; } // "安徽省",
|
||||
public string cityName { get; set; } // "合肥市",
|
||||
public string countyName { get; set; } // "肥西县",
|
||||
public string detailInfo { get; set; } // "蜀山区长江西路某某号某某单元",
|
||||
public string telNumber { get; set; } // "18388888888",
|
||||
public int? lat { get; set; } // 0,
|
||||
public int? lng { get; set; } // 0
|
||||
}
|
||||
|
||||
public class WXProductInfo
|
||||
{
|
||||
public List<WXProductSkuInfoLite> productSkus { get; set; }
|
||||
public WXProductKeyInfo productKey { get; set; }
|
||||
public WXProductInfoInfo info { get; set; }
|
||||
public int? status { get; set; } // 5
|
||||
public string createTime { get; set; } // "1772529740",
|
||||
public string updateTime { get; set; } // "1772533190",
|
||||
public int? version { get; set; } // 8,
|
||||
public int? editStatus { get; set; } // 4,
|
||||
public string editTime { get; set; } // "1772533189",
|
||||
public int source { get; set; } // 1
|
||||
}
|
||||
|
||||
public class WXProductSkuInfoLite
|
||||
{
|
||||
public WXSkuKeyInfoLite skuKey { get; set; }
|
||||
public WXProductSkuInfoInfoLite productSkuInfo { get; set; }
|
||||
}
|
||||
|
||||
public class WXProductSkuInfoInfoLite
|
||||
{
|
||||
public List<WXSaleParamInfoLite> saleParam { get; set; }
|
||||
public string thumbImg { get; set; } // "https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/69a6a1ae000e63741a5ddf35d5b71715000000a000004f50"
|
||||
public string skuCode { get; set; } // ""
|
||||
public int? salePrice { get; set; } // 5880
|
||||
public WXStockInfoLite stockInfo { get; set; }
|
||||
public WXRealStockInfoLite realStockInfo { get; set; }
|
||||
}
|
||||
|
||||
public class WXRealStockInfoLite
|
||||
{
|
||||
public int? stockNum { get; set; } // 999
|
||||
public int? totalNum { get; set; } // 999
|
||||
}
|
||||
|
||||
public class WXStockInfoLite
|
||||
{
|
||||
public string stockNum { get; set; } // "9999999"
|
||||
}
|
||||
|
||||
public class WXSaleParamInfoLite
|
||||
{
|
||||
public List<WXProductCategoryInfoLite> categorys { get; set; }
|
||||
}
|
||||
|
||||
public class WXSkuKeyInfoLite
|
||||
{
|
||||
public string skuId { get; set; } // "8767785131",
|
||||
}
|
||||
|
||||
public class WXProductKeyInfo
|
||||
{
|
||||
public string productId { get; set; } // "10000538778988"
|
||||
}
|
||||
|
||||
public class WXProductInfoInfo
|
||||
{
|
||||
// 主图
|
||||
public List<string> headImg { get; set; } = new List<string>();
|
||||
public List<WXProductCategoryInfoLite> category { get; set; } = new List<WXProductCategoryInfoLite>();
|
||||
public List<WXProductParamInfo> param { get; set; } = new List<WXProductParamInfo>();
|
||||
public List<WXQualificationInfo> qualificationList { get; set; }
|
||||
public List<WXProductHeadimgInfo> productHeadimgInfo { get; set; }
|
||||
public List<WXHeadImgInfo> headImgInfos { get; set; }
|
||||
public string title { get; set; } // "歪歪马震动棒 成人情趣用品"
|
||||
public string subTitle { get; set; } // "",
|
||||
public string brand { get; set; } // "",
|
||||
public string model { get; set; } // "",
|
||||
public WXProductDetailInfo detail { get; set; }
|
||||
public string brandId { get; set; } // "10655917"
|
||||
public string listingTime { get; set; } // "1772533190"
|
||||
public string spuCode { get; set; } // "2028756820870602753"
|
||||
public WXAfterSaleInfo afterSaleInfo { get; set; }
|
||||
public string lastEditDraftTime { get; set; } // "1772532559"
|
||||
public string shortTitle { get; set; } // "歪歪马脉冲震动成人情趣棒"
|
||||
public string aiGenShortTitle { get; set; } // "歪歪马脉冲震动成人情趣棒"
|
||||
public string uniqueId { get; set; } // "4411405439658180613"
|
||||
}
|
||||
|
||||
public class WXAfterSaleInfo
|
||||
{
|
||||
public string afterSaleAddressId;
|
||||
}
|
||||
|
||||
public class WXProductDetailInfo
|
||||
{
|
||||
public List<string> detailImg { get; set; } = new List<string>(); // [ "https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/69a6a8460000683300254e4c8c4fab15000000a100004f50", ... ],
|
||||
public List<object> detailVideos { get; set; } = new List<object>();
|
||||
public List<object> detailVideoInfo { get; set; } = new List<object>();
|
||||
public List<object> carouselImg { get; set; } = new List<object>();
|
||||
public string desc { get; set; } = "";
|
||||
}
|
||||
|
||||
public class WXHeadImgInfo
|
||||
{
|
||||
public string imgUrl { get; set; } // "https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/69a6a8420006d56e0003583092a31715000000a100004f50",
|
||||
public int? imgWidth { get; set; } // 800,
|
||||
public int? imgHeight { get; set; } // 800
|
||||
}
|
||||
|
||||
public class WXProductHeadimgInfo
|
||||
{
|
||||
public List<object> colors { get; set; } = new List<object>(); // []
|
||||
public string imgUrl { get; set; } // "https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/69a6a8420006d56e0003583092a31715000000a100004f50"
|
||||
public WXMainColors mainColors { get; set; }
|
||||
}
|
||||
|
||||
public class WXMainColors
|
||||
{
|
||||
public int? red { get; set; } // 255,
|
||||
public int? green { get; set; } // 255,
|
||||
public int? blue { get; set; } // 255
|
||||
}
|
||||
|
||||
public class WXQualificationInfo
|
||||
{
|
||||
public List<string> qualificationUrl { get; set; } // ["https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/69a6a84a0008442e2a4a8f7179bc1715000000a000004f50"]
|
||||
public string qualificationId { get; set; } // "50000115"
|
||||
public int? showCertType { get; set; } // 0
|
||||
}
|
||||
|
||||
public class WXProductParamInfo
|
||||
{
|
||||
public List<WXProductParamCategoryInfo> categorys { get; set; } = new List<WXProductParamCategoryInfo>();
|
||||
}
|
||||
|
||||
public class WXProductParamCategoryInfo
|
||||
{
|
||||
public string name { get; set; } // [0] "name": "长度" [1] "name": "20 cm",
|
||||
public int? catType { get; set; } = 0;
|
||||
public WXProductParamCategoryCatInfo catInfo { get; set; }
|
||||
}
|
||||
|
||||
public class WXProductParamCategoryCatInfo
|
||||
{
|
||||
public int? isRequired { get; set; } // 1,
|
||||
public int? isCustomize { get; set; } // 0,
|
||||
public int? inputType { get; set; } // 1-单选 2-文本
|
||||
public long? catGroup { get; set; } // 4294967295,
|
||||
}
|
||||
|
||||
public class WXProductCategoryInfoLite
|
||||
{
|
||||
public string catId { get; set; } // "10000577"
|
||||
public string name { get; set; } // "情趣用品" // 可能为空或没有此字段
|
||||
public string fCatId { get; set; } // "10000575"
|
||||
public WXProductCategoryInfoInfoLite catInfo { get; set; }
|
||||
public bool? leaf { get; set; } // false
|
||||
}
|
||||
|
||||
public class WXProductCategoryInfoInfoLite
|
||||
{
|
||||
public int? catLevel { get; set; } // 2
|
||||
public long? catGroup { get; set; } // 4294967295
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WXProd.aspx.cs" Inherits="KJD_Web.Upload.Prod.WXProd" ValidateRequest="false"%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<!--<pre name="code" class="html" />-->
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div style="padding:0px 0px;">
|
||||
<div style="padding:0px 20px;">
|
||||
<asp:FileUpload ID="FileUpload1" runat="server" />
|
||||
</div>
|
||||
<div style="padding:10px 20px;">
|
||||
<asp:Button ID="btnSubmit" runat="server" Text="提交到服务端" Width="100px" OnClick="btnSubmit_Click" />
|
||||
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
|
||||
</div>
|
||||
<div style="padding:10px 20px;">
|
||||
<asp:TextBox ID="TextBox2" runat="server" TextMode="MultiLine" Height="650px" Width="300px"></asp:TextBox>
|
||||
</div>
|
||||
<div style="padding:10px 20px;">
|
||||
<asp:Button ID="Button1" runat="server" Text="提交到服务端" Width="100px" OnClick="btnSubmit_Click" />
|
||||
<asp:Label ID="Label2" runat="server" Text=""></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,446 @@
|
||||
using KJD_Web.Model;
|
||||
using KJD_Web.Utils;
|
||||
using KJD_WebService.Model;
|
||||
using KJD_WebService.Model.WxModel;
|
||||
using NaiBa.Util.Extension;
|
||||
using NaiBa.Util.Helper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace KJD_Web.Upload.Prod
|
||||
{
|
||||
public class BaseClass
|
||||
{
|
||||
public static string BuildPDDObjString(string file, bool IsLoginDef = false)
|
||||
{
|
||||
string LoginApiUrl = "http://1.13.195.131:9000";
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取签名字符串,新版
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
public partial class WXProd : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
FileUpload1.Visible = false;
|
||||
}
|
||||
|
||||
protected void btnSubmit_Click(object sender, EventArgs e)
|
||||
{
|
||||
Label1.Text = "";
|
||||
Label2.Text = "";
|
||||
|
||||
string rst = getProd();
|
||||
Label1.Text = rst;
|
||||
Label2.Text = rst;
|
||||
TextBox2.Text = "";
|
||||
FileUpload1.Visible = false;
|
||||
}
|
||||
|
||||
string getProd()
|
||||
{
|
||||
string prodStr = Encoding.UTF8.GetString(this.FileUpload1.FileBytes);
|
||||
prodStr = TextBox2.Text.Trim();
|
||||
|
||||
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<wx_client_prod_key>(regex_str);
|
||||
if (wxClientProd.product_key == null)
|
||||
return "解析失败";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
|
||||
//商品详情格式
|
||||
wxClientProd.info = new wx_client_prod_info();
|
||||
|
||||
//主标题
|
||||
wxClientProd.info.title = RegexUtils.GetStringJson(ref prodStr, "title");
|
||||
if (wxClientProd.info.title.IsNullOrEmpty())
|
||||
return "解析失败";
|
||||
|
||||
//副标题
|
||||
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<string>(regex_str);
|
||||
if (wxClientProd.info.head_img == null)
|
||||
return "解析失败";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
|
||||
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<wx_client_category>(regex_str);
|
||||
if (wxClientProd.info.category != null && !str_lst.IsNullOrEmpty() && !wxClientProd.info.category.Any(c => c.catIdStr == nodeCatId))
|
||||
{
|
||||
wxClientProd.info.category.Add(new wx_client_category() { catId = nodeCatId, cat_id = nodeCatId });
|
||||
}
|
||||
//if (wxClientProd.info.category == null)
|
||||
// return "解析失败";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
|
||||
str_lst = RegexUtils.GetJsonObjStrJson(ref prodStr, "detail");
|
||||
try
|
||||
{
|
||||
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
|
||||
wxClientProd.info.detail = JsonUtils.DeserializeJsonToObjectNullable<wx_client_prod_detail>(regex_str);
|
||||
if (wxClientProd.info.detail == null)
|
||||
{
|
||||
wxClientProd.info.detail = new wx_client_prod_detail();
|
||||
wxClientProd.info.detail.detail_img.Add(wxClientProd.info.head_img.FirstOrDefault());
|
||||
}
|
||||
|
||||
//if (wxClientProd.info.detail == null)
|
||||
// return "解析失败";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
|
||||
str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "param");
|
||||
try
|
||||
{
|
||||
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
|
||||
wxClientProd.info.param = JsonUtils.DeserializeJsonToListNullable<wx_client_param>(regex_str);
|
||||
if (wxClientProd.info.param == null)
|
||||
wxClientProd.info.param = new List<wx_client_param>();
|
||||
//if (wxClientProd.info.param == null)
|
||||
// return "解析失败";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
|
||||
//品牌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<wx_client_sku_id_list>(regex_str);
|
||||
//if (wxClientProd.info.sku_id_list == null)
|
||||
// return "解析失败";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
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<wx_sku>(regex_str);
|
||||
//if (wxClientProd.info.sku_list == null)
|
||||
// return "解析失败";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
|
||||
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<wx_client_sku_info>(regex_str);
|
||||
if (sku_infos != null)
|
||||
{
|
||||
wxClientProd.info.sku_list = new wx_sku();
|
||||
wxClientProd.info.sku_list.sku_info = sku_infos;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
}
|
||||
|
||||
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<wx_client_product_sale_attr>(regex_str);
|
||||
//if (wxClientProd.info.product_sale_attrs == null)
|
||||
// return "解析失败";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
|
||||
|
||||
//总销量
|
||||
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<wx_client_service_desc>(regex_str);
|
||||
//if (wxClientProd.info.service_desc == null)
|
||||
// return "解析失败";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
|
||||
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<wx_client_express_info>(regex_str);
|
||||
//if (wxClientProd.info.express_info == null)
|
||||
// return;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
|
||||
str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "headVideoInfo");
|
||||
try
|
||||
{
|
||||
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
|
||||
wxClientProd.info.headVideoInfo = JsonUtils.DeserializeJsonToListNullable<wx_client_head_video_info>(regex_str);
|
||||
//if (wxClientProd.info.headVideoInfo == null)
|
||||
// return "解析失败";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
|
||||
str_lst = RegexUtils.GetJsonObjStrJson(ref prodStr, "afterSaleInfo");
|
||||
try
|
||||
{
|
||||
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
|
||||
wxClientProd.info.afterSaleInfo = JsonUtils.DeserializeJsonToObjectNullable<object>(regex_str);
|
||||
//if (wxClientProd.info.afterSaleInfo == null)
|
||||
// return "解析失败";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
|
||||
str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "deliveryExpressFee");
|
||||
try
|
||||
{
|
||||
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
|
||||
wxClientProd.info.deliveryExpressFee = JsonUtils.DeserializeJsonToListNullable<object>(regex_str);
|
||||
//if (wxClientProd.info.deliveryExpressFee == null)
|
||||
// return "解析失败";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
|
||||
str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "templateInfo");
|
||||
try
|
||||
{
|
||||
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
|
||||
wxClientProd.info.templateInfo = JsonUtils.DeserializeJsonToListNullable<object>(regex_str);
|
||||
//if (wxClientProd.info.templateInfo == null)
|
||||
// return "解析失败";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
|
||||
wxClientProd.info.spuCode = RegexUtils.GetStringJson(ref prodStr, "spuCode");
|
||||
|
||||
str_lst = RegexUtils.GetJsonArrStrJson(ref prodStr, "productSkus");
|
||||
try
|
||||
{
|
||||
var regex_str = str_lst.OrderByDescending(s => s.Length).FirstOrDefault();
|
||||
wxClientProd.productSkus = JsonUtils.DeserializeJsonToList<WXProductSkuInfoLite>(regex_str);
|
||||
if (wxClientProd.productSkus == null)
|
||||
return "解析失败";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "解析失败";
|
||||
}
|
||||
|
||||
return SaveWxProd(wxClientProd.product_key.product_id, wxClientProd, prodStr);
|
||||
}
|
||||
|
||||
string SaveWxProd(string prodId, WXClientProductInfoLite wxClientProdInfoLite, string baseStr)
|
||||
{
|
||||
bool isExist = false;
|
||||
var existUrl = BaseClass.BuildPDDObjString("product/get_product_spu_id_list");
|
||||
string existData = UserLogin.GetSignaturex() + "&search_spu_ids=" + prodId;
|
||||
//if (!string.IsNullOrEmpty(prod.dbProduct.real_spu_id))
|
||||
// existData = UserLogin.GetSignaturex() + "&search_spu_ids=" + prod.spuId + "," + prod.dbProduct.real_spu_id;
|
||||
string html = HtmlUtils.PostUtf8(existUrl, existData);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = HtmlUtils.PostUtf8(existUrl, existData);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
{
|
||||
return "采集入库失败,产品数据库连接失败";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (html.Contains("\"data\":[") && !html.Contains("\"data\":[]"))
|
||||
isExist = true;
|
||||
}
|
||||
|
||||
var url = BaseClass.BuildPDDObjString("product/add_product");
|
||||
if (isExist)
|
||||
url = BaseClass.BuildPDDObjString("product/mdy_product");
|
||||
|
||||
var skus = wxClientProdInfoLite.productSkus;
|
||||
|
||||
var product_json = "{\"wxxdData\":" + JsonUtils.SerializeObject(wxClientProdInfoLite) + ",\"baseData\":" + JsonUtils.SerializeObject(baseStr) + "}";
|
||||
var data = UserLogin.GetSignaturex() +
|
||||
"&from_shop_id=" + wxClientProdInfoLite.product_key.appid +
|
||||
"&from_shop_name=" + wxClientProdInfoLite.product_key.appid +
|
||||
"&spu_id=" + prodId +
|
||||
"&skc_id=" + prodId +
|
||||
"&price_text=" + skus.Min(s => s.productSkuInfo.salePrice * 0.01m) + " - " + skus.Max(s => s.productSkuInfo.salePrice * 0.01m) +
|
||||
"&ext_code=" + wxClientProdInfoLite.info.spuCode +
|
||||
"&product_name=" + HttpUtility.UrlEncode(wxClientProdInfoLite.info.title, Encoding.UTF8) +
|
||||
"&product_json=" + HttpUtility.UrlEncode(product_json, Encoding.UTF8) + // product_json /*HttpUtility.UrlEncode(JsonUtils.SerializeObject(wxClientProdInfoLite), Encoding.UTF8)*/
|
||||
"&sale_count=" + wxClientProdInfoLite.info.total_sold_num +
|
||||
"&sale_count_text=" + wxClientProdInfoLite.info.total_sold_num +
|
||||
"&main_img=" + HttpUtility.UrlEncode(wxClientProdInfoLite.info.head_img.FirstOrDefault(), Encoding.UTF8) +
|
||||
"&wx_safe_status=" + HttpUtility.UrlEncode("安全商品", Encoding.UTF8) +
|
||||
"&product_get_type=" + HttpUtility.UrlEncode("微信小店", Encoding.UTF8);
|
||||
|
||||
if (wxClientProdInfoLite.info.category.Count > 0)
|
||||
{
|
||||
data += "&wx_cat_1=" + wxClientProdInfoLite.info.category[0].catIdStr;
|
||||
data += "&main_cat_id=" + wxClientProdInfoLite.info.category[0].catIdStr;
|
||||
data += "&main_cat_name=" + wxClientProdInfoLite.info.category[0].name;
|
||||
|
||||
data += "&wx_cat_leaf=" + wxClientProdInfoLite.info.category.LastOrDefault()?.catIdStr;
|
||||
data += "&cat_id=" + wxClientProdInfoLite.info.category.LastOrDefault()?.catIdStr;
|
||||
data += "&cat_name=" + HttpUtility.UrlEncode((wxClientProdInfoLite.info.category.LastOrDefault()?.name).ParseToString(), Encoding.UTF8);
|
||||
}
|
||||
if (wxClientProdInfoLite.info.category.Count > 1)
|
||||
{
|
||||
data += "&wx_cat_2=" + wxClientProdInfoLite.info.category[1].catIdStr;
|
||||
}
|
||||
if (wxClientProdInfoLite.info.category.Count > 2)
|
||||
{
|
||||
data += "&wx_cat_3=" + wxClientProdInfoLite.info.category[2].catIdStr;
|
||||
}
|
||||
|
||||
if (wxClientProdInfoLite.info.category.FirstOrDefault().name == "图书")
|
||||
{
|
||||
data += "&special_prod_type=" + HttpUtility.UrlEncode("书籍", Encoding.UTF8);
|
||||
}
|
||||
|
||||
html = HtmlUtils.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = HtmlUtils.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
{
|
||||
string msg = "商品入库失败!请检查网络连接:" + RegexUtils.GetStringJson(ref html, "msg");
|
||||
//Invoke(new Action(() =>
|
||||
//{
|
||||
// row.Cells["colMsg"].Value = msg;
|
||||
//}));
|
||||
return msg;
|
||||
}
|
||||
else
|
||||
{
|
||||
//prod.getProductMsg = "商品入库成功!";
|
||||
//Invoke(new Action(() =>
|
||||
//{
|
||||
// row.Cells["colMsg"].Value = prod.getProductMsg;
|
||||
//}));
|
||||
if (!isExist)
|
||||
{
|
||||
url = BaseClass.BuildPDDObjString("product/mdy_product");
|
||||
html = HtmlUtils.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = HtmlUtils.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
{
|
||||
string msg = "商品入库失败!请检查网络连接:" + RegexUtils.GetStringJson(ref html, "msg");
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
|
||||
return "微信商品采集入库成功!";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace KJD_Web.Upload.Prod
|
||||
{
|
||||
|
||||
|
||||
public partial class WXProd
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// FileUpload1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.FileUpload FileUpload1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSubmit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnSubmit;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// TextBox2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox TextBox2;
|
||||
|
||||
/// <summary>
|
||||
/// Button1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button Button1;
|
||||
|
||||
/// <summary>
|
||||
/// Label2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label2;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using KJD_Web.Upload.Prod;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
@@ -6,7 +7,10 @@ using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Cache;
|
||||
using System.Net.Security;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
@@ -72,6 +76,128 @@ namespace KJD_Web.Utils
|
||||
return decoder.GetString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// URL UTF-8转码
|
||||
/// </summary>
|
||||
/// <param name="IndexKey"></param>
|
||||
/// <returns></returns>
|
||||
public static string UrlEncodeUtf8(string IndexKey)
|
||||
{
|
||||
if (String.IsNullOrEmpty(IndexKey))
|
||||
return "";
|
||||
return HttpUtility.UrlEncode(IndexKey, Encoding.UTF8);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// post 数据
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="postData"></param>
|
||||
/// <returns></returns>
|
||||
public static string PostUtf8(string url, StringBuilder postData)
|
||||
{
|
||||
try
|
||||
{
|
||||
WebClientx wc = new WebClientx();
|
||||
byte[] sendData = Encoding.GetEncoding("utf-8").GetBytes(postData.ToString());
|
||||
wc.Headers.Add("ContentLength", sendData.Length.ToString());
|
||||
wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
|
||||
wc.Proxy = null;
|
||||
return Encoding.UTF8.GetString(wc.UploadData(url, "POST", sendData));
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 浏览器标识
|
||||
/// </summary>
|
||||
public static string UserAgent = @"Mozilla/5.0+(Windows+NT+10.0;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/57.0.2987.133+Safari/537.36
|
||||
Mozilla/5.0+(Windows+NT+6.1)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/57.0.2987.133+Safari/537.36
|
||||
Mozilla/5.0+(Windows+NT+10.0;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/54.0.2840.99+Safari/537.36
|
||||
Mozilla/5.0+(Windows+NT+5.1)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/31.0.1650.63+Safari/537.36
|
||||
Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+Win64;+x64;+Trident/5.0)
|
||||
Mozilla/5.0+(Windows+NT+5.1)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/45.0.2454.101+Safari/537.36
|
||||
Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/45.0.2454.101+Safari/537.36
|
||||
Mozilla/5.0+(Windows+NT+6.3;+WOW64;+Trident/7.0;+rv:11.0)+like+Gecko
|
||||
Mozilla/5.0+(Windows+NT+10.0;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/57.0.2987.133+Safari/537.36
|
||||
Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0)
|
||||
Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/57.0.2987.133+Safari/537.36
|
||||
Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.1+(KHTML,+like+Gecko)+Chrome/21.0.1180.89+Safari/537.1
|
||||
Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/45.0.2454.101+Safari/537.36
|
||||
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.104 Safari/537.36 Core/1.53.2372.400 QQBrowser/9.5.10548.400";
|
||||
|
||||
/// <summary>
|
||||
/// post 数据
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="postData"></param>
|
||||
/// <returns></returns>
|
||||
public static string PostUtf8(string url, string postData, string contentType = "")
|
||||
{
|
||||
//return PostUtf8(url, Encoding.UTF8.GetBytes(postData));
|
||||
|
||||
bool isError = false;
|
||||
string[] l = UserAgent.Split('\n');
|
||||
reTry:
|
||||
try
|
||||
{
|
||||
string codeType = "utf-8";
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
request.UserAgent = l[new Random(Guid.NewGuid().GetHashCode()).Next(l.Length)].Trim();
|
||||
byte[] byteData = Encoding.GetEncoding(codeType).GetBytes(postData);
|
||||
request.Method = "POST";
|
||||
request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
|
||||
request.Timeout = 30 * 1000;
|
||||
request.ReadWriteTimeout = 30 * 1000;
|
||||
request.Proxy = null;
|
||||
request.ContentType = "application/x-www-form-urlencoded; charset=" + codeType;
|
||||
//if (BaseClass.SaLevel > 0)
|
||||
{
|
||||
//260306 采用GZip/deflate压缩
|
||||
//request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
|
||||
//request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
|
||||
}
|
||||
if (url.StartsWith("https://openapi.jinritemai.com/"))
|
||||
{
|
||||
request.Headers.Add("X-USE-BOE", "1");
|
||||
request.Headers.Add("Origin-From", "djt_prod");
|
||||
request.Headers.Add("djt_prod", "boe_time_sku");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(contentType))
|
||||
{
|
||||
request.ContentType = contentType;
|
||||
}
|
||||
request.ContentLength = byteData.Length;
|
||||
request.Referer = url;
|
||||
request.CookieContainer = new CookieContainer();
|
||||
request.AllowAutoRedirect = false;
|
||||
using (Stream requestStream = request.GetRequestStream())
|
||||
{
|
||||
requestStream.Write(byteData, 0, byteData.Length);
|
||||
}
|
||||
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||
|
||||
Stream receiveStream = response.GetResponseStream();
|
||||
StreamReader readStream = new StreamReader(receiveStream, Encoding.GetEncoding(codeType));
|
||||
|
||||
return readStream.ReadToEnd().Trim();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//{
|
||||
// isError = true;
|
||||
// goto reTry;
|
||||
//}
|
||||
Thread.Sleep(50);
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static int HexToInt(char h)
|
||||
{
|
||||
if ((h >= '0') && (h <= '9'))
|
||||
@@ -150,4 +276,141 @@ namespace KJD_Web.Utils
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 下载器
|
||||
/// </summary>
|
||||
public class WebClientx : WebClient
|
||||
{
|
||||
/// <summary>
|
||||
/// 默认超时多少秒
|
||||
/// </summary>
|
||||
public int Timeout = 100;
|
||||
/// <summary>
|
||||
/// 允许自动重定向
|
||||
/// </summary>
|
||||
public bool AllowAutoRedirect = true;
|
||||
public bool IsDelete = false;
|
||||
|
||||
private string OutIP = "";
|
||||
/// <summary>
|
||||
/// 证书列表
|
||||
/// </summary>
|
||||
public static List<Certificate> X509List = new List<Certificate>();
|
||||
/// <summary>
|
||||
/// 绑定IP
|
||||
/// </summary>
|
||||
/// <param name="outIp"></param>
|
||||
public WebClientx(string outIp)
|
||||
{
|
||||
OutIP = outIp;
|
||||
CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);
|
||||
}
|
||||
|
||||
public WebClientx()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// 重写
|
||||
/// </summary>
|
||||
/// <param name="address"></param>
|
||||
/// <returns></returns>
|
||||
protected override WebRequest GetWebRequest(Uri address)
|
||||
{
|
||||
string s = address.ToString();
|
||||
if (string.IsNullOrEmpty(s) || s.Length < 7 || !(s.Substring(0, 7).ToLower() == "http://" || s.Substring(0, 8).ToLower() == "https://"))
|
||||
return null;
|
||||
var request = (HttpWebRequest)base.GetWebRequest(address);
|
||||
request.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;
|
||||
request.Timeout = 1000 * Timeout;
|
||||
request.ReadWriteTimeout = 500 * Timeout;
|
||||
request.AllowAutoRedirect = AllowAutoRedirect;
|
||||
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateServerCertificate);
|
||||
if (IsDelete)
|
||||
request.Method = "DELETE";
|
||||
if (!string.IsNullOrEmpty(OutIP))
|
||||
{
|
||||
request.ServicePoint.BindIPEndPointDelegate = (servicePoint, remoteEndPoint, retryCount) =>
|
||||
{
|
||||
servicePoint.MaxIdleTime = 20;
|
||||
return new IPEndPoint(IPAddress.Parse(OutIP), 0);
|
||||
};
|
||||
}
|
||||
if (request.RequestUri.Scheme == "https") //挂接验证服务端证书的回调
|
||||
{
|
||||
X509Certificate2 x509c = null;
|
||||
for (int i = 0; i < X509List.Count; i++)
|
||||
{
|
||||
if (X509List[i].Domain.ToLower() == address.Host.ToLower())
|
||||
{
|
||||
x509c = X509List[i].X509;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (x509c == null)
|
||||
{
|
||||
ServicePointManager.ServerCertificateValidationCallback =
|
||||
new RemoteCertificateValidationCallback(RemoteCertificateValidationCallback);
|
||||
try
|
||||
{
|
||||
X509Store _store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
|
||||
_store.Open(OpenFlags.ReadWrite);
|
||||
string findValue = Dns.GetHostName(); //获取本地主机名称作为证书查找的参数
|
||||
X509Certificate2Collection _certsCollection =
|
||||
_store.Certificates.Find(X509FindType.FindByIssuerName, findValue, false);
|
||||
if (_certsCollection.Count > 0)
|
||||
{
|
||||
x509c = _certsCollection[0];
|
||||
request.ClientCertificates.Add(x509c);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
}
|
||||
}
|
||||
return request;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取证书
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="certificate"></param>
|
||||
/// <param name="chain"></param>
|
||||
/// <param name="sslPolicyErrors"></param>
|
||||
/// <returns></returns>
|
||||
public bool RemoteCertificateValidationCallback(Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
|
||||
{
|
||||
//if (sslPolicyErrors == SslPolicyErrors.None) {
|
||||
// return true;
|
||||
//}
|
||||
|
||||
//Console.WriteLine("Certificate error: {0}", sslPolicyErrors);
|
||||
|
||||
//// Do not allow this client to communicate with unauthenticated servers.
|
||||
//return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 网站证书
|
||||
/// </summary>
|
||||
public class Certificate
|
||||
{
|
||||
/// <summary>
|
||||
/// 域名
|
||||
/// </summary>
|
||||
public string Domain { get; set; }
|
||||
/// <summary>
|
||||
/// 证书
|
||||
/// </summary>
|
||||
public X509Certificate2 X509 { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -31,7 +32,12 @@ namespace KJD_Web.Utils
|
||||
}
|
||||
}
|
||||
|
||||
public static string SerializerObjectToString(object obj, JsonSerializerSettings jsonsetting = null)
|
||||
public static string SerializeObject(object obj)
|
||||
{
|
||||
return SerializeObjectToString(obj);
|
||||
}
|
||||
|
||||
public static string SerializeObjectToString(object obj, JsonSerializerSettings jsonsetting = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -47,5 +53,78 @@ namespace KJD_Web.Utils
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static T DeserializeJsonToObjectNullable<T>(string json) where T : class
|
||||
{
|
||||
try
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
StringReader sr = new StringReader(json);
|
||||
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(T));
|
||||
T t = o as T;
|
||||
return t;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static JObject JObjectParse(string json)
|
||||
{
|
||||
try
|
||||
{
|
||||
JObject obj = JObject.Parse(json);
|
||||
return obj;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 解析JSON数组生成对象实体集合
|
||||
/// </summary>
|
||||
/// <typeparam name="T">对象类型</typeparam>
|
||||
/// <param name="json">json数组字符串(eg.[{"ID":"112","Name":"石子儿"}])</param>
|
||||
/// <returns>对象实体集合</returns>
|
||||
public static List<T> DeserializeJsonToList<T>(string json) where T : class
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
StringReader sr = new StringReader(json);
|
||||
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(List<T>));
|
||||
List<T> list = o as List<T>;
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<T> DeserializeJsonToListNullable<T>(string json) where T : class
|
||||
{
|
||||
try
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
StringReader sr = new StringReader(json);
|
||||
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(List<T>));
|
||||
List<T> list = o as List<T>;
|
||||
return list;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化JSON到给定的匿名对象.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">匿名对象类型</typeparam>
|
||||
/// <param name="json">json字符串</param>
|
||||
/// <param name="anonymousTypeObject">匿名对象</param>
|
||||
/// <returns>匿名对象</returns>
|
||||
public static T DeserializeAnonymousType<T>(string json, T anonymousTypeObject)
|
||||
{
|
||||
T t = JsonConvert.DeserializeAnonymousType(json, anonymousTypeObject);
|
||||
return t;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -664,5 +664,100 @@ namespace KJD_Web.Utils
|
||||
|
||||
return htmlStr.Trim();
|
||||
}
|
||||
|
||||
public static string GetOneJsonObjStrJson(ref string html, string reg)
|
||||
{
|
||||
return GetJsonObjStrJson(ref html, reg).FirstOrDefault();
|
||||
}
|
||||
|
||||
public static List<string> GetJsonObjStrJson(ref string html, string reg, int level = 0)
|
||||
{
|
||||
List<string> rstLst = new List<string>();
|
||||
if (html == null)
|
||||
return rstLst;
|
||||
|
||||
string htmlTmp = html.Replace("\\{", "\\这里是正花括号占位符").Replace("\\}", "\\这里是反花括号占位符").Replace("\"" + reg + "\": {", "\"" + reg + "\":{");
|
||||
|
||||
retry:
|
||||
string lvStr = "";
|
||||
if (level == 1)
|
||||
{
|
||||
lvStr += "\"";
|
||||
}
|
||||
var index1 = htmlTmp.IndexOf("\"" + reg + "\":" + lvStr + "{");
|
||||
if (index1 < 0)
|
||||
return rstLst;
|
||||
|
||||
htmlTmp = htmlTmp.Substring(index1 + ("\"" + reg + "\":" + lvStr + "{").Length - 1);
|
||||
// 括号计数
|
||||
int braceNum = 0;
|
||||
//string rst = "{";
|
||||
//while (htmlTmp.Length > 0)
|
||||
for (int i = 0; i < htmlTmp.Length; i++)
|
||||
{
|
||||
//rst += htmlTmp.Substring(0, 1);
|
||||
//if (htmlTmp.StartsWith("{"))
|
||||
// braceNum++;
|
||||
//else if (htmlTmp.StartsWith("}"))
|
||||
// braceNum--;
|
||||
if (htmlTmp[i] == '{')
|
||||
braceNum++;
|
||||
else if (htmlTmp[i] == '}')
|
||||
braceNum--;
|
||||
//htmlTmp = htmlTmp.Substring(1);
|
||||
if (braceNum == 0)
|
||||
{
|
||||
rstLst.Add(htmlTmp.Substring(0, i + 1).Replace("\\这里是正花括号占位符", "\\{").Replace("\\这里是反花括号占位符", "\\}"));
|
||||
htmlTmp = htmlTmp.Substring(i + 1);
|
||||
//rstLst.Add(rst.Replace("\\这里是正花括号占位符", "\\{").Replace("\\这里是反花括号占位符", "\\}"));
|
||||
break;
|
||||
}
|
||||
|
||||
// 循环完了还没结果返回空列表
|
||||
if (i == htmlTmp.Length - 1)
|
||||
return rstLst;
|
||||
}
|
||||
if (htmlTmp.Length > 0)
|
||||
goto retry;
|
||||
|
||||
return rstLst;
|
||||
}
|
||||
|
||||
public static List<string> GetJsonArrStrJson(ref string html, string reg)
|
||||
{
|
||||
List<string> rstLst = new List<string>();
|
||||
if (html == null)
|
||||
return rstLst;
|
||||
|
||||
string htmlTmp = html.Replace("\\[", "\\这里是正方括号占位符").Replace("\\]", "\\这里是反方括号占位符").Replace("\"" + reg + "\": [", "\"" + reg + "\":[");
|
||||
|
||||
retry:
|
||||
var index1 = htmlTmp.IndexOf("\"" + reg + "\":[");
|
||||
if (index1 < 0)
|
||||
return rstLst;
|
||||
|
||||
htmlTmp = htmlTmp.Substring(index1 + ("\"" + reg + "\":[").Length);
|
||||
// 括号计数
|
||||
int braceNum = 1;
|
||||
string rst = "[";
|
||||
while (htmlTmp.Length > 0)
|
||||
{
|
||||
rst += htmlTmp.Substring(0, 1);
|
||||
if (htmlTmp.StartsWith("["))
|
||||
braceNum++;
|
||||
else if (htmlTmp.StartsWith("]"))
|
||||
braceNum--;
|
||||
htmlTmp = htmlTmp.Substring(1);
|
||||
if (braceNum == 0)
|
||||
{
|
||||
rstLst.Add(rst.Replace("\\这里是正方括号占位符", "\\[").Replace("\\这里是反方括号占位符", "\\]"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (htmlTmp.Length > 0)
|
||||
goto retry;
|
||||
|
||||
return rstLst;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,8 @@
|
||||
-->
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.5.2"/>
|
||||
<httpRuntime targetFramework="4.5.2"/>
|
||||
<!--<customErrors mode="Off"/>-->
|
||||
<httpRuntime targetFramework="4.5.2" requestValidationMode="2.0"/>
|
||||
<webServices>
|
||||
<protocols>
|
||||
<add name="HttpGet"/>
|
||||
@@ -34,6 +35,8 @@
|
||||
</protocols>
|
||||
</webServices>
|
||||
<pages controlRenderingCompatibilityVersion="4.0"/>
|
||||
<!--<machineKey validation="3DES" validationKey="319B474B1D2B7A87C996B280450BB36506A95AEDF9B51211" decryption="3DES" decryptionKey="280450BB36319B474C996B506A95AEDF9B51211B1D2B7A87" />-->
|
||||
<machineKey validation="SHA1" validationKey="319A374B1D2B7A87C996B280450BB46506A95AEDF9B51212" decryption="3DES" decryptionKey="2B0B50BB36319B474C996B506A95AEDF9B51211B1D2B7A88" />
|
||||
</system.web>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
|
||||
Reference in new issue
Block a user