店铺考核提供备注功能 微信带货助手采集功能
This commit is contained in:
1 parent
4fa1fc03ca
commit
119b2f4f3e
64 files changed
+7940
-908
No files matched your search
@@ -13,6 +13,7 @@ using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
@@ -57,11 +58,17 @@ namespace KJD_Web.BLL.BXX
|
||||
string sale_count = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sale_count"))?.Replace("'", "\\'");
|
||||
string sale_count_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sale_count_text"))?.Replace("'", "\\'");
|
||||
string distribution_set = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "distribution_set"))?.Replace("'", "\\'");
|
||||
string special_prod_type = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "special_prod_type"))?.Replace("'", "\\'");
|
||||
if (special_prod_type != "爆款商品")
|
||||
special_prod_type = "普通商品";
|
||||
string add_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'");
|
||||
|
||||
string special_prod_type = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "special_prod_type"))?.Replace("'", "\\'");
|
||||
if (special_prod_type != "爆款数据")
|
||||
special_prod_type = "普通商品";
|
||||
string view_uv = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "view_uv"))?.Replace("'", "\\'"); // 爆款数据产品曝光数量
|
||||
string add_hot_version = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_hot_version"))?.Replace("'", "\\'");
|
||||
if (special_prod_type == "爆款数据" && product_get_type == "微信店采" && add_hot_version != "v3")
|
||||
{
|
||||
return "{\"code\":666,\"msg\":\"当前版本已失效,请更新软件\"}";
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(product_get_type))
|
||||
{
|
||||
product_get_type = "母店采集";
|
||||
@@ -105,6 +112,8 @@ namespace KJD_Web.BLL.BXX
|
||||
sql += "add_user_name,";
|
||||
if (group != null)
|
||||
sql += "`group`,";
|
||||
if (!string.IsNullOrWhiteSpace(view_uv))
|
||||
sql += "view_uv,";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += ") ";
|
||||
sql += "values ('" + from_shop_id + "','" + from_shop_name + "','" + offline_supplier_id + "','" + offline_supplier_name + "','" + spu_id + "','" +
|
||||
@@ -117,6 +126,8 @@ namespace KJD_Web.BLL.BXX
|
||||
sql += "'" + add_user_name + "',";
|
||||
if (group != null)
|
||||
sql += "'" + group + "',";
|
||||
if (!string.IsNullOrWhiteSpace(view_uv))
|
||||
sql += "" + view_uv + ",";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += ");";
|
||||
|
||||
@@ -173,7 +184,7 @@ namespace KJD_Web.BLL.BXX
|
||||
string sale_count_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sale_count_text"))?.Replace("'", "\\'");
|
||||
string wx_safe_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_safe_status"))?.Replace("'", "\\'");
|
||||
string special_prod_type = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "special_prod_type"))?.Replace("'", "\\'");
|
||||
if (!string.IsNullOrEmpty(special_prod_type) && special_prod_type != "爆款商品")
|
||||
if (!string.IsNullOrEmpty(special_prod_type) && special_prod_type != "爆款数据")
|
||||
special_prod_type = "普通商品";
|
||||
string wx_cat_1 = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_cat_1"))?.Replace("'", "\\'");
|
||||
string wx_cat_2 = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_cat_2"))?.Replace("'", "\\'");
|
||||
@@ -188,6 +199,13 @@ namespace KJD_Web.BLL.BXX
|
||||
string wx_img_map_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_img_map_json"))?.Replace("'", "\\'");
|
||||
string problem_prod_data = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "problem_prod_data"))?.Replace("'", "\\'");
|
||||
string is_relation = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "is_relation"))?.Replace("'", "\\'");
|
||||
string view_uv = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "view_uv"))?.Replace("'", "\\'"); // 产品曝光数量
|
||||
string product_get_type = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_get_type"))?.Replace("'", "\\'");
|
||||
string add_hot_version = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_hot_version"))?.Replace("'", "\\'");
|
||||
if (special_prod_type == "爆款数据" && product_get_type == "微信店采" && add_hot_version != "v3")
|
||||
{
|
||||
return "{\"code\":666,\"msg\":\"当前版本已失效,请更新软件\"}";
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
@@ -267,6 +285,8 @@ namespace KJD_Web.BLL.BXX
|
||||
sql += " p.problem_prod_data=" + problem_prod_data + ",";
|
||||
if (!is_relation.IsNullOrEmpty())
|
||||
sql += " p.is_relation=" + is_relation + ",";
|
||||
if (!string.IsNullOrWhiteSpace(view_uv))
|
||||
sql += " p.view_uv=" + view_uv + ",";
|
||||
sql += " p.mdy_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where spu_id='" + spu_id + "';";
|
||||
@@ -491,12 +511,13 @@ namespace KJD_Web.BLL.BXX
|
||||
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 = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'"));
|
||||
var search_prod_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_prod_name"))?.Replace("'", "\\'");
|
||||
var search_prod_name_in = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "search_prod_name_in"))?.Replace("'", "\\'");
|
||||
var search_group = RegexUtils.GetStringQuery(ref inputData, "search_group")?.Replace("'", "\\'");
|
||||
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'");
|
||||
var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'");
|
||||
var search_secret_spu_ids = RegexUtils.GetStringQuery(ref inputData, "search_secret_spu_ids")?.Replace("'", "\\'");
|
||||
var ext_code_in = RegexUtils.GetStringQuery(ref inputData, "ext_code_in")?.Replace("'", "\\'");
|
||||
var ext_code_in = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code_in"))?.Replace("'", "\\'");
|
||||
var get_select_count = RegexUtils.GetStringQuery(ref inputData, "get_select_count")?.Replace("'", "\\'");
|
||||
var select_shop_id = RegexUtils.GetStringQuery(ref inputData, "select_shop_id")?.Replace("'", "\\'");
|
||||
var from_shop_id = RegexUtils.GetStringQuery(ref inputData, "from_shop_id")?.Replace("'", "\\'");
|
||||
@@ -520,6 +541,7 @@ namespace KJD_Web.BLL.BXX
|
||||
var ban_wx = RegexUtils.GetStringQuery(ref inputData, "ban_wx")?.Replace("'", "\\'");
|
||||
var ban_pdd = RegexUtils.GetStringQuery(ref inputData, "ban_pdd")?.Replace("'", "\\'");
|
||||
var add_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'");
|
||||
var is_not_count = RegexUtils.GetStringQuery(ref inputData, "is_not_count").ParseToBool(); // 不计数
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
@@ -598,6 +620,10 @@ namespace KJD_Web.BLL.BXX
|
||||
}
|
||||
where += " and (" + multi_search_prod_name.Substring(4) + ")";
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(search_prod_name_in))
|
||||
{
|
||||
where += " and p.product_name in ('" + search_prod_name_in.Replace(",", "','") + "')";
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(search_group))
|
||||
{
|
||||
if (search_group == "无分组")
|
||||
@@ -684,7 +710,7 @@ namespace KJD_Web.BLL.BXX
|
||||
sql += where;
|
||||
|
||||
var count = 0;
|
||||
if (isDetail)
|
||||
if (isDetail || is_not_count)
|
||||
count = 1;
|
||||
else
|
||||
count = mySql.ExecuteRowCount(sql, paramLst.ToArray());
|
||||
@@ -706,7 +732,7 @@ namespace KJD_Web.BLL.BXX
|
||||
sql = "select p.id,p.from_shop_id,p.spu_id,p.skc_id,p.main_cat_id,p.main_cat_name,p.cat_id,p.cat_name,p.price_text,p.ext_code,p.product_name," +
|
||||
" p.main_img,p.notes,p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,p.group," +
|
||||
" p.product_get_type,p.wx_safe_status,p.sale_count,p.sale_count_text,p.special_prod_type,p.from_shop_name,p.wx_cat_1,p.wx_cat_2,p.wx_cat_3," +
|
||||
" p.wx_cat_leaf,p.send_to_out_server,p.secret_spu_id,p.real_coid,p.real_spu_id,p.is_relation," +
|
||||
" p.wx_cat_leaf,p.send_to_out_server,p.secret_spu_id,p.real_coid,p.real_spu_id,p.is_relation,p.view_uv," +
|
||||
" s.img_url,e.ext_code_price" +
|
||||
" FROM bxx.product p " +
|
||||
" LEFT JOIN bxx.sku_img_replace s ON p.sku_img_replace_id=s.id" +
|
||||
@@ -717,7 +743,7 @@ namespace KJD_Web.BLL.BXX
|
||||
sql = "SELECT p.id,p.from_shop_id,p.spu_id,p.skc_id,p.main_cat_id,p.main_cat_name,p.cat_id,p.cat_name,p.price_text,p.ext_code,p.product_name," +
|
||||
" p.main_img,p.notes,p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,p.group," +
|
||||
" p.product_get_type,p.wx_safe_status,p.sale_count,p.sale_count_text,p.special_prod_type,p.from_shop_name,p.wx_cat_1,p.wx_cat_2,p.wx_cat_3," +
|
||||
" p.wx_cat_leaf,p.send_to_out_server,p.secret_spu_id,p.real_coid,p.real_spu_id,p.is_relation," +
|
||||
" p.wx_cat_leaf,p.send_to_out_server,p.secret_spu_id,p.real_coid,p.real_spu_id,p.is_relation,p.view_uv" +
|
||||
" s.img_url,COUNT(se.id) AS select_count,e.ext_code_price" +
|
||||
" FROM bxx.product p" +
|
||||
" LEFT JOIN bxx.sku_img_replace s ON p.sku_img_replace_id=s.id LEFT JOIN bxx.product_select se ON p.id=se.out_product_id AND se.shop_id='" + select_shop_id + "' " +
|
||||
@@ -732,6 +758,8 @@ namespace KJD_Web.BLL.BXX
|
||||
sql += " group by p.id";
|
||||
if (sort_field == "select_total_count")
|
||||
sql += " order by p.select_total_count desc, p.id desc";
|
||||
else if (sort_field == "view_uv")
|
||||
sql += " order by p.view_uv desc, p.id desc";
|
||||
else
|
||||
sql += " order by p.id desc";
|
||||
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
@@ -779,6 +807,7 @@ namespace KJD_Web.BLL.BXX
|
||||
sku_img_replace_id = row["sku_img_replace_id"].ParseToInt(),
|
||||
sku_img_replace_url = row["img_url"].ToString(),
|
||||
product_get_type_text = row["product_get_type"].ToString(),
|
||||
view_uv = row["view_uv"].ParseToNullableInt(),
|
||||
sale_count = row["sale_count"].ParseToInt(),
|
||||
sale_count_text = row["sale_count_text"].ToString(),
|
||||
wx_safe_status = row["wx_safe_status"].ToString(),
|
||||
@@ -831,6 +860,8 @@ namespace KJD_Web.BLL.BXX
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializeObjectToString(productLst, jsonSetting);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
if (is_not_count)
|
||||
count = productLst.Count;
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -1454,6 +1485,8 @@ namespace KJD_Web.BLL.BXX
|
||||
var product_get_type = RegexUtils.GetStringQuery(ref inputData, "product_get_type")?.Replace("'", "\\'");
|
||||
var wx_safe_status = RegexUtils.GetStringQuery(ref inputData, "wx_safe_status")?.Replace("'", "\\'");
|
||||
var special_prod_type = RegexUtils.GetStringQuery(ref inputData, "special_prod_type")?.Replace("'", "\\'");
|
||||
if (special_prod_type.IsNullOrEmpty())
|
||||
special_prod_type = "普通商品,书籍";
|
||||
var is_supplier_prod_ok = RegexUtils.GetStringQuery(ref inputData, "is_supplier_prod_ok")?.Replace("'", "\\'");
|
||||
var is_not_count = RegexUtils.GetStringQuery(ref inputData, "is_not_count").ParseToBool(); // 不计数
|
||||
var prod_count = RegexUtils.GetStringQuery(ref inputData, "prod_count").ParseToInt();
|
||||
@@ -1523,9 +1556,9 @@ namespace KJD_Web.BLL.BXX
|
||||
where += " and p.product_get_type ='" + product_get_type + "'";
|
||||
if (!string.IsNullOrEmpty(wx_safe_status))
|
||||
where += " and p.wx_safe_status in ('" + wx_safe_status.Replace(",", "','") + "')";
|
||||
//if (!string.IsNullOrEmpty(special_prod_type)) // 普通商品 爆款商品
|
||||
//if (!string.IsNullOrEmpty(special_prod_type)) // 普通商品 爆款数据
|
||||
// where += " and p.special_prod_type ='" + special_prod_type + "'";
|
||||
sql += " and p.special_prod_type in ('普通商品','书籍')";
|
||||
where += " and p.special_prod_type in ('" + special_prod_type.Replace(",", "','") + "')";
|
||||
// 供应商货源是否已完成初始设置
|
||||
if (!string.IsNullOrEmpty(is_supplier_prod_ok))
|
||||
{
|
||||
@@ -1873,7 +1906,7 @@ namespace KJD_Web.BLL.BXX
|
||||
string sku_edit_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_edit_json"))?.Replace("'", "\\'");
|
||||
string wx_safe_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_safe_status"))?.Replace("'", "\\'");
|
||||
string special_prod_type = RegexUtils.GetStringQuery(ref inputData, "special_prod_type")?.Replace("'", "\\'");
|
||||
if (!string.IsNullOrEmpty(special_prod_type) && special_prod_type != "爆款商品")
|
||||
if (!string.IsNullOrEmpty(special_prod_type) && special_prod_type != "爆款数据")
|
||||
special_prod_type = "普通商品";
|
||||
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
@@ -3561,36 +3594,53 @@ namespace KJD_Web.BLL.BXX
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string XJGetAiImage(string inputData)
|
||||
//public string XJGetAiImage(string inputData)
|
||||
//{
|
||||
// if (string.IsNullOrEmpty(inputData))
|
||||
// return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
|
||||
// if (!WXUserManage.GetSign(inputData))
|
||||
// return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
|
||||
// string image_url = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "image_url"))?.ParseToString();
|
||||
// string word = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "word"))?.ParseToString();
|
||||
// if (image_url == null)
|
||||
// return "{\"code\":500,\"msg\":\"缺少图片地址\"}";
|
||||
// if (word == null)
|
||||
// return "{\"code\":500,\"msg\":\"缺少图片文字\"}";
|
||||
|
||||
// string secret = "sadhjufhe15c4fbvFBvcvds+5sdfds@#%$xsc";
|
||||
// string time = TimeUtils.DateTimeToTimestampSeconds(DateTime.Now).ToString();
|
||||
// string code = EncrypUtil.GetMd5(secret + time);
|
||||
|
||||
// try
|
||||
// {
|
||||
// string url = "http://ai-bs.jiaotian.vip:" + RandomUtils.GetId(20010, 20021) + "/index.php?obj=public/image";
|
||||
// string data = "time=" + time + "&code=" + code + "&image_url=" + image_url + "&word=" + word;
|
||||
// string html = HttpUtils.e57GetResponse(url, "");
|
||||
// return html;
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// return "{\"code\":50001,\"msg\":\"" + ex.Message + "\"}";
|
||||
// }
|
||||
//}
|
||||
|
||||
public string IsGetWXRecommendHotProd(string inputData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(inputData))
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
|
||||
string image_url = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "image_url"))?.ParseToString();
|
||||
string word = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "word"))?.ParseToString();
|
||||
if (image_url == null)
|
||||
return "{\"code\":500,\"msg\":\"缺少图片地址\"}";
|
||||
if (word == null)
|
||||
return "{\"code\":500,\"msg\":\"缺少图片文字\"}";
|
||||
|
||||
string secret = "sadhjufhe15c4fbvFBvcvds+5sdfds@#%$xsc";
|
||||
string time = TimeUtils.DateTimeToTimestampSeconds(DateTime.Now).ToString();
|
||||
string code = EncrypUtil.GetMd5(secret + time);
|
||||
|
||||
try
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
string url = "http://ai-bs.jiaotian.vip:" + RandomUtils.GetId(20010, 20021) + "/index.php?obj=public/image";
|
||||
string data = "time=" + time + "&code=" + code + "&image_url=" + image_url + "&word=" + word;
|
||||
string html = HttpUtils.e57GetResponse(url, "");
|
||||
return html;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "{\"code\":50001,\"msg\":\"" + ex.Message + "\"}";
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
|
||||
var isGetReturn = System.Configuration.ConfigurationManager.ConnectionStrings["GetWXRecommendHotProd"]?.ConnectionString;
|
||||
var isGetOnce = System.Configuration.ConfigurationManager.ConnectionStrings["GetWXRecommendHotProd"]?.ConnectionString;
|
||||
var minViewUv = (System.Configuration.ConfigurationManager.ConnectionStrings["GetWXRecommendHotProdMinViewUv"]?.ConnectionString).ParseToInt(500);
|
||||
var getInterval = (System.Configuration.ConfigurationManager.ConnectionStrings["GetWXRecommendHotProdInterval"]?.ConnectionString).ParseToInt(3);
|
||||
return "{\"code\":200,\"is_get\":\"" + isGetReturn + "\",\"isGetOnce\":\"" + isGetOnce + "\"," +
|
||||
"\"minViewUv\":" + minViewUv + ",\"getInterval\":" + getInterval + "}";
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user