优化清理无流量逻辑 修复用户导入商品失败问题 图书上传资质文件逻辑完成
This commit is contained in:
1 parent
7d07c83579
commit
3514be2dba
16 files changed
+705
-340
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using KJD_Web.Model;
|
||||
using KJD_Web.Model.ShopModel;
|
||||
using KJD_Web.Model.WxModel;
|
||||
using KJD_Web.Utils;
|
||||
using MySql.Data.MySqlClient;
|
||||
using Mysqlx.Crud;
|
||||
@@ -1206,6 +1207,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(1);
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(200);
|
||||
string img_md5 = RegexUtils.GetStringQuery(ref inputData, "img_md5")?.Replace("'", "\\'");
|
||||
string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name"))?.Replace("'", "\\'");
|
||||
string is_detail = RegexUtils.GetStringQuery(ref inputData, "is_detail")?.Replace("'", "\\'");
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
@@ -1216,6 +1218,8 @@ namespace KJD_Web.BLL.WXXD
|
||||
string where = "";
|
||||
if (!string.IsNullOrEmpty(img_md5))
|
||||
where += " and img_md5 in ('" + img_md5.Replace(",", "','") + "')";
|
||||
if (!string.IsNullOrEmpty(cat_name))
|
||||
where += " and cat_name in ('" + cat_name.Replace(",", "','") + "')";
|
||||
sql += where;
|
||||
sql += " ORDER BY id DESC";
|
||||
sql += " LIMIT " + (page - 1) * page_size + "," + page_size + ";";
|
||||
@@ -1226,22 +1230,26 @@ namespace KJD_Web.BLL.WXXD
|
||||
if (dt != null)
|
||||
{
|
||||
JArray jArr = new JArray();
|
||||
List<wx_qualification_image_info> wxQualificationImageInfos = new List<wx_qualification_image_info>();
|
||||
try
|
||||
{
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
JObject jObj = new JObject();
|
||||
jObj["id"] = row["id"].ToString();
|
||||
jObj["img_md5"] = row["img_md5"].ToString();
|
||||
var img = new wx_qualification_image_info()
|
||||
{
|
||||
id = row["id"].ParseToInt(),
|
||||
cat_name = row["cat_name"].ParseToString(),
|
||||
img_md5 = row["img_md5"].ParseToString(),
|
||||
img_thumb_base64 = row["img_thumb_base64"].ParseToNullableString(),
|
||||
txt_margin = row["txt_margin"].ParseToNullableString(),
|
||||
add_time = row["add_time"].ParseToString().ParseToDateTime(),
|
||||
mdy_time = row["mdy_time"].ParseToString().ParseToDateTime(),
|
||||
};
|
||||
if (is_detail == "true")
|
||||
jObj["img_base64"] = row["img_base64"].ParseToNullableString();
|
||||
jObj["img_thumb_base64"] = row["img_thumb_base64"].ParseToNullableString();
|
||||
jObj["txt_margin"] = row["txt_margin"].ParseToNullableString();
|
||||
jObj["add_time"] = Convert.ToDateTime(row["add_time"]);
|
||||
jObj["mdy_time"] = Convert.ToDateTime(row["mdy_time"]);
|
||||
jArr.Add(jObj);
|
||||
img.img_base64 = row["img_base64"].ParseToNullableString();
|
||||
wxQualificationImageInfos.Add(img);
|
||||
}
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + JsonUtils.SerializeObject(jArr) + "}";
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + JsonUtils.SerializeObject(wxQualificationImageInfos) + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -1256,6 +1264,44 @@ namespace KJD_Web.BLL.WXXD
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string WXDelQualificationImage(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
|
||||
string img_md5 = RegexUtils.GetStringQuery(ref inputData, "img_md5")?.Replace("'", "\\'");
|
||||
string id = RegexUtils.GetStringQuery(ref inputData, "id")?.Replace("'", "\\'");
|
||||
if (id.IsNullOrZero() && img_md5.IsNullOrEmpty())
|
||||
{
|
||||
return "{\"code\":50001,\"msg\":\"图片id不能为空\"}";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "delete FROM wxxd.wx_qualification_image where 1=1";
|
||||
|
||||
string where = "";
|
||||
if (!string.IsNullOrEmpty(img_md5))
|
||||
where += " and img_md5 in ('" + img_md5.Replace(",", "','") + "')";
|
||||
if (!id.IsNullOrZero())
|
||||
where += " and id in (" + id + ")";
|
||||
sql += where + ";";
|
||||
|
||||
var rows = mySql.ExecuteAffectedRows(sql);
|
||||
mySql.Close();
|
||||
|
||||
if(!string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
return "{\"code\":50002,\"msg\":\"" + mySql.Message + "\"}";
|
||||
}
|
||||
return "{\"code\":200,\"msg\":\"success\",\"affected_rows\":" + rows + "}";
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
|
||||
public string E57GetFreightTemplate(string inputData)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user