合并中转仓代码

This commit is contained in:
chfei committed 2026-08-07 18:58:50 +08:00
commit 2ef9a10f05
46 files changed
+1136 -205

No files matched your search

@@ -1048,6 +1048,8 @@ namespace KJD_Web.BLL.BXX
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_json", Value = newProdJson, });
mySql.ExecuteNonQuery(sql, paramLst.ToArray());
prod.product_json = newProdJson;
//sql = "DELETE FROM " + tableName + " where is_del = 1 AND add_time < '" + DateTime.Now.AddDays(-10) + "' ORDER BY add_time DESC limit 1;";
}
catch
{
@@ -2037,6 +2039,8 @@ namespace KJD_Web.BLL.BXX
var min_view_uv = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "min_view_uv"))?.ParseToNullableInt();
if (min_view_uv > 0 && min_view_uv < 100)
min_view_uv = 100;
if (is学员数据)
min_view_uv = null;
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
@@ -92,85 +92,85 @@ namespace KJD_Web.BLL.WXXD
dt = mySql.ExecuteDataTable(sql);
}
mySql.Close();
if (dt != null)
{
try
{
List<oms_wei_order> orderList = new List<oms_wei_order>();
foreach (DataRow row in dt.Rows)
{
oms_wei_order order = new oms_wei_order
{
id = row["id"].ParseToLong(),
aftersale_detail = row["aftersale_detail"].ParseToNullableString(),
audit_status = row["audit_status"].ParseToNullableInt(),
audit_time = row["audit_time"].ParseToNullableString().ParseToDateTime(),
city_name = row["city_name"].ParseToNullableString(),
colour_flag = row["colour_flag"].ParseToNullableInt(),
colour_flag_update_time = row["colour_flag_update_time"].ParseToNullableString().ParseToDateTime(),
commission_amount = row["commission_amount"].ParseToNullableInt(),
county_name = row["county_name"].ParseToNullableString(),
create_time = row["create_time"].ParseToInt(),
delivery_deadline = row["delivery_deadline"].ParseToNullableInt(),
delivery_product_info = row["delivery_product_info"].ParseToNullableString(),
delivery_time = row["delivery_time"].ParseToNullableInt(),
detail_info = row["detail_info"].ParseToNullableString(),
discounted_price = row["discounted_price"].ParseToNullableInt(),
erp_send_code = row["erp_send_code"].ParseToNullableString(),
erp_send_company = row["erp_send_company"].ParseToNullableString(),
erp_send_status = row["erp_send_status"].ParseToNullableInt(),
erp_send_time = row["erp_send_time"].ParseToNullableString().ParseToDateTime(),
ewaybill_order_code = row["ewaybill_order_code"].ParseToNullableString(),
external_gift = row["external_gift"].ParseToNullableInt(),
ext_info = row["ext_info"].ParseToNullableString(),
freight = row["freight"].ParseToNullableInt(),
freight_insurance_amount = row["freight_insurance_amount"].ParseToNullableInt(),
gift_order_status = row["gift_order_status"].ParseToNullableInt(),
hash_code = row["hash_code"].ParseToNullableString(),
has_freight_insurance = row["has_freight_insurance"].ParseToNullableInt(),
house_number = row["house_number"].ParseToNullableString(),
is_express_no_used = row["is_express_no_used"].ParseToNullableInt(),
is_shipment_optimized = row["is_shipment_optimized"].ParseToNullableInt(),
merchant_id = row["merchant_id"].ParseToLong(),
openid = row["openid"].ParseToNullableString(),
order_id = row["order_id"].ParseToNullableString(),
order_price = row["order_price"].ParseToNullableInt(),
out_account = row["out_account"].ParseToNullableString(),
out_after_sale_status = row["out_after_sale_status"].ParseToNullableString(),
out_amount = row["out_amount"].ParseToNullableInt(),
out_express_company = row["out_express_company"].ParseToNullableString(),
out_express_no = row["out_express_no"].ParseToNullableString(),
out_order_no = row["out_order_no"].ParseToNullableString(),
out_shipped = row["out_shipped_int"].ParseToNullableInt(),
pay_info = row["pay_info"].ParseToNullableString(),
postal_code = row["postal_code"].ParseToNullableString(),
predict_commission_fee = row["predict_commission_fee"].ParseToNullableInt(),
product_price = row["product_price"].ParseToNullableInt(),
profit = row["profit"].ParseToNullableInt(),
province_name = row["province_name"].ParseToNullableString(),
purchase_price = row["purchase_price"].ParseToNullableInt(),
purchase_status = row["purchase_status"].ParseToNullableInt(),
purchase_time = row["purchase_time"].ParseToNullableInt(),
settle_info = row["settle_info"].ParseToNullableString(),
ship_done_time = row["ship_done_time"].ParseToNullableInt(),
shop_id = row["shop_id"].ParseToLong(),
shop_name = row["shop_name"].ParseToNullableString(),
shop_remark = row["shop_remark"].ParseToNullableString(),
soft_remark = row["soft_remark"].ParseToNullableString(),
status = row["status"].ParseToNullableInt(),
supplier_remark_exception = row["supplier_remark_exception"].ParseToNullableString(),
tel_number = row["tel_number"].ParseToNullableString(),
tel_number_ext_info = row["tel_number_ext_info"].ParseToNullableString(),
transfer_warehouse_status = row["transfer_warehouse_status"].ParseToNullableInt(),
unionid = row["unionid"].ParseToNullableString(),
update_time = row["update_time"].ParseToInt(),
user_name = row["user_name"].ParseToNullableString(),
use_tel_number = row["use_tel_number"].ParseToNullableInt(),
virtual_order_tel_number = row["virtual_order_tel_number"].ParseToNullableString(),
};
if (order.order_id == "3737914129536416512")
{
mySql.Close();
if (dt != null)
{
try
{
List<oms_wei_order> orderList = new List<oms_wei_order>();
foreach (DataRow row in dt.Rows)
{
oms_wei_order order = new oms_wei_order
{
id = row["id"].ParseToLong(),
aftersale_detail = row["aftersale_detail"].ParseToNullableString(),
audit_status = row["audit_status"].ParseToNullableInt(),
//audit_time = row["audit_time"].ParseToNullableString().ParseToDateTime(),
city_name = row["city_name"].ParseToNullableString(),
colour_flag = row["colour_flag"].ParseToNullableInt(),
colour_flag_update_time = row["colour_flag_update_time"].ParseToNullableString().ParseToDateTime(),
commission_amount = row["commission_amount"].ParseToNullableInt(),
county_name = row["county_name"].ParseToNullableString(),
create_time = row["create_time"].ParseToInt(),
delivery_deadline = row["delivery_deadline"].ParseToNullableInt(),
//delivery_product_info = row["delivery_product_info"].ParseToNullableString(),
delivery_time = row["delivery_time"].ParseToNullableInt(),
detail_info = row["detail_info"].ParseToNullableString(),
discounted_price = row["discounted_price"].ParseToNullableInt(),
erp_send_code = row["erp_send_code"].ParseToNullableString(),
erp_send_company = row["erp_send_company"].ParseToNullableString(),
erp_send_status = row["erp_send_status"].ParseToNullableInt(),
erp_send_time = row["erp_send_time"].ParseToNullableString().ParseToDateTime(),
//ewaybill_order_code = row["ewaybill_order_code"].ParseToNullableString(),
external_gift = row["external_gift"].ParseToNullableInt(),
//ext_info = row["ext_info"].ParseToNullableString(),
freight = row["freight"].ParseToNullableInt(),
freight_insurance_amount = row["freight_insurance_amount"].ParseToNullableInt(),
gift_order_status = row["gift_order_status"].ParseToNullableInt(),
hash_code = row["hash_code"].ParseToNullableString(),
has_freight_insurance = row["has_freight_insurance"].ParseToNullableInt(),
house_number = row["house_number"].ParseToNullableString(),
is_express_no_used = row["is_express_no_used"].ParseToNullableInt(),
is_shipment_optimized = row["is_shipment_optimized"].ParseToNullableInt(),
merchant_id = row["merchant_id"].ParseToLong(),
openid = row["openid"].ParseToNullableString(),
order_id = row["order_id"].ParseToNullableString(),
order_price = row["order_price"].ParseToNullableInt(),
out_account = row["out_account"].ParseToNullableString(),
out_after_sale_status = row["out_after_sale_status"].ParseToNullableString(),
out_amount = row["out_amount"].ParseToNullableInt(),
out_express_company = row["out_express_company"].ParseToNullableString(),
out_express_no = row["out_express_no"].ParseToNullableString(),
out_order_no = row["out_order_no"].ParseToNullableString(),
out_shipped = row["out_shipped_int"].ParseToNullableInt(),
//pay_info = row["pay_info"].ParseToNullableString(),
postal_code = row["postal_code"].ParseToNullableString(),
predict_commission_fee = row["predict_commission_fee"].ParseToNullableInt(),
product_price = row["product_price"].ParseToNullableInt(),
profit = row["profit"].ParseToNullableInt(),
province_name = row["province_name"].ParseToNullableString(),
purchase_price = row["purchase_price"].ParseToNullableInt(),
purchase_status = row["purchase_status"].ParseToNullableInt(),
purchase_time = row["purchase_time"].ParseToNullableInt(),
settle_info = row["settle_info"].ParseToNullableString(),
ship_done_time = row["ship_done_time"].ParseToNullableInt(),
shop_id = row["shop_id"].ParseToLong(),
shop_name = row["shop_name"].ParseToNullableString(),
shop_remark = row["shop_remark"].ParseToNullableString(),
soft_remark = row["soft_remark"].ParseToNullableString(),
status = row["status"].ParseToNullableInt(),
supplier_remark_exception = row["supplier_remark_exception"].ParseToNullableString(),
tel_number = row["tel_number"].ParseToNullableString(),
tel_number_ext_info = row["tel_number_ext_info"].ParseToNullableString(),
transfer_warehouse_status = row["transfer_warehouse_status"].ParseToNullableInt(),
unionid = row["unionid"].ParseToNullableString(),
update_time = row["update_time"].ParseToInt(),
user_name = row["user_name"].ParseToNullableString(),
use_tel_number = row["use_tel_number"].ParseToNullableInt(),
virtual_order_tel_number = row["virtual_order_tel_number"].ParseToNullableString(),
};
if (order.order_id == "3737914129536416512")
{
}
orderList.Add(order);
@@ -786,6 +786,8 @@ namespace KJD_Web.BLL.WXXD
warehouse_status = row["warehouse_status"].ParseToNullableInt(),
inbound_time = row["inbound_time"].ParseToNullableString().ParseToDateTimeNullable(),
outbound_time = row["outbound_time"].ParseToNullableString().ParseToDateTimeNullable(),
has_reject = row["has_reject"].ParseToInt(),
});
}
return oms_wei_external_procurement_log_list;
@@ -1082,50 +1084,50 @@ namespace KJD_Web.BLL.WXXD
// "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,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,@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
{
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(wx_send_type))
sql += " wx_send_type=@wx_send_type,";
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,";
if (!string.IsNullOrEmpty(wx_order_send_type))
sql += " wx_order_send_type=@wx_order_send_type,";
sql = sql.TrimEnd(',');
sql += " where order_sn=@pdd_order_sn";
}
//260705-105706954352823
if (id == 0)
{
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,@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
{
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(wx_send_type))
sql += " wx_send_type=@wx_send_type,";
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,";
if (!string.IsNullOrEmpty(wx_order_send_type))
sql += " wx_order_send_type=@wx_order_send_type,";
sql = sql.TrimEnd(',');
sql += " where order_sn=@pdd_order_sn";
}
//260705-105706954352823
List<MySqlParameter> paramLst = new List<MySqlParameter>();
@@ -1696,13 +1698,67 @@ namespace KJD_Web.BLL.WXXD
}
public string WXAddOrderItemExtInfo(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var timeCalc = DateTime.Now;
/// <summary>
/// 订单拒收状态维护
/// </summary>
/// <param name="inputData"></param>
/// <returns></returns>
public string WXUpdateTransitOrderRejectStatus(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!WXUserManage.GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
var order_no = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_no"))?.Replace("'", "\\'");
var order_sku_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_sku_id"))?.Replace("'", "\\'");
var order_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_code"))?.Replace("'", "\\'");
var has_reject = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "has_reject"))?.Replace("'", "\\'");
if (order_code.IsNullOrEmpty() && (order_no.IsNullOrEmpty() || order_sku_id.IsNullOrEmpty()))
{
return "{\"code\":500,\"msg\":\"拒收信息不完整\",\"affected_rows\":" + 0 + "}";
}
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn, true);
string sql;
sql = "UPDATE erp.oms_wei_external_procurement_log SET ";
sql += " has_reject=" + has_reject + ",";
sql = sql.TrimEnd(',');
if (!order_code.IsNullOrEmpty())
sql += " WHERE order_code='" + order_code + "' AND order_no='" + order_code + "';";
else
sql += " WHERE order_no='" + order_no + "' AND order_sku_id='" + order_sku_id + "';";
var rows = mySql.ExecuteAffectedRows(sql);
if (!mySql.Message.IsNullOrEmpty())
{
mySql.RollBack();
mySql.Close();
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"affected_rows\":" + rows + "}";
}
if (rows == 0)
{
mySql.RollBack();
mySql.Close();
return "{\"code\":500,\"msg\":\"更新拒收状态失败,未找到记录\",\"affected_rows\":" + rows + "}";
}
mySql.Commit();
mySql.Close();
return "{\"code\":200,\"msg\":\"success\",\"affected_rows\":" + rows + "}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string WXAddOrderItemExtInfo(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, "wx_order_id"))?.Replace("'", "\\'");
string sku_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_sku_id"))?.Replace("'", "\\'");
@@ -42,6 +42,32 @@ namespace KJD_Web.BLL.WXXD
return true;
}
public static DateTime dtAuthorizationExpireTime = DateTime.Now;
public static string e57Authorization = "";
public string GetE57Authorization(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
{
if (!GetSign(inputData))
return "{\"code\":999,\"msg\":\"校验失败\"}";
if (dtAuthorizationExpireTime <= DateTime.Now || string.IsNullOrEmpty(e57Authorization))
{
//{"msg":"username required","code":500}
//{"msg":"操作成功","code":200,"token":"eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImIxYTU3OWI2LTM0NWUtNDQwOC05ZjFiLTk0ZTUyOTIxMzlmZCJ9.3qvRXiWeCo_cIOHs6gbCHqDrmfCrH6XDOrMY0BjuUOIu3yVsCwFGVO0hT0A5Wssh_VFPJLouyb1moTcODt0vow"}
var url = "https://po.e57.cn/prod-api/api/sys-api/internal/createTokenForUser";
var data = "{\"username\":\"admin\"}";
var html = HttpUtils.e57PostResponse(url, data, "");
e57Authorization = RegexUtils.GetStringJson(ref html, "token").ParseToString();
dtAuthorizationExpireTime = DateTime.Now.AddHours(2);
//dtAuthorizationExpireTime = DateTime.Now.AddMinutes(10);
return html.Replace("token", "authorization");
}
return "{\"code\":200,\"authorization\":\"" + e57Authorization + "\"}";
}
return "{\"code\":19999,\"msg\":\"输入为空\"}";
}
public string CheckUserLogin(string inputData)
{
if (!string.IsNullOrEmpty(inputData))
@@ -59,5 +59,9 @@ namespace KJD_Web.Model.WxModel
/// 中转出库时间
/// </summary>
public DateTime? outbound_time { get; set; }
/// <summary>
/// 申请拒收状态 0未申请 1申请成功 2申请失败
/// </summary>
public int has_reject { get; set; }
}
}
@@ -285,7 +285,18 @@ namespace KJD_Web
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void wx_update_transit_order_reject_status()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new WXOrderManage().WXUpdateTransitOrderRejectStatus(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void wx_add_order_item_ext_info()
@@ -54,7 +54,18 @@ namespace KJD_Web
return jsonText;
}
}
//GetE57Authorization
[WebMethod]
public void get_e57_authorization()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new WXUserManage().GetE57Authorization(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void user_login()
{