买手退货退款逻辑优化 修复部分bug
This commit is contained in:
1 parent
32bccd0ba9
commit
fb4bafd4d8
3 files changed
+92
-43
No files matched your search
@@ -1996,7 +1996,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
public string SendAfterSaleE57NeedManual(PddBuyerOrderLiteInfo order, string statusText)
|
public static string SendAfterSaleE57NeedManual(PddBuyerOrderLiteInfo order, string statusText)
|
||||||
{
|
{
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
|
|
||||||
|
|||||||
@@ -959,11 +959,17 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
else if (chkEmergencyShopInAfterSale.IsChecked == true && (order.DeliveryDeadlineDtatusStr != "退款中"))
|
else if (chkEmergencyShopInAfterSale.IsChecked == true && (order.DeliveryDeadlineDtatusStr != "退款中"))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
//// 退货退款
|
||||||
|
//if (chkEmergencyReturn.IsChecked == true && !(order.refundItems.OrderByDescending(or => or.create_time).FirstOrDefault()?.RefundStatusStr).ParseToString().Contains("退货"))
|
||||||
|
// return true;
|
||||||
|
//// 仅退款
|
||||||
|
//else if (chkEmergencyRefund.IsChecked == true && (order.refundItems.OrderByDescending(or => or.create_time).FirstOrDefault()?.RefundStatusStr).ParseToString().Contains("退货"))
|
||||||
|
// return true;
|
||||||
// 退货退款
|
// 退货退款
|
||||||
if (chkEmergencyReturn.IsChecked == true && !(order.refundItems.OrderByDescending(or => or.create_time).FirstOrDefault()?.RefundStatusStr).ParseToString().Contains("退货"))
|
if (chkEmergencyReturn.IsChecked == true && !(order.refundItems.OrderByDescending(or => or.create_time).FirstOrDefault()?.type).ParseToString().Contains("RETURN"))
|
||||||
return true;
|
return true;
|
||||||
// 仅退款
|
// 仅退款
|
||||||
else if (chkEmergencyRefund.IsChecked == true && (order.refundItems.OrderByDescending(or => or.create_time).FirstOrDefault()?.RefundStatusStr).ParseToString().Contains("退货"))
|
else if (chkEmergencyRefund.IsChecked == true && !(order.refundItems.OrderByDescending(or => or.create_time).FirstOrDefault()?.type).ParseToString().Contains("REFUND"))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (filterHeadStr.StartsWith("售后完成单"))
|
if (filterHeadStr.StartsWith("售后完成单"))
|
||||||
@@ -1274,13 +1280,17 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
List<oms_wei_order_item_info> tmpOrderItems = new List<oms_wei_order_item_info>();
|
List<oms_wei_order_item_info> tmpOrderItems = new List<oms_wei_order_item_info>();
|
||||||
foreach (var order in orders)
|
foreach (var order in orders)
|
||||||
{
|
{
|
||||||
foreach(var orderItem in order.orderItems)
|
foreach (var orderItem in order.orderItems)
|
||||||
{
|
{
|
||||||
if (orderItem == null || string.IsNullOrEmpty(orderItem.ItemTransitOrderWithVoid?.out_order_no) || !orderItem.PddBuyerAfterSaleAddressStr.IsNullOrEmpty() ||
|
if (orderItem.ItemOrder?.OrderBuyType == "云仓")
|
||||||
(!orderItem.TransitRefundStatusStr.Contains("需手动申请售后") && !orderItem.TransitRefundStatusStr.Contains("待用户发货")))
|
if (orderItem != null && !string.IsNullOrEmpty(orderItem.ItemTransitOrderWithVoid?.out_order_no) && orderItem.PddBuyerAfterSaleAddressStr.IsNullOrEmpty() &&
|
||||||
continue;
|
(orderItem.TransitRefundStatusStr.Contains("需手动申请售后") || orderItem.TransitRefundStatusStr.Contains("待用户发货")))
|
||||||
|
tmpOrderItems.Add(orderItem);
|
||||||
|
|
||||||
tmpOrderItems.Add(orderItem);
|
if (orderItem.ItemOrder?.OrderBuyType == "直发" || orderItem.ItemOrder?.OrderBuyType == "云改直")
|
||||||
|
if (orderItem != null && !string.IsNullOrEmpty(orderItem.ItemOrder?.out_order_no) && orderItem.PddBuyerAfterSaleAddressStr.IsNullOrEmpty() &&
|
||||||
|
((orderItem.ItemOrder?.out_after_sale_status).ParseToString().Contains("需手动申请售后") || (orderItem.ItemOrder?.out_after_sale_status).ParseToString().Contains("待用户发货")))
|
||||||
|
tmpOrderItems.Add(orderItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tmpOrderItems.Count == 0)
|
if (tmpOrderItems.Count == 0)
|
||||||
@@ -1296,9 +1306,17 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
{
|
{
|
||||||
Dispatcher.Invoke(new Action(() => { txtMsg.Text = "正在处理买手退货,总计:" + tmpOrderItems.Count + ",已处理:" + index++; }));
|
Dispatcher.Invoke(new Action(() => { txtMsg.Text = "正在处理买手退货,总计:" + tmpOrderItems.Count + ",已处理:" + index++; }));
|
||||||
|
|
||||||
var pddOrderSn = tmpOrderItem.ItemTransitOrderWithVoid.out_order_no;
|
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;
|
BuyerLoginInfo buyer = null;
|
||||||
Dispatcher.Invoke(new Action(() => { buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => b.buyer_nick == tmpOrderItem.ItemTransitOrderWithVoid.buyer_account); }));
|
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)
|
if (buyer == null)
|
||||||
{
|
{
|
||||||
BaseMsgWindow.ShowAnimateMessage("买手单:" + pddOrderSn + " 买手不在当前账户下,跳过", "Error", 3);
|
BaseMsgWindow.ShowAnimateMessage("买手单:" + pddOrderSn + " 买手不在当前账户下,跳过", "Error", 3);
|
||||||
@@ -1316,39 +1334,47 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
}
|
}
|
||||||
|
|
||||||
MainWindow.Instance.orderListCtrl.GetOrder(tmpOrderItem.order_id);
|
MainWindow.Instance.orderListCtrl.GetOrder(tmpOrderItem.order_id);
|
||||||
var order = GlobalConfig.lstOrder.FirstOrDefault(oi => oi.order_id == 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)
|
if (order == null)
|
||||||
continue;
|
continue;
|
||||||
var orderItem = order.orderItems.FirstOrDefault(oi => oi.order_id == tmpOrderItem.order_id && oi.sku_id == tmpOrderItem.sku_id);
|
oms_wei_order_item_info orderItem = null;
|
||||||
if (orderItem == null || string.IsNullOrEmpty(orderItem.ItemTransitOrderWithVoid?.out_order_no) || !orderItem.PddBuyerAfterSaleAddressStr.IsNullOrEmpty() ||
|
Dispatcher.Invoke(new Action(() => { orderItem = order.orderItems.FirstOrDefault(oi => oi.order_id == tmpOrderItem.order_id && oi.sku_id == tmpOrderItem.sku_id); }));
|
||||||
(!orderItem.TransitRefundStatusStr.Contains("需手动申请售后") && !orderItem.TransitRefundStatusStr.Contains("待用户发货")))
|
if (orderItem == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance,
|
string refundStatusStr = "";
|
||||||
// orderItem, buyer, orderItem.BuyMap);
|
string outOrderNo = "";
|
||||||
|
if (order.OrderBuyType == "云仓")
|
||||||
//buyOrderForm.TitleText = "买手退货退款 - 当前买手 " + buyer.buyer_nick;
|
{
|
||||||
|
outOrderNo = (orderItem.ItemTransitOrderWithVoid?.out_order_no).ParseToString();
|
||||||
//buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/complaint.html?order_sn=" + pddOrderSn + "&after_sales_reason=88&after_sales_type=2&after_sales_code=1002";
|
refundStatusStr = (orderItem?.TransitRefundStatusStr).ParseToString();
|
||||||
//buyOrderForm.pnlBuy.Visible = false;
|
}
|
||||||
|
else if (order.OrderBuyType == "直发" || order.OrderBuyType == "云改直")
|
||||||
//if (orderItem.BuyMap != null)
|
{
|
||||||
//{
|
outOrderNo = (order.out_order_no).ParseToString();
|
||||||
// buyOrderForm.pnlBuy.Visible = true;
|
refundStatusStr = (order.out_after_sale_status).ParseToString();
|
||||||
// buyOrderForm.pnlMap.Visible = false;
|
}
|
||||||
//}
|
if (orderItem == null || string.IsNullOrEmpty(outOrderNo) || !orderItem.PddBuyerAfterSaleAddressStr.IsNullOrEmpty() ||
|
||||||
//buyOrderForm.ShowDialog();
|
(!refundStatusStr.Contains("需手动申请售后") && !refundStatusStr.Contains("待用户发货")))
|
||||||
|
continue;
|
||||||
|
|
||||||
PddBuyerOrderLiteInfo pddBuyerOrderLiteInfo = new PddBuyerOrderLiteInfo();
|
PddBuyerOrderLiteInfo pddBuyerOrderLiteInfo = new PddBuyerOrderLiteInfo();
|
||||||
pddBuyerOrderLiteInfo.ShopOrderIdStr = orderItem.order_id;
|
pddBuyerOrderLiteInfo.ShopOrderIdStr = orderItem.order_id;
|
||||||
pddBuyerOrderLiteInfo.order_sn = pddOrderSn;
|
pddBuyerOrderLiteInfo.order_sn = pddOrderSn;
|
||||||
pddBuyerOrderLiteInfo.order_amount = orderItem.ItemTransitOrderWithVoid.out_amount;
|
|
||||||
|
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()
|
order_pdd_buyer_after_sale pddBuyerAfterSale = new order_pdd_buyer_after_sale()
|
||||||
{
|
{
|
||||||
wx_order_id = orderItem.order_id,
|
wx_order_id = orderItem.order_id,
|
||||||
wx_sku_id = orderItem.sku_id,
|
wx_sku_id = orderItem.sku_id,
|
||||||
TransitCreateTime = orderItem.ItemTransitOrderWithVoid.created_time,
|
TransitCreateTime = orderItem.ItemTransitOrderWithVoid?.created_time == null ? DateTime.MinValue : orderItem.ItemTransitOrderWithVoid.created_time,
|
||||||
pre_allocated_order_no = orderItem.ItemTransitOrderWithVoid.pre_allocated_order_no,
|
pre_allocated_order_no = orderItem.ItemTransitOrderWithVoid?.pre_allocated_order_no,
|
||||||
buyerId = buyer.buyer_id,
|
buyerId = buyer.buyer_id,
|
||||||
buyerName = buyer.buyer_name,
|
buyerName = buyer.buyer_name,
|
||||||
orderSn = pddOrderSn,
|
orderSn = pddOrderSn,
|
||||||
@@ -1360,14 +1386,16 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
pddBuyerAfterSale = orderItem.PddBuyerAfterSale;
|
pddBuyerAfterSale = orderItem.PddBuyerAfterSale;
|
||||||
|
|
||||||
bool isSimPddAfterSaleSuccess = true;
|
bool isSimPddAfterSaleSuccess = true;
|
||||||
if (orderItem.TransitRefundStatusStr.Contains("需手动申请售后"))
|
if (refundStatusStr.Contains("需手动申请售后"))
|
||||||
{
|
{
|
||||||
isSimPddAfterSaleSuccess = false;
|
isSimPddAfterSaleSuccess = false;
|
||||||
var rst = PDDBuyerOrderReadCtrl.SimPddAfterSaleWithReturnGoods(buyer, pddBuyerOrderLiteInfo);
|
// pddBuyerAfterSale作为参数传入,获取退货退款金额
|
||||||
|
var rst = PDDBuyerOrderReadCtrl.SimPddAfterSaleWithReturnGoods(buyer, pddBuyerOrderLiteInfo, pddBuyerAfterSale);
|
||||||
|
|
||||||
var afterSalesStatus = BaseRegex.GetIntJson(ref rst, "after_sales_status");
|
var afterSalesStatus = BaseRegex.GetIntJson(ref rst, "after_sales_status");
|
||||||
var afterSalesId = BaseRegex.GetLongJson(ref rst, "after_sales_id");
|
var afterSalesId = BaseRegex.GetLongJson(ref rst, "after_sales_id");
|
||||||
pddBuyerAfterSale.afterSalesId = afterSalesId.ToString();
|
pddBuyerAfterSale.afterSalesId = afterSalesId.ToString();
|
||||||
|
pddBuyerAfterSale.statusText = "待用户发货";
|
||||||
|
|
||||||
if (afterSalesStatus == 0)
|
if (afterSalesStatus == 0)
|
||||||
{
|
{
|
||||||
@@ -1377,17 +1405,35 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var e57Rst = PDDBuyerOrderReadCtrl.SendTransitAfterSaleE57(pddBuyerOrderLiteInfo, "待用户发货");
|
if (order.OrderBuyType == "云仓")
|
||||||
if (e57Rst.Contains("<code>0</code>") || e57Rst.Contains("<code>200</code>"))
|
|
||||||
{
|
{
|
||||||
BaseMsgWindow.ShowAnimateMessage("买手退款信息更新成功", "Msg", 3);
|
var e57Rst = PDDBuyerOrderReadCtrl.SendTransitAfterSaleE57(pddBuyerOrderLiteInfo, "待用户发货");
|
||||||
isSimPddAfterSaleSuccess = true;
|
if (e57Rst.Contains("<code>0</code>") || e57Rst.Contains("<code>200</code>"))
|
||||||
Thread.Sleep(Randomx.GetId(10000, 12001));
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (order.OrderBuyType == "直发" || order.OrderBuyType == "云改直")
|
||||||
{
|
{
|
||||||
var msg = BaseRegex.GetStringXml(ref e57Rst, "msg");
|
var e57Rst = PDDBuyerOrderReadCtrl.SendAfterSaleE57NeedManual(pddBuyerOrderLiteInfo, "待用户发货");
|
||||||
BaseMsgWindow.ShowAnimateMessage("买手退款信息更新失败,服务端返回 " + msg, "Error", 3);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1405,7 +1451,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
var data3 = UserLogin.GetSignaturex();
|
var data3 = UserLogin.GetSignaturex();
|
||||||
data3 += "&wx_order_id=" + pddBuyerAfterSale.wx_order_id;
|
data3 += "&wx_order_id=" + pddBuyerAfterSale.wx_order_id;
|
||||||
data3 += "&wx_sku_id=" + pddBuyerAfterSale.wx_sku_id;
|
data3 += "&wx_sku_id=" + pddBuyerAfterSale.wx_sku_id;
|
||||||
data3 += "&TransitCreateTime=" + pddBuyerAfterSale.TransitCreateTime.ToString("yyyy-MM-dd HH:mm:ss");
|
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 += "&pre_allocated_order_no=" + pddBuyerAfterSale.pre_allocated_order_no;
|
||||||
data3 += "&buyerId=" + pddBuyerAfterSale.buyerId;
|
data3 += "&buyerId=" + pddBuyerAfterSale.buyerId;
|
||||||
data3 += "&buyerName=" + pddBuyerAfterSale.buyerName;
|
data3 += "&buyerName=" + pddBuyerAfterSale.buyerName;
|
||||||
@@ -1418,6 +1465,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
|||||||
data3 += "&statusText=" + pddBuyerAfterSale.statusText;
|
data3 += "&statusText=" + pddBuyerAfterSale.statusText;
|
||||||
if (!string.IsNullOrEmpty(address))
|
if (!string.IsNullOrEmpty(address))
|
||||||
data3 += "&afterSaleAddress=" + address;
|
data3 += "&afterSaleAddress=" + address;
|
||||||
|
if (order.OrderBuyType == "直发" || order.OrderBuyType == "云改直") // 云仓 0 直发 1
|
||||||
|
data3 += "&wx_send_type=1";
|
||||||
//data3 += "&is_mdy=true";
|
//data3 += "&is_mdy=true";
|
||||||
var html3 = GetHtml.PostUtf8(url3, data3);
|
var html3 = GetHtml.PostUtf8(url3, data3);
|
||||||
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
|
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace AllBase
|
|||||||
/// 版本ID
|
/// 版本ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
public static int VersionCount = 203;
|
public static int VersionCount = 205;
|
||||||
|
|
||||||
public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
|
public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
|
||||||
public static string DebugUrl { get; set; } = "http://localhost:9000";
|
public static string DebugUrl { get; set; } = "http://localhost:9000";
|
||||||
|
|||||||
Reference in new issue
Block a user