中转仓订单中间状态优化
This commit is contained in:
1 parent
3a07409f5f
commit
e4e8f7166c
9 files changed
+489
-225
No files matched your search
@@ -48,11 +48,11 @@
|
||||
|
||||
|
||||
<usercontrols:UcWaterMarkTextBox
|
||||
x:Name="txtOrderId"
|
||||
x:Name="txtFilterOrderId"
|
||||
Grid.Column="0"
|
||||
Height="28"
|
||||
Margin="0,0,8,0"
|
||||
WaterMark="店铺单号" />
|
||||
WaterMark="店铺单号" TextChanged="txtOrderId_TextChanged" />
|
||||
|
||||
<usercontrols:UcWaterMarkTextBox
|
||||
x:Name="txtSearchAll"
|
||||
|
||||
@@ -13,6 +13,7 @@ using AllBase.Model.Result;
|
||||
using AllBase.Util;
|
||||
using CefSharp.DevTools.Autofill;
|
||||
using CefSharp.DevTools.FedCm;
|
||||
using NaiBa.Util;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -40,6 +41,7 @@ using TemuKJD.ToolForms;
|
||||
using Work;
|
||||
using Work._29Tools.BLL;
|
||||
using Work.BuyUsers;
|
||||
using WPFCommon.Helpers;
|
||||
using static _29WxOrderWpf.Services.ShipGiftService;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
@@ -52,12 +54,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
public CheckBox chkSelectAll = null;
|
||||
public OrderFilterConfig orderFilterConfig = null;
|
||||
|
||||
public bool IsAutoReadOrder = true;
|
||||
public DateTime nextGetOrderTime = DateTime.MinValue;
|
||||
|
||||
public string strSearchAll = "";
|
||||
public List<string> lstFilterText { get; set; }
|
||||
public string strSearchAll { get; set; } = "";
|
||||
public ConcurrentList<string> lstFilterOrderIds { get; set; } = new ConcurrentList<string>();
|
||||
public ConcurrentList<string> lstFilterRemarkText { get; set; } = new ConcurrentList<string>();
|
||||
public ShipGiftService _shipGiftService { get; }
|
||||
public OrderListCtrl()
|
||||
{
|
||||
@@ -131,9 +133,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
public bool hasReadOrder = false;
|
||||
/// <summary>
|
||||
///
|
||||
/// 批量拉取订单
|
||||
/// </summary>
|
||||
/// <param name="filterGetCondition">按过滤条件读取读取服务端订单</param>
|
||||
/// <param name="filterGetCondition">按过滤条件读取读取服务端订单,已废弃</param>
|
||||
public void GetOrder(string orderIds = "", bool filterGetCondition = false)
|
||||
{
|
||||
while (!MainWindow.Instance.hasReadShop)
|
||||
@@ -178,21 +180,25 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
data += "&erp_shop_id_in=" + shop_id;
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
// 按过滤条件读取
|
||||
if (filterGetCondition)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(txtShopName.Text.Trim()))
|
||||
{
|
||||
var shopNames = txtShopName.Text.Trim().Split(';').Where(s => !s.IsNullOrEmpty()).ToList();
|
||||
shop_id = string.Join(",", GlobalConfig.ShopLoginList.Where(s => shopNames.Contains(s.ShopAccount)).Select(s => s.ErpShopId).Where(s => !s.IsNullOrEmpty()));
|
||||
}
|
||||
}
|
||||
// 按过滤条件读取 已废弃
|
||||
//if (filterGetCondition)
|
||||
//{
|
||||
// if (!string.IsNullOrEmpty(txtShopName.Text.Trim()))
|
||||
// {
|
||||
// var shopNames = txtShopName.Text.Trim().Split(';').Where(s => !s.IsNullOrEmpty()).ToList();
|
||||
// shop_id = string.Join(",", GlobalConfig.ShopLoginList.Where(s => shopNames.Contains(s.ShopAccount)).Select(s => s.ErpShopId).Where(s => !s.IsNullOrEmpty()));
|
||||
// }
|
||||
//}
|
||||
var startTime = BaseClass.DateTimeToTimestampSeconds(dateStart.SelectedDate.Value);
|
||||
var endTime = BaseClass.DateTimeToTimestampSeconds(dateEnd.SelectedDate.Value.AddDays(1));
|
||||
if (!chkEndDate.IsChecked.ParseToBool())
|
||||
endTime = BaseClass.DateTimeToTimestampSeconds(DateTime.Now.Date.AddDays(1));
|
||||
data += "&start_time=" + startTime;
|
||||
data += "&end_time=" + endTime;
|
||||
// 查询单一订单号订单,不按时间范围搜索
|
||||
if (string.IsNullOrEmpty(orderIds) || orderIds.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList().Count != 1)
|
||||
{
|
||||
data += "&start_time=" + startTime;
|
||||
data += "&end_time=" + endTime;
|
||||
}
|
||||
}));
|
||||
Thread.Sleep(200);
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
@@ -230,7 +236,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
foreach (var oie in orderItemExts)
|
||||
{
|
||||
// 移除订单物流异常信息,每次批量读单最后要去微信获取
|
||||
oie.abnormal_text = "";
|
||||
// 改为后台模拟读取不存在则设置为 ""
|
||||
//oie.abnormal_text = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,6 +377,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
if (string.IsNullOrEmpty(orderIds))
|
||||
AutoUpdateTransitPackageToPddShop();
|
||||
|
||||
if (string.IsNullOrEmpty(orderIds))
|
||||
Task.Run(DoReturnOrderBuyerRefendSlient);
|
||||
|
||||
if (string.IsNullOrEmpty(orderIds))
|
||||
hasReadOrder = true;
|
||||
|
||||
@@ -988,15 +998,15 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
if (order == null)
|
||||
return true;
|
||||
|
||||
if (order.order_id == "3738456804637165312")
|
||||
if (order.order_id == "3735242250991331072")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// 过滤id
|
||||
if (!string.IsNullOrEmpty(txtOrderId.Text.Trim()))
|
||||
if (lstFilterOrderIds.Count > 0)
|
||||
{
|
||||
if (!(";" + txtOrderId.Text.Trim().Replace(' ', ';').Replace(',', ';') + ";").Contains(";" + order.order_id + ";"))
|
||||
if (!lstFilterOrderIds.Contains(order.order_id))
|
||||
return true;
|
||||
}
|
||||
// 其他一级过滤选项
|
||||
@@ -1064,13 +1074,13 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
if (comboBoxItem.Content is TextBlock tb)
|
||||
{
|
||||
if (tb.Text == "店铺备注包含" && !lstFilterText.Contains(order.shop_remark))
|
||||
if (tb.Text == "店铺备注包含" && !lstFilterRemarkText.Contains(order.shop_remark))
|
||||
return true;
|
||||
else if (tb.Text == "软件备注包含" && !lstFilterText.Contains(order.soft_remark))
|
||||
else if (tb.Text == "软件备注包含" && !lstFilterRemarkText.Contains(order.soft_remark))
|
||||
return true;
|
||||
else if (tb.Text == "店铺备注不含" && lstFilterText.Contains(order.shop_remark))
|
||||
else if (tb.Text == "店铺备注不含" && lstFilterRemarkText.Contains(order.shop_remark))
|
||||
return true;
|
||||
else if (tb.Text == "软件备注不含" && lstFilterText.Contains(order.soft_remark))
|
||||
else if (tb.Text == "软件备注不含" && lstFilterRemarkText.Contains(order.soft_remark))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1254,8 +1264,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
});
|
||||
}
|
||||
|
||||
private void btnFilter_Click(object sender, RoutedEventArgs e)
|
||||
private async void btnFilter_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (lstFilterOrderIds.Count == 1 && !GlobalConfig.lstOrder.Any(o => o.order_id == lstFilterOrderIds.FirstOrDefault()))
|
||||
{
|
||||
await Task.Run(() => { this.GetOrder(lstFilterOrderIds.FirstOrDefault()); });
|
||||
}
|
||||
FilterOrders();
|
||||
}
|
||||
|
||||
@@ -1493,21 +1507,32 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
private async void btnBatchRefund_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var orders = GlobalConfig.lstFilterOrder.Where(o => o.IsSelect == true);
|
||||
var orders = GlobalConfig.lstFilterOrder.Where(o => o.IsSelect == true && o.IsEmergency);
|
||||
List<oms_wei_order_item_info> tmpOrderItems = new List<oms_wei_order_item_info>();
|
||||
foreach (var order in orders)
|
||||
{
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
if (orderItem.ItemOrder?.OrderBuyType == "云仓")
|
||||
if (orderItem != null && !string.IsNullOrEmpty(orderItem.ItemTransitOrderWithVoid?.out_order_no) && orderItem.PddBuyerAfterSaleAddressStr.IsNullOrEmpty() &&
|
||||
if (orderItem?.ItemOrder?.OrderBuyType == "云仓")
|
||||
{
|
||||
if (!string.IsNullOrEmpty(orderItem.ItemTransitOrderWithVoid?.out_order_no) && orderItem.PddBuyerAfterSaleAddressStr.IsNullOrEmpty() &&
|
||||
(orderItem.TransitRefundStatusStr.Contains("需手动申请售后") || orderItem.TransitRefundStatusStr.Contains("待用户发货")))
|
||||
tmpOrderItems.Add(orderItem);
|
||||
}
|
||||
|
||||
if (orderItem.ItemOrder?.OrderBuyType == "直发" || orderItem.ItemOrder?.OrderBuyType == "云改直")
|
||||
if (orderItem != null && !string.IsNullOrEmpty(orderItem.ItemOrder?.out_order_no) && orderItem.PddBuyerAfterSaleAddressStr.IsNullOrEmpty() &&
|
||||
if (orderItem?.ItemOrder?.OrderBuyType == "直发")
|
||||
{
|
||||
if (orderItem != null && !string.IsNullOrEmpty(orderItem.ItemOrder?.out_order_no) && orderItem.DirectPddBuyerAfterSaleAddressStr.IsNullOrEmpty() &&
|
||||
((orderItem.ItemOrder?.out_after_sale_status).ParseToString().Contains("需手动申请售后") || (orderItem.ItemOrder?.out_after_sale_status).ParseToString().Contains("待用户发货")))
|
||||
tmpOrderItems.Add(orderItem);
|
||||
}
|
||||
// 云改直有两个买手单,暂时只处理直发的,云仓默认已退款
|
||||
if (orderItem?.ItemOrder?.OrderBuyType == "云改直")
|
||||
{
|
||||
if (orderItem != null && !string.IsNullOrEmpty(orderItem.ItemOrder?.out_order_no) && orderItem.DirectPddBuyerAfterSaleAddressStr.IsNullOrEmpty() &&
|
||||
((orderItem.ItemOrder?.out_after_sale_status).ParseToString().Contains("需手动申请售后") || (orderItem.ItemOrder?.out_after_sale_status).ParseToString().Contains("待用户发货")))
|
||||
tmpOrderItems.Add(orderItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tmpOrderItems.Count == 0)
|
||||
@@ -1516,185 +1541,313 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
return;
|
||||
}
|
||||
|
||||
await Task.Run(() =>
|
||||
await DoBuyerRefend(tmpOrderItems);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自动拒收 小兰做,维护数据库,软件负责展示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task DoRejectSlient()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 中转仓拦截退货包裹
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task DoReturnPackageBuyerRefendSlient()
|
||||
{
|
||||
List<oms_wei_order_info> emergencyRefundOrders = new List<oms_wei_order_info>();
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
int index = 0;
|
||||
foreach (var tmpOrderItem in tmpOrderItems)
|
||||
emergencyRefundOrders = GlobalConfig.lstOrder.Where(o => o.IsEmergency).ToList();
|
||||
}));
|
||||
List<oms_wei_order_item_info> tmpOrderItems = new List<oms_wei_order_item_info>();
|
||||
foreach (var order in emergencyRefundOrders)
|
||||
{
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() => { BottomMsg = "正在处理买手退货,总计:" + tmpOrderItems.Count + ",已处理:" + index++; }));
|
||||
|
||||
var pddOrderSn = "";
|
||||
if (tmpOrderItem.ItemOrder?.OrderBuyType == "云仓")
|
||||
pddOrderSn = tmpOrderItem.ItemTransitOrderWithVoid?.out_order_no;
|
||||
else if (tmpOrderItem.ItemOrder?.OrderBuyType == "直发" || tmpOrderItem.ItemOrder?.OrderBuyType == "云改直")
|
||||
pddOrderSn = tmpOrderItem.ItemOrder?.out_order_no;
|
||||
|
||||
BuyerLoginInfo buyer = null;
|
||||
if (tmpOrderItem.ItemOrder?.OrderBuyType == "云仓")
|
||||
Dispatcher.Invoke(new Action(() => { buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => b.buyer_nick == tmpOrderItem.ItemTransitOrderWithVoid.buyer_account); }));
|
||||
else if (tmpOrderItem.ItemOrder?.OrderBuyType == "直发" || tmpOrderItem.ItemOrder?.OrderBuyType == "云改直")
|
||||
Dispatcher.Invoke(new Action(() => { buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => b.buyer_nick == tmpOrderItem.ItemOrder?.out_account); }));
|
||||
if (buyer == null)
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("买手单:" + pddOrderSn + " 买手不在当前账户下,跳过", "Error", 3);
|
||||
}
|
||||
|
||||
// 检测一下买手号
|
||||
if (buyer.status == "在线")
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(buyer);
|
||||
}
|
||||
if (buyer.status != "在线")
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("买手单:" + pddOrderSn + " 买手号掉线,跳过", "Error", 3);
|
||||
// 用户仅退款的,拦截并退回总店,已到仓后自动去拼多多申请退货退款
|
||||
if (orderItem.ItemRefund?.type != "REFUND")
|
||||
continue;
|
||||
}
|
||||
|
||||
MainWindow.Instance.orderListCtrl.GetOrder(tmpOrderItem.order_id);
|
||||
|
||||
oms_wei_order_info order = null;
|
||||
Dispatcher.Invoke(new Action(() => { order = GlobalConfig.lstOrder.FirstOrDefault(oi => oi.order_id == tmpOrderItem.order_id); }));
|
||||
if (order == null)
|
||||
continue;
|
||||
oms_wei_order_item_info orderItem = null;
|
||||
Dispatcher.Invoke(new Action(() => { orderItem = order.orderItems.FirstOrDefault(oi => oi.order_id == tmpOrderItem.order_id && oi.sku_id == tmpOrderItem.sku_id); }));
|
||||
if (orderItem == null)
|
||||
if (orderItem.ItemTransitOrder?.warehouse_status != 3)
|
||||
continue;
|
||||
|
||||
string refundStatusStr = "";
|
||||
string outOrderNo = "";
|
||||
if (order.OrderBuyType == "云仓")
|
||||
if (orderItem?.ItemOrder?.OrderBuyType == "云仓")
|
||||
{
|
||||
outOrderNo = (orderItem.ItemTransitOrderWithVoid?.out_order_no).ParseToString();
|
||||
refundStatusStr = (orderItem?.TransitRefundStatusStr).ParseToString();
|
||||
if (!string.IsNullOrEmpty(orderItem.ItemTransitOrderWithVoid?.out_order_no) && orderItem.PddBuyerAfterSaleAddressStr.IsNullOrEmpty() &&
|
||||
(orderItem.TransitRefundStatusStr.Contains("需手动申请售后") || orderItem.TransitRefundStatusStr.Contains("待用户发货")))
|
||||
tmpOrderItems.Add(orderItem);
|
||||
}
|
||||
else if (order.OrderBuyType == "直发" || order.OrderBuyType == "云改直")
|
||||
{
|
||||
outOrderNo = (order.out_order_no).ParseToString();
|
||||
refundStatusStr = (order.out_after_sale_status).ParseToString();
|
||||
}
|
||||
if (orderItem == null || string.IsNullOrEmpty(outOrderNo) || !orderItem.PddBuyerAfterSaleAddressStr.IsNullOrEmpty() ||
|
||||
(!refundStatusStr.Contains("需手动申请售后") && !refundStatusStr.Contains("待用户发货")))
|
||||
}
|
||||
}
|
||||
if (tmpOrderItems.Count > 0)
|
||||
await DoBuyerRefend(tmpOrderItems);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 退货仓退货
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task DoReturnOrderBuyerRefendSlient()
|
||||
{
|
||||
List<oms_wei_order_info> emergencyRefundOrders = new List<oms_wei_order_info>();
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
emergencyRefundOrders = GlobalConfig.lstOrder.Where(o => o.IsEmergency).ToList();
|
||||
}));
|
||||
List<oms_wei_order_item_info> tmpOrderItems = new List<oms_wei_order_item_info>();
|
||||
foreach (var order in emergencyRefundOrders)
|
||||
{
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
// 退货地址是退货仓的,直接申请退货退款,取到地址后直接去填写退货仓退货信息
|
||||
if (orderItem.ItemRefund?.return_detail != GlobalConfig.TransitReturnOrderReturnAddress)
|
||||
continue;
|
||||
|
||||
PddBuyerOrderLiteInfo pddBuyerOrderLiteInfo = new PddBuyerOrderLiteInfo();
|
||||
pddBuyerOrderLiteInfo.ShopOrderIdStr = orderItem.order_id;
|
||||
pddBuyerOrderLiteInfo.order_sn = pddOrderSn;
|
||||
|
||||
if (order.OrderBuyType == "云仓")
|
||||
pddBuyerOrderLiteInfo.order_amount = orderItem.ItemTransitOrderWithVoid?.out_amount;
|
||||
else if (order.OrderBuyType == "直发" || order.OrderBuyType == "云改直")
|
||||
pddBuyerOrderLiteInfo.order_amount = order.out_amount;
|
||||
|
||||
order_pdd_buyer_after_sale pddBuyerAfterSale = new order_pdd_buyer_after_sale()
|
||||
if (orderItem?.ItemOrder?.OrderBuyType == "云仓")
|
||||
{
|
||||
wx_order_id = orderItem.order_id,
|
||||
wx_sku_id = orderItem.sku_id,
|
||||
TransitCreateTime = orderItem.ItemTransitOrderWithVoid?.created_time == null ? DateTime.MinValue : orderItem.ItemTransitOrderWithVoid.created_time,
|
||||
pre_allocated_order_no = orderItem.ItemTransitOrderWithVoid?.pre_allocated_order_no,
|
||||
buyerId = buyer.buyer_id,
|
||||
buyerName = buyer.buyer_name,
|
||||
orderSn = pddOrderSn,
|
||||
orderAmount = pddBuyerOrderLiteInfo.order_amount,
|
||||
refundAmount = pddBuyerOrderLiteInfo.order_amount,
|
||||
orderDate = pddOrderSn.ParseToString().Split('-').FirstOrDefault().ParseToInt(),
|
||||
};
|
||||
if (orderItem.PddBuyerAfterSale != null)
|
||||
pddBuyerAfterSale = orderItem.PddBuyerAfterSale;
|
||||
if (!string.IsNullOrEmpty(orderItem.ItemTransitOrderWithVoid?.out_order_no) && orderItem.PddBuyerAfterSaleAddressStr.IsNullOrEmpty() &&
|
||||
(orderItem.TransitRefundStatusStr.Contains("需手动申请售后") || orderItem.TransitRefundStatusStr.Contains("待用户发货")))
|
||||
tmpOrderItems.Add(orderItem);
|
||||
}
|
||||
|
||||
bool isSimPddAfterSaleSuccess = true;
|
||||
if (refundStatusStr.Contains("需手动申请售后"))
|
||||
if (orderItem?.ItemOrder?.OrderBuyType == "直发")
|
||||
{
|
||||
isSimPddAfterSaleSuccess = false;
|
||||
// pddBuyerAfterSale作为参数传入,获取退货退款金额
|
||||
var rst = PDDBuyerOrderReadCtrl.SimPddAfterSaleWithReturnGoods(buyer, pddBuyerOrderLiteInfo, pddBuyerAfterSale);
|
||||
if (orderItem != null && !string.IsNullOrEmpty(orderItem.ItemOrder?.out_order_no) && orderItem.DirectPddBuyerAfterSaleAddressStr.IsNullOrEmpty() &&
|
||||
((orderItem.ItemOrder?.out_after_sale_status).ParseToString().Contains("需手动申请售后") || (orderItem.ItemOrder?.out_after_sale_status).ParseToString().Contains("待用户发货")))
|
||||
tmpOrderItems.Add(orderItem);
|
||||
}
|
||||
// 云改直有两个买手单,暂时只处理直发的,云仓默认已退款
|
||||
if (orderItem?.ItemOrder?.OrderBuyType == "云改直")
|
||||
{
|
||||
if (orderItem != null && !string.IsNullOrEmpty(orderItem.ItemOrder?.out_order_no) && orderItem.DirectPddBuyerAfterSaleAddressStr.IsNullOrEmpty() &&
|
||||
((orderItem.ItemOrder?.out_after_sale_status).ParseToString().Contains("需手动申请售后") || (orderItem.ItemOrder?.out_after_sale_status).ParseToString().Contains("待用户发货")))
|
||||
tmpOrderItems.Add(orderItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tmpOrderItems.Count > 0)
|
||||
await DoBuyerRefend(tmpOrderItems);
|
||||
}
|
||||
|
||||
var afterSalesStatus = BaseRegex.GetIntJson(ref rst, "after_sales_status");
|
||||
var afterSalesId = BaseRegex.GetLongJson(ref rst, "after_sales_id");
|
||||
pddBuyerAfterSale.afterSalesId = afterSalesId.ToString();
|
||||
pddBuyerAfterSale.statusText = "待用户发货";
|
||||
public async Task DoBuyerRefend(List<oms_wei_order_item_info> tmpOrderItems)
|
||||
{
|
||||
if (tmpOrderItems == null)
|
||||
return;
|
||||
|
||||
if (afterSalesStatus == 0)
|
||||
{
|
||||
var msg = BaseRegex.GetStringJsonByRegs(ref rst, rst, "msg", "err_msg", "error_msg", "errorMsg", "errMsg");
|
||||
BaseMsgWindow.ShowAnimateMessage(msg, "Error", 3);
|
||||
Thread.Sleep(5000);
|
||||
}
|
||||
else
|
||||
int index = 0;
|
||||
foreach (var tmpOrderItem in tmpOrderItems)
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() => { BottomMsg = "正在处理买手退货,总计:" + tmpOrderItems.Count + ",已处理:" + index++; }));
|
||||
|
||||
var pddOrderSn = "";
|
||||
if (tmpOrderItem.ItemOrder?.OrderBuyType == "云仓")
|
||||
pddOrderSn = tmpOrderItem.ItemTransitOrderWithVoid?.out_order_no;
|
||||
else if (tmpOrderItem.ItemOrder?.OrderBuyType == "直发" || tmpOrderItem.ItemOrder?.OrderBuyType == "云改直")
|
||||
pddOrderSn = tmpOrderItem.ItemOrder?.out_order_no;
|
||||
|
||||
BuyerLoginInfo buyer = null;
|
||||
if (tmpOrderItem.ItemOrder?.OrderBuyType == "云仓")
|
||||
Dispatcher.Invoke(new Action(() => { buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => b.buyer_nick == tmpOrderItem.ItemTransitOrderWithVoid.buyer_account); }));
|
||||
else if (tmpOrderItem.ItemOrder?.OrderBuyType == "直发" || tmpOrderItem.ItemOrder?.OrderBuyType == "云改直")
|
||||
Dispatcher.Invoke(new Action(() => { buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => b.buyer_nick == tmpOrderItem.ItemOrder?.out_account); }));
|
||||
if (buyer == null)
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("买手单:" + pddOrderSn + " 买手不在当前账户下,跳过", "Error", 3);
|
||||
}
|
||||
|
||||
// 检测一下买手号
|
||||
if (buyer.status == "在线")
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(buyer);
|
||||
}
|
||||
if (buyer.status != "在线")
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("买手单:" + pddOrderSn + " 买手号掉线,跳过", "Error", 3);
|
||||
continue;
|
||||
}
|
||||
|
||||
MainWindow.Instance.orderListCtrl.GetOrder(tmpOrderItem.order_id);
|
||||
|
||||
oms_wei_order_info order = null;
|
||||
Dispatcher.Invoke(new Action(() => { order = GlobalConfig.lstOrder.FirstOrDefault(oi => oi.order_id == tmpOrderItem.order_id); }));
|
||||
if (order == null)
|
||||
continue;
|
||||
oms_wei_order_item_info orderItem = null;
|
||||
Dispatcher.Invoke(new Action(() => { orderItem = order.orderItems.FirstOrDefault(oi => oi.order_id == tmpOrderItem.order_id && oi.sku_id == tmpOrderItem.sku_id); }));
|
||||
if (orderItem == null)
|
||||
continue;
|
||||
|
||||
string refundStatusStr = "";
|
||||
string outOrderNo = "";
|
||||
string AfterSaleAddressStr = "";
|
||||
if (order.OrderBuyType == "云仓")
|
||||
{
|
||||
outOrderNo = (orderItem.ItemTransitOrderWithVoid?.out_order_no).ParseToString();
|
||||
refundStatusStr = (orderItem?.TransitRefundStatusStr).ParseToString();
|
||||
AfterSaleAddressStr = orderItem.PddBuyerAfterSaleAddressStr;
|
||||
}
|
||||
else if (order.OrderBuyType == "直发" || order.OrderBuyType == "云改直")
|
||||
{
|
||||
outOrderNo = (order.out_order_no).ParseToString();
|
||||
refundStatusStr = (order.out_after_sale_status).ParseToString();
|
||||
AfterSaleAddressStr = orderItem.DirectPddBuyerAfterSaleAddressStr;
|
||||
}
|
||||
if (string.IsNullOrEmpty(outOrderNo) || !AfterSaleAddressStr.IsNullOrEmpty() ||
|
||||
(!refundStatusStr.Contains("需手动申请售后") && !refundStatusStr.Contains("待用户发货")))
|
||||
continue;
|
||||
|
||||
PddBuyerOrderLiteInfo pddBuyerOrderLiteInfo = new PddBuyerOrderLiteInfo();
|
||||
pddBuyerOrderLiteInfo.ShopOrderIdStr = orderItem.order_id;
|
||||
pddBuyerOrderLiteInfo.order_sn = pddOrderSn;
|
||||
|
||||
if (order.OrderBuyType == "云仓")
|
||||
pddBuyerOrderLiteInfo.order_amount = orderItem.ItemTransitOrderWithVoid?.out_amount;
|
||||
else if (order.OrderBuyType == "直发" || order.OrderBuyType == "云改直")
|
||||
pddBuyerOrderLiteInfo.order_amount = order.out_amount;
|
||||
|
||||
order_pdd_buyer_after_sale pddBuyerAfterSale = new order_pdd_buyer_after_sale()
|
||||
{
|
||||
wx_order_id = orderItem.order_id,
|
||||
wx_sku_id = orderItem.sku_id,
|
||||
TransitCreateTime = orderItem.ItemTransitOrderWithVoid?.created_time == null ? DateTime.MinValue : orderItem.ItemTransitOrderWithVoid.created_time,
|
||||
pre_allocated_order_no = orderItem.ItemTransitOrderWithVoid?.pre_allocated_order_no,
|
||||
buyerId = buyer.buyer_id,
|
||||
buyerName = buyer.buyer_name,
|
||||
orderSn = pddOrderSn,
|
||||
orderAmount = pddBuyerOrderLiteInfo.order_amount,
|
||||
refundAmount = pddBuyerOrderLiteInfo.order_amount,
|
||||
orderDate = pddOrderSn.ParseToString().Split('-').FirstOrDefault().ParseToInt(),
|
||||
};
|
||||
if (orderItem.PddBuyerAfterSale != null)
|
||||
pddBuyerAfterSale = orderItem.PddBuyerAfterSale;
|
||||
|
||||
bool isSimPddAfterSaleSuccess = true;
|
||||
if (refundStatusStr.Contains("需手动申请售后"))
|
||||
{
|
||||
isSimPddAfterSaleSuccess = false;
|
||||
// pddBuyerAfterSale作为参数传入,获取退货退款金额
|
||||
var rst = PDDBuyerOrderReadCtrl.SimPddAfterSaleWithReturnGoods(buyer, pddBuyerOrderLiteInfo, pddBuyerAfterSale);
|
||||
|
||||
var afterSalesStatus = BaseRegex.GetIntJson(ref rst, "after_sales_status");
|
||||
var afterSalesId = BaseRegex.GetLongJson(ref rst, "after_sales_id");
|
||||
pddBuyerAfterSale.afterSalesId = afterSalesId.ToString();
|
||||
pddBuyerAfterSale.statusText = "待用户发货";
|
||||
|
||||
if (afterSalesStatus == 0)
|
||||
{
|
||||
var msg = BaseRegex.GetStringJsonByRegs(ref rst, rst, "msg", "err_msg", "error_msg", "errorMsg", "errMsg");
|
||||
BaseMsgWindow.ShowAnimateMessage(msg, "Error", 5);
|
||||
Thread.Sleep(5000);
|
||||
if (msg == "已超过可申请售后的时间")
|
||||
{
|
||||
if (order.OrderBuyType == "云仓")
|
||||
{
|
||||
var e57Rst = PDDBuyerOrderReadCtrl.SendTransitAfterSaleE57(pddBuyerOrderLiteInfo, "待用户发货");
|
||||
var e57Rst = PDDBuyerOrderReadCtrl.SendTransitAfterSaleE57(pddBuyerOrderLiteInfo, "已超过可申请售后的时间");
|
||||
if (e57Rst.Contains("<code>0</code>") || e57Rst.Contains("<code>200</code>"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("买手退款信息更新成功", "Msg", 3);
|
||||
isSimPddAfterSaleSuccess = true;
|
||||
Thread.Sleep(Randomx.GetId(10000, 12001));
|
||||
}
|
||||
else
|
||||
{
|
||||
var msg = BaseRegex.GetStringXml(ref e57Rst, "msg");
|
||||
msg = BaseRegex.GetStringXml(ref e57Rst, "msg");
|
||||
BaseMsgWindow.ShowAnimateMessage("买手退款信息更新失败,服务端返回 " + msg, "Error", 3);
|
||||
}
|
||||
}
|
||||
else if (order.OrderBuyType == "直发" || order.OrderBuyType == "云改直")
|
||||
{
|
||||
var e57Rst = PDDBuyerOrderReadCtrl.SendAfterSaleE57NeedManual(pddBuyerOrderLiteInfo, "待用户发货");
|
||||
var e57Rst = PDDBuyerOrderReadCtrl.SendAfterSaleE57NeedManual(pddBuyerOrderLiteInfo, "已超过可申请售后的时间");
|
||||
if (e57Rst.Contains("<code>0</code>") || e57Rst.Contains("<code>200</code>"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("买手退款信息更新成功", "Msg", 3);
|
||||
isSimPddAfterSaleSuccess = true;
|
||||
Thread.Sleep(Randomx.GetId(10000, 12001));
|
||||
}
|
||||
else
|
||||
{
|
||||
var msg = BaseRegex.GetStringXml(ref e57Rst, "msg");
|
||||
msg = BaseRegex.GetStringXml(ref e57Rst, "msg");
|
||||
BaseMsgWindow.ShowAnimateMessage("买手退款信息更新失败,服务端返回 " + msg, "Error", 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isSimPddAfterSaleSuccess)
|
||||
else
|
||||
{
|
||||
var addressRst = YkdBuyerOrder.GetAfterSaleAddress(buyer, pddOrderSn, pddBuyerAfterSale.afterSalesId.ParseToString());
|
||||
var merchantReceiverInfo = BaseRegex.GetOneJsonObjStrJson(ref addressRst, "merchantReceiverInfo");
|
||||
string address = "";
|
||||
if (merchantReceiverInfo != null)
|
||||
if (order.OrderBuyType == "云仓")
|
||||
{
|
||||
address = BaseRegex.GetStringJson(ref merchantReceiverInfo, "copyValue");
|
||||
var e57Rst = PDDBuyerOrderReadCtrl.SendTransitAfterSaleE57(pddBuyerOrderLiteInfo, "待用户发货");
|
||||
if (e57Rst.Contains("<code>0</code>") || e57Rst.Contains("<code>200</code>"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("买手退款信息更新成功" + orderItem.order_id, "Msg", 3);
|
||||
isSimPddAfterSaleSuccess = true;
|
||||
Thread.Sleep(Randomx.GetId(10000, 12001));
|
||||
}
|
||||
else
|
||||
{
|
||||
var msg = BaseRegex.GetStringXml(ref e57Rst, "msg");
|
||||
BaseMsgWindow.ShowAnimateMessage("买手退款信息更新失败,服务端返回 " + msg, "Error", 3);
|
||||
}
|
||||
}
|
||||
else if (order.OrderBuyType == "直发" || order.OrderBuyType == "云改直")
|
||||
{
|
||||
var e57Rst = PDDBuyerOrderReadCtrl.SendAfterSaleE57NeedManual(pddBuyerOrderLiteInfo, "待用户发货");
|
||||
if (e57Rst.Contains("<code>0</code>") || e57Rst.Contains("<code>200</code>"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("买手退款信息更新成功", "Msg", 3);
|
||||
isSimPddAfterSaleSuccess = true;
|
||||
Thread.Sleep(Randomx.GetId(10000, 12001));
|
||||
}
|
||||
else
|
||||
{
|
||||
var msg = BaseRegex.GetStringXml(ref e57Rst, "msg");
|
||||
BaseMsgWindow.ShowAnimateMessage("买手退款信息更新失败,服务端返回 " + msg, "Error", 3);
|
||||
}
|
||||
}
|
||||
|
||||
var url3 = BaseClass.Build29WxObjString("order/wx_add_mdy_buyer_after_sale");
|
||||
var data3 = UserLogin.GetSignaturex();
|
||||
data3 += "&wx_order_id=" + pddBuyerAfterSale.wx_order_id;
|
||||
data3 += "&wx_sku_id=" + pddBuyerAfterSale.wx_sku_id;
|
||||
if (pddBuyerAfterSale.TransitCreateTime != DateTime.MinValue)
|
||||
data3 += "&TransitCreateTime=" + pddBuyerAfterSale.TransitCreateTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
data3 += "&pre_allocated_order_no=" + pddBuyerAfterSale.pre_allocated_order_no;
|
||||
data3 += "&buyerId=" + pddBuyerAfterSale.buyerId;
|
||||
data3 += "&buyerName=" + pddBuyerAfterSale.buyerName;
|
||||
data3 += "&orderAmount=" + pddBuyerAfterSale.orderAmount;
|
||||
data3 += "&orderSn=" + pddBuyerAfterSale.orderSn;
|
||||
data3 += "&afterSalesId=" + pddBuyerAfterSale.afterSalesId;
|
||||
data3 += "&orderDate=" + pddBuyerAfterSale.orderDate;
|
||||
//data3 += "&TransitPickupTime=" + pddBuyerOrder.TransitPickupTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
data3 += "&refundAmount=" + pddBuyerAfterSale.refundAmount;
|
||||
data3 += "&statusText=" + pddBuyerAfterSale.statusText;
|
||||
if (!string.IsNullOrEmpty(address))
|
||||
data3 += "&afterSaleAddress=" + address;
|
||||
if (order.OrderBuyType == "直发" || order.OrderBuyType == "云改直") // 云仓 0 直发 1
|
||||
data3 += "&wx_send_type=1";
|
||||
//data3 += "&is_mdy=true";
|
||||
var html3 = GetHtml.PostUtf8(url3, data3);
|
||||
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
|
||||
html3 = GetHtml.PostUtf8(url3, data3);
|
||||
}
|
||||
MainWindow.Instance.orderListCtrl.GetOrder(tmpOrderItem.order_id);
|
||||
Dispatcher.Invoke(new Action(() => { BottomMsg = "正在处理买手退货,总计:" + tmpOrderItems.Count + ",已处理:" + index; }));
|
||||
}
|
||||
if (isSimPddAfterSaleSuccess)
|
||||
{
|
||||
var addressRst = YkdBuyerOrder.GetAfterSaleAddress(buyer, pddOrderSn, pddBuyerAfterSale.afterSalesId.ParseToString());
|
||||
var merchantReceiverInfo = BaseRegex.GetOneJsonObjStrJson(ref addressRst, "merchantReceiverInfo");
|
||||
string address = "";
|
||||
if (merchantReceiverInfo != null)
|
||||
{
|
||||
address = BaseRegex.GetStringJson(ref merchantReceiverInfo, "copyValue");
|
||||
}
|
||||
|
||||
Dispatcher.Invoke(new Action(() => { BottomMsg = "买手退货处理完成,总计:" + tmpOrderItems.Count + ",已处理:" + index; }));
|
||||
});
|
||||
var url3 = BaseClass.Build29WxObjString("order/wx_add_mdy_buyer_after_sale");
|
||||
var data3 = UserLogin.GetSignaturex();
|
||||
data3 += "&wx_order_id=" + pddBuyerAfterSale.wx_order_id;
|
||||
data3 += "&wx_sku_id=" + pddBuyerAfterSale.wx_sku_id;
|
||||
if (pddBuyerAfterSale.TransitCreateTime != DateTime.MinValue)
|
||||
data3 += "&TransitCreateTime=" + pddBuyerAfterSale.TransitCreateTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
data3 += "&pre_allocated_order_no=" + pddBuyerAfterSale.pre_allocated_order_no;
|
||||
data3 += "&buyerId=" + pddBuyerAfterSale.buyerId;
|
||||
data3 += "&buyerName=" + pddBuyerAfterSale.buyerName;
|
||||
data3 += "&orderAmount=" + pddBuyerAfterSale.orderAmount;
|
||||
data3 += "&orderSn=" + pddBuyerAfterSale.orderSn;
|
||||
data3 += "&afterSalesId=" + pddBuyerAfterSale.afterSalesId;
|
||||
data3 += "&orderDate=" + pddBuyerAfterSale.orderDate;
|
||||
//data3 += "&TransitPickupTime=" + pddBuyerOrder.TransitPickupTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
data3 += "&refundAmount=" + pddBuyerAfterSale.refundAmount;
|
||||
data3 += "&statusText=" + pddBuyerAfterSale.statusText;
|
||||
if (!string.IsNullOrEmpty(address))
|
||||
data3 += "&afterSaleAddress=" + address;
|
||||
if (order.OrderBuyType == "直发" || order.OrderBuyType == "云改直") // 云仓 0 直发 1
|
||||
data3 += "&wx_send_type=1";
|
||||
//data3 += "&is_mdy=true";
|
||||
var html3 = await GetHtml.PostUtf8Async(url3, data3);
|
||||
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
|
||||
html3 = await GetHtml.PostUtf8Async(url3, data3);
|
||||
}
|
||||
MainWindow.Instance.orderListCtrl.GetOrder(tmpOrderItem.order_id);
|
||||
Dispatcher.Invoke(new Action(() => { BottomMsg = "正在处理买手退货,总计:" + tmpOrderItems.Count + ",已处理:" + index; }));
|
||||
}
|
||||
|
||||
Dispatcher.Invoke(new Action(() => { BottomMsg = "买手退货处理完成,总计:" + tmpOrderItems.Count + ",已处理:" + index; }));
|
||||
}
|
||||
|
||||
|
||||
@@ -1774,7 +1927,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
private void txtFilterRemark_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
lstFilterText = txtFilterRemark.Text.Trim().Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList();
|
||||
lstFilterRemarkText = [.. txtFilterRemark.Text.Trim().Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList(),];
|
||||
}
|
||||
|
||||
private void txtOrderId_TextChanged(object arg1, TextChangedEventArgs arg2)
|
||||
{
|
||||
lstFilterOrderIds = [.. txtFilterOrderId.Text.Trim().Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList(),];
|
||||
}
|
||||
|
||||
private void chkEmergencyReturnOrRefund_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -1568,6 +1568,48 @@
|
||||
Grid.Column="1"
|
||||
Width="auto"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{Binding AddEditTransitWarehouseReturnOrderStr, Converter={StaticResource HasTextVisibility}}">
|
||||
<TextBox
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="0,1,-8,1"
|
||||
VerticalAlignment="Top"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
BorderThickness="1"
|
||||
IsReadOnly="True"
|
||||
Text="云仓退货:" />
|
||||
<uc:UcWaterMarkTextBox1
|
||||
x:Name="txtTransitReturnOrderWaybill"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="0,1,0,1"
|
||||
VerticalAlignment="Top"
|
||||
Background="Transparent"
|
||||
BorderThickness="1"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding DistribReturnOrderInfo.real_logistics_express_code}"
|
||||
TextWrapping="Wrap"
|
||||
WaterMark="云仓退货" />
|
||||
<Button
|
||||
x:Name="btnRetrunOrder"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="2,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
d:Content="添加"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Click="btnReturnOrder_Click"
|
||||
Content="{Binding AddEditTransitWarehouseReturnOrderStr}"
|
||||
Cursor="Hand"
|
||||
Foreground="{StaticResource PageLinkBrush}" />
|
||||
</WrapPanel>
|
||||
<WrapPanel
|
||||
Grid.Row="7"
|
||||
Grid.Column="1"
|
||||
Width="auto"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{Binding PddBuyerAfterSaleAddressStr, Converter={StaticResource HasTextVisibility}}">
|
||||
<TextBox
|
||||
Grid.Row="2"
|
||||
@@ -1611,11 +1653,11 @@
|
||||
</WrapPanel>
|
||||
|
||||
<WrapPanel
|
||||
Grid.Row="7"
|
||||
Grid.Row="8"
|
||||
Grid.Column="1"
|
||||
Width="auto"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{Binding AddEditTransitWarehouseReturnOrderStr, Converter={StaticResource HasTextVisibility}}">
|
||||
Visibility="{Binding DirectPddBuyerAfterSaleAddressStr, Converter={StaticResource HasTextVisibility}}">
|
||||
<TextBox
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
@@ -1625,32 +1667,35 @@
|
||||
BorderBrush="Transparent"
|
||||
BorderThickness="1"
|
||||
IsReadOnly="True"
|
||||
Text="云仓退货:" />
|
||||
Text="直发总店:" />
|
||||
<uc:UcWaterMarkTextBox1
|
||||
x:Name="txtTransitReturnOrderWaybill"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
x:Name="txtDirectBuyerRefundAddress"
|
||||
Margin="0,1,0,1"
|
||||
VerticalAlignment="Top"
|
||||
Background="Transparent"
|
||||
BorderThickness="1"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding DistribReturnOrderInfo.real_logistics_express_code}"
|
||||
Text="{Binding DirectPddBuyerAfterSaleAddressStr, Converter={StaticResource TextEllipsisConverter}}"
|
||||
TextWrapping="Wrap"
|
||||
WaterMark="云仓退货" />
|
||||
<Button
|
||||
x:Name="btnRetrunOrder"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="2,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
d:Content="添加"
|
||||
ToolTip="{Binding DirectPddBuyerAfterSaleAddressStr}"
|
||||
Visibility="{Binding Text, RelativeSource={RelativeSource Self}, Converter={StaticResource HasTextVisibility}}"
|
||||
WaterMark="总店退货地址" />
|
||||
<Border
|
||||
Grid.Column="6"
|
||||
Width="12"
|
||||
Height="12"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Click="btnReturnOrder_Click"
|
||||
Content="{Binding AddEditTransitWarehouseReturnOrderStr}"
|
||||
Cursor="Hand"
|
||||
Foreground="{StaticResource PageLinkBrush}" />
|
||||
MouseLeftButtonDown="pathDirectBuyerAfterSaleAddress_MouseLeftButtonDown"
|
||||
Visibility="{Binding ElementName=txtBuyerRefundAddress, Path=Visibility}">
|
||||
<Path
|
||||
Margin="0,0,0,0"
|
||||
Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z"
|
||||
Fill="{StaticResource PageLinkBrush}"
|
||||
MouseLeftButtonDown="pathDirectBuyerAfterSaleAddress_MouseLeftButtonDown"
|
||||
Stretch="Uniform" />
|
||||
</Border>
|
||||
</WrapPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -1052,10 +1052,15 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
if (this.DataContext is oms_wei_order_item_info orderItem)
|
||||
{
|
||||
orderItem.ItemTransitOrders = OrderListCtrl.GetTransitWarehouseList(orderItem.order_id);
|
||||
orderItem.PddBuyerOrders = OrderListCtrl.GetPddBuyerOrders(orderItem.order_id);
|
||||
orderItem.PddBuyerOrders = OrderListCtrl.GetPddBuyerOrders(orderItem.order_id).Where(o => o.wx_send_type == 0).ToList();
|
||||
OrderListCtrl.InitOrderItemObservableProp(orderItem);
|
||||
|
||||
|
||||
|
||||
if (orderItem.ItemTransitOrder?.warehouse_status == 3)
|
||||
{
|
||||
BaseMsgWindow.ShowError("商品已拒收或拦截!");
|
||||
return;
|
||||
}
|
||||
if (orderItem.ItemTransitOrder?.warehouse_status == 2)
|
||||
{
|
||||
BaseMsgWindow.ShowError("商品已出库,请选择退回中转仓!");
|
||||
@@ -1106,7 +1111,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_item_info orderItem)
|
||||
{
|
||||
if (orderItem.ItemTransitOrder?.warehouse_status != 2 && orderItem.AddEditTransitWarehouseAfterSaleStr == "添加")
|
||||
if (orderItem.ItemTransitOrder?.warehouse_status != 2 && orderItem.ItemTransitOrder?.warehouse_status != 1 && orderItem.AddEditTransitWarehouseAfterSaleStr == "添加")
|
||||
{
|
||||
BaseMsgWindow.ShowError("商品未出库,请选择中转仓拒收!");
|
||||
return;
|
||||
@@ -1141,6 +1146,22 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}
|
||||
}
|
||||
|
||||
private void pathDirectBuyerAfterSaleAddress_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_item_info order_item)
|
||||
{
|
||||
try
|
||||
{
|
||||
Clipboard.SetDataObject(order_item.DirectPddBuyerAfterSaleAddressStr);
|
||||
BaseMsgWindow.ShowAnimateMessage("复制成功");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowError("复制失败 " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void pathCopyAddress_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_item_info order_item)
|
||||
@@ -1421,7 +1442,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,19 +57,27 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
||||
this.txtExpressName.Text = OrderItem.ItemTransitOrder?.express_2_company;
|
||||
this.txtWarehouseWaybill.Text = OrderItem.ItemTransitOrder?.express_2_waybill;
|
||||
|
||||
if (OrderItem.ItemTransitOrderAfterSale != null)
|
||||
{
|
||||
btnAdd.IsEnabled = false;
|
||||
if (OrderItem.ItemTransitOrderAfterSale != null)
|
||||
{
|
||||
btnAdd.IsEnabled = false;
|
||||
|
||||
this.txtUser.Text = OrderItem.ItemTransitOrderAfterSale.recipient_name;
|
||||
this.txtMobile.Text = OrderItem.ItemTransitOrderAfterSale.recipient_phone;
|
||||
this.txtDetailAddress.Text = OrderItem.ItemTransitOrderAfterSale.refund_detail_address;
|
||||
//this.txtAddress.Text = OrderItem.ItemTransitOrderAfterSale.refund_province + "/" + OrderItem.ItemTransitOrderAfterSale.refund_city + "/" + OrderItem.ItemTransitOrderAfterSale.refund_county;
|
||||
this.txtProvince.Text = OrderItem.ItemTransitOrderAfterSale.refund_province;
|
||||
this.txtCity.Text = OrderItem.ItemTransitOrderAfterSale.refund_city;
|
||||
this.txtCounty.Text = OrderItem.ItemTransitOrderAfterSale.refund_county;
|
||||
}
|
||||
}
|
||||
this.txtUser.Text = OrderItem.ItemTransitOrderAfterSale.recipient_name;
|
||||
this.txtMobile.Text = OrderItem.ItemTransitOrderAfterSale.recipient_phone;
|
||||
this.txtDetailAddress.Text = OrderItem.ItemTransitOrderAfterSale.refund_detail_address;
|
||||
//this.txtAddress.Text = OrderItem.ItemTransitOrderAfterSale.refund_province + "/" + OrderItem.ItemTransitOrderAfterSale.refund_city + "/" + OrderItem.ItemTransitOrderAfterSale.refund_county;
|
||||
this.txtProvince.Text = OrderItem.ItemTransitOrderAfterSale.refund_province;
|
||||
this.txtCity.Text = OrderItem.ItemTransitOrderAfterSale.refund_city;
|
||||
this.txtCounty.Text = OrderItem.ItemTransitOrderAfterSale.refund_county;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (OrderItem.PddBuyerAfterSale?.orderSn == OrderItem.ItemTransitOrder?.out_order_no && !string.IsNullOrEmpty(OrderItem.PddBuyerAfterSale?.afterSaleAddress))
|
||||
{
|
||||
txtAddressAnalysis.Text = OrderItem.PddBuyerAfterSale?.afterSaleAddress;
|
||||
btnAddressAnalysis_Click(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if (OrderItem?.ItemTransitOrder?.warehouse_status != 0 && OrderItem?.ItemTransitOrder?.warehouse_status != 1)
|
||||
////if (OrderItem?.ItemTransitOrderWithVoid?.warehouse_status != 0 && OrderItem?.ItemTransitOrderWithVoid?.warehouse_status != 1)
|
||||
|
||||
@@ -165,7 +165,8 @@ namespace _29WxOrderWpf.Windows.OrderWindows
|
||||
//<AjaxResult><msg>创建退货包裹成功</msg><code>0</code></AjaxResult>
|
||||
MainWindow.Instance.orderListCtrl.GetOrder(OrderItem.order_id);
|
||||
MainWindow.Instance.orderListCtrl.FilterOneOrder(OrderItem.order_id, true);
|
||||
BaseMsgWindow.ShowInfo("添加退货包裹成功", "", this);
|
||||
StartUp.UpdateBalance();
|
||||
BaseMsgWindow.ShowInfo("添加退货包裹成功", "", this);
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace AllBase
|
||||
/// 版本ID
|
||||
/// </summary>
|
||||
|
||||
public static int VersionCount = 237;
|
||||
public static int VersionCount = 250;
|
||||
|
||||
public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
|
||||
public static string DebugUrl { get; set; } = "http://localhost:9000";
|
||||
|
||||
@@ -369,7 +369,14 @@ namespace AllBase.Model.DBModel
|
||||
|
||||
public string OutExpressNoStr
|
||||
{
|
||||
get { return this.out_express_no + (this.out_shipped != 2 ? "" : " ×"); }
|
||||
get
|
||||
{
|
||||
if (order_id == "3738523900304581376")
|
||||
{
|
||||
|
||||
}
|
||||
return this.out_express_no + ((this.out_shipped != 2 || string.IsNullOrEmpty(this.out_express_no)) ? "" : " ×");
|
||||
}
|
||||
set { }
|
||||
}
|
||||
public SolidColorBrush OutExpressNoBrush
|
||||
|
||||
@@ -215,12 +215,17 @@ namespace AllBase.Model.DBModel
|
||||
{
|
||||
get { return this.GetValue(x => x.PddBuyerAfterSale); }
|
||||
set { this.SetValue(x => x.PddBuyerAfterSale, value); }
|
||||
}
|
||||
public string PddBuyerAfterSaleAddressStr
|
||||
{
|
||||
get { return this.GetValue(x => x.PddBuyerAfterSaleAddressStr); }
|
||||
set { this.SetValue(x => x.PddBuyerAfterSaleAddressStr, value); }
|
||||
}
|
||||
}
|
||||
public string PddBuyerAfterSaleAddressStr
|
||||
{
|
||||
get { return this.GetValue(x => x.PddBuyerAfterSaleAddressStr); }
|
||||
set { this.SetValue(x => x.PddBuyerAfterSaleAddressStr, value); }
|
||||
}
|
||||
public string DirectPddBuyerAfterSaleAddressStr
|
||||
{
|
||||
get { return this.GetValue(x => x.DirectPddBuyerAfterSaleAddressStr); }
|
||||
set { this.SetValue(x => x.DirectPddBuyerAfterSaleAddressStr, value); }
|
||||
}
|
||||
public void SetTransitOrder()
|
||||
{
|
||||
|
||||
@@ -273,9 +278,20 @@ namespace AllBase.Model.DBModel
|
||||
AddEditTransitWarehouseRejectStr = "";
|
||||
}
|
||||
|
||||
if (order_id == "3738396781943865344")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// 仓库物流售后按钮上的文字,仓库作废单不存在仓库物流,所以此处必须是有效的仓库单(含作废失败)
|
||||
AddEditTransitWarehouseAfterSaleStr = this.ItemTransitOrderAfterSale == null ? "添加" : "已添加";
|
||||
if (this.ItemTransitOrderWithVoid == null || (!this.ItemOrder.IsEmergency && !this.ItemOrder.isAbnormal && !this.ItemOrder.IsRefund) || this.ItemTransitOrderWithVoid.warehouse_status < 1)
|
||||
{
|
||||
if (AddEditTransitWarehouseAfterSaleStr != "已添加")
|
||||
AddEditTransitWarehouseAfterSaleStr = "";
|
||||
}
|
||||
// 退货退款的,不能中转仓退回。如果是退到退货仓,则退货仓流程,否则店家自行收货退回总店。
|
||||
if (!RefundAddressStr.ParseToString().Trim().IsNullOrEmpty() || this.ItemRefund?.type != "REFUND")
|
||||
{
|
||||
if (AddEditTransitWarehouseAfterSaleStr != "已添加")
|
||||
AddEditTransitWarehouseAfterSaleStr = "";
|
||||
@@ -283,10 +299,6 @@ namespace AllBase.Model.DBModel
|
||||
if (this.ItemTransitOrderAfterSale != null)
|
||||
TransitWarehouseAfterSaleWayBillStr = (this.ItemTransitOrderAfterSale?.downstream_express_code + "-" + this.ItemTransitOrderAfterSale?.downstream_waybill).Trim('-');
|
||||
|
||||
if (order_id == "3738382691615546112")
|
||||
{
|
||||
|
||||
}
|
||||
AddEditTransitWarehouseReturnOrderStr = "";
|
||||
if (ItemRefund?.return_detail == GlobalConfig.TransitReturnOrderReturnAddress)
|
||||
{
|
||||
@@ -296,8 +308,10 @@ namespace AllBase.Model.DBModel
|
||||
AddEditTransitWarehouseReturnOrderStr = DistribReturnOrderInfo == null ? "添加" : "已添加";
|
||||
}
|
||||
|
||||
// 买手退货地址
|
||||
// 云仓买手退货地址
|
||||
this.PddBuyerAfterSaleAddressStr = this.PddBuyerAfterSale?.afterSaleAddress;
|
||||
// 直发买手退货地址
|
||||
this.DirectPddBuyerAfterSaleAddressStr = this.DirectPddBuyerAfterSale?.afterSaleAddress;
|
||||
}
|
||||
/// <summary>
|
||||
/// 仓库拒收按钮文本参数
|
||||
@@ -479,6 +493,10 @@ namespace AllBase.Model.DBModel
|
||||
}
|
||||
public void SetWarehouseWaybillStatusStr()
|
||||
{
|
||||
if (order_id == "3737682230178873344")
|
||||
{
|
||||
|
||||
}
|
||||
WarehouseWaybillStatusStr = "";
|
||||
if (ItemTransitOrderWithVoid == null)
|
||||
WarehouseWaybillStatusStr = "";
|
||||
@@ -491,8 +509,10 @@ namespace AllBase.Model.DBModel
|
||||
WarehouseWaybillStatusStr = "取号异常-超出派送范围";
|
||||
else
|
||||
WarehouseWaybillStatusStr = "取号异常";
|
||||
}
|
||||
else if (ItemTransitOrderWithVoid?.warehouse_status == 2)
|
||||
}
|
||||
else if (ItemTransitOrderWithVoid?.warehouse_status == 3)
|
||||
WarehouseWaybillStatusStr = "中转拦截到仓";
|
||||
else if (ItemTransitOrderWithVoid?.warehouse_status == 2)
|
||||
WarehouseWaybillStatusStr = "中转已出库";
|
||||
// 老订单还用之前的逻辑判断
|
||||
else if (ItemTransitOrderWithVoid?.created_time < new DateTime(2026, 7, 14) && (ItemTransitOrderWithVoid?.pre_allocated_order_no == 1 || ItemTransitOrderWithVoid?.pre_allocated_order_no == 3) && !ItemTransitOrderWithVoid.express_2_company.IsNullOrEmpty() && !ItemTransitOrderWithVoid.express_2_waybill.IsNullOrEmpty())
|
||||
@@ -522,7 +542,7 @@ namespace AllBase.Model.DBModel
|
||||
var warehouseWaybillStatusStr = WarehouseWaybillStatusStr.ParseToString();
|
||||
//if (warehouseWaybillStatusStr.StartsWith("中转已作废"))
|
||||
// return PurpleBrush;
|
||||
if (warehouseWaybillStatusStr.StartsWith("中转已出库"))
|
||||
if (warehouseWaybillStatusStr.StartsWith("中转已出库") || warehouseWaybillStatusStr.StartsWith("中转拦截到仓"))
|
||||
return GlobalConfig.GreenBrush;
|
||||
if (warehouseWaybillStatusStr.StartsWith("中转已入库") || warehouseWaybillStatusStr.StartsWith("中转已取号") || warehouseWaybillStatusStr.StartsWith("中转提前取号"))
|
||||
return GlobalConfig.YellowBrush;
|
||||
@@ -599,7 +619,7 @@ namespace AllBase.Model.DBModel
|
||||
return ItemTransitOrderWithVoid.refund_status + "(退款金额待获取)";
|
||||
}
|
||||
|
||||
if (!ItemTransitOrderWithVoid.refund_status.Contains("需手动申请售后"))
|
||||
if (!ItemTransitOrderWithVoid.refund_status.Contains("需手动申请售后") && !ItemTransitOrderWithVoid.refund_status.Contains("已超过可申请售后的时间"))
|
||||
return "已申请售后 " + ItemTransitOrderWithVoid.refund_status.Replace("申请收到,", "");
|
||||
|
||||
if (order_id == "3737761985909113600")
|
||||
@@ -622,7 +642,7 @@ namespace AllBase.Model.DBModel
|
||||
{
|
||||
if (TransitRefundStatusStr.Contains("退款成功"))
|
||||
return GlobalConfig.GreenBrush;
|
||||
if (TransitRefundStatusStr.Contains("需手动申请售后"))
|
||||
if (TransitRefundStatusStr.Contains("需手动申请售后") || TransitRefundStatusStr.Contains("已超过可申请售后的时间") || TransitRefundStatusStr.Contains("退款失败"))
|
||||
return GlobalConfig.RedBrush;
|
||||
return GlobalConfig.LightOrangeBrush;
|
||||
//return YellowBrush;
|
||||
@@ -681,7 +701,11 @@ namespace AllBase.Model.DBModel
|
||||
{
|
||||
if (ItemOrder?.status == 10)
|
||||
return "待付款";
|
||||
if (ItemOrder?.status == 20)
|
||||
if (ItemOrder?.status == 12)
|
||||
return "礼物待收下";
|
||||
if (ItemOrder?.status == 13)
|
||||
return "一起买待成团";
|
||||
if (ItemOrder?.status == 20)
|
||||
return "待店铺发货";
|
||||
if (ItemOrder?.status == 21)
|
||||
return "店铺部分发货";
|
||||
@@ -690,7 +714,7 @@ namespace AllBase.Model.DBModel
|
||||
if (ItemOrder?.status == 100)
|
||||
return "订单完成";
|
||||
if (ItemOrder?.status == 200)
|
||||
return "售后完成单取消";
|
||||
return "售后完成订单取消";
|
||||
if (ItemOrder?.status == 250)
|
||||
return "未付款已取消";
|
||||
return "未知状态";
|
||||
@@ -811,8 +835,8 @@ namespace AllBase.Model.DBModel
|
||||
DirectRefundStatusBackColor = GlobalConfig.LightOrangeBrush;
|
||||
if (DirectRefundStatusStr.ParseToString().Contains("退款成功"))
|
||||
DirectRefundStatusBackColor = GlobalConfig.GreenBrush;
|
||||
else if (DirectRefundStatusStr.ParseToString().Contains("需手动申请售后"))
|
||||
DirectRefundStatusBackColor = GlobalConfig.RedBrush;
|
||||
else if (DirectRefundStatusStr.ParseToString().Contains("需手动申请售后") || DirectRefundStatusStr.ParseToString().Contains("已超过可申请售后的时间"))
|
||||
DirectRefundStatusBackColor = GlobalConfig.RedBrush;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1029,7 +1053,8 @@ namespace AllBase.Model.DBModel
|
||||
BtnAbnormalBtnVisibility = Visibility.Collapsed;
|
||||
// 买手未退款的,中转正式取号以后的,不可异常重拍
|
||||
else if (this.ItemTransitOrder?.refund_status != "买手退款成功" ||
|
||||
this.WarehouseWaybillStatusStr == "中转已取号" || this.WarehouseWaybillStatusStr == "中转已入库" || this.WarehouseWaybillStatusStr == "中转已出库")
|
||||
this.WarehouseWaybillStatusStr == "中转已取号" || this.WarehouseWaybillStatusStr == "中转已入库" ||
|
||||
this.WarehouseWaybillStatusStr == "中转已出库" || this.WarehouseWaybillStatusStr == "中转拦截到仓")
|
||||
BtnAbnormalBtnVisibility = Visibility.Collapsed;
|
||||
// 已正式取号的,不可异常重拍
|
||||
if (this.ItemTransitOrder?.pre_allocated_order_no == 1 || this.ItemTransitOrder?.pre_allocated_order_no == 3)
|
||||
@@ -1043,7 +1068,7 @@ namespace AllBase.Model.DBModel
|
||||
BtnDirectBuyOrderVisibility = Visibility.Collapsed;
|
||||
if (this.ItemOrder?.IsWaitBuy == true && this.BuyGoodsBtnTxt != "关联拍单")
|
||||
BtnDirectBuyOrderVisibility = Visibility.Visible;
|
||||
if (this.ItemOrder?.isAbnormal == true)
|
||||
if (this.ItemOrder?.isAbnormal == true && this.refund_status <= 1)
|
||||
{
|
||||
//if (BtnAbnormalBtnVisibility == Visibility.Collapsed && (this.ItemOrder.out_order_no.IsNullOrEmpty() || this.ItemOrder.out_after_sale_status == "退款成功"))
|
||||
if (this.ItemOrder.out_order_no.IsNullOrEmpty() || this.ItemOrder.out_after_sale_status == "退款成功")
|
||||
|
||||
Reference in new issue
Block a user