oem逻辑优化 订单查询服务端相关代码
This commit is contained in:
1 parent
554d1f4b4f
commit
aeeb0fa0c6
33 files changed
+2448
-103
No files matched your search
@@ -706,10 +706,13 @@ namespace KJD_Web.BLL.BXX
|
||||
string parameName = "@prodNameWords" + index;
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = parameName, Value = word/*.Replace("&", "&").Replace("'", "\\'")*/, });
|
||||
//multi_search_prod_name += " or p.product_name like '%" + parameName + "%'";
|
||||
multi_search_prod_name += " or p.product_name like CONCAT('%'," + parameName + ",'%')";
|
||||
|
||||
//multi_search_prod_name += " or p.product_name like CONCAT('%'," + parameName + ",'%')";
|
||||
multi_search_prod_name += " or p.product_name like CONCAT(" + parameName + ",'%')";
|
||||
|
||||
}
|
||||
where += " and (" + multi_search_prod_name.Substring(4) + ")";
|
||||
|
||||
//where += " and p.product_name like '" + search_prod_name + "'";
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(search_prod_name_in))
|
||||
{
|
||||
|
||||
@@ -648,9 +648,12 @@ namespace KJD_Web.BLL.WXXD
|
||||
string order_no = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_no"))?.Replace("'", "\\'");
|
||||
string order_sku_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_sku_id"))?.Replace("'", "\\'");
|
||||
string out_order_no = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "out_order_no"))?.Replace("'", "\\'");
|
||||
string pre_allocated_order_no = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "pre_allocated_order_no"))?.Replace("'", "\\'");
|
||||
string transfer_warehouse_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "transfer_warehouse_status"))?.Replace("'", "\\'");
|
||||
string not_count = RegexUtils.GetStringQuery(ref inputData, "not_count")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(order_no) && string.IsNullOrEmpty(out_order_no) && string.IsNullOrEmpty(order_sku_id))
|
||||
return "{\"code\":500,\"msg\":\"商品查询信息不能为空\"}";
|
||||
string is_admin = RegexUtils.GetStringQuery(ref inputData, "is_admin")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(order_no) && string.IsNullOrEmpty(out_order_no) && string.IsNullOrEmpty(order_sku_id) && is_admin != "true")
|
||||
return "{\"code\":500,\"msg\":\"中转订单查询信息不能为空\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
@@ -666,6 +669,12 @@ namespace KJD_Web.BLL.WXXD
|
||||
where += " and order_sku_id IN ('" + order_sku_id.Replace(",", "','") + "')";
|
||||
if (out_order_no != null)
|
||||
where += " and out_order_no IN ('" + out_order_no.Replace(",", "','") + "')";
|
||||
// 取号状态
|
||||
if (pre_allocated_order_no != null)
|
||||
where += " and pre_allocated_order_no IN (" + pre_allocated_order_no + ")";
|
||||
// 仓库状态
|
||||
if (transfer_warehouse_status != null)
|
||||
where += " and transfer_warehouse_status IN (" + transfer_warehouse_status + ")";
|
||||
sql += where;
|
||||
sql += ";";
|
||||
|
||||
@@ -682,6 +691,15 @@ namespace KJD_Web.BLL.WXXD
|
||||
sql = "SELECT * FROM `erp`.`oms_wei_external_procurement_log` WHERE 1=1";
|
||||
sql += where;
|
||||
sql += " order by id desc limit " + Math.Max(0, page - 1) * page_size + "," + page_size + ";";
|
||||
|
||||
// 客戶端查兩次
|
||||
//if (is_admin == "true")
|
||||
//{
|
||||
// sql = "SELECT e.*,o.create_time as order_create_time FROM `erp`.`oms_wei_external_procurement_log` e LEFT JOIN `erp`.`oms_wei_order` ON e.order_no = o.order_id 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();
|
||||
@@ -703,19 +721,23 @@ namespace KJD_Web.BLL.WXXD
|
||||
out_order_no = row["out_order_no"].ParseToString(),
|
||||
purchaser_note = row["purchaser_note"].ParseToString(),
|
||||
created_time = row["created_time"].ParseToString().ParseToDateTime(),
|
||||
express_1_company = row["express_1_company"].ParseToString(),
|
||||
express_1_waybill = row["express_1_waybill"].ParseToString(),
|
||||
express_2_company = row["express_2_company"].ParseToString(),
|
||||
express_1_company = row["express_1_company"].ParseToString(),
|
||||
express_1_waybill = row["express_1_waybill"].ParseToString(),
|
||||
express_2_company = row["express_2_company"].ParseToString(),
|
||||
express_2_waybill = row["express_2_waybill"].ParseToString(),
|
||||
order_code = row["order_code"].ParseToString(),
|
||||
order_platform_code = row["order_platform_code"].ParseToString(),
|
||||
pickup_time = row["pickup_time"].ParseToString().ParseToDateTime(),
|
||||
platform = row["platform"].ParseToString(),
|
||||
pre_allocated_order_no = row["pre_allocated_order_no"].ParseToNullableInt(),
|
||||
raw_message = row["raw_message"].ParseToString(),
|
||||
refund_status = row["refund_status"].ParseToString(),
|
||||
transfer_warehouse_status = row["transfer_warehouse_status"].ParseToNullableInt(),
|
||||
updated_time = row["updated_time"].ParseToString().ParseToDateTime(),
|
||||
order_code = row["order_code"].ParseToString(),
|
||||
order_platform_code = row["order_platform_code"].ParseToString(),
|
||||
pickup_time = row["pickup_time"].ParseToString().ParseToDateTime(),
|
||||
platform = row["platform"].ParseToString(),
|
||||
pre_allocated_order_no = row["pre_allocated_order_no"].ParseToNullableInt(),
|
||||
raw_message = row["raw_message"].ParseToString(),
|
||||
refund_status = row["refund_status"].ParseToString(),
|
||||
transfer_warehouse_status = row["transfer_warehouse_status"].ParseToNullableInt(),
|
||||
updated_time = row["updated_time"].ParseToString().ParseToDateTime(),
|
||||
is_transfer_ship = row["is_transfer_ship"].ParseToNullableInt(),
|
||||
random_code = row["random_code"].ParseToString(),
|
||||
transfer_refund_status = row["transfer_refund_status"].ParseToNullableInt(),
|
||||
order_void_status = row["order_void_status"].ParseToNullableInt(),
|
||||
});
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
@@ -737,7 +759,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改中转仓订单信息,临时补救
|
||||
/// 修改中转仓订单信息(真实物流),临时补救
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
@@ -754,12 +776,17 @@ namespace KJD_Web.BLL.WXXD
|
||||
string out_order_no = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "out_order_no"))?.Replace("'", "\\'");
|
||||
string express_1_company = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "express_1_company"))?.Replace("'", "\\'");
|
||||
string express_1_waybill = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "express_1_waybil"))?.Replace("'", "\\'");
|
||||
string refund_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "refund_status"))?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(out_order_no))
|
||||
return "{\"code\":500,\"msg\":\"订单外部ID信息不能为空\"}";
|
||||
if (string.IsNullOrEmpty(express_1_company))
|
||||
return "{\"code\":500,\"msg\":\"物流公司不能为空\"}";
|
||||
if (string.IsNullOrEmpty(express_1_waybill))
|
||||
return "{\"code\":500,\"msg\":\"物流单号不能为空\"}";
|
||||
//if (string.IsNullOrEmpty(express_1_company))
|
||||
// return "{\"code\":500,\"msg\":\"物流公司不能为空\"}";
|
||||
//if (string.IsNullOrEmpty(express_1_waybill))
|
||||
// return "{\"code\":500,\"msg\":\"物流单号不能为空\"}";
|
||||
|
||||
if (string.IsNullOrEmpty(express_1_company) && string.IsNullOrEmpty(express_1_waybill) && string.IsNullOrEmpty(refund_status))
|
||||
return "{\"code\":500,\"msg\":\"修改信息不能为空\"}";
|
||||
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
@@ -767,9 +794,13 @@ namespace KJD_Web.BLL.WXXD
|
||||
string sql = "";
|
||||
var count = -1;
|
||||
|
||||
sql = " update `erp`.`oms_wei_external_procurement_log` ";
|
||||
sql += " set express_1_company='" + express_1_company + "',";
|
||||
sql += " express_1_waybill='" + express_1_waybill + "',";
|
||||
sql = " update `erp`.`oms_wei_external_procurement_log` set ";
|
||||
if (!string.IsNullOrEmpty(express_1_company))
|
||||
sql += " express_1_company='" + express_1_company + "',";
|
||||
if (!string.IsNullOrEmpty(express_1_waybill))
|
||||
sql += " express_1_waybill='" + express_1_waybill + "',";
|
||||
if (!string.IsNullOrEmpty(refund_status))
|
||||
sql += " refund_status='" + refund_status + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where out_order_no = '" + out_order_no + "';";
|
||||
|
||||
@@ -786,7 +817,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改中转仓订单信息,临时补救
|
||||
/// 修改中转仓订单信息(取号状态),临时补救
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
@@ -829,6 +860,52 @@ namespace KJD_Web.BLL.WXXD
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除中转仓订单 临时补救,慎用
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public string WXDelErpTransitWarehouseOrder(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
var timeCalc = DateTime.Now;
|
||||
|
||||
string out_order_no = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "out_order_no"))?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(out_order_no))
|
||||
return "{\"code\":500,\"msg\":\"订单外部ID信息不能为空\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "";
|
||||
var count = -1;
|
||||
|
||||
sql = " DELETE FROM `erp`.`oms_wei_external_procurement_log` WHERE out_order_no in ('" + out_order_no.Replace(",", "','") + "')";
|
||||
|
||||
count = mySql.ExecuteAffectedRows(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (!string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"affected_rows\":" + count + "}";
|
||||
}
|
||||
if (count == 0)
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"删除失败,订单不存在\",\"affected_rows\":" + count + "}";
|
||||
}
|
||||
return "{\"code\":200,\"msg\":\"success\",\"affected_rows\":" + count + "}";
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改订单软件备注
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public string WXUpdateErpSoftRemark(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
@@ -865,5 +942,235 @@ namespace KJD_Web.BLL.WXXD
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string WXAddMdyBuyerOrder(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
var timeCalc = DateTime.Now;
|
||||
|
||||
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 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("'", "\\'");
|
||||
string buyerName = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "buyerName"))?.Replace("'", "\\'");
|
||||
string pdd_order_sn = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "pdd_order_sn"))?.Replace("'", "\\'");
|
||||
string order_amount = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_amount"))?.Replace("'", "\\'");
|
||||
string order_time = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_time"))?.Replace("'", "\\'");
|
||||
string outExpressCompanyCode = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "outExpressCompanyCode"))?.Replace("'", "\\'");
|
||||
string tracking_number = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "tracking_number"))?.Replace("'", "\\'");
|
||||
string order_status_prompt = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_status_prompt"))?.Replace("'", "\\'");
|
||||
string after_sales_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "after_sales_status"))?.Replace("'", "\\'");
|
||||
string order_detail = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_detail"))?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(wx_order_id) || string.IsNullOrEmpty(pdd_order_sn))
|
||||
return "{\"code\":500,\"msg\":\"订单ID不能为空\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "";
|
||||
var count = -1;
|
||||
|
||||
sql = "select id from wxxd.order_pdd_buyer_order where order_sn='" + pdd_order_sn + "'";
|
||||
var id = mySql.ExecuteFirstInt(sql);
|
||||
if (!string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
mySql.Close();
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
|
||||
}
|
||||
|
||||
//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," +
|
||||
// "outExpressCompanyCode,tracking_number,order_status_prompt,after_sales_status,order_detail)";
|
||||
//sql += "VALUES(@wx_order_id,@wx_sku_id,@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)";
|
||||
//sql += " ON DUPLICATE KEY UPDATE wx_order_id=VALUES(@wx_order_id),wx_sku_id=VALUES(@wx_sku_id),TransitCreateTime=VALUES(@TransitCreateTime)," +
|
||||
// "pre_allocated_order_no=VALUES(@pre_allocated_order_no),buyerId=VALUES(@buyerId),buyerName=VALUES(@buyerName),order_amount=VALUES(@order_amount)," +
|
||||
// "order_time=VALUES(@order_time),outExpressCompanyCode=VALUES(@outExpressCompanyCode),tracking_number=VALUES(@tracking_number),order_status_prompt=VALUES(@order_status_prompt)," +
|
||||
// "after_sales_status=VALUES(@after_sales_status),order_detail=VALUES(@order_detail)";
|
||||
|
||||
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," +
|
||||
"outExpressCompanyCode,tracking_number,order_status_prompt,after_sales_status,order_detail)";
|
||||
sql += "VALUES(@wx_order_id,@wx_sku_id,@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);";
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "UPDATE wxxd.order_pdd_buyer_order SET ";
|
||||
if (!string.IsNullOrEmpty(wx_order_id))
|
||||
sql += " wx_order_id=@wx_order_id,";
|
||||
if (!string.IsNullOrEmpty(wx_sku_id))
|
||||
sql += " wx_sku_id=@wx_sku_id,";
|
||||
if (!string.IsNullOrEmpty(TransitCreateTime))
|
||||
sql += " TransitCreateTime=@TransitCreateTime,";
|
||||
if (!string.IsNullOrEmpty(pre_allocated_order_no))
|
||||
sql += " pre_allocated_order_no=@pre_allocated_order_no,";
|
||||
if (!string.IsNullOrEmpty(buyerId))
|
||||
sql += " buyerId=@buyerId,";
|
||||
if (!string.IsNullOrEmpty(buyerName))
|
||||
sql += " buyerName=@buyerName,";
|
||||
if (!string.IsNullOrEmpty(order_amount))
|
||||
sql += " order_amount=@order_amount,";
|
||||
if (!string.IsNullOrEmpty(order_time))
|
||||
sql += " order_time=@order_time,";
|
||||
if (!string.IsNullOrEmpty(outExpressCompanyCode))
|
||||
sql += " outExpressCompanyCode=@outExpressCompanyCode,";
|
||||
if (!string.IsNullOrEmpty(tracking_number))
|
||||
sql += " tracking_number=@tracking_number,";
|
||||
if (!string.IsNullOrEmpty(order_status_prompt))
|
||||
sql += " order_status_prompt=@order_status_prompt,";
|
||||
if (!string.IsNullOrEmpty(after_sales_status))
|
||||
sql += " after_sales_status=@after_sales_status,";
|
||||
if (!string.IsNullOrEmpty(order_detail))
|
||||
sql += " order_detail=@order_detail,";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where order_sn=@pdd_order_sn";
|
||||
}
|
||||
//260705-105706954352823
|
||||
|
||||
|
||||
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.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, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "buyerName", Value = buyerName, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "pdd_order_sn", Value = pdd_order_sn, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "order_amount", Value = order_amount, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int64, ParameterName = "order_time", Value = order_time.ParseToLong(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "outExpressCompanyCode", Value = outExpressCompanyCode, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "tracking_number", Value = tracking_number, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "order_status_prompt", Value = order_status_prompt, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "after_sales_status", Value = after_sales_status.ParseToInt(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "order_detail", Value = order_detail, });
|
||||
//sql = " update `wxxd`.`order_pdd_buyer_order` set ";
|
||||
//if (!string.IsNullOrEmpty(soft_remark))
|
||||
// sql += " soft_remark=" + soft_remark + ",";
|
||||
//sql = sql.TrimEnd(',');
|
||||
//sql += " where order_id = '" + wx_order_id + "';";
|
||||
|
||||
count = mySql.ExecuteAffectedRows(sql, paramLst.ToArray());
|
||||
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 WXGetBuyerOrderList(string inputData, bool isDetail = false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
var timeCalc = DateTime.Now;
|
||||
|
||||
var wx_order_id_in = RegexUtils.GetStringQuery(ref inputData, "wx_order_id_in")?.Replace("'", "\\'");
|
||||
var buyer_order_sn_in = RegexUtils.GetStringQuery(ref inputData, "buyer_order_sn_in")?.Replace("'", "\\'");
|
||||
if (wx_order_id_in.IsNullOrEmpty() && string.IsNullOrEmpty(buyer_order_sn_in))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"未指定订单\"}";
|
||||
}
|
||||
var sort_type = RegexUtils.GetStringQuery(ref inputData, "sort_type")?.Replace("'", "\\'");
|
||||
var is_not_count = RegexUtils.GetStringQuery(ref inputData, "is_not_count") != "false";
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(500);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT COUNT(id) FROM wxxd.order_pdd_buyer_order o WHERE 1=1 ";
|
||||
|
||||
string where = "";
|
||||
if (!string.IsNullOrWhiteSpace(wx_order_id_in))
|
||||
where += " and o.wx_order_id in ('" + wx_order_id_in.Replace(",", "','") + "')";
|
||||
if (!string.IsNullOrWhiteSpace(buyer_order_sn_in))
|
||||
where += " and o.order_sn in ('" + buyer_order_sn_in.Replace(",", "','") + "')";
|
||||
sql += where;
|
||||
|
||||
var count = 0;
|
||||
if (!is_not_count)
|
||||
count = mySql.ExecuteRowCount(sql);
|
||||
|
||||
DataTable dt;
|
||||
if (count == 0 && !is_not_count)
|
||||
{
|
||||
dt = new DataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "SELECT o.* FROM" +
|
||||
" wxxd.order_pdd_buyer_order o " +
|
||||
" WHERE 1=1";
|
||||
|
||||
//where子句
|
||||
sql += where;
|
||||
|
||||
if (sort_type == "asc")
|
||||
sql += " ORDER BY o.id ASC";
|
||||
else
|
||||
sql += " ORDER BY o.id DESC";
|
||||
sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
}
|
||||
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<order_pdd_buyer_order> refundItemList = new List<order_pdd_buyer_order>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
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(),
|
||||
};
|
||||
refundItemList.Add(order);
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializeObjectToString(refundItemList, 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\":\"输入为空\"}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,6 +135,7 @@
|
||||
<Compile Include="Model\WxModel\oms_wei_order.cs" />
|
||||
<Compile Include="Model\WxModel\oms_wei_order_item.cs" />
|
||||
<Compile Include="Model\WxModel\oms_wei_refund.cs" />
|
||||
<Compile Include="Model\WxModel\order_pdd_buyer_order.cs" />
|
||||
<Compile Include="Model\WxModel\user_payment_record.cs" />
|
||||
<Compile Include="Model\WxModel\WXBuyUrlNotesInfo.cs" />
|
||||
<Compile Include="Model\WxModel\WXClientProductInfoLite.cs" />
|
||||
|
||||
@@ -34,5 +34,15 @@ namespace KJD_Web.Model.WxModel
|
||||
/// 1正常取号 2提前取号
|
||||
/// </summary>
|
||||
public int? pre_allocated_order_no { get; set; }
|
||||
public int? is_transfer_ship { get; set; }
|
||||
public string random_code { get; set; }
|
||||
/// <summary>
|
||||
/// 1, "拒收" 2, "拦截" 3, "取消" 4, "订单作废"
|
||||
/// </summary>
|
||||
public int? transfer_refund_status { get; set; }
|
||||
/// <summary>
|
||||
/// 订单作废状态:0=正常,1=已作废,2=作废失败
|
||||
/// </summary>
|
||||
public int? order_void_status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace KJD_Web.Model.WxModel
|
||||
{
|
||||
public class order_pdd_buyer_order
|
||||
{
|
||||
public long? id { get; set; }
|
||||
public string wx_order_id { get; set; }
|
||||
public string wx_sku_id { get; set; }
|
||||
public DateTime TransitCreateTime { get; set; }
|
||||
public int? pre_allocated_order_no { get; set; }
|
||||
public string buyerId { get; set; }
|
||||
public string buyerName { get; set; }
|
||||
public string order_sn { get; set; }
|
||||
public int? order_amount { get; set; }
|
||||
public long? order_time { get; set; }
|
||||
public string outExpressCompanyCode { get; set; }
|
||||
public string tracking_number { get; set; }
|
||||
/// <summary>
|
||||
/// 订单状态
|
||||
/// </summary>
|
||||
public string order_status_prompt { get; set; }
|
||||
public int? after_sales_status { get; set; }
|
||||
public string order_detail { get; set; }
|
||||
public DateTime add_time { get; set; }
|
||||
public DateTime mdy_time { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -169,6 +169,21 @@ namespace KJD_Web
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除中转仓指定订单 临时补救,慎用
|
||||
/// </summary>
|
||||
[WebMethod]
|
||||
public void wx_del_erp_transit_warehouse_order()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXOrderManage().WXDelErpTransitWarehouseOrder(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
|
||||
[WebMethod]
|
||||
public void wx_update_erp_soft_remark()
|
||||
@@ -181,5 +196,30 @@ namespace KJD_Web
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
|
||||
[WebMethod]
|
||||
public void wx_add_mdy_buyer_order()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXOrderManage().WXAddMdyBuyerOrder(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void wx_get_buyer_order_list()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXOrderManage().WXGetBuyerOrderList(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user