用户备注功能

This commit is contained in:
wule_5900x committed 2025-08-10 13:07:56 +08:00
1 parent 54ee83df62
commit c3dc9979d1
21 files changed
+1168 -307

No files matched your search

+44 -13
View File
@@ -465,6 +465,7 @@ namespace KJD_Web.BLL
var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'");
var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'");
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'");
var search_user_notes = RegexUtils.GetStringQuery(ref inputData, "search_user_notes")?.Replace("'", "\\'");
var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'");
var search_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "search_sub_sa_name")?.Replace("'", "\\'");
var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
@@ -504,6 +505,8 @@ namespace KJD_Web.BLL
where += " and s.shop_account like '%" + search_shop_account + "%'";
if (!string.IsNullOrWhiteSpace(search_notes))
where += " and s.notes like '%" + search_notes + "%'";
if (!string.IsNullOrWhiteSpace(search_user_notes))
where += " and s.user_notes like '%" + search_user_notes + "%'";
if (!string.IsNullOrWhiteSpace(search_spu))
where += " and p.spu_id like '%" + search_spu + "%'";
if (!string.IsNullOrWhiteSpace(search_skc))
@@ -535,7 +538,7 @@ namespace KJD_Web.BLL
//sql = "select * from kjd.product_select where 1=1";
//else
sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," +
"s.sub_user_name,s.notes,s.status,s.draft_id,s.add_times,s.add_time,s.mdy_time," +
"s.sub_user_name,s.notes,s.user_notes,s.status,s.draft_id,s.add_times,s.add_time,s.mdy_time," +
"s.fission_product_name,s.operate_sub_sa_name,s.add_sub_sa_time," +
"p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img," +
"u.nick_name as operate_sub_sa_nick " +
@@ -582,11 +585,12 @@ namespace KJD_Web.BLL
operate_sub_sa_name = row["operate_sub_sa_name"].ToString(),
operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString(),
fission_product_name = row["fission_product_name"].ToString(),
user_notes = row["user_notes"].ToString(),
//product_json = row["product_json"].ToString(),
//size_json = row["size_json"].ToString(),
};
prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?;
productLst.Add(prodSelect);
};
prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?;
productLst.Add(prodSelect);
}
var data = JsonUtils.SerializerObjectToString(productLst);
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
@@ -705,10 +709,11 @@ namespace KJD_Web.BLL
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'");
string fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_product_name"))?.Replace("'", "\\'");
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
var id = RegexUtils.GetStringQuery(ref inputData, "db_id");
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"));
string user_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_notes"));
string fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_product_name"));
if (string.IsNullOrEmpty(user_name))
{
@@ -719,13 +724,21 @@ namespace KJD_Web.BLL
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update kjd.product_select set";
if (notes != null)
sql += " notes='" + notes + "',";
sql += " notes=@notes,";
if (user_notes != null)
sql += " user_notes=@user_notes,";
if (fission_product_name != null)
sql += " fission_product_name='" + fission_product_name + "',";
sql += " fission_product_name=@fission_product_name,";
sql = sql.TrimEnd(',');
sql += " where id=" + id + ";";
sql += " where id=@id;";
var rst = mySql.ExecuteNonQuery(sql);
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@id", Value = id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@fission_product_name", Value = fission_product_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@user_notes", Value = user_notes, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (rst)
{
@@ -739,4 +752,22 @@ namespace KJD_Web.BLL
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
}
}
}
/*
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "spu_id", Value = spu_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "skc_id", Value = skc_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "cat_id", Value = cat_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "cat_name", Value = cat_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_name", Value = product_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "ext_code", Value = ext_code, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "main_img", Value = main_img, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_json", Value = product_json, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "size_json", Value = size_json, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "notes", Value = notes.ParseToString(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_md5", Value = product_md5, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "add_time", Value = add_time, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "mdy_time", Value = mdy_time, });
rst = mySql.ExecuteInsertId(sql, paramLst.ToArray());*/