1.新增供应商一个 云仓退货相关服务逻辑

This commit is contained in:
wule committed 2026-08-17 01:41:32 +08:00
1 parent 917eb94971
commit 456b0534e3
3 files changed
+214

No files matched your search

@@ -2040,5 +2040,117 @@ namespace KJD_Web.BLL.WXXD
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string WXGetErpReturnOrderList(string inputData, bool isDetail = false)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var timeCalc = DateTime.Now;
var erp_order_id_in = RegexUtils.GetStringQuery(ref inputData, "erp_order_id_in")?.Replace("'", "\\'");
if (erp_order_id_in.IsNullOrEmpty())
{
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") == "true";
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 erp.distrib_return_order o WHERE 1=1 ";
string where = "";
if (!string.IsNullOrWhiteSpace(erp_order_id_in))
where += " and o.order_code_source in ('" + erp_order_id_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 erp.distrib_return_order o WHERE 1=1";
//where子句
sql += where;
if (sort_type == "asc")
sql += " ORDER BY o.created_at ASC";
else
sql += " ORDER BY o.created_at DESC";
sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (dt != null)
{
try
{
List<distrib_return_order_info> orderList = new List<distrib_return_order_info>();
foreach (DataRow row in dt.Rows)
{
distrib_return_order_info order = new distrib_return_order_info
{
id = row["id"].ParseToLong(),
additional_weight_fee = row["additional_weight_fee"].ParseToNullableInt(),
after_sale_no = row["after_sale_no"].ParseToNullableString(),
created_at = row["created_at"].ParseToString().ParseToDateTime(),
ext_field1 = row["ext_field1"].ParseToNullableString(),
ext_field2 = row["ext_field2"].ParseToNullableString(),
first_weight_fee = row["first_weight_fee"].ParseToNullableInt(),
logistics_code = row["logistics_code"].ParseToNullableString(),
logistics_express_no = row["logistics_express_no"].ParseToNullableString(),
order_code = row["order_code"].ParseToNullableString(),
order_code_source = row["order_code_source"].ParseToNullableString(),
order_void_status = row["order_void_status"].ParseToNullableInt(),
platform = row["platform"].ParseToNullableString(),
platform_code = row["platform_code"].ParseToNullableString(),
platform_order_no = row["platform_order_no"].ParseToNullableString(),
postage = row["postage"].ParseToNullableInt(),
real_logistics_code = row["real_logistics_code"].ParseToNullableString(),
real_logistics_express_code = row["real_logistics_express_code"].ParseToNullableString(),
receiver_address = row["receiver_address"].ParseToNullableString(),
receiver_area = row["receiver_area"].ParseToNullableString(),
receiver_city = row["receiver_city"].ParseToNullableString(),
receiver_name= row["receiver_name"].ParseToNullableString(),
receiver_phone = row["receiver_phone"].ParseToNullableString(),
receiver_province = row["receiver_province"].ParseToNullableString(),
response_msg = row["response_msg"].ParseToNullableString(),
return_order_status = row["return_order_status"].ParseToNullableInt(),
sender_info = row["sender_info"].ParseToNullableString(),
sender_name = row["sender_name"].ParseToNullableString(),
};
orderList.Add(order);
}
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
var data = JsonUtils.SerializeObjectToString(orderList, 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\":\"输入为空\"}";
}
}
}