1直发买手单号查询 2优化同步单逻辑
This commit is contained in:
1 parent
661f8c052e
commit
064d360de7
3 files changed
+47
-14
No files matched your search
@@ -1,6 +1,7 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.CefHelper;
|
||||
using _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model;
|
||||
@@ -15,6 +16,7 @@ using CefSharp.Wpf;
|
||||
using NaiBa.Util;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.OpenXmlFormats.Dml.Chart;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -37,14 +39,13 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Xml.XPath;
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using Work;
|
||||
using Work._29Tools.BLL;
|
||||
using Work._29Tools.CefTools;
|
||||
using Work.BaseForms;
|
||||
using Work.BuyUsers;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Tab;
|
||||
using WxOrder.Framework.Commons;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Tab;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
{
|
||||
@@ -583,6 +584,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
void UpdateOrderStatus(PddBuyerOrderLiteInfo pdd_order, oms_wei_order_info wx_order, oms_wei_order_item_info wx_order_item, oms_wei_external_procurement_log_info wx_transit_order)
|
||||
{
|
||||
pdd_order.ShopIdStr = (wx_order?.shop_id).ParseToString();
|
||||
pdd_order.WxOrderStatus = wx_order?.status;
|
||||
pdd_order.ShopOrderIdStr = wx_order_item?.order_id ?? wx_transit_order?.order_no;
|
||||
pdd_order.ShopOrderSkuIdStr = wx_order_item?.sku_id ?? wx_transit_order?.order_sku_id;
|
||||
pdd_order.ShopOrderSkuNameStr = wx_order_item?.sku_attr_str;
|
||||
@@ -759,7 +761,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
o.ShopOrderRefundStr = "店铺售后";
|
||||
}
|
||||
}
|
||||
o.OutAfterSaleStatusStr = wxOrder.out_after_sale_status;
|
||||
o.WxOrderStatus = wxOrder?.status;
|
||||
o.OutAfterSaleStatusStr = wxOrder.out_after_sale_status;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -857,6 +860,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
order.ShopOrderRefundStr = o.ShopOrderRefundStr; // "" 或者 "店铺售后"
|
||||
order.OutAfterSaleStatusStr = o.OutAfterSaleStatusStr; // 店铺售后状态文本描述
|
||||
order.wxRefundStatus = o.wxRefundStatus;
|
||||
order.WxOrderStatus = o.WxOrderStatus;
|
||||
|
||||
|
||||
var index = lstPddBuyerOrderInfoLite.IndexOf(order);
|
||||
@@ -930,11 +934,15 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
|
||||
if (order.order_sn == "260923-399088033421688")
|
||||
{
|
||||
|
||||
}
|
||||
if (order.ShopOrderIdStr == "3739357317247975936")
|
||||
if (order.ShopOrderIdStr == "3739389160415730432")
|
||||
{
|
||||
|
||||
}
|
||||
if (order.WxSendTypeStr == "直发")
|
||||
{
|
||||
if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill && !string.IsNullOrEmpty(order.tracking_number) && order.WxOrderStatus < 30)
|
||||
if (!lstSyncLogistics.Any(o => o.order_id == order.order_sn) || lstSyncLogistics.Any(o => o.order_id == order.order_sn && o.tracking_number.IsNullOrEmpty()))
|
||||
isUpdate = true;
|
||||
}
|
||||
if (isUpdate && !string.IsNullOrEmpty(order.ShopOrderIdStr)/* && order.WxSendTypeStr != "直发"*/)
|
||||
{
|
||||
@@ -2133,19 +2141,30 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
{
|
||||
try
|
||||
{
|
||||
if (order.WxOrderStatus < 30 == false)
|
||||
return;
|
||||
|
||||
// 取最新订单状态
|
||||
var wxOrder = GetOrderInfo(order.ShopOrderIdStr).FirstOrDefault();
|
||||
if (wxOrder == null)
|
||||
throw new Exception("买手单对应微信订单不存在!");
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == wxOrder.shop_id.ToString());
|
||||
if (shop == null)
|
||||
throw new Exception("买手单对应店铺不存在!");
|
||||
|
||||
if (wxOrder.status < 30 == false)
|
||||
return;
|
||||
|
||||
if (order.ShopOrderIdStr == "3739357317247975936")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//3739354841155797760
|
||||
//3739338593856835840
|
||||
//3739343419162669824
|
||||
//3739334599561594624
|
||||
//3739334374248562688
|
||||
//3739334539482412288
|
||||
var apiSearchDropship = new WxApiBLL().WxApiDropshipSearch(shop, order.ShopOrderIdStr, 100);
|
||||
if (!apiSearchDropship.Contains("\"errcode\":0"))
|
||||
throw new Exception("同步单代发查询失败!" + BaseRegex.GetStringJson(ref apiSearchDropship, "msg"));
|
||||
|
||||
@@ -1518,6 +1518,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
// 仓库退款单号
|
||||
else if (order.orderItems.Any(oi => oi.ItemTransitOrderAfterSales.Any(t => t.refund_waybill.ParseToString().Contains(strSearchAll))))
|
||||
isFilter = false;
|
||||
// 直发订单号
|
||||
else if (order.out_order_no.Contains(strSearchAll))
|
||||
isFilter = false;
|
||||
// 直发物流单号
|
||||
else if (order.out_express_no.Contains(strSearchAll))
|
||||
isFilter = false;
|
||||
if (isFilter)
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -122,13 +122,21 @@ namespace AllBase.Model.Result
|
||||
{
|
||||
get { return this.GetValue(x => x.WxSendTypeStr); }
|
||||
set { this.SetValue(x => x.WxSendTypeStr, value); }
|
||||
}
|
||||
public string ShopIdStr
|
||||
{
|
||||
get { return this.GetValue(x => x.ShopIdStr); }
|
||||
set { this.SetValue(x => x.ShopIdStr, value); }
|
||||
}
|
||||
public string ShopOrderIdStr
|
||||
}
|
||||
public string ShopIdStr
|
||||
{
|
||||
get { return this.GetValue(x => x.ShopIdStr); }
|
||||
set { this.SetValue(x => x.ShopIdStr, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 状态10 待付款;20 待发货;21 部分发货;30 待收货;100 完成;200 全部商品售后之后,订单取消;250 未付款用户主动取消或超时未付款订单自动取消;
|
||||
/// </summary>
|
||||
public int? WxOrderStatus
|
||||
{
|
||||
get { return this.GetValue(x => x.WxOrderStatus); }
|
||||
set { this.SetValue(x => x.WxOrderStatus, value); }
|
||||
}
|
||||
public string ShopOrderIdStr
|
||||
{
|
||||
get { return this.GetValue(x => x.ShopOrderIdStr); }
|
||||
set { this.SetValue(x => x.ShopOrderIdStr, value); }
|
||||
|
||||
Reference in new issue
Block a user