拼多多买手订单抓取推送

This commit is contained in:
wule committed 2026-04-10 16:00:24 +08:00
1 parent fa96cc1444
commit caeea6e0c3
18 files changed
+1703 -215

No files matched your search

@@ -250,6 +250,90 @@ namespace KJD_Web.BLL.BXX
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string MdyViolationProd(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var time = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name"))?.Replace("'", "\\'");
string secret_spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "secret_spu_id"))?.Replace("'", "\\'");
string spu_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "spu_id"))?.Replace("'", "\\'");
string group = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "group"))?.Replace("'", "\\'");
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'");
string wx_safe_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_safe_status"))?.Replace("'", "\\'");
if (string.IsNullOrWhiteSpace(product_name) && string.IsNullOrWhiteSpace(secret_spu_id) && string.IsNullOrWhiteSpace(spu_id))
return "{\"code\":500,\"msg\":\"没有商品查询信息\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
if (!string.IsNullOrEmpty(product_name))
sql = "select id,spu_id from bxx.product p where p.product_name='" + product_name + "' and p.wx_safe_status in ('安全商品','未校验');";
else if (!string.IsNullOrEmpty(secret_spu_id))
sql = "select id,spu_id from bxx.product p where p.secret_spu_id='" + secret_spu_id + "' and p.wx_safe_status in ('安全商品','未校验');";
else
sql = "select id,spu_id from bxx.product p where p.spu_id='" + spu_id + "' and p.wx_safe_status in ('安全商品','未校验');";
var dt = mySql.ExecuteDataTable(sql);
if (!string.IsNullOrEmpty(mySql.Message))
{
mySql.Close();
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
var ids = "";
foreach(DataRow row in dt.Rows)
{
ids += row["spu_id"].ParseToString() + "','";
}
ids.Trim(',', '\'');
if (string.IsNullOrEmpty(ids))
{
return "{\"code\":200,\"msg\":\"success\",\"err_msg\":\"商品不存在\"}";
}
else
{
sql = "update bxx.product p set";
if (group != null)
sql += " p.group='" + group + "',";
if (notes != null)
sql += " p.notes='" + notes + "',";
if (wx_safe_status != null)
sql += " p.wx_safe_status='" + wx_safe_status + "',";
sql += " p.mdy_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
sql = sql.TrimEnd(',');
sql += " where p.spu_id in('" + ids + "')";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
if (rst)
{
return "{\"code\":200,\"msg\":\"success\"}";
}
else
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string GetProductSpuIdLst(string inputData)
{
var timeCalc = DateTime.Now;
@@ -1295,11 +1379,11 @@ namespace KJD_Web.BLL.BXX
}
if (!string.IsNullOrEmpty(wx_cat_2))
{
where += " and p.wx_cat_2=" + wx_cat_2 + "";
where += " and p.wx_cat_2 in (" + wx_cat_2 + ")";
}
if (!string.IsNullOrEmpty(wx_cat_3))
{
where += " and p.wx_cat_3=" + wx_cat_3 + "";
where += " and p.wx_cat_3 in (" + wx_cat_3 + ")";
}
if (!string.IsNullOrEmpty(product_get_type))
where += " and p.product_get_type ='" + product_get_type + "'";