优化同步单发货逻辑支持手动发货

This commit is contained in:
wule committed 2026-09-25 18:17:06 +08:00
1 parent 064d360de7
commit e1e118cc61
2 files changed
+728 -415

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -935,7 +935,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (order.order_sn == "260923-399088033421688") if (order.order_sn == "260923-399088033421688")
{ {
} }
if (order.ShopOrderIdStr == "3739389160415730432") if (order.ShopOrderIdStr == "3739399763136525568")
{ {
} }
if (order.WxSendTypeStr == "直发") if (order.WxSendTypeStr == "直发")
@@ -1785,7 +1785,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (buyerOrder.WxSendTypeStr == "直发") if (buyerOrder.WxSendTypeStr == "直发")
{ {
if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill) if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill)
SendAsyncWaybillOrder(buyerOrder); SendAsyncWaybillOrder(buyerOrder, true);
else else
SendOrderE57(buyerOrder); SendOrderE57(buyerOrder);
} }
@@ -2137,12 +2137,15 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
} }
} }
public void SendAsyncWaybillOrder(PddBuyerOrderLiteInfo order) public void SendAsyncWaybillOrder(PddBuyerOrderLiteInfo order, bool showErrBox = false)
{ {
try try
{ {
if (order.WxOrderStatus < 30 == false) if (order.WxOrderStatus < 30 == false)
{
if (showErrBox) BaseMsgWindow.ShowError("订单已发货无需重复创建同步单!");
return; return;
}
// 取最新订单状态 // 取最新订单状态
var wxOrder = GetOrderInfo(order.ShopOrderIdStr).FirstOrDefault(); var wxOrder = GetOrderInfo(order.ShopOrderIdStr).FirstOrDefault();
@@ -2151,8 +2154,12 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == wxOrder.shop_id.ToString()); var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == wxOrder.shop_id.ToString());
if (shop == null) if (shop == null)
throw new Exception("买手单对应店铺不存在!"); throw new Exception("买手单对应店铺不存在!");
if (wxOrder.status < 30 == false)
if (order.WxOrderStatus < 30 == false)
{
if (showErrBox) BaseMsgWindow.ShowError("订单已发货无需重复创建同步单!");
return; return;
}
if (order.ShopOrderIdStr == "3739357317247975936") if (order.ShopOrderIdStr == "3739357317247975936")
{ {
@@ -2227,6 +2234,11 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
html3 = GetHtml.PostUtf8(url3, data3); html3 = GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200")) if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
html3 = GetHtml.PostUtf8(url3, data3); html3 = GetHtml.PostUtf8(url3, data3);
if (showErrBox)
{
BaseMsgWindow.ShowError("同步单创建失败:" + ex.Message);
}
} }
} }