优化读拼多多买手单
This commit is contained in:
1 parent
f89670877d
commit
a31b87b512
9 files changed
+208
-143
No files matched your search
@@ -64,6 +64,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
{
|
{
|
||||||
private static readonly object locker = new object();
|
private static readonly object locker = new object();
|
||||||
|
|
||||||
|
private static ConcurrentList<Task> lstTask = new ConcurrentList<Task>();
|
||||||
|
|
||||||
string lblMsgStr = "当前没有任何操作";
|
string lblMsgStr = "当前没有任何操作";
|
||||||
public string LblMsgStr
|
public string LblMsgStr
|
||||||
{
|
{
|
||||||
@@ -99,6 +101,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
public static ConcurrentList<PddBuyerAfterSaleLiteInfo> lstPddBuyerAfterSaleInfoLite { get; set; } = new ConcurrentList<PddBuyerAfterSaleLiteInfo>();
|
public static ConcurrentList<PddBuyerAfterSaleLiteInfo> lstPddBuyerAfterSaleInfoLite { get; set; } = new ConcurrentList<PddBuyerAfterSaleLiteInfo>();
|
||||||
public static ObservableCollectionThreadSafe<PddBuyerAfterSaleLiteInfo> lstFilterPddBuyerAfterSaleInfoLite { get; set; } = new ObservableCollectionThreadSafe<PddBuyerAfterSaleLiteInfo>();
|
public static ObservableCollectionThreadSafe<PddBuyerAfterSaleLiteInfo> lstFilterPddBuyerAfterSaleInfoLite { get; set; } = new ObservableCollectionThreadSafe<PddBuyerAfterSaleLiteInfo>();
|
||||||
public static ConcurrentList<string> lstPddBuyerOrderVoidAfterSaleOrderSn { get; set; } = new ConcurrentList<string>();
|
public static ConcurrentList<string> lstPddBuyerOrderVoidAfterSaleOrderSn { get; set; } = new ConcurrentList<string>();
|
||||||
|
public static ConcurrentList<string> lstdisctinctOrderSn = new ConcurrentList<string>();
|
||||||
public CancellationTokenSource cancellationTokenSource { get; set; } = new CancellationTokenSource();
|
public CancellationTokenSource cancellationTokenSource { get; set; } = new CancellationTokenSource();
|
||||||
public BuyerReadOrderConfig buyerReadOrderConfig = new BuyerReadOrderConfig();
|
public BuyerReadOrderConfig buyerReadOrderConfig = new BuyerReadOrderConfig();
|
||||||
public DateTime nextGetOrderTime = DateTime.MinValue;
|
public DateTime nextGetOrderTime = DateTime.MinValue;
|
||||||
@@ -421,7 +424,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
if (ordersStr != null && ordersStr.StartsWith("{\"3\":"))
|
if (ordersStr != null && ordersStr.StartsWith("{\"3\":"))
|
||||||
{
|
{
|
||||||
ordersStr = "{\"orders\":" + ordersStr.Substring(5);
|
ordersStr = "{\"orders\":" + ordersStr.Substring(5);
|
||||||
await CefReadBuyerOrder(buyerId, ordersStr);
|
await CefReadBuyerOrderQueue(buyerId, ordersStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -443,7 +446,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
if (ordersStr != null && ordersStr.StartsWith("{\"2\":"))
|
if (ordersStr != null && ordersStr.StartsWith("{\"2\":"))
|
||||||
{
|
{
|
||||||
ordersStr = "{\"orders\":" + ordersStr.Substring(5);
|
ordersStr = "{\"orders\":" + ordersStr.Substring(5);
|
||||||
await CefReadBuyerOrder(buyerId, ordersStr);
|
await CefReadBuyerOrderQueue(buyerId, ordersStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -452,7 +455,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
// 读订单
|
// 读订单
|
||||||
if (/*(cefAddress.Contains("orders.html")) &&*/ url1.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/aristotle/order_list_v")) //https://mobile.yangkeduo.com/proxy/api/api/aristotle/order_list_v4?pdduid=6766109923730
|
if (/*(cefAddress.Contains("orders.html")) &&*/ url1.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/aristotle/order_list_v")) //https://mobile.yangkeduo.com/proxy/api/api/aristotle/order_list_v4?pdduid=6766109923730
|
||||||
{
|
{
|
||||||
await CefReadBuyerOrder(url1, data1);
|
await CefReadBuyerOrderQueue(url1, data1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 售后 第一页
|
// 售后 第一页
|
||||||
@@ -702,13 +705,9 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
pdd_afterSale.AfterSaleAddress = buyer_after_sale?.afterSaleAddress;
|
pdd_afterSale.AfterSaleAddress = buyer_after_sale?.afterSaleAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task CefReadBuyerOrder(string url, string data)
|
|
||||||
{
|
|
||||||
if (data.Contains("轻奢壁挂式香皂盒置物架卫生间沥水家居可拆卸收纳盒翻盖肥皂盒"))
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
async Task CefReadBuyerOrderQueue(string url, string data)
|
||||||
|
{
|
||||||
var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => url.Contains(b.buyer_id));
|
var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => url.Contains(b.buyer_id));
|
||||||
if (buyer == null)
|
if (buyer == null)
|
||||||
return;
|
return;
|
||||||
@@ -718,10 +717,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
//{"server_time":1775789489,"orders":[],"extra_info":{}}
|
//{"server_time":1775789489,"orders":[],"extra_info":{}}
|
||||||
if (data.Contains("\"orders\":[]"))
|
if (data.Contains("\"orders\":[]"))
|
||||||
{
|
{
|
||||||
Dispatcher.Invoke(new Action(() =>
|
ShowBuyerOrderReadInfo(buyer, " 获取到空订单列表,退出自动滑动 ");
|
||||||
{
|
|
||||||
lblMsg.Content = buyer.buyer_name + " 获取到空订单列表,退出自动滑动 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
||||||
}));
|
|
||||||
currentReadBuyer = "";
|
currentReadBuyer = "";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -732,15 +728,29 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
lblMsg.Content = buyer.buyer_name + " 正在获取订单列表 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
||||||
}));
|
|
||||||
|
|
||||||
var list = JsonHelper.DeserializeJsonToList<PddBuyerOrderLiteInfo>(JsonHelper.JObjectParse(data)["orders"].ParseToString());
|
var list = JsonHelper.DeserializeJsonToList<PddBuyerOrderLiteInfo>(JsonHelper.JObjectParse(data)["orders"].ParseToString());
|
||||||
|
var isBreak = false;
|
||||||
|
lock (locker)
|
||||||
|
{
|
||||||
|
if (list.All(l => lstdisctinctOrderSn.Contains(l.order_sn)))
|
||||||
|
isBreak = true;
|
||||||
|
lstdisctinctOrderSn.AddRange(list.Where(l => !lstdisctinctOrderSn.Contains(l.order_sn)).Select(l => l.order_sn).ToList());
|
||||||
|
}
|
||||||
|
if (isBreak)
|
||||||
|
{
|
||||||
|
ShowBuyerOrderReadInfo(buyer, " 获取到重复订单列表,退出自动滑动 ");
|
||||||
|
currentReadBuyer = "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (list.Count > 0)
|
if (list.Count > 0)
|
||||||
dicPddOrderOffset[buyer] = list.LastOrDefault().order_sn;
|
dicPddOrderOffset[buyer] = list.LastOrDefault()?.order_sn;
|
||||||
|
|
||||||
|
ShowBuyerOrderReadInfo(buyer, " 正在获取订单列表 " + list?.LastOrDefault()?.order_sn + " ");
|
||||||
|
if ((list?.LastOrDefault()?.order_sn).ParseToString().Contains("PO"))
|
||||||
|
{
|
||||||
|
//PO-261024-019168007731171
|
||||||
|
}
|
||||||
|
|
||||||
// 提取拼多多外采订单列表
|
// 提取拼多多外采订单列表
|
||||||
var out_order_nos = string.Join(",", list.Select(bo => bo.order_sn));
|
var out_order_nos = string.Join(",", list.Select(bo => bo.order_sn));
|
||||||
@@ -794,11 +804,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
o.buyerId = buyer.buyer_id;
|
o.buyerId = buyer.buyer_id;
|
||||||
o.buyerName = buyer.buyer_name;
|
o.buyerName = buyer.buyer_name;
|
||||||
|
|
||||||
if (o.order_sn == "260923-573109716621688")
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查找店铺订单并更新店铺订单状态
|
// 查找店铺订单并更新店铺订单状态
|
||||||
var orderItemExt = orderExtList.FirstOrDefault(oie => oie.out_order_id == o.order_sn && oie.buy_type == "直发");
|
var orderItemExt = orderExtList.FirstOrDefault(oie => oie.out_order_id == o.order_sn && oie.buy_type == "直发");
|
||||||
if (orderItemExt != null)
|
if (orderItemExt != null)
|
||||||
@@ -840,18 +845,20 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
|
|
||||||
bool isUpdate = false;
|
bool isUpdate = false;
|
||||||
PddBuyerOrderLiteInfo order = null;
|
PddBuyerOrderLiteInfo order = null;
|
||||||
Dispatcher.Invoke(new Action(() =>
|
lock (locker)
|
||||||
{
|
{
|
||||||
order = lstPddBuyerOrderInfoLite.FirstOrDefault(or => or.order_sn == o.order_sn);
|
order = lstPddBuyerOrderInfoLite.FirstOrDefault(or => or.order_sn == o.order_sn);
|
||||||
}));
|
}
|
||||||
|
;
|
||||||
if (order == null)
|
if (order == null)
|
||||||
{
|
{
|
||||||
order = o;
|
order = o;
|
||||||
isUpdate = true;
|
isUpdate = true;
|
||||||
Dispatcher.Invoke(new Action(() =>
|
lock (locker)
|
||||||
{
|
{
|
||||||
lstPddBuyerOrderInfoLite.Add(order);
|
lstPddBuyerOrderInfoLite.Add(order);
|
||||||
}));
|
}
|
||||||
|
;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -921,16 +928,31 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
order.wxRefundStatus = o.wxRefundStatus;
|
order.wxRefundStatus = o.wxRefundStatus;
|
||||||
order.WxOrderStatus = o.WxOrderStatus;
|
order.WxOrderStatus = o.WxOrderStatus;
|
||||||
|
|
||||||
|
lock (locker)
|
||||||
var index = lstPddBuyerOrderInfoLite.IndexOf(order);
|
|
||||||
Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
{
|
||||||
lstPddBuyerOrderInfoLite.Remove(order);
|
var index = Math.Max(0, lstPddBuyerOrderInfoLite.IndexOf(order));
|
||||||
|
lstPddBuyerOrderInfoLite.RemoveAll(o => o.order_sn == order.order_sn);
|
||||||
lstPddBuyerOrderInfoLite.Insert(index, order);
|
lstPddBuyerOrderInfoLite.Insert(index, order);
|
||||||
}));
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (lstTask.Count >= 1)
|
||||||
|
{
|
||||||
|
Thread.Sleep(100);
|
||||||
|
lstTask.RemoveAll(t => t.IsFaulted || t.IsCanceled || t.IsCompleted);
|
||||||
|
}
|
||||||
|
var t = Task.Run(() => GetCefOrder(order, isUpdate));
|
||||||
|
lstTask.Add(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
lock (locker)
|
||||||
|
{
|
||||||
|
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async Task GetCefOrder(PddBuyerOrderLiteInfo order, bool isUpdate)
|
||||||
|
{
|
||||||
if (filterOneBuyerOrder(order) == false)
|
if (filterOneBuyerOrder(order) == false)
|
||||||
{
|
{
|
||||||
Dispatcher.Invoke(new Action(() =>
|
Dispatcher.Invoke(new Action(() =>
|
||||||
@@ -991,12 +1013,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
SendTransitOrderE57(order);
|
SendTransitOrderE57(order);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (order.order_sn == "260924-431226960203223")
|
|
||||||
{
|
|
||||||
}
|
|
||||||
if (order.ShopOrderIdStr == "3739392779260688128")
|
|
||||||
{
|
|
||||||
}
|
|
||||||
if (order.WxSendTypeStr == "直发")
|
if (order.WxSendTypeStr == "直发")
|
||||||
{
|
{
|
||||||
if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill && !string.IsNullOrEmpty(order.tracking_number) && order.WxOrderStatus < 30)
|
if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill && !string.IsNullOrEmpty(order.tracking_number) && order.WxOrderStatus < 30)
|
||||||
@@ -1055,25 +1071,18 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (order.order_sn == "260924-431226960203223")
|
//// 填写取件码
|
||||||
{
|
//if (order.WxSendTypeStr == "直发")
|
||||||
|
//{
|
||||||
}
|
// if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill && !string.IsNullOrEmpty(order.tracking_number))
|
||||||
|
// {
|
||||||
// 填写取件码
|
// if (lstSyncLogistics.Any(o => o.order_id == order.order_sn))
|
||||||
if (order.WxSendTypeStr == "直发")
|
// if (lstSyncLogistics.Any(o => o.order_id == order.order_sn && (o.upload_pickup_status == 0 || o.pickup_code.IsNullOrEmpty())))
|
||||||
{
|
// SetPickUpNo(order);
|
||||||
if (GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill && !string.IsNullOrEmpty(order.tracking_number))
|
// }
|
||||||
{
|
//}
|
||||||
if (lstSyncLogistics.Any(o => o.order_id == order.order_sn))
|
|
||||||
if (lstSyncLogistics.Any(o => o.order_id == order.order_sn && (o.upload_pickup_status == 0 || o.pickup_code.IsNullOrEmpty())))
|
|
||||||
SetPickUpNo(order);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
|
||||||
}
|
|
||||||
|
|
||||||
async Task CefReadBuyerAfterSale(string url, string data)
|
async Task CefReadBuyerAfterSale(string url, string data)
|
||||||
{
|
{
|
||||||
@@ -1089,12 +1098,9 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
if (data.Contains("\"listItemVOList\":[]") || data.Contains("\"hasNextQuery\":false"))
|
if (data.Contains("\"listItemVOList\":[]") || data.Contains("\"hasNextQuery\":false"))
|
||||||
//if (!data.Contains("/complaints_new_detail.html?after_sales_id="))
|
//if (!data.Contains("/complaints_new_detail.html?after_sales_id="))
|
||||||
{
|
{
|
||||||
Dispatcher.Invoke(new Action(() =>
|
ShowBuyerOrderReadInfo(buyer, " 获取到空售后列表,退出自动滑动 ");
|
||||||
{
|
|
||||||
lblMsg.Content = buyer.buyer_name + " 获取到空售后列表,退出自动滑动 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
||||||
}));
|
|
||||||
currentReadBuyer = "";
|
currentReadBuyer = "";
|
||||||
//return;
|
return;
|
||||||
}
|
}
|
||||||
//{\"error_code\":50000,\"error_msg\":\"http error:504\"}
|
//{\"error_code\":50000,\"error_msg\":\"http error:504\"}
|
||||||
//{"errorCode":72004,"errorMsg":"","error_code":72004,"error_msg":"","result":null}
|
//{"errorCode":72004,"errorMsg":"","error_code":72004,"error_msg":"","result":null}
|
||||||
@@ -1105,14 +1111,11 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
currentReadBuyer = "";
|
currentReadBuyer = "";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
lblMsg.Content = buyer.buyer_name + " 正在获取售后列表 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
||||||
}));
|
|
||||||
|
|
||||||
var list = JsonHelper.DeserializeJsonToList<PddBuyerAfterSaleLiteInfo>(JsonHelper.JObjectParse(data)["result"]["listItemVOList"].ParseToString());
|
var list = JsonHelper.DeserializeJsonToList<PddBuyerAfterSaleLiteInfo>(JsonHelper.JObjectParse(data)["result"]["listItemVOList"].ParseToString());
|
||||||
|
|
||||||
|
//ShowBuyerOrderReadInfo(buyer, " 正在获取售后列表 " + nextQueryCreatedAt + " ");
|
||||||
|
ShowBuyerOrderReadInfo(buyer, " 正在获取售后列表 " + list?.LastOrDefault()?.orderSn + " ");
|
||||||
|
|
||||||
var out_order_nos = string.Join(",", list.Select(bo => bo.orderSn));
|
var out_order_nos = string.Join(",", list.Select(bo => bo.orderSn));
|
||||||
var transitOrderList = GetOrderTransitWarehouseInfo(out_order_nos);
|
var transitOrderList = GetOrderTransitWarehouseInfo(out_order_nos);
|
||||||
var orderExtList = GetOrderItemExtInfo(out_order_nos);
|
var orderExtList = GetOrderItemExtInfo(out_order_nos);
|
||||||
@@ -1301,10 +1304,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
|
|
||||||
if (afterSale.orderDate < DateTime.Now.AddMonths(-2).ToString("yyMMdd").ParseToInt())
|
if (afterSale.orderDate < DateTime.Now.AddMonths(-2).ToString("yyMMdd").ParseToInt())
|
||||||
{
|
{
|
||||||
Dispatcher.Invoke(new Action(() =>
|
ShowBuyerOrderReadInfo(buyer, " 近2个月售后列表获取完成,退出自动滑动 ");
|
||||||
{
|
|
||||||
lblMsg.Content = buyer.buyer_name + " 近2个月售后列表获取完成,退出自动滑动 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
||||||
}));
|
|
||||||
currentReadBuyer = "";
|
currentReadBuyer = "";
|
||||||
//return;
|
//return;
|
||||||
}
|
}
|
||||||
@@ -1507,6 +1507,10 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
if (isReadBuyerOrder)
|
if (isReadBuyerOrder)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
lock (locker)
|
||||||
|
{
|
||||||
|
lstdisctinctOrderSn.Clear();
|
||||||
|
}
|
||||||
isReadBuyerOrder = true;
|
isReadBuyerOrder = true;
|
||||||
lstPddBuyerOrderVoidAfterSaleOrderSn.Clear();
|
lstPddBuyerOrderVoidAfterSaleOrderSn.Clear();
|
||||||
|
|
||||||
@@ -1719,6 +1723,10 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
string tempOffset = "";
|
string tempOffset = "";
|
||||||
while (currentReadBuyer == readBuyer)
|
while (currentReadBuyer == readBuyer)
|
||||||
{
|
{
|
||||||
|
if (currentReadBuyer != readBuyer)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
if (isSkipNext)
|
if (isSkipNext)
|
||||||
{
|
{
|
||||||
ShowBuyerOrderReadInfo(buyer, "已跳过当前买手订单读取");
|
ShowBuyerOrderReadInfo(buyer, "已跳过当前买手订单读取");
|
||||||
@@ -1756,6 +1764,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
tempOffset = dicPddOrderOffset[buyer];
|
tempOffset = dicPddOrderOffset[buyer];
|
||||||
|
|
||||||
string jsStr = $"PDDOrders.trigger({{offset:'MO-01-{dicPddOrderOffset[buyer]}',type:{type},size:10,mode:'store'}})";
|
string jsStr = $"PDDOrders.trigger({{offset:'MO-01-{dicPddOrderOffset[buyer]}',type:{type},size:10,mode:'store'}})";
|
||||||
|
if (dicPddOrderOffset[buyer].ParseToString().StartsWith("PO-"))
|
||||||
|
jsStr = $"PDDOrders.trigger({{offset:'MO-02-{dicPddOrderOffset[buyer].Replace("PO-", "")}',type:{type},size:10,mode:'store'}})";
|
||||||
await client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
await client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
||||||
await Task.Delay(Randomx.GetId(2000, 4000));
|
await Task.Delay(Randomx.GetId(2000, 4000));
|
||||||
}
|
}
|
||||||
@@ -1855,6 +1865,10 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
|
|
||||||
void ScrollGetPddOrder()
|
void ScrollGetPddOrder()
|
||||||
{
|
{
|
||||||
|
lock (locker)
|
||||||
|
{
|
||||||
|
lstdisctinctOrderSn.Clear();
|
||||||
|
}
|
||||||
isReadBuyerOrder = true;
|
isReadBuyerOrder = true;
|
||||||
lstPddBuyerOrderVoidAfterSaleOrderSn.Clear();
|
lstPddBuyerOrderVoidAfterSaleOrderSn.Clear();
|
||||||
|
|
||||||
@@ -2203,7 +2217,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
|
|
||||||
private void ShowBuyerOrderReadInfo(BuyerLoginInfo buyer, string msg = "", List<string> selectIds = null)
|
private void ShowBuyerOrderReadInfo(BuyerLoginInfo buyer, string msg = "", List<string> selectIds = null)
|
||||||
{
|
{
|
||||||
this.LblMsgStr = buyer?.buyer_name + " " + msg + " " + DateTime.Now.ToString("yyMMdd HH:mm:ss");
|
this.LblMsgStr = buyer?.buyer_name + " " + msg + " " + DateTime.Now.ToString("yy-MM-dd HH:mm:ss");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnSendBuyerOrder_Click(object sender, RoutedEventArgs e)
|
private void btnSendBuyerOrder_Click(object sender, RoutedEventArgs e)
|
||||||
@@ -2271,7 +2285,10 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
return;
|
return;
|
||||||
//if (resetSendStatus)
|
//if (resetSendStatus)
|
||||||
// order.sendStatus = "";
|
// order.sendStatus = "";
|
||||||
|
lock(locker)
|
||||||
|
{
|
||||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
||||||
|
}
|
||||||
|
|
||||||
// 仓库处理中
|
// 仓库处理中
|
||||||
if (order.sendStatus.ParseToString().Contains("仓库处理中"))
|
if (order.sendStatus.ParseToString().Contains("仓库处理中"))
|
||||||
@@ -2506,7 +2523,10 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
if (exportRst.Contains("操作超时"))
|
if (exportRst.Contains("操作超时"))
|
||||||
{
|
{
|
||||||
order.sendStatus = "发送失败 操作超时";
|
order.sendStatus = "发送失败 操作超时";
|
||||||
|
lock (locker)
|
||||||
|
{
|
||||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
|
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
|
||||||
@@ -2543,14 +2563,20 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
order.sendStatus = "已发送待发货订单";
|
order.sendStatus = "已发送待发货订单";
|
||||||
if (order.after_sales != null)
|
if (order.after_sales != null)
|
||||||
order.sendStatus = "已发送售后订单 " + sendStatusTmp;
|
order.sendStatus = "已发送售后订单 " + sendStatusTmp;
|
||||||
|
lock (locker)
|
||||||
|
{
|
||||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
order.sendStatus = "发送失败 " + (string.IsNullOrEmpty(msg) ? data : msg);
|
order.sendStatus = "发送失败 " + (string.IsNullOrEmpty(msg) ? data : msg);
|
||||||
|
lock (locker)
|
||||||
|
{
|
||||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void SetPickUpNo(PddPickInfo pddPickInfo)
|
public void SetPickUpNo(PddPickInfo pddPickInfo)
|
||||||
{
|
{
|
||||||
@@ -2882,12 +2908,15 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
if (outOrderNo.IsNullOrEmpty())
|
if (outOrderNo.IsNullOrEmpty())
|
||||||
continue;
|
continue;
|
||||||
var afterSaleId = BaseRegex.GetStringJson(ref rstStrTmp, "afterSaleId");
|
var afterSaleId = BaseRegex.GetStringJson(ref rstStrTmp, "afterSaleId");
|
||||||
|
lock(locker)
|
||||||
|
{
|
||||||
var order = lstPddBuyerOrderInfoLite.FirstOrDefault(o => o.order_sn == outOrderNo);
|
var order = lstPddBuyerOrderInfoLite.FirstOrDefault(o => o.order_sn == outOrderNo);
|
||||||
if (order == null)
|
if (order == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
order.wxRefundStatus = order.order_status_prompt.Contains("待发货") ? "待退款" : "待退货";
|
order.wxRefundStatus = order.order_status_prompt.Contains("待发货") ? "待退款" : "待退货";
|
||||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
||||||
|
}
|
||||||
//Dispatcher.Invoke(new Action(() =>
|
//Dispatcher.Invoke(new Action(() =>
|
||||||
//{
|
//{
|
||||||
// ShowOrder(order);
|
// ShowOrder(order);
|
||||||
@@ -2955,7 +2984,10 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
var msg = BaseRegex.GetStringXml(ref refundRst, "msg");
|
var msg = BaseRegex.GetStringXml(ref refundRst, "msg");
|
||||||
order.sendStatus = "退款成功 买手退款信息更新失败,服务端返回 " + msg;
|
order.sendStatus = "退款成功 买手退款信息更新失败,服务端返回 " + msg;
|
||||||
}
|
}
|
||||||
|
lock(locker)
|
||||||
|
{
|
||||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
||||||
|
}
|
||||||
return "{\"success\":true,\"msg\":\"操作成功\"}";
|
return "{\"success\":true,\"msg\":\"操作成功\"}";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -3001,7 +3033,10 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
var msg = BaseRegex.GetStringXml(ref refundRst, "msg");
|
var msg = BaseRegex.GetStringXml(ref refundRst, "msg");
|
||||||
order.sendStatus = "退款成功 买手退款信息更新失败,服务端返回 " + msg;
|
order.sendStatus = "退款成功 买手退款信息更新失败,服务端返回 " + msg;
|
||||||
}
|
}
|
||||||
|
lock (locker)
|
||||||
|
{
|
||||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
||||||
|
}
|
||||||
return "{\"success\":true,\"msg\":\"操作成功\"}";
|
return "{\"success\":true,\"msg\":\"操作成功\"}";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
ManualUpdateBuyOrderCommand = new DelegateCommand(ManualUpdateBuyOrder);
|
ManualUpdateBuyOrderCommand = new DelegateCommand(ManualUpdateBuyOrder);
|
||||||
UpdateTransitWarehouseCommand = new DelegateCommand(UpdateTransitWarehouse);
|
UpdateTransitWarehouseCommand = new DelegateCommand(UpdateTransitWarehouse);
|
||||||
|
|
||||||
this.txtShopNameVal = orderItem.Shop.ShopAccount;
|
this.txtShopNameVal = orderItem?.ItemOrder?.Shop?.ShopAccount;
|
||||||
this.txtOrderIdVal = orderItem.order_id;
|
this.txtOrderIdVal = orderItem.order_id;
|
||||||
this.txtShopSkuIdVal = orderItem.sku_id;
|
this.txtShopSkuIdVal = orderItem.sku_id;
|
||||||
this.txtShopGoodsIdVal = orderItem.product_id;
|
this.txtShopGoodsIdVal = orderItem.product_id;
|
||||||
@@ -1222,6 +1222,11 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
if (BuyType == "direct")
|
if (BuyType == "direct")
|
||||||
{
|
{
|
||||||
#region 直发拍单
|
#region 直发拍单
|
||||||
|
if (orderItem.ItemOrder?.Shop == null)
|
||||||
|
{
|
||||||
|
this.ErrorMsg = "缺少店铺信息!";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var url = BaseClass.Build29WxObjString("order/wx_get_order_item_ext_info");
|
var url = BaseClass.Build29WxObjString("order/wx_get_order_item_ext_info");
|
||||||
var data = UserLogin.GetSignaturex();
|
var data = UserLogin.GetSignaturex();
|
||||||
@@ -1241,8 +1246,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
order_id = orderItem.order_id,
|
order_id = orderItem.order_id,
|
||||||
sku_id = orderItem.sku_id,
|
sku_id = orderItem.sku_id,
|
||||||
out_order_id = "tb_" + txtBuyOrderIdVal.Trim(),
|
out_order_id = "tb_" + txtBuyOrderIdVal.Trim(),
|
||||||
shop_app_id = orderItem.Shop.ShopId,
|
shop_app_id = orderItem.ItemOrder?.Shop?.ShopId,
|
||||||
shop_name = orderItem.Shop.ShopAccount,
|
shop_name = orderItem.ItemOrder?.Shop?.ShopAccount,
|
||||||
buy_type = "直发",
|
buy_type = "直发",
|
||||||
};
|
};
|
||||||
var url1 = BaseClass.Build29WxObjString("order/wx_add_order_item_ext_info");
|
var url1 = BaseClass.Build29WxObjString("order/wx_add_order_item_ext_info");
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
ManualUpdateBuyOrderCommand = new DelegateCommand(ManualUpdateBuyOrder);
|
ManualUpdateBuyOrderCommand = new DelegateCommand(ManualUpdateBuyOrder);
|
||||||
UpdateTransitWarehouseCommand = new DelegateCommand(UpdateTransitWarehouse);
|
UpdateTransitWarehouseCommand = new DelegateCommand(UpdateTransitWarehouse);
|
||||||
|
|
||||||
this.txtShopNameVal = orderItem.Shop.ShopAccount;
|
this.txtShopNameVal = orderItem.ItemOrder?.Shop?.ShopAccount;
|
||||||
this.txtOrderIdVal = orderItem.order_id;
|
this.txtOrderIdVal = orderItem.order_id;
|
||||||
this.txtShopSkuIdVal = orderItem.sku_id;
|
this.txtShopSkuIdVal = orderItem.sku_id;
|
||||||
this.txtShopGoodsIdVal = orderItem.product_id;
|
this.txtShopGoodsIdVal = orderItem.product_id;
|
||||||
@@ -1936,6 +1936,11 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
if (BuyType == "direct")
|
if (BuyType == "direct")
|
||||||
{
|
{
|
||||||
#region 直发拍单
|
#region 直发拍单
|
||||||
|
if (orderItem.ItemOrder?.Shop == null)
|
||||||
|
{
|
||||||
|
this.ErrorMsg = "缺少店铺信息!";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var url = BaseClass.Build29WxObjString("order/wx_get_order_item_ext_info");
|
var url = BaseClass.Build29WxObjString("order/wx_get_order_item_ext_info");
|
||||||
var data = UserLogin.GetSignaturex();
|
var data = UserLogin.GetSignaturex();
|
||||||
@@ -1955,8 +1960,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
order_id = orderItem.order_id,
|
order_id = orderItem.order_id,
|
||||||
sku_id = orderItem.sku_id,
|
sku_id = orderItem.sku_id,
|
||||||
out_order_id = "tb_" + txtBuyOrderIdVal.Trim(),
|
out_order_id = "tb_" + txtBuyOrderIdVal.Trim(),
|
||||||
shop_app_id = orderItem.Shop.ShopId,
|
shop_app_id = orderItem.ItemOrder?.Shop?.ShopId,
|
||||||
shop_name = orderItem.Shop.ShopAccount,
|
shop_name = orderItem.ItemOrder?.Shop?.ShopAccount,
|
||||||
buy_type = "直发",
|
buy_type = "直发",
|
||||||
};
|
};
|
||||||
var url1 = BaseClass.Build29WxObjString("order/wx_add_order_item_ext_info");
|
var url1 = BaseClass.Build29WxObjString("order/wx_add_order_item_ext_info");
|
||||||
|
|||||||
@@ -1270,7 +1270,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
BaseMsgWindow.ShowAnimateMessage("订单扩展信息查询失败 " + ex.Message, "Error", 5);
|
BaseMsgWindow.ShowAnimateMessage("订单扩展信息查询失败 " + ex.Message, "Error", 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (index % 5 == 0 || index >= GlobalConfig.ShopLoginList.Count - 1)
|
if (index % 10 == 0 || index >= GlobalConfig.ShopLoginList.Count - 1)
|
||||||
disPlayOrderTabOrderCount();
|
disPlayOrderTabOrderCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1628,7 +1628,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
TokenSource.Cancel();
|
TokenSource.Cancel();
|
||||||
TokenSource = new CancellationTokenSource();
|
TokenSource = new CancellationTokenSource();
|
||||||
|
|
||||||
Task.Run(() =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
var token = TokenSource.Token;
|
var token = TokenSource.Token;
|
||||||
try
|
try
|
||||||
@@ -1636,15 +1636,15 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
if (this.lbxOrder == null)
|
if (this.lbxOrder == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (token.IsCancellationRequested)
|
//if (token.IsCancellationRequested)
|
||||||
return;
|
// return;
|
||||||
Dispatcher.Invoke(new Action(() =>
|
//Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
//{
|
||||||
GlobalConfig.lstFilterOrder.Clear();
|
// GlobalConfig.lstFilterOrder.Clear();
|
||||||
//GlobalConfig.lstFilterOrder = new ObservableCollection<oms_wei_order_info>(orderLstTmp);
|
// //GlobalConfig.lstFilterOrder = new ObservableCollection<oms_wei_order_info>(orderLstTmp);
|
||||||
GlobalConfig.lstFilterOrder = new ObservableCollection<oms_wei_order_info>();
|
// GlobalConfig.lstFilterOrder = new ObservableCollection<oms_wei_order_info>();
|
||||||
this.lbxOrder.ItemsSource = GlobalConfig.lstFilterOrder;
|
// this.lbxOrder.ItemsSource = GlobalConfig.lstFilterOrder;
|
||||||
}));
|
//}));
|
||||||
|
|
||||||
if (token.IsCancellationRequested)
|
if (token.IsCancellationRequested)
|
||||||
return;
|
return;
|
||||||
@@ -1656,31 +1656,42 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
else
|
else
|
||||||
orderLstTmp = GlobalConfig.lstOrder.Where(o => !GetOrderIsFilter(o)).OrderByDescending(o => o.create_time).ToList();
|
orderLstTmp = GlobalConfig.lstOrder.Where(o => !GetOrderIsFilter(o)).OrderByDescending(o => o.create_time).ToList();
|
||||||
|
|
||||||
|
//if (token.IsCancellationRequested)
|
||||||
|
// return;
|
||||||
|
//disPlayOrderTabOrderCount();
|
||||||
|
|
||||||
|
////int n = 0;
|
||||||
|
//foreach (var order in orderLstTmp)
|
||||||
|
//{
|
||||||
|
// //if (n++ % 10 == 0)
|
||||||
|
// //Thread.Sleep(1);
|
||||||
|
|
||||||
|
// if (token.IsCancellationRequested)
|
||||||
|
// break;
|
||||||
|
|
||||||
|
// var orders = GlobalConfig.lstFilterOrder.ToList();
|
||||||
|
// if (!orders.Any(o => o.order_id == order.order_id))
|
||||||
|
// {
|
||||||
|
// Dispatcher.InvokeAsync(() =>
|
||||||
|
// {
|
||||||
|
// lock (MainWindow._orderLock)
|
||||||
|
// {
|
||||||
|
// GlobalConfig.lstFilterOrder.Add(order);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
if (token.IsCancellationRequested)
|
if (token.IsCancellationRequested)
|
||||||
return;
|
return;
|
||||||
disPlayOrderTabOrderCount();
|
await Dispatcher.InvokeAsync(new Action(() =>
|
||||||
|
{
|
||||||
|
GlobalConfig.lstFilterOrder.Clear();
|
||||||
|
GlobalConfig.lstFilterOrder = new ObservableCollection<oms_wei_order_info>(orderLstTmp);
|
||||||
|
this.lbxOrder.ItemsSource = GlobalConfig.lstFilterOrder;
|
||||||
|
}));
|
||||||
|
|
||||||
int n = 0;
|
await disPlayOrderTabOrderCount();
|
||||||
foreach (var order in orderLstTmp)
|
|
||||||
{
|
|
||||||
//if (n++ % 10 == 0)
|
|
||||||
Thread.Sleep(1);
|
|
||||||
|
|
||||||
if (token.IsCancellationRequested)
|
|
||||||
break;
|
|
||||||
|
|
||||||
var orders = GlobalConfig.lstFilterOrder.ToList();
|
|
||||||
if (!orders.Any(o => o.order_id == order.order_id))
|
|
||||||
{
|
|
||||||
Dispatcher.InvokeAsync(() =>
|
|
||||||
{
|
|
||||||
lock (MainWindow._orderLock)
|
|
||||||
{
|
|
||||||
GlobalConfig.lstFilterOrder.Add(order);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -2306,9 +2317,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
{
|
{
|
||||||
if (this.IsLoaded)
|
if (this.IsLoaded)
|
||||||
{
|
{
|
||||||
GlobalConfig.lstFilterOrder.Clear();
|
//GlobalConfig.lstFilterOrder.Clear();
|
||||||
GlobalConfig.lstFilterOrder = new ObservableCollection<oms_wei_order_info>();
|
//GlobalConfig.lstFilterOrder = new ObservableCollection<oms_wei_order_info>();
|
||||||
this.lbxOrder.ItemsSource = GlobalConfig.lstFilterOrder;
|
//this.lbxOrder.ItemsSource = GlobalConfig.lstFilterOrder;
|
||||||
|
|
||||||
dgHeaderTime.Header = ColumnHeaderTitle = "交易时间 ▼";
|
dgHeaderTime.Header = ColumnHeaderTitle = "交易时间 ▼";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -430,9 +430,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
{
|
{
|
||||||
var url = BaseClass.Build29WxObjString("shop/get_shop_erp_merchant");
|
var url = BaseClass.Build29WxObjString("shop/get_shop_erp_merchant");
|
||||||
var data = UserLogin.GetSignaturex();
|
var data = UserLogin.GetSignaturex();
|
||||||
data += "&corporate_account_user_id=" + orderItem.Shop.ErpCorporateAccountUserId;
|
data += "&corporate_account_user_id=" + orderItem.ItemOrder.Shop.ErpCorporateAccountUserId;
|
||||||
data += "&manage_user_id=" + orderItem.Shop.ErpManageUserId;
|
data += "&manage_user_id=" + orderItem.ItemOrder.Shop.ErpManageUserId;
|
||||||
data += "&shop_id=" + orderItem.Shop.ErpShopId;
|
data += "&shop_id=" + orderItem.ItemOrder.Shop.ErpShopId;
|
||||||
var html = GetHtml.PostUtf8(url, data);
|
var html = GetHtml.PostUtf8(url, data);
|
||||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||||
html = GetHtml.PostUtf8(url, data);
|
html = GetHtml.PostUtf8(url, data);
|
||||||
@@ -477,9 +477,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
|
|
||||||
if (orderItem.BuyGoodsBtnTxt == "去店铺后台绑定代发")
|
if (orderItem.BuyGoodsBtnTxt == "去店铺后台绑定代发")
|
||||||
{
|
{
|
||||||
if (orderItem.Shop != null)
|
if (orderItem.ItemOrder.Shop != null)
|
||||||
{
|
{
|
||||||
WXShopLoginForm shopLoginForm = new WXShopLoginForm(orderItem.Shop);
|
WXShopLoginForm shopLoginForm = new WXShopLoginForm(orderItem.ItemOrder.Shop);
|
||||||
shopLoginForm.openType = Work._29Tools.Forms.ShopForms.EnumOpenType.manage;
|
shopLoginForm.openType = Work._29Tools.Forms.ShopForms.EnumOpenType.manage;
|
||||||
shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||||
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/supply/consignmentOrderList";
|
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/supply/consignmentOrderList";
|
||||||
@@ -504,9 +504,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
// 掉线提示重登
|
// 掉线提示重登
|
||||||
if (orderItem.Shop?.LoginStatus != "登录成功")
|
if (orderItem.ItemOrder?.Shop?.LoginStatus != "登录成功")
|
||||||
{
|
{
|
||||||
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
|
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.ItemOrder?.Shop?.ErpShopId).ToList())
|
||||||
{
|
{
|
||||||
// 更新代发管理情况
|
// 更新代发管理情况
|
||||||
foreach (var oi in ord.orderItems)
|
foreach (var oi in ord.orderItems)
|
||||||
@@ -707,7 +707,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// 查询代发列表
|
// 查询代发列表
|
||||||
var apiSearchDropship = new WxApiBLL().WxApiDropshipSearch(orderItem.Shop, orderItem.order_id, 100);
|
var apiSearchDropship = new WxApiBLL().WxApiDropshipSearch(orderItem.ItemOrder.Shop, orderItem.order_id, 100);
|
||||||
if (!apiSearchDropship.Contains("\"errcode\":0"))
|
if (!apiSearchDropship.Contains("\"errcode\":0"))
|
||||||
throw new Exception("查询代发失败!" + BaseRegex.GetStringJsonByRegs(ref apiSearchDropship, apiSearchDropship, "msg", "errmsg"));
|
throw new Exception("查询代发失败!" + BaseRegex.GetStringJsonByRegs(ref apiSearchDropship, apiSearchDropship, "msg", "errmsg"));
|
||||||
|
|
||||||
@@ -718,7 +718,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(dsOrderId))
|
if (!string.IsNullOrEmpty(dsOrderId))
|
||||||
{
|
{
|
||||||
var apiCancelDropship = await new WxApiBLL().WxApiDropshipCancel(orderItem.Shop, orderItem.ItemOrder, dsOrderId);
|
var apiCancelDropship = await new WxApiBLL().WxApiDropshipCancel(orderItem.ItemOrder.Shop, orderItem.ItemOrder, dsOrderId);
|
||||||
if (!apiCancelDropship.Contains("\"errcode\":0"))
|
if (!apiCancelDropship.Contains("\"errcode\":0"))
|
||||||
{
|
{
|
||||||
var errMsg = BaseRegex.GetStringJsonByRegs(ref apiCancelDropship, apiCancelDropship, "msg", "errmsg");
|
var errMsg = BaseRegex.GetStringJsonByRegs(ref apiCancelDropship, apiCancelDropship, "msg", "errmsg");
|
||||||
@@ -732,7 +732,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
if (!string.IsNullOrEmpty(dsOrderId))
|
if (!string.IsNullOrEmpty(dsOrderId))
|
||||||
{
|
{
|
||||||
// 查询代发详情
|
// 查询代发详情
|
||||||
var apiSearchDropshipDetail = new WxApiBLL().WxApiDropshipSearchDetail(orderItem.Shop, dsOrderId);
|
var apiSearchDropshipDetail = new WxApiBLL().WxApiDropshipSearchDetail(orderItem.ItemOrder.Shop, dsOrderId);
|
||||||
if (!apiSearchDropshipDetail.Contains("\"errcode\":0"))
|
if (!apiSearchDropshipDetail.Contains("\"errcode\":0"))
|
||||||
throw new Exception("查询代发失详情失败!" + BaseRegex.GetStringJson(ref apiSearchDropshipDetail, "msg"));
|
throw new Exception("查询代发失详情失败!" + BaseRegex.GetStringJson(ref apiSearchDropshipDetail, "msg"));
|
||||||
|
|
||||||
@@ -741,7 +741,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
if (!string.IsNullOrEmpty(supplierId) && !supplierId.Contains(targetSupplierId) && !supplierName.Contains(targetSupplierName))
|
if (!string.IsNullOrEmpty(supplierId) && !supplierId.Contains(targetSupplierId) && !supplierName.Contains(targetSupplierName))
|
||||||
{
|
{
|
||||||
// 取消代发
|
// 取消代发
|
||||||
var apiCancelDropship = await new WxApiBLL().WxApiDropshipCancel(orderItem.Shop, orderItem.ItemOrder, dsOrderId);
|
var apiCancelDropship = await new WxApiBLL().WxApiDropshipCancel(orderItem.ItemOrder.Shop, orderItem.ItemOrder, dsOrderId);
|
||||||
if (!apiCancelDropship.Contains("\"errcode\":0"))
|
if (!apiCancelDropship.Contains("\"errcode\":0"))
|
||||||
{
|
{
|
||||||
var errMsg = BaseRegex.GetStringJsonByRegs(ref apiCancelDropship, apiCancelDropship, "msg", "errmsg");
|
var errMsg = BaseRegex.GetStringJsonByRegs(ref apiCancelDropship, apiCancelDropship, "msg", "errmsg");
|
||||||
@@ -757,7 +757,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
if (!supplierId.Contains(targetSupplierId) && !supplierName.Contains(targetSupplierName))
|
if (!supplierId.Contains(targetSupplierId) && !supplierName.Contains(targetSupplierName))
|
||||||
{
|
{
|
||||||
// 设置29供货商代发wxfc630d60a1af6c6f或其他代发
|
// 设置29供货商代发wxfc630d60a1af6c6f或其他代发
|
||||||
var apiAddDropship = new WxApiBLL().WxApiDropshipAssign(orderItem.Shop, orderItem.order_id, orderItem.product_id, orderItem.sku_id, orderItem.sku_cnt.ParseToInt(), targetSupplierId);
|
var apiAddDropship = new WxApiBLL().WxApiDropshipAssign(orderItem.ItemOrder.Shop, orderItem.order_id, orderItem.product_id, orderItem.sku_id, orderItem.sku_cnt.ParseToInt(), targetSupplierId);
|
||||||
if (!apiAddDropship.Contains("\"errcode\":0"))
|
if (!apiAddDropship.Contains("\"errcode\":0"))
|
||||||
{
|
{
|
||||||
throw new Exception("设置代发失败!请确认商品已加入" + targetSupplierName + "代发!" + BaseRegex.GetStringJson(ref apiAddDropship, "msg"));
|
throw new Exception("设置代发失败!请确认商品已加入" + targetSupplierName + "代发!" + BaseRegex.GetStringJson(ref apiAddDropship, "msg"));
|
||||||
@@ -1786,7 +1786,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var rst = await WxApiBLL.WxSearchAndDropshipCancelAsync(orderItem.Shop, orderItem.ItemOrder);
|
var rst = await WxApiBLL.WxSearchAndDropshipCancelAsync(orderItem.ItemOrder.Shop, orderItem.ItemOrder);
|
||||||
if (rst == "success")
|
if (rst == "success")
|
||||||
{
|
{
|
||||||
var ret = await MainWindow.Instance.orderListCtrl._shipGiftService.Send(orderItem.order_id, giftType);
|
var ret = await MainWindow.Instance.orderListCtrl._shipGiftService.Send(orderItem.order_id, giftType);
|
||||||
@@ -1938,7 +1938,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
{
|
{
|
||||||
if (this.DataContext is oms_wei_order_item_info orderItem)
|
if (this.DataContext is oms_wei_order_item_info orderItem)
|
||||||
{
|
{
|
||||||
WXOrderListOptimizeForm form = new WXOrderListOptimizeForm(orderItem.Shop);
|
WXOrderListOptimizeForm form = new WXOrderListOptimizeForm(orderItem.ItemOrder.Shop);
|
||||||
form.lblOrderId.Text = orderItem.order_id;
|
form.lblOrderId.Text = orderItem.order_id;
|
||||||
form.lblSpuId.Text = orderItem.product_id;
|
form.lblSpuId.Text = orderItem.product_id;
|
||||||
form.lblSkuId.Text = orderItem.sku_id; // skuId
|
form.lblSkuId.Text = orderItem.sku_id; // skuId
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace _29WxOrderWpf.ViewModels
|
|||||||
{
|
{
|
||||||
IsChangeingPickNo = false;
|
IsChangeingPickNo = false;
|
||||||
string orderId = OrderItem.order_id;
|
string orderId = OrderItem.order_id;
|
||||||
ShopLoginInfo shop = OrderItem.Shop;
|
ShopLoginInfo shop = OrderItem.ItemOrder.Shop;
|
||||||
if (string.IsNullOrEmpty(PickNo))
|
if (string.IsNullOrEmpty(PickNo))
|
||||||
{
|
{
|
||||||
BaseMsgWindow.ShowInfo("取件码不能为空");
|
BaseMsgWindow.ShowInfo("取件码不能为空");
|
||||||
|
|||||||
@@ -286,21 +286,21 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
|||||||
|
|
||||||
string url = HttpResponseTransitWorkOrderBLL.WorkOrderUrl + "/api/open/v1/customer-work-orders/intercept-return-cloud-warehouse-after-outbound";
|
string url = HttpResponseTransitWorkOrderBLL.WorkOrderUrl + "/api/open/v1/customer-work-orders/intercept-return-cloud-warehouse-after-outbound";
|
||||||
JObject obj = new JObject();
|
JObject obj = new JObject();
|
||||||
obj["appId"] = this.OrderItem.Shop?.ShopId;
|
obj["appId"] = this.OrderItem.ItemOrder?.Shop?.ShopId;
|
||||||
obj["wechatOrderNo"] = this.OrderItem.order_id;
|
obj["wechatOrderNo"] = this.OrderItem.order_id;
|
||||||
//obj["purchaseOrderNo"] = this.OrderItem.PddBuyerAfterSale?.orderSn;
|
//obj["purchaseOrderNo"] = this.OrderItem.PddBuyerAfterSale?.orderSn;
|
||||||
obj["purchaseOrderNo"] = TransitOrder?.order_code;
|
obj["purchaseOrderNo"] = TransitOrder?.order_code;
|
||||||
obj["creator"] = BaseClass.UserName;
|
obj["creator"] = BaseClass.UserName;
|
||||||
obj["remark"] = "客户要求拦截并退回云仓";
|
obj["remark"] = "客户要求拦截并退回云仓";
|
||||||
|
|
||||||
var rst = HttpResponseTransitWorkOrderBLL.PostResponse(this.OrderItem.Shop, url, JsonHelper.SerializeObject(obj), "");
|
var rst = HttpResponseTransitWorkOrderBLL.PostResponse(this.OrderItem.ItemOrder?.Shop, url, JsonHelper.SerializeObject(obj), "");
|
||||||
return rst;
|
return rst;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<string> GetWorkOrder()
|
public async Task<string> GetWorkOrder()
|
||||||
{
|
{
|
||||||
string url = HttpResponseTransitWorkOrderBLL.WorkOrderUrl + "/api/open/v1/customer-work-orders?wechatOrderNo=" + this.OrderItem.order_id;
|
string url = HttpResponseTransitWorkOrderBLL.WorkOrderUrl + "/api/open/v1/customer-work-orders?wechatOrderNo=" + this.OrderItem.order_id;
|
||||||
var rst = await HttpResponseTransitWorkOrderBLL.GetResponseAsync(this.OrderItem.Shop, url, "");
|
var rst = await HttpResponseTransitWorkOrderBLL.GetResponseAsync(this.OrderItem.ItemOrder?.Shop, url, "");
|
||||||
return rst;
|
return rst;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,14 +20,14 @@ namespace AllBase.Model.DBModel
|
|||||||
{
|
{
|
||||||
public class oms_wei_order_item_info : PropertyNotifyObject
|
public class oms_wei_order_item_info : PropertyNotifyObject
|
||||||
{
|
{
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 订单对应店铺
|
///// 订单对应店铺
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public ShopLoginInfo Shop
|
//public ShopLoginInfo Shop
|
||||||
{
|
//{
|
||||||
get { return this.GetValue(x => x.Shop); }
|
// get { return this.GetValue(x => x.Shop); }
|
||||||
set { this.SetValue(x => x.Shop, value); }
|
// set { this.SetValue(x => x.Shop, value); }
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单扩展信息
|
/// 订单扩展信息
|
||||||
@@ -1747,7 +1747,7 @@ namespace AllBase.Model.DBModel
|
|||||||
public void UpdateOrderItemBuyButton()
|
public void UpdateOrderItemBuyButton()
|
||||||
{
|
{
|
||||||
var order_item = this;
|
var order_item = this;
|
||||||
order_item.Shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order_item.shop_id.ParseToString());
|
var Shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order_item.shop_id.ParseToString());
|
||||||
|
|
||||||
// 关联商品sku
|
// 关联商品sku
|
||||||
if (GlobalConfig.CurrentBuyPlatform == "pdd")
|
if (GlobalConfig.CurrentBuyPlatform == "pdd")
|
||||||
|
|||||||
@@ -1599,6 +1599,15 @@ namespace TemuKJD.ToolForms
|
|||||||
{
|
{
|
||||||
#region 直发拍单
|
#region 直发拍单
|
||||||
|
|
||||||
|
if (orderItem.ItemOrder?.Shop == null)
|
||||||
|
{
|
||||||
|
if (!IsAutoBuy)
|
||||||
|
BaseMsgForm.ShowError("缺少店铺信息!");
|
||||||
|
else
|
||||||
|
Invoke(() => { lblErrMsg.Text = "缺少店铺信息!"; });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var url = BaseClass.Build29WxObjString("order/wx_get_order_item_ext_info");
|
var url = BaseClass.Build29WxObjString("order/wx_get_order_item_ext_info");
|
||||||
var data = UserLogin.GetSignaturex();
|
var data = UserLogin.GetSignaturex();
|
||||||
data += "&wx_order_id_in=" + orderItem.order_id;
|
data += "&wx_order_id_in=" + orderItem.order_id;
|
||||||
@@ -1620,8 +1629,8 @@ namespace TemuKJD.ToolForms
|
|||||||
order_id = orderItem.order_id,
|
order_id = orderItem.order_id,
|
||||||
sku_id = orderItem.sku_id,
|
sku_id = orderItem.sku_id,
|
||||||
out_order_id = txtBuyOrderId.Text.Trim(),
|
out_order_id = txtBuyOrderId.Text.Trim(),
|
||||||
shop_app_id = orderItem.Shop.ShopId,
|
shop_app_id = orderItem.ItemOrder?.Shop?.ShopId,
|
||||||
shop_name = orderItem.Shop.ShopAccount,
|
shop_name = orderItem.ItemOrder?.Shop?.ShopAccount,
|
||||||
buy_type = "直发",
|
buy_type = "直发",
|
||||||
};
|
};
|
||||||
var url1 = BaseClass.Build29WxObjString("order/wx_add_order_item_ext_info");
|
var url1 = BaseClass.Build29WxObjString("order/wx_add_order_item_ext_info");
|
||||||
|
|||||||
Reference in new issue
Block a user