用户开放机会商品采集功能

This commit is contained in:
wule committed 2026-05-04 19:43:15 +08:00
1 parent b5ae0fc2f2
commit 5470863fff
26 files changed
+3131 -288

No files matched your search

@@ -51,6 +51,7 @@ namespace KJD_Web.BLL.BXX
string product_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_json"));
string size_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "size_json"));
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img"))?.Replace("'", "\\'");
string group = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "group"))?.Replace("'", "\\'");
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'");
string product_get_type = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_get_type"))?.Replace("'", "\\'");
string sale_count = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sale_count"))?.Replace("'", "\\'");
@@ -59,6 +60,7 @@ namespace KJD_Web.BLL.BXX
string special_prod_type = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "special_prod_type"))?.Replace("'", "\\'");
if (special_prod_type == null)
special_prod_type = "普通商品";
string add_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "add_user_name"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty(product_get_type))
{
@@ -95,17 +97,28 @@ namespace KJD_Web.BLL.BXX
}
}
sql = "insert into ";
sql += "bxx.product ";
sql += "(from_shop_id,from_shop_name,offline_supplier_id,offline_supplier_name,spu_id,skc_id,real_coid,real_spu_id,main_cat_id,main_cat_name,cat_id," +
"cat_name,price_text,product_name,ext_code,main_img,product_json,size_json,notes,product_get_type,sale_count,sale_count_text,special_prod_type," +
"distribution_set,ban_wx,ban_pdd,add_time,mdy_time) " +
"values ('" + from_shop_id + "','" + from_shop_name + "','" + offline_supplier_id + "','" + offline_supplier_name + "','" + spu_id + "','" +
skc_id + "','" + real_coid + "','" + real_spu_id + "','" + main_cat_id + "','" + main_cat_name + "','" + cat_id + "','" + cat_name + "','" +
price_text + "','" + product_name + "','" + ext_code + "','" + main_img + "',@product_json,@size_json,'" + notes + "','" + product_get_type + "','" +
sale_count + "','" + sale_count_text + "','" + special_prod_type + "'," + distribution_set.ParseToInt() + "," + ban_wx + "," + ban_pdd + ",'" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
sql = "INSERT INTO bxx.product(";
sql += "from_shop_id,from_shop_name,offline_supplier_id,offline_supplier_name,spu_id,skc_id,real_coid,real_spu_id,main_cat_id,main_cat_name,cat_id,";
sql += "cat_name,price_text,product_name,ext_code,main_img,product_json,size_json,notes,product_get_type,sale_count,sale_count_text,special_prod_type,";
sql += "distribution_set,ban_wx,ban_pdd,add_time,mdy_time,";
if (add_user_name != null)
sql += "add_user_name,";
if (group != null)
sql += "`group`,";
sql = sql.TrimEnd(',');
sql += ") ";
sql += "values ('" + from_shop_id + "','" + from_shop_name + "','" + offline_supplier_id + "','" + offline_supplier_name + "','" + spu_id + "','" +
skc_id + "','" + real_coid + "','" + real_spu_id + "','" + main_cat_id + "','" + main_cat_name + "','" + cat_id + "','" + cat_name + "','" +
price_text + "','" + product_name + "','" + ext_code + "','" + main_img + "',@product_json,@size_json,'" + notes + "','" + product_get_type + "','" +
sale_count + "','" + sale_count_text + "','" + special_prod_type + "'," + distribution_set.ParseToInt() + "," + ban_wx + "," + ban_pdd + ",";
sql += "'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
sql += "'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
if (add_user_name != null)
sql += "'" + add_user_name + "',";
if (group != null)
sql += "'" + group + "',";
sql = sql.TrimEnd(',');
sql += ");";
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_json", Value = product_json, });
@@ -502,6 +515,7 @@ namespace KJD_Web.BLL.BXX
var end_time = RegexUtils.GetStringQuery(ref inputData, "end_time")?.Replace("'", "\\'");
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("'", "\\'");
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
@@ -658,6 +672,11 @@ namespace KJD_Web.BLL.BXX
{
where += " and p.ban_pdd=" + ban_pdd;
}
if (!string.IsNullOrEmpty(add_user_name))
{
add_user_name = "'" + string.Join("','", add_user_name.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
where += " and p.add_user_name in (" + add_user_name + ")";
}
sql += where;
var count = 0;
@@ -1155,6 +1174,7 @@ namespace KJD_Web.BLL.BXX
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(200);
var product_get_type = RegexUtils.GetStringQuery(ref inputData, "product_get_type")?.Replace("'", "\\'");
var add_user_name = RegexUtils.GetStringQuery(ref inputData, "add_user_name")?.Replace("'", "\\'");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
@@ -1164,6 +1184,11 @@ namespace KJD_Web.BLL.BXX
string where = "";
if (!string.IsNullOrEmpty(product_get_type))
where += " and p.product_get_type ='" + product_get_type + "'";
if (!string.IsNullOrEmpty(add_user_name))
{
add_user_name = "'" + string.Join("','", add_user_name.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
where += " and p.add_user_name in (" + add_user_name + ")";
}
sql += where;
var dt = mySql.ExecuteDataTable(sql);
@@ -1432,6 +1457,7 @@ namespace KJD_Web.BLL.BXX
var is_relation = RegexUtils.GetStringQuery(ref inputData, "is_relation").ParseToNullableInt();
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("'", "\\'");
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
@@ -1522,6 +1548,11 @@ namespace KJD_Web.BLL.BXX
{
where += " and p.ban_pdd=" + ban_pdd;
}
if (!string.IsNullOrEmpty(add_user_name))
{
add_user_name = "'" + string.Join("','", add_user_name.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
where += " and p.add_user_name in (" + add_user_name + ")";
}
sql += where;
int count = prod_count;
@@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
<ProjectExtensions>