在线寄件尝试 订单过滤功能 订单采购路径功能

This commit is contained in:
wule committed 2026-05-21 22:13:47 +08:00
1 parent ef35522b6a
commit e5910fc100
25 files changed
+5233 -316

No files matched your search

@@ -831,6 +831,97 @@ namespace KJD_Web.BLL.WXXD
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string WXGetRandomAfterSaleList(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var timeCalc = DateTime.Now;
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("'", "\\'");
if (string.IsNullOrEmpty(user_name))
{
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
}
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
string type = RegexUtils.GetStringQuery(ref inputData, "type")?.Replace("'", "\\'");
string isDel = RegexUtils.GetStringQuery(ref inputData, "isDel")?.Replace("'", "\\'");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "SELECT count(*) FROM `wxxd`.`after_sale` where 1=1";
string where = "";
if (type != null)
where += " and type='" + type + "'";
if (isDel == "true")
where += " and is_del>0";
else
where += " and is_del=0";
sql += where;
sql += ";";
var count = 0;
count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "SELECT * FROM `wxxd`.`after_sale` where 1=1";
sql += where;
sql += " order by RAND() limit " + Math.Max(0, page - 1) * page_size + "," + page_size + ";";
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (dt != null)
{
try
{
List<WXAddressInfo> WXAddressInfoLst = new List<WXAddressInfo>();
foreach (DataRow row in dt.Rows)
{
WXAddressInfoLst.Add(new WXAddressInfo()
{
id = row["id"].ParseToInt(),
after_sale_json = row["after_sale_json"].ParseToString(),
coid = row["coid"].ParseToString(),
supplier_name = row["supplier_name"].ParseToString(),
type = row["type"].ParseToString(),
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
});
}
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
var data = JsonUtils.SerializeObjectToString(WXAddressInfoLst, jsonSetting);
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
}
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\":\"输入为空\"}";
}
/// <summary>
/// 聚水潭等外部平台售后列表
/// </summary>
@@ -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.XDevAPI;
@@ -14,6 +15,7 @@ using System.Linq;
using System.Security.Cryptography;
using System.Web;
using System.Web.Security;
using System.Web.UI.HtmlControls;
namespace KJD_Web.BLL.WXXD
{
@@ -1000,6 +1002,304 @@ namespace KJD_Web.BLL.WXXD
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string WXAddMdyOrderDecryptAddress(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
// 软件用户名
string shop_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "shop_id"))?.Replace("'", "\\'");
string order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_id"))?.Replace("'", "\\'");
string order_address = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_address"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty(shop_id))
return "{\"code\":500,\"msg\":\"缺少店铺编号\"}";
if (string.IsNullOrEmpty(order_id))
return "{\"code\":500,\"msg\":\"缺少订单编号\"}";
if (string.IsNullOrEmpty(order_address))
return "{\"code\":500,\"msg\":\"缺少地址信息\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "SELECT 1 FROM `wxxd`.`order_decrypt_address` where order_id='" + order_id + "' AND shop_id='" + shop_id + "'";
string where = "";
sql += where;
var exist = mySql.ExecuteFirstInt(sql);
if (!mySql.Message.IsNullOrEmpty())
{
mySql.Close();
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
}
if (exist == 0)
{
sql = " INSERT INTO `wxxd`.`order_decrypt_address` (shop_id,order_id,order_address)" +
" VALUES (@shop_id,@order_id,@order_address);";
}
else
{
sql = "UPDATE `wxxd`.`order_decrypt_address` SET ";
if (order_address != null)
sql += " order_address=@order_address,";
sql = sql.TrimEnd(',');
sql += " WHERE order_id=@order_id and shop_id=@shop_id;";
}
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "order_address", Value = order_address, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "order_id", Value = order_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "shop_id", Value = shop_id, });
mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":200,\"msg\":\"success\",\"data\":\"\"}";
}
else
{
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string WXGetOrderDecryptAddress(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var timeCalc = DateTime.Now;
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(200);
string order_ids = RegexUtils.GetStringQuery(ref inputData, "order_ids")?.Replace("'", "\\'");
string not_count = RegexUtils.GetStringQuery(ref inputData, "not_count")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(order_ids))
return "{\"code\":500,\"msg\":\"订单编号不能为空\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
var count = -1;
sql = "SELECT count(*) FROM `wxxd`.`order_decrypt_address` where 1=1";
string where = "";
if (order_ids != null)
where += " and order_id IN ('" + order_ids.Replace(",", "','") + "')";
sql += where;
sql += ";";
if (not_count != "true")
count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "SELECT * FROM `wxxd`.`order_decrypt_address` where 1=1";
sql += where;
sql += " order by id desc limit " + Math.Max(0, page - 1) * page_size + "," + page_size + ";";
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (dt != null)
{
try
{
List<WXOrderDecryptAddressInfo> WXOrderAddressInfoLst = new List<WXOrderDecryptAddressInfo>();
foreach (DataRow row in dt.Rows)
{
WXOrderAddressInfoLst.Add(new WXOrderDecryptAddressInfo()
{
id = row["id"].ParseToInt(),
shop_id = row["shop_id"].ParseToString(),
order_address = row["order_address"].ParseToString(),
order_id = row["order_id"].ParseToString(),
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
});
}
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
var data = JsonUtils.SerializeObjectToString(WXOrderAddressInfoLst, jsonSetting);
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
}
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 WXAddMdyBuyUrlNotes(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
// 软件用户名
string spu_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "spu_code"))?.Replace("'", "\\'");
string user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_user_name"))?.Replace("'", "\\'");
string buy_url_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "buy_url_notes"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty(spu_code))
return "{\"code\":500,\"msg\":\"缺少店铺编号\"}";
if (string.IsNullOrEmpty(user_name))
return "{\"code\":500,\"msg\":\"缺少用户名\"}";
if (string.IsNullOrEmpty(buy_url_notes))
return "{\"code\":500,\"msg\":\"缺少地址信息\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "SELECT 1 FROM `bxx`.`product_buy_url_notes` where user_name='" + user_name + "' AND spu_code='" + spu_code + "'";
string where = "";
sql += where;
var exist = mySql.ExecuteFirstInt(sql);
if (!mySql.Message.IsNullOrEmpty())
{
mySql.Close();
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
}
if (exist == 0)
{
sql = " INSERT INTO `bxx`.`product_buy_url_notes` (spu_code,user_name,buy_url_notes)" +
" VALUES (@spu_code,@user_name,@buy_url_notes);";
}
else
{
sql = "UPDATE `bxx`.`product_buy_url_notes` SET ";
if (buy_url_notes != null)
sql += " buy_url_notes=@buy_url_notes,";
sql = sql.TrimEnd(',');
sql += " WHERE user_name=@user_name and spu_code=@spu_code;";
}
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "buy_url_notes", Value = buy_url_notes, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "user_name", Value = user_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "spu_code", Value = spu_code, });
mySql.ExecuteNonQuery(sql, paramLst.ToArray());
mySql.Close();
if (string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":200,\"msg\":\"success\",\"data\":\"\"}";
}
else
{
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
}
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string WXGetBuyUrlNotes(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
var timeCalc = DateTime.Now;
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(200);
string spu_codes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "spu_codes"))?.Replace("'", "\\'");
string user_name = RegexUtils.GetStringQuery(ref inputData, "main_user_name")?.Replace("'", "\\'");
string not_count = RegexUtils.GetStringQuery(ref inputData, "not_count")?.Replace("'", "\\'");
if (string.IsNullOrEmpty(spu_codes))
return "{\"code\":500,\"msg\":\"商品编码不能为空\"}";
if (string.IsNullOrEmpty(user_name))
return "{\"code\":500,\"msg\":\"用户名不能为空\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
var count = -1;
sql = "SELECT COUNT(*) FROM `bxx`.`product_buy_url_notes` WHERE 1=1";
string where = "";
if (spu_codes != null)
where += " and spu_code IN ('" + spu_codes.Replace(",", "','") + "')";
if (user_name != null)
where += " and user_name='" + user_name + "'";
sql += where;
sql += ";";
if (not_count != "true")
count = mySql.ExecuteRowCount(sql);
DataTable dt;
if (count == 0)
{
dt = new DataTable();
}
else
{
sql = "SELECT * FROM `bxx`.`product_buy_url_notes` WHERE 1=1";
sql += where;
sql += " order by id desc limit " + Math.Max(0, page - 1) * page_size + "," + page_size + ";";
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (dt != null)
{
try
{
List<WXBuyUrlNotesInfo> WXBuyUrlNotesInfoLst = new List<WXBuyUrlNotesInfo>();
foreach (DataRow row in dt.Rows)
{
WXBuyUrlNotesInfoLst.Add(new WXBuyUrlNotesInfo()
{
id = row["id"].ParseToInt(),
user_name = row["user_name"].ParseToString(),
spu_code = row["spu_code"].ParseToString(),
buy_url_notes = row["buy_url_notes"].ParseToString(),
add_time = Convert.ToDateTime(row["add_time"]),
mdy_time = Convert.ToDateTime(row["mdy_time"]),
});
}
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
var data = JsonUtils.SerializeObjectToString(WXBuyUrlNotesInfoLst, jsonSetting);
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
}
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 E57GetWxTokens(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
@@ -128,9 +128,11 @@
<Compile Include="Model\PddModel\PDDProductPropertyInfo.cs" />
<Compile Include="Model\ShopModel\JSTListProductSkuInfo.cs" />
<Compile Include="Model\WXAddressInfo.cs" />
<Compile Include="Model\WxModel\WXBuyUrlNotesInfo.cs" />
<Compile Include="Model\WxModel\WXClientProductInfoLite.cs" />
<Compile Include="Model\WxModel\WXGetEditProductInfoLite.cs" />
<Compile Include="Model\WxModel\WxOptimizeExpressInfo.cs" />
<Compile Include="Model\WxModel\WXOrderDecryptAddressInfo.cs" />
<Compile Include="Model\WxProdSecretSpuIdShopIdMapParam.cs" />
<Compile Include="Model\WXShopDefaultAddressInfo.cs" />
<Compile Include="Upload\Prod\BaseClass.cs" />
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class WXBuyUrlNotesInfo
{
public int id { get; set; }
public string spu_code { get; set; }
public string user_name { get; set; }
public string buy_url_notes { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace KJD_Web.Model.WxModel
{
public class WXOrderDecryptAddressInfo
{
public int id { get; set; }
public string shop_id { get; set; }
public string order_id { get; set; }
public string order_address { get; set; }
public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; }
}
}
@@ -232,6 +232,17 @@ namespace KJD_Web
Context.Response.End();
}
[WebMethod]
public void wx_get_random_after_sale_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new WXProductManage().WXGetRandomAfterSaleList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void wx_get_after_sale_list()
{
string jsontext = GetRequestJsonString();
@@ -376,6 +376,52 @@ namespace KJD_Web
Context.Response.End();
}
[WebMethod]
public void wx_add_mdy_order_address()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new WXShopManage().WXAddMdyOrderDecryptAddress(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void wx_get_order_address()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new WXShopManage().WXGetOrderDecryptAddress(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void wx_add_mdy_buy_url_notes()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new WXShopManage().WXAddMdyBuyUrlNotes(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void wx_get_buy_url_notes()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new WXShopManage().WXGetBuyUrlNotes(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void e57_get_wx_tokens()
{