商品sku列表编辑功能

This commit is contained in:
wule committed 2025-12-12 13:39:31 +08:00
1 parent ad238cd241
commit 2bb124e2d7
16 files changed
+814 -237

No files matched your search

@@ -617,7 +617,7 @@ namespace KJD_Web.BLL.BXX
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code")).ParseToString();
int ext_code_price = RegexUtils.GetStringQuery(ref inputData, "ext_code_price").ParseToInt();
var ext_code_price = RegexUtils.GetStringQuery(ref inputData, "ext_code_price")?.ParseToInt();
if (string.IsNullOrEmpty(user_name))
{
@@ -827,6 +827,7 @@ namespace KJD_Web.BLL.BXX
string fission_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_words"))?.Replace("'", "\\'");
string head_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "head_words"))?.Replace("'", "\\'");
string end_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "end_words"))?.Replace("'", "\\'");
string sku_edit_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_edit_json"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
@@ -850,6 +851,8 @@ namespace KJD_Web.BLL.BXX
sql += " p.head_words='" + head_words + "',";
if (end_words != null)
sql += " p.end_words='" + end_words + "',";
if (sku_edit_json != null)
sql += " p.sku_edit_json='" + sku_edit_json + "',";
sql = sql.TrimEnd(',');
if (in_db_ids != null)
{
@@ -1006,6 +1009,64 @@ namespace KJD_Web.BLL.BXX
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string AddSkuImg(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("'", "\\'");
string img_md5 = RegexUtils.GetStringQuery(ref inputData, "img_md5").Replace("'", "\\'");
string img_base64 = RegexUtils.GetStringQuery(ref inputData, "img_base64").Replace("'", "\\'");
string img_url = RegexUtils.GetStringQuery(ref inputData, "img_url").Replace("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":500,\"msg\":\"没有用户名\"}";
}
int sku_img_replace_id = 0;
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
sql = "select id from bxx.sku_img where img_md5='" + img_md5 + "';";
var bRst = false;
var rst = mySql.ExecuteFirstInt(sql).ParseToLong();
if (rst <= 0)
{
sql = "insert into bxx.sku_img (img_md5,img_base64,img_url) " +
"values ('" + img_md5 + "','" + img_base64 + "','" + img_url + "');";
rst = mySql.ExecuteInsertId(sql);
if (rst > 0)
{
mySql.Close();
return "{\"code\":200,\"msg\":\"success\",\"insert_id\":" + rst + "}";
}
}
else
{
sku_img_replace_id = (int)rst;
sql = "update bxx.sku_img set img_url='" + img_url + "' where img_md5='" + img_md5 + "';";
bRst = mySql.ExecuteNonQuery(sql);
if (bRst)
{
mySql.Close();
return "{\"code\":200,\"msg\":\"success\",\"update_id\":" + rst + "}";
}
}
mySql.Close();
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
/// <summary>
/// 添加用户选择商品
/// </summary>
@@ -251,6 +251,19 @@ namespace KJD_Web
Context.Response.End();
}
//AddSkuImg
[WebMethod]
public void add_sku_img()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddSkuImg(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_user_select_product()
{