修改云仓 本地直发逻辑

This commit is contained in:
wule committed 2026-07-30 18:30:57 +08:00
1 parent b4ec400796
commit b5bc7f2b81
4 files changed
+30 -6

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ namespace AllBase
/// <summary>
/// 版本ID
/// </summary>
public static int VersionCount = 1256;
public static int VersionCount = 1258;
public static string MainPath = "29wx";
//public static string MainPath = "29wx";
//public static string MainPath = "29pdd";
@@ -1606,8 +1606,10 @@ namespace KJD_Web.BLL.WXXD
string order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_order_id"))?.Replace("'", "\\'");
string sku_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_sku_id"))?.Replace("'", "\\'");
string out_order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "out_order_id"))?.Replace("'", "\\'");
string shop_app_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "shop_app_id"))?.Replace("'", "\\'");
string shop_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "shop_name"))?.Replace("'", "\\'");
string buy_type = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "buy_type"))?.Replace("'", "\\'");
string abnormal_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "abnormal_text"))?.Replace("'", "\\'");
string flag = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "flag"))?.Replace("'", "\\'");
string label = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "label"))?.Replace("'", "\\'");
@@ -1636,14 +1638,16 @@ namespace KJD_Web.BLL.WXXD
return "{\"code\":500,\"msg\":\"订单已存在\"}";
}
sql = "INSERT INTO wxxd.order_item_ext (order_id,sku_id,shop_app_id,shop_name,abnormal_text,flag,label,remark,after_sale_user_delivery_address)";
sql += "VALUES(@order_id,@sku_id,@shop_app_id,@shop_name,@abnormal_text,@flag,@label,@remark,@after_sale_user_delivery_address);";
sql = "INSERT INTO wxxd.order_item_ext (order_id,sku_id,out_order_id,shop_app_id,shop_name,buy_type,abnormal_text,flag,label,remark,after_sale_user_delivery_address)";
sql += "VALUES(@order_id,@sku_id,@out_order_id,@shop_app_id,@shop_name,@buy_type,@abnormal_text,@flag,@label,@remark,@after_sale_user_delivery_address);";
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "order_id", Value = order_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "sku_id", Value = sku_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "out_order_id", Value = out_order_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "shop_app_id", Value = shop_app_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "shop_name", Value = shop_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "buy_type", Value = buy_type, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "abnormal_text", Value = abnormal_text, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "flag", Value = flag, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "label", Value = label, });
@@ -1672,8 +1676,10 @@ namespace KJD_Web.BLL.WXXD
string order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_order_id"))?.Replace("'", "\\'");
string sku_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_sku_id"))?.Replace("'", "\\'");
string out_order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "out_order_id"))?.Replace("'", "\\'");
string shop_app_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "shop_app_id"))?.Replace("'", "\\'");
string shop_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "shop_name"))?.Replace("'", "\\'");
string buy_type = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "buy_type"))?.Replace("'", "\\'");
string abnormal_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "abnormal_text"))?.Replace("'", "\\'");
string flag = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "flag"))?.Replace("'", "\\'");
string label = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "label"))?.Replace("'", "\\'");
@@ -1689,8 +1695,12 @@ namespace KJD_Web.BLL.WXXD
string sql = "UPDATE wxxd.order_item_ext SET ";
if (!string.IsNullOrEmpty(shop_app_id))
sql += " shop_app_id=@shop_app_id,";
if (!string.IsNullOrEmpty(out_order_id))
sql += " out_order_id=@out_order_id,";
if (!string.IsNullOrEmpty(shop_name))
sql += " shop_name=@shop_name,";
if (buy_type != null)
sql += " buy_type=@buy_type,";
if (abnormal_text != null)
sql += " abnormal_text=@abnormal_text,";
if (!string.IsNullOrEmpty(flag))
@@ -1704,15 +1714,17 @@ namespace KJD_Web.BLL.WXXD
sql = sql.TrimEnd(',');
sql += " where 1=1";
if (!string.IsNullOrEmpty(order_id))
sql += " and order_id=@order_id,";
sql += " and order_id=@order_id";
if (!string.IsNullOrEmpty(sku_id))
sql += " and sku_id=@sku_id,";
sql += " and sku_id=@sku_id";
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "order_id", Value = order_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "sku_id", Value = sku_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "out_order_id", Value = out_order_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "shop_app_id", Value = shop_app_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "shop_name", Value = shop_name, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "buy_type", Value = buy_type, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "abnormal_text", Value = abnormal_text, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "flag", Value = flag, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "label", Value = label, });
@@ -1741,7 +1753,8 @@ namespace KJD_Web.BLL.WXXD
var wx_order_id_in = RegexUtils.GetStringQuery(ref inputData, "wx_order_id_in")?.Replace("'", "\\'");
var wx_sku_id = RegexUtils.GetStringQuery(ref inputData, "wx_sku_id_in")?.Replace("'", "\\'");
if (wx_order_id_in.IsNullOrEmpty())
var out_order_id_in = RegexUtils.GetStringQuery(ref inputData, "out_order_id_in")?.Replace("'", "\\'");
if (wx_order_id_in.IsNullOrEmpty() && out_order_id_in.IsNullOrEmpty())
{
return "{\"code\":500,\"msg\":\"未指定订单\"}";
}
@@ -1761,6 +1774,8 @@ namespace KJD_Web.BLL.WXXD
where += " and o.order_id in ('" + wx_order_id_in.Replace(",", "','") + "')";
if (!string.IsNullOrWhiteSpace(wx_sku_id))
where += " and o.sku_id in ('" + wx_sku_id.Replace(",", "','") + "')";
if (!string.IsNullOrWhiteSpace(out_order_id_in))
where += " and o.out_order_id in ('" + out_order_id_in.Replace(",", "','") + "')";
sql += where;
var count = 0;
@@ -1801,6 +1816,7 @@ namespace KJD_Web.BLL.WXXD
{
id = row["id"].ParseToLong(),
add_time = row["add_time"].ParseToString().ParseToDateTime(),
buy_type = row["buy_type"].ParseToString(),
abnormal_text = row["abnormal_text"].ParseToString(),
after_sale_user_delivery_address = row["after_sale_user_delivery_address"].ParseToString(),
flag = row["flag"].ParseToNullableInt(),
@@ -1811,6 +1827,7 @@ namespace KJD_Web.BLL.WXXD
shop_app_id = row["shop_app_id"].ParseToString(),
shop_name = row["shop_name"].ParseToString(),
sku_id = row["sku_id"].ParseToString(),
out_order_id = row["out_order_id"].ParseToString(),
};
buyerOrderList.Add(order);
}
@@ -9,10 +9,15 @@ namespace KJD_Web.Model.WxModel
{
public long? id { get; set; }
public string order_id { get; set; }
public string out_order_id { get; set; }
public string sku_id { get; set; }
public string shop_app_id { get; set; }
public string shop_name { get; set; }
/// <summary>
/// 直发/云仓(一般只有直发才会写值,直发会覆盖中转)
/// </summary>
public string buy_type { get; set; }
/// <summary>
/// 订单异常文本
/// </summary>
public string abnormal_text { get; set; }
@@ -3916,6 +3916,8 @@ namespace TemuKJD.WXForms.ProductForms
attrValue = "20 cm";
else if (attr.value == "mm")
attrValue = "20 mm";
else if (attr.value == "毫米(mm);厘米(cm);米(m)")
attrValue = "20 毫米(mm)";
else if (attr.value.Contains("岁以上") && attr.value.Contains("个月以上"))
attrValue = "7 岁以上";
else if (attr.value == "只;个")