新供应商 拍单王接口

This commit is contained in:
wule committed 2026-08-03 10:30:03 +08:00
1 parent ad509cfc66
commit 5cd3f5f638
16 files changed
+436 -56

No files matched your search

@@ -69,7 +69,7 @@ namespace KJD_Web.BLL.WXXD
}
else
{
sql = "SELECT o.* FROM erp.oms_wei_order o WHERE 1=1";
sql = "SELECT o.*,(out_shipped+0) as out_shipped_int FROM erp.oms_wei_order o WHERE 1=1";
//where子句
sql += where;
@@ -133,7 +133,7 @@ namespace KJD_Web.BLL.WXXD
out_express_company = row["out_express_company"].ParseToString(),
out_express_no = row["out_express_no"].ParseToString(),
out_order_no = row["out_order_no"].ParseToString(),
out_shipped = row["out_shipped"].ParseToNullableInt(),
out_shipped = row["out_shipped_int"].ParseToNullableInt(),
pay_info = row["pay_info"].ParseToString(),
postal_code = row["postal_code"].ParseToString(),
predict_commission_fee = row["predict_commission_fee"].ParseToNullableInt(),
@@ -160,6 +160,10 @@ namespace KJD_Web.BLL.WXXD
use_tel_number = row["use_tel_number"].ParseToNullableInt(),
virtual_order_tel_number = row["virtual_order_tel_number"].ParseToString(),
};
if (order.order_id == "3737914129536416512")
{
}
orderList.Add(order);
}
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
@@ -942,6 +946,45 @@ namespace KJD_Web.BLL.WXXD
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string WXUpdateErpOutAfterSaleStatus(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var timeCalc = DateTime.Now;
string order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_id"))?.Replace("'", "\\'");
if (string.IsNullOrEmpty(order_id))
return "{\"code\":500,\"msg\":\"订单ID不能为空\"}";
string out_after_sale_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "out_after_sale_status"))?.Replace("'", "\\'");
if (out_after_sale_status == null)
return "{\"code\":500,\"msg\":\"售后状态不能为NULL\"}";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "";
var count = -1;
sql = " update erp.oms_wei_order set ";
if (out_after_sale_status != null)
sql += " out_after_sale_status='" + out_after_sale_status + "',";
sql = sql.TrimEnd(',');
sql += " where order_id = '" + order_id + "';";
count = mySql.ExecuteAffectedRows(sql);
mySql.Close();
if (!string.IsNullOrEmpty(mySql.Message))
{
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"affected_rows\":" + count + "}";
}
return "{\"code\":200,\"msg\":\"success\",\"affected_rows\":" + count + "}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string WXAddMdyBuyerOrder(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
@@ -952,6 +995,9 @@ namespace KJD_Web.BLL.WXXD
string wx_order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_order_id"))?.Replace("'", "\\'");
string wx_sku_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_sku_id"))?.Replace("'", "\\'");
string wx_send_type = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_send_type"))?.Replace("'", "\\'");
if (wx_send_type.IsNullOrEmpty())
wx_send_type = "0";
string TransitCreateTime = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "TransitCreateTime"))?.Replace("'", "\\'");
string pre_allocated_order_no = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "pre_allocated_order_no"))?.Replace("'", "\\'");
string buyerId = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "buyerId"))?.Replace("'", "\\'");
@@ -995,9 +1041,9 @@ namespace KJD_Web.BLL.WXXD
if (id == 0)
{
sql = "INSERT INTO wxxd.order_pdd_buyer_order (wx_order_id,wx_sku_id,TransitCreateTime,pre_allocated_order_no,buyerId,buyerName,order_sn,order_amount,order_time," +
sql = "INSERT INTO wxxd.order_pdd_buyer_order (wx_order_id,wx_sku_id,wx_send_type,TransitCreateTime,pre_allocated_order_no,buyerId,buyerName,order_sn,order_amount,order_time," +
"outExpressCompanyCode,tracking_number,order_status_prompt,after_sales_status,order_detail,wx_order_send_type)";
sql += "VALUES(@wx_order_id,@wx_sku_id,@TransitCreateTime,@pre_allocated_order_no,@buyerId,@buyerName,@pdd_order_sn,@order_amount,@order_time," +
sql += "VALUES(@wx_order_id,@wx_sku_id,@wx_send_type,@TransitCreateTime,@pre_allocated_order_no,@buyerId,@buyerName,@pdd_order_sn,@order_amount,@order_time," +
"@outExpressCompanyCode,@tracking_number,@order_status_prompt,@after_sales_status,@order_detail@wx_order_send_type);";
}
else
@@ -1007,6 +1053,8 @@ namespace KJD_Web.BLL.WXXD
sql += " wx_order_id=@wx_order_id,";
if (!string.IsNullOrEmpty(wx_sku_id))
sql += " wx_sku_id=@wx_sku_id,";
if (!string.IsNullOrEmpty(wx_send_type))
sql += " wx_send_type=@wx_send_type,";
if (!string.IsNullOrEmpty(TransitCreateTime))
sql += " TransitCreateTime=@TransitCreateTime,";
if (!string.IsNullOrEmpty(pre_allocated_order_no))
@@ -1040,6 +1088,7 @@ namespace KJD_Web.BLL.WXXD
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "wx_order_id", Value = wx_order_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "wx_sku_id", Value = wx_sku_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "wx_send_type", Value = wx_send_type.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.DateTime, ParameterName = "TransitCreateTime", Value = TransitCreateTime.ParseToDateTime(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "pre_allocated_order_no", Value = pre_allocated_order_no.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "buyerId", Value = buyerId, });
@@ -1139,24 +1188,25 @@ namespace KJD_Web.BLL.WXXD
{
order_pdd_buyer_order order = new order_pdd_buyer_order
{
id = row["id"].ParseToLong(),
add_time = row["add_time"].ParseToString ().ParseToDateTime(),
after_sales_status = row["after_sales_status"].ParseToNullableInt(),
buyerId = row["buyerId"].ParseToString(),
buyerName = row["buyerName"].ParseToString(),
mdy_time = row["mdy_time"].ParseToString().ParseToDateTime(),
order_amount = row["order_amount"].ParseToNullableInt(),
order_detail = row["order_detail"].ParseToString(),
order_sn = row["order_sn"].ParseToString(),
order_status_prompt = row["order_status_prompt"].ParseToString(),
order_time = row["order_time"].ParseToNullableLong(),
outExpressCompanyCode = row["outExpressCompanyCode"].ParseToString(),
pre_allocated_order_no = row["pre_allocated_order_no"].ParseToNullableInt(),
tracking_number = row["tracking_number"].ParseToString(),
TransitCreateTime = row["TransitCreateTime"].ParseToString().ParseToDateTime(),
wx_order_id = row["wx_order_id"].ParseToString(),
wx_sku_id = row["wx_sku_id"].ParseToString(),
wx_order_send_type = row["wx_order_send_type"].ParseToNullableInt(),
id = row["id"].ParseToLong(),
add_time = row["add_time"].ParseToString().ParseToDateTime(),
after_sales_status = row["after_sales_status"].ParseToNullableInt(),
buyerId = row["buyerId"].ParseToString(),
buyerName = row["buyerName"].ParseToString(),
mdy_time = row["mdy_time"].ParseToString().ParseToDateTime(),
order_amount = row["order_amount"].ParseToNullableInt(),
order_detail = row["order_detail"].ParseToString(),
order_sn = row["order_sn"].ParseToString(),
order_status_prompt = row["order_status_prompt"].ParseToString(),
order_time = row["order_time"].ParseToNullableLong(),
outExpressCompanyCode = row["outExpressCompanyCode"].ParseToString(),
pre_allocated_order_no = row["pre_allocated_order_no"].ParseToNullableInt(),
tracking_number = row["tracking_number"].ParseToString(),
TransitCreateTime = row["TransitCreateTime"].ParseToString().ParseToDateTime(),
wx_order_id = row["wx_order_id"].ParseToString(),
wx_sku_id = row["wx_sku_id"].ParseToString(),
wx_order_send_type = row["wx_order_send_type"].ParseToNullableInt(),
wx_send_type = row["wx_send_type"].ParseToInt(),
};
buyerOrderList.Add(order);
}
@@ -1189,6 +1239,9 @@ namespace KJD_Web.BLL.WXXD
string wx_order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_order_id"))?.Replace("'", "\\'");
string wx_sku_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_sku_id"))?.Replace("'", "\\'");
string wx_send_type = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_send_type"))?.Replace("'", "\\'");
if (wx_send_type.IsNullOrEmpty())
wx_send_type = "0";
string TransitCreateTime = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "TransitCreateTime"))?.Replace("'", "\\'");
string pre_allocated_order_no = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "pre_allocated_order_no"))?.Replace("'", "\\'");
string buyerId = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "buyerId"))?.Replace("'", "\\'");
@@ -1221,9 +1274,9 @@ namespace KJD_Web.BLL.WXXD
if (id == 0 && is_mdy != "true")
{
sql = "INSERT INTO wxxd.order_pdd_buyer_after_sale (wx_order_id,wx_sku_id,TransitCreateTime,pre_allocated_order_no,buyerId,buyerName,orderSn,afterSalesId,orderAmount,orderDate," +
sql = "INSERT INTO wxxd.order_pdd_buyer_after_sale (wx_order_id,wx_sku_id,wx_send_type,TransitCreateTime,pre_allocated_order_no,buyerId,buyerName,orderSn,afterSalesId,orderAmount,orderDate," +
"refundAmount,statusText,afterSaleAddress,order_detail)";
sql += "VALUES(@wx_order_id,@wx_sku_id,@TransitCreateTime,@pre_allocated_order_no,@buyerId,@buyerName,@orderSn,@afterSalesId,@orderAmount,@orderDate," +
sql += "VALUES(@wx_order_id,@wx_sku_id,@wx_send_type,@TransitCreateTime,@pre_allocated_order_no,@buyerId,@buyerName,@orderSn,@afterSalesId,@orderAmount,@orderDate," +
"@refundAmount,@statusText,@afterSaleAddress,@order_detail);";
}
else
@@ -1233,6 +1286,8 @@ namespace KJD_Web.BLL.WXXD
sql += " wx_order_id=@wx_order_id,";
if (!string.IsNullOrEmpty(wx_sku_id))
sql += " wx_sku_id=@wx_sku_id,";
if (!string.IsNullOrEmpty(wx_send_type))
sql += " wx_send_type=@wx_send_type,";
if (!string.IsNullOrEmpty(TransitCreateTime))
sql += " TransitCreateTime=@TransitCreateTime,";
if (!string.IsNullOrEmpty(pre_allocated_order_no))
@@ -1263,6 +1318,7 @@ namespace KJD_Web.BLL.WXXD
List<MySqlParameter> paramLst = new List<MySqlParameter>();
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "wx_order_id", Value = wx_order_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "wx_sku_id", Value = wx_sku_id, });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "wx_send_type", Value = wx_send_type.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.DateTime, ParameterName = "TransitCreateTime", Value = TransitCreateTime.ParseToDateTime(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "pre_allocated_order_no", Value = pre_allocated_order_no.ParseToInt(), });
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "buyerId", Value = buyerId, });
@@ -1373,6 +1429,7 @@ namespace KJD_Web.BLL.WXXD
TransitCreateTime = row["TransitCreateTime"].ParseToString().ParseToDateTime(),
wx_order_id = row["wx_order_id"].ParseToString(),
wx_sku_id = row["wx_sku_id"].ParseToString(),
wx_send_type = row["wx_send_type"].ParseToInt(),
};
buyerAfterSaleLst.Add(afterSale);
}
@@ -10,6 +10,10 @@ namespace KJD_Web.Model.WxModel
public long? id { get; set; }
public string wx_order_id { get; set; }
public string wx_sku_id { get; set; }
/// <summary>
/// 买手订单在微信店铺的发货类型 0中转仓发货 1直发
/// </summary>
public int wx_send_type { get; set; }
public DateTime TransitCreateTime { get; set; }
//public DateTime TransitPickupTime { get; set; }
public int? pre_allocated_order_no { get; set; }
@@ -10,6 +10,10 @@ namespace KJD_Web.Model.WxModel
public long? id { get; set; }
public string wx_order_id { get; set; }
public string wx_sku_id { get; set; }
/// <summary>
/// 买手订单在微信店铺的发货类型 0中转仓发货 1直发
/// </summary>
public int wx_send_type { get; set; }
public DateTime TransitCreateTime { get; set; }
public int? pre_allocated_order_no { get; set; }
public string buyerId { get; set; }
@@ -199,6 +199,19 @@ namespace KJD_Web
[WebMethod]
public void wx_update_erp_out_after_sale_status()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new WXOrderManage().WXUpdateErpOutAfterSaleStatus(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void wx_add_mdy_buyer_order()
{
string jsontext = GetRequestJsonString();