聚水潭食品类目上传

This commit is contained in:
wule committed 2026-02-23 21:28:09 +08:00
1 parent 7b06707a40
commit 1b2b6bb553
12 files changed
+430 -16

No files matched your search

@@ -115,6 +115,7 @@ namespace KJD_Web.BLL.BXX
string offline_supplier_name = RegexUtils.GetStringQuery(ref inputData, "offline_supplier_name")?.Replace("'", "\\'");
string spu_id = RegexUtils.GetStringQuery(ref inputData, "spu_id")?.Replace("'", "\\'");
string skc_id = RegexUtils.GetStringQuery(ref inputData, "skc_id")?.Replace("'", "\\'");
string secret_spu_id = RegexUtils.GetStringQuery(ref inputData, "secret_spu_id")?.Replace("'", "\\'");
string price_text = RegexUtils.GetStringQuery(ref inputData, "price_text")?.Replace("'", "\\'");
string main_cat_id = RegexUtils.GetStringQuery(ref inputData, "main_cat_id")?.Replace("'", "\\'");
string main_cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_cat_name"))?.Replace("'", "\\'");
@@ -175,6 +176,8 @@ namespace KJD_Web.BLL.BXX
sql += " p.product_name='" + product_name + "',";
if (ext_code != null)
sql += " p.ext_code='" + ext_code + "',";
if (secret_spu_id != null)
sql += " p.secret_spu_id='" + secret_spu_id + "',";
if (main_img != null)
sql += " p.main_img='" + main_img + "',";
if (product_json != null)
@@ -264,6 +267,7 @@ namespace KJD_Web.BLL.BXX
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 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("'", "\\'");
@@ -283,7 +287,7 @@ namespace KJD_Web.BLL.BXX
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select count(*) from bxx.product p where p.is_del=0";
string sql = "select count(*) from bxx.product p FORCE INDEX (index_wx_safe_status) where p.is_del=0";
string where = "";
if (!string.IsNullOrEmpty(from_shop_id))
@@ -292,6 +296,8 @@ namespace KJD_Web.BLL.BXX
where += " and p.from_shop_name ='" + from_shop_name + "'";
if (!string.IsNullOrEmpty(search_db_ids))
where += " and p.id in (" + search_db_ids + ")";
if (!string.IsNullOrEmpty(search_secret_spu_ids))
where += " and p.secret_spu_id in ('" + string.Join("','", search_secret_spu_ids.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)) + "')";
if (!string.IsNullOrEmpty(product_get_type))
where += " and p.product_get_type ='" + product_get_type + "'";
if (!string.IsNullOrEmpty(wx_safe_status))
@@ -381,7 +387,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.wx_cat_leaf,p.send_to_out_server,p.secret_spu_id," +
" 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" +
@@ -391,7 +397,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.wx_cat_leaf,p.send_to_out_server,p.secret_spu_id," +
" 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 + "' " +
" LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
@@ -458,6 +464,7 @@ namespace KJD_Web.BLL.BXX
main_cat_id = row["main_cat_id"].ToString(),
main_cat_name = row["main_cat_name"].ToString(),
send_to_out_server = row["send_to_out_server"].ParseToInt(),
secret_spu_id = row["secret_spu_id"].IsNullOrEmpty() ? null : row["secret_spu_id"].ParseToString(),
};
if (isDetail)
{
@@ -468,6 +475,24 @@ namespace KJD_Web.BLL.BXX
prod.sku_img_replace_base64 = row["img_base64"].ToString();
//prod.sku_img_replace_url = row["img_url"].ToString();
prod.wx_img_map_json = row["wx_img_map_json"].ToString();
if(!prod.sku_secret_json.IsNullOrEmpty() && prod.secret_spu_id.IsNullOrEmpty())
{
var secret_json = prod.sku_secret_json;
var goodsId = RegexUtils.GetStringJson(ref secret_json, "goodsId");
prod.secret_spu_id = goodsId;
if (!string.IsNullOrWhiteSpace(goodsId))
{
mySql = new MysqlUtils(conn);
try
{
sql = "update bxx.product set secret_spu_id='" + goodsId + "' where spu_id='" + prod.spu_id + "'";
mySql.ExecuteNonQuery(sql);
}
catch { }
mySql.Close();
}
}
}
if (!string.IsNullOrEmpty(get_select_count))
{