1中转仓订单退货功能 2中转仓订单运费根据oem或管理员设定调整 3其他一些问题修复
This commit is contained in:
1 parent
d6f81f9ef4
commit
2e20cbdf68
24 files changed
+834
-292
No files matched your search
@@ -2,6 +2,7 @@
|
||||
using _29WxOrderWpf.Converters;
|
||||
using _29WxOrderWpf.Ctrls.BuyerCtrls;
|
||||
using _29WxOrderWpf.UserControls;
|
||||
using _29WxOrderWpf.Windows.OrderWindows;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model;
|
||||
@@ -204,9 +205,10 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
BaseMsgWindow.ShowError("请选择买手号");
|
||||
return;
|
||||
}
|
||||
if (orderItem.sku_cnt > 1 || orderItem.ItemOrder.orderItems.Count > 1)
|
||||
if (/*orderItem.sku_cnt > 1 ||*/ orderItem.ItemOrder.orderItems.Count > 1)
|
||||
{
|
||||
BaseMsgWindow.ShowError("多单或多件商品订单中转仓暂不支持");
|
||||
//BaseMsgWindow.ShowError("多子单或多件商品订单中转仓暂不支持");
|
||||
BaseMsgWindow.ShowError("多子单订单中转仓暂不支持");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -230,6 +232,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
orderItem = newOrder?.orderItems?.FirstOrDefault(oi => oi.sku_id == skuId);
|
||||
if (orderItem == null)
|
||||
return;
|
||||
|
||||
// 如果是退款单,弹出退款窗口
|
||||
if (/*orderItem?.ItemRefund?.count > 0 &&*/ orderItem.refund_status > 1)
|
||||
{
|
||||
@@ -252,7 +255,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 拍单前检测买手号是否在线
|
||||
if (GlobalConfig.CurrentPddBuyer.status == "在线")
|
||||
{
|
||||
@@ -268,29 +270,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
return;
|
||||
}
|
||||
|
||||
//if (!GlobalConfig.BuyConfig.IsUseAppBalance)
|
||||
//{
|
||||
|
||||
// var url = BaseClass.Build29WxObjString("shop/get_shop_erp_merchant");
|
||||
// var data = UserLogin.GetSignaturex();
|
||||
// data += "&corporate_account_user_id=" + orderItem.Shop.ErpCorporateAccountUserId;
|
||||
// data += "&manage_user_id=" + orderItem.Shop.ErpManageUserId;
|
||||
// data += "&shop_id=" + orderItem.Shop.ErpShopId;
|
||||
// var html = GetHtml.PostUtf8(url, data);
|
||||
// if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
// html = GetHtml.PostUtf8(url, data);
|
||||
// if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
// {
|
||||
// Dispatcher.Invoke(new Action(() =>
|
||||
// {
|
||||
// //BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg"));
|
||||
// //btnBuyOrder.Cursor = Cursors.Hand;
|
||||
// GlobalConfig.BuyConfig.IsUseAppBalance = true;
|
||||
// }));
|
||||
// //return;
|
||||
// }
|
||||
//}
|
||||
|
||||
orderRetry:
|
||||
// 拍单前查询账户余额
|
||||
if (GlobalConfig.BuyConfig.IsUseAppBalance)
|
||||
@@ -318,17 +297,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
//BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg"));
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
if (orderItem.Shop.ErpCorporateAccountUserId == null && orderItem.Shop.ErpManageUserId == null)
|
||||
{
|
||||
GlobalConfig.BuyConfig.IsUseAppBalance = true;
|
||||
StartUp.SaveBuyConfig();
|
||||
BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg") + ",自动切换为快递余额拍单。");
|
||||
goto orderRetry;
|
||||
}
|
||||
//return;
|
||||
GlobalConfig.BuyConfig.IsUseAppBalance = true;
|
||||
StartUp.SaveBuyConfig();
|
||||
BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg") + ",自动切换为快递余额拍单。");
|
||||
goto orderRetry;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(html) && html.Contains("\"code\":200"))
|
||||
{
|
||||
@@ -340,14 +314,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
//BaseMsgWindow.ShowError("未找到店铺账户!");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
GlobalConfig.BuyConfig.IsUseAppBalance = true;
|
||||
StartUp.SaveBuyConfig();
|
||||
BaseMsgWindow.ShowError("未找到店铺账户!自动切换为快递余额拍单。");
|
||||
goto orderRetry;
|
||||
//return;
|
||||
}
|
||||
|
||||
var balance = erpM.balance.ParseToDecimal();
|
||||
@@ -355,10 +327,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("ERP账户余额不足(剩余" + balance.ToString("0.00") + "元,拍单至少需保留10元),无法中转拍单,请先充值!");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
GlobalConfig.BuyConfig.IsUseAppBalance = true;
|
||||
StartUp.SaveBuyConfig();
|
||||
BaseMsgWindow.ShowError("ERP账户余额不足(剩余" + balance.ToString("0.00") + "元,拍单至少需保留10元),无法中转拍单,自动切换为快递余额拍单。");
|
||||
goto orderRetry;
|
||||
}
|
||||
}
|
||||
catch
|
||||
@@ -411,6 +385,32 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
return;
|
||||
}
|
||||
|
||||
// 检测是否加入代发
|
||||
if (orderItem.Shop?.LoginStatus == "登录成功")
|
||||
{
|
||||
var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
|
||||
if (!is29SupplierRst.Contains("\"code\":0"))
|
||||
is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
|
||||
if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"supplierName\":\"29供货商\"")) // "supplierName":"29供货商"
|
||||
{
|
||||
orderItem.Shop.Is29Supplier = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopBLL.CheckShopLogin(orderItem.Shop);
|
||||
if (orderItem.Shop?.LoginStatus == "登录成功")
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("店铺后台未查询到该代发单,请确认店铺在线且商品加入代发");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 掉线提示重登
|
||||
if (orderItem.Shop?.LoginStatus != "登录成功")
|
||||
{
|
||||
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
|
||||
@@ -426,43 +426,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}));
|
||||
return;
|
||||
}
|
||||
// 检测是否加入代发
|
||||
if (orderItem.Shop?.LoginStatus == "登录成功")
|
||||
{
|
||||
var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
|
||||
if (!is29SupplierRst.Contains("\"code\":0"))
|
||||
is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
|
||||
if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"supplierName\":\"29供货商\"")) // "supplierName":"29供货商"
|
||||
{
|
||||
orderItem.Shop.Is29Supplier = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopBLL.CheckShopLogin(orderItem.Shop);
|
||||
if (orderItem.Shop?.LoginStatus != "登录成功")
|
||||
{
|
||||
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
|
||||
{
|
||||
// 更新代发管理情况
|
||||
foreach (var oi in ord.orderItems)
|
||||
Dispatcher.Invoke(new Action(() => { oi.UpdateOrderItemBuyButton(); }));
|
||||
}
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("请登录店铺");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("店铺后台未查询到该代发单,请确认店铺在线且商品加入代发");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 打开拍单窗口
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
@@ -483,6 +448,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
// "&order_extra_type=1&refer_page_element=open_btn&source_channel=0&refer_page_name=goods_detail" +
|
||||
// "&refer_page_id=10014_" + BaseClass.DateTimeToTimestampSeconds(DateTime.Now) + Randomx.GetNumber(3) + "_tny5ifswls&refer_page_sn=10014";
|
||||
|
||||
buyOrderForm.ShowBuyMask = true;
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
|
||||
"&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
|
||||
"&page_from=101";
|
||||
@@ -496,6 +462,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
buyOrderForm.pnlMap.Visible = false;
|
||||
}
|
||||
buyOrderForm.ShowDialog();
|
||||
// 窗口关闭后更新运费信息
|
||||
MainWindow.Instance.Balance = BaseClass.Balance.ToString("0.00");
|
||||
}));
|
||||
});
|
||||
@@ -511,12 +478,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
//if (order_item.BuyMap == null && order_item.ItemOrder.out_amount == 0)
|
||||
// txtProfitForecast.Visibility = Visibility.Visible;
|
||||
|
||||
btnDeleteTransitOrder.Visibility = Visibility.Collapsed;
|
||||
//if (BaseClass.SaLevel == 1 && order_item.ItemTransitOrder != null)
|
||||
//{
|
||||
// btnDeleteTransitOrder.Visibility = Visibility.Visible;
|
||||
//}
|
||||
|
||||
order_item.UpdateOrderItemBuyButton();
|
||||
|
||||
Task.Run(() =>
|
||||
@@ -531,11 +492,16 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}));
|
||||
});
|
||||
|
||||
// 作废重拍
|
||||
if (order_item.ItemOrder.status == 20 /*&& order_item.refund_status <= 1*/ && order_item.ItemTransitOrder != null)
|
||||
{
|
||||
btnDeleteTransitOrder.Visibility = Visibility.Visible;
|
||||
}
|
||||
//待采购不显示所有采购信息状态(否则会显示作废订单状态)
|
||||
else
|
||||
{
|
||||
btnDeleteTransitOrder.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
// 待采购不显示所有采购信息状态(否则会显示作废订单状态)
|
||||
if (GlobalConfig.OrderTabHeaderStr.StartsWith("待采购"))
|
||||
{
|
||||
wpBuyAccount.Visibility = Visibility.Collapsed;
|
||||
@@ -545,10 +511,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
wpTransitBuyerRefundStatus.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//imgOrderItem.Source = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void txtOutOrderNumStr_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
@@ -681,7 +643,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
if (orderItem.ItemTransitOrder == null)
|
||||
{
|
||||
BaseMsgWindow.ShowError("订单状态已修改,请确认后重试");
|
||||
BaseMsgWindow.ShowError("要作废的中转订单不存在,请确认后重试");
|
||||
return;
|
||||
}
|
||||
});
|
||||
@@ -733,16 +695,28 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
//}' 成功返回code:0 失败返回code:1
|
||||
|
||||
string url2 = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/discardOrder";
|
||||
var data = new JObject();
|
||||
data["orderNo"] = orderItem.order_id;
|
||||
data["outOrderNo"] = orderItem.ItemTransitOrder.out_order_no;
|
||||
var dataStr2 = JsonHelper.SerializeObject(data);
|
||||
var data2 = new JObject();
|
||||
data2["orderNo"] = orderItem.order_id;
|
||||
data2["outOrderNo"] = orderItem.ItemTransitOrder.out_order_no;
|
||||
var dataStr2 = JsonHelper.SerializeObject(data2);
|
||||
var discardRst = HttpResponseWXBLL.e57PostResponse(url2, dataStr2, "");
|
||||
if (discardRst.Contains("<code>0</code>") || discardRst.Contains("<code>200</code>"))
|
||||
{
|
||||
MainWindow.Instance.orderListCtrl.GetOrder(orderId);
|
||||
MainWindow.Instance.orderListCtrl.FilterOrders();
|
||||
BaseMsgWindow.ShowInfo("订单作废成功,请重新拍单");
|
||||
|
||||
var url3 = BaseClass.Build29WxObjString("user/get_all_user");
|
||||
var data3 = UserLogin.GetSignaturex();
|
||||
data3 += "&search_user_name=" + BaseClass.UserName;
|
||||
var html = GetHtml.PostUtf8(url3, data3);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url3, data3);
|
||||
if (html.Contains("\"code\":200"))
|
||||
{
|
||||
BaseClass.Balance = BaseRegex.GetDecimalJson(ref html, "balance");
|
||||
MainWindow.Instance.Balance = BaseClass.Balance.ToString("0.00");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -763,5 +737,20 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAddEditTransitWarehouseAfterSale_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_item_info orderItem)
|
||||
{
|
||||
var transitAfterSale = orderItem.ItemTransitOrderAfterSale;
|
||||
if (orderItem.ItemTransitOrder?.warehouse_status == 2 && orderItem.AddEditTransitWarehouseAfterSaleStr == "添加")
|
||||
{
|
||||
BaseMsgWindow.ShowError("商品已出库,请联系卖家直接退回总店!");
|
||||
return;
|
||||
}
|
||||
TransitAfterSaleWindow transitAfterSaleWindow = new TransitAfterSaleWindow(orderItem);
|
||||
transitAfterSaleWindow.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user