1淘宝拍单 2中转仓订单优化
This commit is contained in:
1 parent
77843a54f6
commit
b84ccc4670
8 files changed
+4044
-142
No files matched your search
@@ -867,6 +867,7 @@
|
||||
Margin="-2,2,4,2"
|
||||
Padding="0"
|
||||
VerticalAlignment="Top"
|
||||
d:Text="BBB采购废柴"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Cursor="Hand"
|
||||
@@ -911,6 +912,7 @@
|
||||
Margin="-2,2"
|
||||
Padding="0"
|
||||
VerticalAlignment="Top"
|
||||
d:Text="261009-123456…"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Cursor="Hand"
|
||||
|
||||
@@ -542,7 +542,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
taobaoBuyView.ViewModel.AbnormalTransitWarehouseOrderInfo = orderItem.ItemTransitOrder;
|
||||
new DialogWindow()
|
||||
{
|
||||
Title = "淘宝买手登录",
|
||||
Title = "买手拍单 - 当前买手 " + GlobalConfig.CurrentTaobaoBuyer.buyer_nick,
|
||||
Content = taobaoBuyView,
|
||||
//Height = System.Windows.Forms.SystemInformation.WorkingArea.Height - 80,
|
||||
//Height = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - 80,
|
||||
@@ -881,63 +881,97 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
private void txtDirectOrderNumStr_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
var buyerName = txtDirectBuyer.Text.Split(':').LastOrDefault();
|
||||
var outOrderId = txtDirectBuyerOrderNo.Text.Split(':').LastOrDefault();
|
||||
if (string.IsNullOrEmpty(buyerName) || string.IsNullOrEmpty(outOrderId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(p => p.buyer_name == buyerName);
|
||||
if (buyer == null)
|
||||
{
|
||||
BaseMsgWindow.ShowError("该订单买手号未在当前账户登录");
|
||||
return;
|
||||
}
|
||||
//GlobalConfig.CurrentPddBuyer = buyer;
|
||||
|
||||
var url = "";
|
||||
if (buyer != null)
|
||||
{
|
||||
if (sender == txtDirectBuyer)
|
||||
url = "https://mobile.yangkeduo.com/index.html";
|
||||
else
|
||||
url = "https://mobile.yangkeduo.com/order.html?order_sn=" + outOrderId + "&page_from=1&main_orders=1&is_tester=1&refer_page_name=my_order" +
|
||||
"&refer_page_id=10032_" + BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now) + "_" + Randomx.GetWordNumber(10) + "&refer_page_sn=10032";
|
||||
}
|
||||
|
||||
var orderItem = this.DataContext as oms_wei_order_item_info;
|
||||
if (orderItem == null)
|
||||
{
|
||||
BaseMsgWindow.ShowError("订单信息为空");
|
||||
return;
|
||||
}
|
||||
// 拍单的时候检测一下买手号
|
||||
if (buyer.status == "在线")
|
||||
|
||||
var buyerAccount = txtTransitOrderBuyerStr.Tag.ParseToString();
|
||||
var buyerName = txtDirectBuyer.Text.Split(':').LastOrDefault();
|
||||
var outOrderId = txtDirectBuyerOrderNo.Text.Split(':').LastOrDefault();
|
||||
if (string.IsNullOrEmpty(buyerName) || string.IsNullOrEmpty(outOrderId))
|
||||
{
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(buyer);
|
||||
}
|
||||
if (buyer.status != "在线")
|
||||
{
|
||||
BaseMsgWindow.ShowError("买手号掉线");
|
||||
return;
|
||||
}
|
||||
|
||||
//PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance, orderItem, buyer, orderItem.BuyMap);
|
||||
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(null, null, orderItem, buyer, orderItem.PddBuyMap);
|
||||
buyOrderForm.BuyType = "direct";
|
||||
buyOrderForm.TitleText = "直发订单查看 - 当前买手 " + buyer.buyer_nick;
|
||||
|
||||
//所有订单页面
|
||||
buyOrderForm.InitUrl = url;
|
||||
buyOrderForm.pnlBuy.Visible = false;
|
||||
|
||||
//已有拍单关联的控制界面显示隐藏
|
||||
if (orderItem.PddBuyMap != null)
|
||||
if (outOrderId.StartsWith("tb_")) // 淘宝买手及订单
|
||||
{
|
||||
buyOrderForm.pnlBuy.Visible = true;
|
||||
buyOrderForm.pnlMap.Visible = false;
|
||||
var buyer = GlobalConfig.TaobaoBuyerLoginList.FirstOrDefault(p => p.buyer_id == buyerAccount || p.buyer_name == buyerName);
|
||||
if (buyer == null)
|
||||
{
|
||||
BaseMsgWindow.ShowError("该订单买手号未在当前账户登录");
|
||||
return;
|
||||
}
|
||||
|
||||
var url = "";
|
||||
if (sender == txtTransitOrderBuyerStr)
|
||||
url = "https://buyertrade.taobao.com/trade/itemlist/list_bought_items.htm?";
|
||||
else
|
||||
url = "https://trade.tmall.com/detail/orderDetail.htm?bizOrderId=" + outOrderId.Replace("tb_", "");
|
||||
|
||||
TaobaoBuyOrderCtrl taobaoBuyView = new TaobaoBuyOrderCtrl(GlobalConfig.CurrentTaobaoBuyer, orderItem);
|
||||
taobaoBuyView.ViewModel.InitUrl = url;
|
||||
taobaoBuyView.ViewModel.BuyType = "direct";
|
||||
new DialogWindow()
|
||||
{
|
||||
Title = "订单查看 - 当前买手 " + buyer.buyer_nick,
|
||||
Content = taobaoBuyView,
|
||||
Width = SystemParameters.PrimaryScreenWidth < 1920 ? SystemParameters.PrimaryScreenWidth : SystemParameters.PrimaryScreenWidth * 90 / 100,
|
||||
Height = SystemParameters.PrimaryScreenHeight * 90 / 100,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen,
|
||||
}.ShowDialog();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(p => p.buyer_name == buyerName);
|
||||
if (buyer == null)
|
||||
{
|
||||
BaseMsgWindow.ShowError("该订单买手号未在当前账户登录");
|
||||
return;
|
||||
}
|
||||
//GlobalConfig.CurrentPddBuyer = buyer;
|
||||
|
||||
var url = "";
|
||||
if (buyer != null)
|
||||
{
|
||||
if (sender == txtDirectBuyer)
|
||||
url = "https://mobile.yangkeduo.com/index.html";
|
||||
else
|
||||
url = "https://mobile.yangkeduo.com/order.html?order_sn=" + outOrderId + "&page_from=1&main_orders=1&is_tester=1&refer_page_name=my_order" +
|
||||
"&refer_page_id=10032_" + BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now) + "_" + Randomx.GetWordNumber(10) + "&refer_page_sn=10032";
|
||||
}
|
||||
|
||||
// 拍单的时候检测一下买手号
|
||||
if (buyer.status == "在线")
|
||||
{
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(buyer);
|
||||
}
|
||||
if (buyer.status != "在线")
|
||||
{
|
||||
BaseMsgWindow.ShowError("买手号掉线");
|
||||
return;
|
||||
}
|
||||
|
||||
//PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance, orderItem, buyer, orderItem.BuyMap);
|
||||
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(null, null, orderItem, buyer, orderItem.PddBuyMap);
|
||||
buyOrderForm.BuyType = "direct";
|
||||
buyOrderForm.TitleText = "直发订单查看 - 当前买手 " + buyer.buyer_nick;
|
||||
|
||||
//所有订单页面
|
||||
buyOrderForm.InitUrl = url;
|
||||
buyOrderForm.pnlBuy.Visible = false;
|
||||
|
||||
//已有拍单关联的控制界面显示隐藏
|
||||
if (orderItem.PddBuyMap != null)
|
||||
{
|
||||
buyOrderForm.pnlBuy.Visible = true;
|
||||
buyOrderForm.pnlMap.Visible = false;
|
||||
}
|
||||
buyOrderForm.ShowDialog();
|
||||
}
|
||||
buyOrderForm.ShowDialog();
|
||||
}
|
||||
|
||||
private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
@@ -1120,8 +1154,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
string url2 = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/discardOrder";
|
||||
var data2 = new JObject();
|
||||
data2["orderNo"] = orderItem.order_id;
|
||||
data2["outOrderNo"] = orderItem.ItemTransitOrder.out_order_no;
|
||||
//data2["outOrderNo"] = orderItem.ItemTransitOrder.order_code;
|
||||
//data2["outOrderNo"] = orderItem.ItemTransitOrder.out_order_no;
|
||||
data2["outOrderNo"] = orderItem.ItemTransitOrder.order_code;
|
||||
var dataStr2 = JsonHelper.SerializeObject(data2);
|
||||
var discardRst = HttpResponseWXBLL.e57PostResponse(url2, dataStr2, "");
|
||||
if (discardRst.Contains("<code>0</code>") || discardRst.Contains("<code>200</code>"))
|
||||
@@ -1398,11 +1432,11 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}
|
||||
|
||||
btnBuyOrder.Cursor = Cursors.Wait;
|
||||
btnBuyOrder.IsEnabled = false;
|
||||
btnDirectBuyOrder.IsEnabled = false;
|
||||
Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(2000);
|
||||
Dispatcher.Invoke(new Action(() => { btnBuyOrder.IsEnabled = true; }));
|
||||
Dispatcher.Invoke(new Action(() => { btnDirectBuyOrder.IsEnabled = true; }));
|
||||
});
|
||||
Task.Run(async() =>
|
||||
{
|
||||
@@ -1471,57 +1505,91 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
//}
|
||||
|
||||
// 检测买手号是否掉线
|
||||
if (GlobalConfig.CurrentPddBuyer.status == "在线")
|
||||
if (GlobalConfig.CurrentBuyPlatform == "pdd")
|
||||
{
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
|
||||
}
|
||||
if (GlobalConfig.CurrentPddBuyer.status != "在线")
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
if (GlobalConfig.CurrentPddBuyer.status == "在线")
|
||||
{
|
||||
BaseMsgWindow.ShowError("买手号掉线");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
PddMobileLoginViewModel.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
|
||||
}
|
||||
if (GlobalConfig.CurrentPddBuyer.status != "在线")
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("买手号掉线");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 打开拍单窗口
|
||||
Dispatcher.Invoke(new Action(async () =>
|
||||
{
|
||||
var BuyPlatform = "pdd";
|
||||
bool IsBuySuccess = false;
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
|
||||
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance,
|
||||
orderItem, GlobalConfig.CurrentPddBuyer, orderItem.PddBuyMap);
|
||||
|
||||
buyOrderForm.TitleText = "买手直发拍单 - 当前买手 " + GlobalConfig.CurrentPddBuyer.buyer_nick;
|
||||
buyOrderForm.BuyType = "direct";
|
||||
|
||||
// 未关联拍单的跳到所有订单页面
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/orders.html";
|
||||
//https://mobile.yangkeduo.com/order.html?order_sn=260729-663591339661688
|
||||
if (orderItem.ItemTransitOrderWithVoid != null)
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order.html?order_sn=" + orderItem.ItemTransitOrderWithVoid.out_order_no;
|
||||
|
||||
buyOrderForm.pnlBuy.Visible = false;
|
||||
|
||||
|
||||
// 已有拍单关联的跳的到订单确认界面
|
||||
if (orderItem.PddBuyMap != null)
|
||||
// 拼多多买手
|
||||
if (GlobalConfig.CurrentBuyPlatform == "pdd")
|
||||
{
|
||||
buyOrderForm.ShowBuyMask = true;
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.PddBuyMap.map_sku_id +
|
||||
"&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.PddBuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
|
||||
"&page_from=101";
|
||||
BuyPlatform = "pdd";
|
||||
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance,
|
||||
orderItem, GlobalConfig.CurrentPddBuyer, orderItem.PddBuyMap);
|
||||
|
||||
buyOrderForm.pnlBuy.Visible = true;
|
||||
buyOrderForm.pnlMap.Visible = false;
|
||||
buyOrderForm.TitleText = "买手直发拍单 - 当前买手 " + GlobalConfig.CurrentPddBuyer.buyer_nick;
|
||||
buyOrderForm.BuyType = "direct";
|
||||
|
||||
// 未关联拍单的跳到所有订单页面
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/orders.html";
|
||||
//https://mobile.yangkeduo.com/order.html?order_sn=260729-663591339661688
|
||||
if (orderItem.ItemTransitOrderWithVoid != null)
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order.html?order_sn=" + orderItem.ItemTransitOrderWithVoid.out_order_no;
|
||||
|
||||
buyOrderForm.pnlBuy.Visible = false;
|
||||
|
||||
// 已有拍单关联的跳的到订单确认界面
|
||||
if (orderItem.PddBuyMap != null)
|
||||
{
|
||||
buyOrderForm.ShowBuyMask = true;
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.PddBuyMap.map_sku_id +
|
||||
"&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.PddBuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
|
||||
"&page_from=101";
|
||||
|
||||
buyOrderForm.pnlBuy.Visible = true;
|
||||
buyOrderForm.pnlMap.Visible = false;
|
||||
}
|
||||
buyOrderForm.ShowDialog();
|
||||
IsBuySuccess = buyOrderForm.IsBuySuccess;
|
||||
}
|
||||
buyOrderForm.ShowDialog();
|
||||
|
||||
if (buyOrderForm.IsBuySuccess)
|
||||
else if (GlobalConfig.CurrentBuyPlatform == "tb")
|
||||
{
|
||||
if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill == true)
|
||||
BuyPlatform = "tb";
|
||||
TaobaoBuyOrderCtrl taobaoBuyView = new TaobaoBuyOrderCtrl(GlobalConfig.CurrentTaobaoBuyer, orderItem);
|
||||
if (orderItem.TbBuyMap != null)
|
||||
{
|
||||
taobaoBuyView.ViewModel.InitUrl = "https://i.taobao.com/my_itaobao/receiver-address-pc";
|
||||
taobaoBuyView.ViewModel.InitUrl = "https://item.taobao.com/item.htm?id=" + orderItem.TbBuyMap.map_goods_id + "&skuId=" + orderItem.TbBuyMap.map_sku_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
taobaoBuyView.ViewModel.InitUrl = "https://s.taobao.com/search?";
|
||||
taobaoBuyView.ViewModel.IsMappingGoods = true;
|
||||
}
|
||||
taobaoBuyView.ViewModel.BuyType = "direct";
|
||||
new DialogWindow()
|
||||
{
|
||||
Title = "买手拍单 - 当前买手 " + GlobalConfig.CurrentTaobaoBuyer.buyer_nick,
|
||||
Content = taobaoBuyView,
|
||||
Width = SystemParameters.PrimaryScreenWidth < 1920 ? SystemParameters.PrimaryScreenWidth : SystemParameters.PrimaryScreenWidth * 90 / 100,
|
||||
Height = SystemParameters.PrimaryScreenHeight * 90 / 100,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen,
|
||||
}.ShowDialog();
|
||||
IsBuySuccess = taobaoBuyView.ViewModel.IsBuySuccess;
|
||||
}
|
||||
|
||||
if (IsBuySuccess)
|
||||
{
|
||||
if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill == true && BuyPlatform == "pdd")
|
||||
{
|
||||
// 设置同步物流单代发
|
||||
//var rst = new WxApiBLL().GetShopSupplier(orderItem.Shop);
|
||||
@@ -1537,7 +1605,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
try
|
||||
{
|
||||
// 查询直拍单是否绑定了同步单代发(放到同步单发货前处理)
|
||||
// 查询拼多都直拍单是否绑定了同步单代发(放到同步单发货前处理)
|
||||
await SetSendOrderSupplier(orderItem, "wx7809625286c28f2f", "百川日用");
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -1551,7 +1619,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
// 查询订单是否在代发货中,如果代发需要取消代发
|
||||
try
|
||||
{
|
||||
// 查询直拍单是否绑定了同步单代发(放到同步单发货前处理)
|
||||
// 查询淘宝直拍单是否绑定了同步单代发(放到同步单发货前处理)
|
||||
await SetSendOrderSupplier(orderItem, "", "");
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in new issue
Block a user