1产品数据库分组字段设置查询 2jit产品合规信息填写
This commit is contained in:
1 parent
20fb940fa7
commit
31d11c0341
14 files changed
+734
-266
No files matched your search
@@ -68,6 +68,70 @@ namespace KJD_Web.BLL
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string GetProductGroupList(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(100);
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "select count(distinct p.group) from kjd.product p where p.is_del=0";
|
||||
|
||||
var count = mySql.ExecuteRowCount(sql);
|
||||
|
||||
DataTable dt;
|
||||
if (count == 0)
|
||||
{
|
||||
dt = new DataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "select distinct p.group from kjd.product p where p.is_del=0";
|
||||
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
}
|
||||
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<string> groupNameLst = new List<string>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
var group = row["group"].ToString();
|
||||
groupNameLst.Add(group);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(groupNameLst);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string GetProductList(string inputData, bool isDetail = false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
@@ -85,6 +149,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_group = RegexUtils.GetStringQuery(ref inputData, "search_group")?.Replace("'", "\\'");
|
||||
var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_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("'", "\\'");
|
||||
@@ -116,6 +181,8 @@ namespace KJD_Web.BLL
|
||||
where += " and p.product_name like '%" + search_prod_name + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_notes))
|
||||
where += " and p.notes like '%" + search_notes + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_group))
|
||||
where += " and p.group like '%" + search_group + "%'";
|
||||
if (!string.IsNullOrEmpty(search_db_ids))
|
||||
where += " and p.id in (" + search_db_ids + ")";
|
||||
sql += where;
|
||||
@@ -132,11 +199,11 @@ namespace KJD_Web.BLL
|
||||
if (isDetail)
|
||||
sql = "select * from kjd.product p where p.is_del=0";
|
||||
else if (string.IsNullOrEmpty(get_select_count))
|
||||
sql = "select p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes," +
|
||||
sql = "select p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes,p.group," +
|
||||
"p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words," +
|
||||
"p.product_get_type from kjd.product p where p.is_del=0";
|
||||
else
|
||||
sql = "SELECT p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes," +
|
||||
sql = "SELECT p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes,p.group," +
|
||||
"p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.product_get_type" +
|
||||
",COUNT(s.id) AS select_count " +
|
||||
"FROM kjd.product p LEFT JOIN kjd.product_select s ON p.id=s.out_product_id AND s.shop_id='" + select_shop_id + "' " +
|
||||
@@ -181,6 +248,7 @@ namespace KJD_Web.BLL
|
||||
add_time = Convert.ToDateTime(row["add_time"]),
|
||||
mdy_time = Convert.ToDateTime(row["mdy_time"]),
|
||||
notes = row["notes"].ToString(),
|
||||
group = row["group"].ToString(),
|
||||
select_total_count = row["select_total_count"].ParseToInt(),
|
||||
end_words = row["end_words"].ParseToString(),
|
||||
fission_words = row["fission_words"].ParseToString(),
|
||||
@@ -296,6 +364,7 @@ namespace KJD_Web.BLL
|
||||
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
|
||||
var product_name = RegexUtils.GetStringQuery(ref inputData, "product_name")?.Replace("'", "\\'");
|
||||
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'");
|
||||
string group = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "group"))?.Replace("'", "\\'");
|
||||
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"))?.Replace("'", "\\'");
|
||||
string fission_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_words"))?.Replace("'", "\\'");
|
||||
string head_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "head_words"))?.Replace("'", "\\'");
|
||||
@@ -316,6 +385,8 @@ namespace KJD_Web.BLL
|
||||
sql += " product_name='" + product_name + "',";
|
||||
if (notes != null)
|
||||
sql += " notes='" + notes + "',";
|
||||
if (group != null)
|
||||
sql += " kjd.product.group='" + group + "',";
|
||||
if (ext_code != null)
|
||||
sql += " ext_code='" + ext_code + "',";
|
||||
if (fission_words != null)
|
||||
|
||||
@@ -48,6 +48,18 @@ namespace KJD_Web
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void get_product_group_list()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new ProductManage().GetProductGroupList(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void get_product_list()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user