优化清理无流量逻辑 修复用户导入商品失败问题 图书上传资质文件逻辑完成

This commit is contained in:
wule committed 2026-08-11 22:14:33 +08:00
1 parent 7d07c83579
commit 3514be2dba
16 files changed
+705 -340

No files matched your search

@@ -2722,6 +2722,9 @@ namespace KJD_Web.BLL.BXX
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
//var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
//string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
//if (time1 != EncrypUtil.Encryption(time))
@@ -2732,6 +2735,71 @@ namespace KJD_Web.BLL.BXX
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string WxApiDropshipSearch(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
string token = RegexUtils.GetStringQuery(ref inputData, "token", true)?.Replace("'", "\\'");
string order_id = RegexUtils.GetStringQuery(ref inputData, "order_id", true)?.Replace("'", "\\'");
string status = RegexUtils.GetStringQuery(ref inputData, "status", true)?.Replace("'", "\\'");
//string data = "{\"search_condition\":{\"order_id\":\"37000204335323251\" },\"page_info\":{\"offset\": 0,\"limit\":10}}";
string data = "{\"search_condition\":{\"order_id\":\"" + order_id + "\",\"status\":" + status + "}}";
return HttpUtils.WxApiPostResponse("https://api.weixin.qq.com/channels/ec/order/dropship/search?access_token=" + token, data, "");
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
/// <summary>
/// 微信小店分配订单代发
/// </summary>
/// <param name="inputData"></param>
/// <returns></returns>
public string WxApiDropshipAssign(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var token = RegexUtils.GetStringQuery(ref inputData, "token")?.Replace("'", "\\'");
var order_id = RegexUtils.GetStringQuery(ref inputData, "order_id")?.Replace("'", "\\'");
//var supplier_appid = RegexUtils.GetStringQuery(ref inputData, "supplier_appid")?.Replace("'", "\\'");
var dropship_product_list = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "dropship_product_list"))?.Replace("'", "\\'");
//{
// "order_id": "37012940902395351",
// "supplier_appid": "wxabc",
// "dropship_product_list": [
// {
// "spu_id": "1253129080",
// "sku_id": "2983950535",
// "product_cnt": 3
// }
// ]
//}
//{ "code":0,"data":{ "list":[{ "name":"29供货商","appid":"wxfc630d60a1af6c6f","status":1,"bindAuditStatus":1,"unbindAuditStatus":0,"bindTime":1782903213,"unbindTime":0,"updateTime":1782903213,"actionSource":0,"remark":"","headImg":""}],"totalCount":1} }
try
{
JObject obj = new JObject();
obj["order_id"] = order_id;
obj["supplier_appid"] = "wxfc630d60a1af6c6f";
JArray array = (JArray.Parse(dropship_product_list));
obj["dropship_product_list"] = array;
return HttpUtils.WxApiPostResponse("https://api.weixin.qq.com/channels/ec/order/dropship/assign?access_token=" + token, JsonUtils.SerializeObject(obj), "");
}
catch
{
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string WxApiCategoryClassify(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
@@ -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)
{
@@ -8,6 +8,7 @@ namespace KJD_Web.Model.WxModel
public class wx_qualification_image_info
{
public int id { get; set; }
public string cat_name { get; set; }
public string img_md5 { get; set; }
public string img_base64 { get; set; }
public string img_thumb_base64 { get; set; }
@@ -335,6 +335,18 @@ namespace KJD_Web
Context.Response.End();
}
[WebMethod]
public void wx_del_qualification_image()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new WXProductManage().WXDelQualificationImage(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void e57_get_freight_template()
{
@@ -371,6 +383,32 @@ namespace KJD_Web
Context.Response.End();
}
/// <summary>
/// 搜索代发
/// </summary>
[WebMethod]
public void wx_api_dropship_search()
{
string jsontext = GetRequestJsonString();
var result = new BXXProductManage().WxApiDropshipSearch(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
/// <summary>
/// 添加代发
/// </summary>
[WebMethod]
public void wx_api_dropship_assign()
{
string jsontext = GetRequestJsonString();
var result = new BXXProductManage().WxApiDropshipAssign(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void wx_api_category_classify()
{