拼多多订单获取
This commit is contained in:
1 parent
627dce3e5b
commit
87c1b8fc79
14 files changed
+679
-101
No files matched your search
@@ -12,6 +12,7 @@ using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Threading;
|
||||
using Work.BaseForms;
|
||||
|
||||
namespace _29WxOrderWpf.BaseWindows
|
||||
@@ -43,47 +44,58 @@ namespace _29WxOrderWpf.BaseWindows
|
||||
public static BaseMsgWindow ShowInfo(string msg, string caption = "", Window window = null, MsgWindowLevel wl = MsgWindowLevel.MEDIUM)
|
||||
{
|
||||
string title = string.IsNullOrEmpty(caption) ? "系统提示" : caption;
|
||||
BaseMsgWindow msgBox = CreateMsgForm(msg, title, wl);
|
||||
msgBox.imgTip.Source = Application.Current.Resources["imgBaseMsgInfo"] as ImageSource;
|
||||
if (window != null)
|
||||
msgBox.Owner = window;
|
||||
else msgBox.Owner = MainWindow.Instance;
|
||||
|
||||
|
||||
BaseMsgWindow msgBox = null;
|
||||
Window owner = window ?? MainWindow.Instance;
|
||||
|
||||
owner.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
msgBox = CreateMsgForm(msg, title, wl);
|
||||
msgBox.imgTip.Source = Application.Current.Resources["imgBaseMsgInfo"] as ImageSource;
|
||||
msgBox.Owner = owner;
|
||||
msgBox.ShowDialog();
|
||||
}));
|
||||
return msgBox;
|
||||
}
|
||||
|
||||
public static BaseMsgWindow ShowError(string msg, string caption = "", Window window = null, MsgWindowLevel wl = MsgWindowLevel.MEDIUM)
|
||||
{
|
||||
string title = string.IsNullOrEmpty(caption) ? "系统错误" : caption;
|
||||
BaseMsgWindow msgBox = CreateMsgForm(msg, title, wl);
|
||||
msgBox.imgTip.Source = Application.Current.Resources["imgBaseMsgErr"] as ImageSource;
|
||||
if (window != null)
|
||||
msgBox.Owner = window;
|
||||
else
|
||||
msgBox.Owner = MainWindow.Instance;
|
||||
msgBox.ShowDialog();
|
||||
BaseMsgWindow msgBox = null;
|
||||
Window owner = window ?? MainWindow.Instance;
|
||||
owner.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
msgBox = CreateMsgForm(msg, title, wl);
|
||||
msgBox.imgTip.Source = Application.Current.Resources["imgBaseMsgErr"] as ImageSource;
|
||||
msgBox.Owner = owner;
|
||||
msgBox.ShowDialog();
|
||||
}));
|
||||
return msgBox;
|
||||
}
|
||||
|
||||
public static BaseMsgWindow ShowConfirm(string msg, string caption = "", Window window = null, MsgWindowLevel fl = MsgWindowLevel.MEDIUM)
|
||||
{
|
||||
string title = string.IsNullOrEmpty(caption) ? "确认系统提示" : caption;
|
||||
BaseMsgWindow msgBox = new BaseMsgWindow
|
||||
|
||||
BaseMsgWindow msgBox = null;
|
||||
Window owner = window ?? MainWindow.Instance;
|
||||
owner.Dispatcher.Invoke(() =>
|
||||
{
|
||||
lblTitle = { Content = title },
|
||||
tbkMsg = { Text = msg },
|
||||
imgTip = { Source = Application.Current.Resources["imgBaseMsgQue"] as ImageSource },
|
||||
};
|
||||
if (fl.Equals(MsgWindowLevel.LARGE))
|
||||
{
|
||||
msgBox.Width = (int)MsgWindowLevel.LARGE;
|
||||
msgBox.Height = 500;
|
||||
}
|
||||
if (window != null)
|
||||
msgBox.Owner = window;
|
||||
else
|
||||
msgBox.Owner = MainWindow.Instance;
|
||||
msgBox.ShowDialog();
|
||||
msgBox = new BaseMsgWindow
|
||||
{
|
||||
lblTitle = { Content = title },
|
||||
tbkMsg = { Text = msg },
|
||||
imgTip = { Source = Application.Current.Resources["imgBaseMsgQue"] as ImageSource },
|
||||
};
|
||||
if (fl.Equals(MsgWindowLevel.LARGE))
|
||||
{
|
||||
msgBox.Width = (int)MsgWindowLevel.LARGE;
|
||||
msgBox.Height = 500;
|
||||
}
|
||||
msgBox.Owner = owner;
|
||||
msgBox.ShowDialog();
|
||||
});
|
||||
return msgBox;
|
||||
}
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
{
|
||||
transitOrderList = JsonHelper.DeserializeJsonToList<oms_wei_external_procurement_log>(JObject.Parse(html3)["data"].ParseToString());
|
||||
// 直接过滤掉仓库作废单
|
||||
transitOrderList = transitOrderList.Where(t => t.order_void_status != 1).ToList();
|
||||
//transitOrderList = transitOrderList.Where(t => t.order_void_status != 1).ToList();
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -564,7 +564,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
pdd_order.WxOrderCreateTime = wx_order_item?.ItemOrder?.create_time == null ? DateTime.MinValue : BaseClass.StampToDateTime((wx_order_item?.ItemOrder?.create_time).ParseToInt());
|
||||
pdd_order.ShopOrderRefundStr = ""; // (/*refund_item?.count > 0 &&*/ wx_order_item.refund_status > 1) ? "店铺售后" : "";
|
||||
pdd_order.wxRefundStatus = "";
|
||||
if (wx_order_item.refund_status > 1)
|
||||
if (wx_order_item?.refund_status > 1)
|
||||
{
|
||||
pdd_order.ShopOrderRefundStr = "店铺售后";
|
||||
pdd_order.wxRefundStatus = pdd_order.order_status_prompt.Contains("待发货") ? "待退款" : "待退货";
|
||||
@@ -576,9 +576,14 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
pdd_order.Express2WaybillStr = wx_transit_order?.express_2_waybill;
|
||||
pdd_order.Express2CompanyStr = wx_transit_order?.express_2_company;
|
||||
pdd_order.TransferWareHouseStatus = wx_transit_order?.transfer_warehouse_status.ParseToString();
|
||||
pdd_order.WxOrderVoidStatus = wx_transit_order?.order_void_status.ParseToString();
|
||||
pdd_order.PreAllocatedOrderNoStr = wx_transit_order?.pre_allocated_order_no.ParseToString();
|
||||
// 更新订单中转取号状态
|
||||
pdd_order.sendStatus = (pdd_order.TransitOrderStatus + " " + pdd_order.ShopOrderRefundStr).Trim();
|
||||
if (pdd_order.WxOrderVoidStatus == "1")
|
||||
{
|
||||
pdd_order.sendStatus += " 已作废";
|
||||
}
|
||||
pdd_order.TransitCreateTime = wx_transit_order?.created_time ?? DateTime.MinValue;
|
||||
}
|
||||
|
||||
@@ -603,6 +608,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
pdd_afterSale.Express2WaybillStr = wx_transit_order?.express_2_waybill;
|
||||
pdd_afterSale.Express2CompanyStr = wx_transit_order?.express_2_company;
|
||||
pdd_afterSale.TransferWareHouseStatus = wx_transit_order?.transfer_warehouse_status.ParseToString();
|
||||
pdd_afterSale.WxOrderVoidStatus = wx_transit_order?.transfer_warehouse_status.ParseToString();
|
||||
pdd_afterSale.PreAllocatedOrderNoStr = wx_transit_order?.pre_allocated_order_no.ParseToString();
|
||||
// 更新订单中转取号状态
|
||||
pdd_afterSale.sendStatus = (pdd_afterSale.TransitOrderStatus + " " + pdd_afterSale.ShopOrderRefundStr).Trim();
|
||||
@@ -675,8 +681,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
if (transit_item != null)
|
||||
{
|
||||
var shopOrder = orders.FirstOrDefault(o1 => o1.order_id == transit_item.order_no);
|
||||
var order_item = shopOrder.orderItems.FirstOrDefault(oi => oi.ItemTransitOrders.Any(t1 => t1.out_order_no == o.order_sn));
|
||||
var refund_item = refunds.FirstOrDefault(ri => ri.order_id == order_item.order_id) ?? order_item?.ItemRefund;
|
||||
var order_item = shopOrder?.orderItems.FirstOrDefault(oi => oi.ItemTransitOrders.Any(t1 => t1.out_order_no == o.order_sn));
|
||||
var refund_item = refunds.FirstOrDefault(ri => ri.order_id == order_item?.order_id) ?? order_item?.ItemRefund;
|
||||
|
||||
UpdateOrderStatus(o, order_item, refund_item, transit_item);
|
||||
}
|
||||
@@ -731,6 +737,13 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
order.shipping_amount = o.shipping_amount;
|
||||
order.order_time = o.order_time;
|
||||
order.tracking_number = o.tracking_number;
|
||||
|
||||
order.TransitCreateTime = o.TransitCreateTime;
|
||||
if (o.TransitCreateTime > DateTime.MinValue)
|
||||
{
|
||||
|
||||
}
|
||||
order.WxOrderCreateTime = o.WxOrderCreateTime;
|
||||
order.ShopOrderIdStr = o.ShopOrderIdStr;
|
||||
order.ShopOrderSkuIdStr = o.ShopOrderSkuIdStr;
|
||||
order.ShopOrderSkuNameStr = o.ShopOrderSkuNameStr;
|
||||
@@ -741,6 +754,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
order.Express2WaybillStr = o.Express2WaybillStr;
|
||||
order.Express2CompanyStr = o.Express2CompanyStr;
|
||||
order.TransferWareHouseStatus = o.TransferWareHouseStatus;
|
||||
order.WxOrderVoidStatus = o.WxOrderVoidStatus;
|
||||
order.PreAllocatedOrderNoStr = o.PreAllocatedOrderNoStr;
|
||||
order.ShopOrderRefundStr = o.ShopOrderRefundStr;
|
||||
order.wxRefundStatus = o.wxRefundStatus;
|
||||
@@ -781,20 +795,55 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
//if (order.sendStatus.ParseToString().Contains("售后"))
|
||||
if (order.ShopOrderRefundStr.ParseToString().Contains("售后"))
|
||||
{
|
||||
//if (!",2,3,4,5,7,8,10,31,".Contains((order.after_sales?.after_sales_status).ParseToString()))
|
||||
if (!",2,3,4,5,7,8,10,31,".Contains("," + (order.after_sales?.after_sales_status).ParseToString() + ","))
|
||||
{
|
||||
// 待发货直接售后,并通知中转仓接口修改退货状态
|
||||
var afterSaleRst = PddAutoAfterSale(order);
|
||||
}
|
||||
}
|
||||
SendTransitOrderE57(order);
|
||||
});
|
||||
|
||||
// 数据源绑定,不再需要显示指定显示的状态
|
||||
//Dispatcher.Invoke(new Action(() =>
|
||||
//{
|
||||
// ShowOrder(order);
|
||||
//}));
|
||||
// 根据订单状态 取号/修改取号
|
||||
SendTransitOrderE57(order);
|
||||
|
||||
if (!string.IsNullOrEmpty(order.ShopOrderIdStr))
|
||||
{
|
||||
// 买手订单状态记录到数据库
|
||||
order_pdd_buyer_order pddBuyerOrder = new order_pdd_buyer_order()
|
||||
{
|
||||
after_sales_status = (order.after_sales?.after_sales_status).ParseToInt(),
|
||||
buyerId = order.buyerId,
|
||||
buyerName = order.buyerName,
|
||||
order_amount = order.order_amount.ParseToInt(),
|
||||
order_sn = order.order_sn,
|
||||
order_status_prompt = order.order_status_prompt,
|
||||
outExpressCompanyCode = order.outExpressCompanyCode,
|
||||
order_time = order.order_time,
|
||||
pre_allocated_order_no = order.PreAllocatedOrderNoStr.ParseToInt(),
|
||||
tracking_number = order.tracking_number,
|
||||
TransitCreateTime = order.TransitCreateTime,
|
||||
wx_order_id = order.ShopOrderIdStr,
|
||||
wx_sku_id = order.ShopOrderSkuIdStr,
|
||||
};
|
||||
var url3 = BaseClass.Build29WxObjString("order/wx_add_mdy_buyer_order");
|
||||
var data3 = UserLogin.GetSignaturex();
|
||||
data3 += "&after_sales_status=" + pddBuyerOrder.after_sales_status;
|
||||
data3 += "&buyerId=" + pddBuyerOrder.buyerId;
|
||||
data3 += "&buyerName=" + pddBuyerOrder.buyerName;
|
||||
data3 += "&order_amount=" + pddBuyerOrder.order_amount;
|
||||
data3 += "&pdd_order_sn=" + pddBuyerOrder.order_sn;
|
||||
data3 += "&order_status_prompt=" + pddBuyerOrder.order_status_prompt;
|
||||
data3 += "&outExpressCompanyCode=" + pddBuyerOrder.outExpressCompanyCode;
|
||||
data3 += "&order_time=" + pddBuyerOrder.order_time;
|
||||
data3 += "&pre_allocated_order_no=" + pddBuyerOrder.pre_allocated_order_no;
|
||||
data3 += "&tracking_number=" + pddBuyerOrder.tracking_number;
|
||||
data3 += "&TransitCreateTime=" + pddBuyerOrder.TransitCreateTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
data3 += "&wx_order_id=" + pddBuyerOrder.wx_order_id;
|
||||
data3 += "&wx_sku_id=" + pddBuyerOrder.wx_sku_id;
|
||||
var html3 = GetHtml.PostUtf8(url3, data3);
|
||||
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
|
||||
html3 = GetHtml.PostUtf8(url3, data3);
|
||||
}
|
||||
});
|
||||
}
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
||||
}
|
||||
@@ -863,8 +912,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
if (transit_item != null)
|
||||
{
|
||||
var shopOrder = orders.FirstOrDefault(o1 => o1.order_id == transit_item.order_no);
|
||||
var order_item = shopOrder.orderItems.FirstOrDefault(oi => oi.ItemTransitOrders.Any(t1 => t1.out_order_no == af.orderSn));
|
||||
var refund_item = refunds.FirstOrDefault(ri => ri.order_id == order_item.order_id) ?? order_item?.ItemRefund;
|
||||
var order_item = shopOrder?.orderItems.FirstOrDefault(oi => oi.ItemTransitOrders.Any(t1 => t1.out_order_no == af.orderSn));
|
||||
var refund_item = refunds.FirstOrDefault(ri => ri.order_id == order_item?.order_id) ?? order_item?.ItemRefund;
|
||||
|
||||
UpdateAfterSaleStatus(af, order_item, refund_item, transit_item);
|
||||
}
|
||||
@@ -898,6 +947,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
afterSale.listItemMallVO = JsonHelper.DeserializeJsonToObject<ListItemMallVO>(JsonHelper.SerializeObject(af.listItemMallVO));
|
||||
afterSale.listItemStatusVO = JsonHelper.DeserializeJsonToObject<ListItemStatusVO>(JsonHelper.SerializeObject(af.listItemStatusVO));
|
||||
|
||||
afterSale.TransitCreateTime = af.TransitCreateTime;
|
||||
afterSale.WxOrderCreateTime = af.WxOrderCreateTime;
|
||||
afterSale.ShopOrderIdStr = af.ShopOrderIdStr;
|
||||
afterSale.ShopOrderSkuIdStr = af.ShopOrderSkuIdStr;
|
||||
afterSale.ShopOrderSkuNameStr = af.ShopOrderSkuNameStr;
|
||||
@@ -908,6 +959,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
afterSale.Express2WaybillStr = af.Express2WaybillStr;
|
||||
afterSale.Express2CompanyStr = af.Express2CompanyStr;
|
||||
afterSale.TransferWareHouseStatus = af.TransferWareHouseStatus;
|
||||
afterSale.WxOrderVoidStatus = af.WxOrderVoidStatus;
|
||||
afterSale.PreAllocatedOrderNoStr = af.PreAllocatedOrderNoStr;
|
||||
afterSale.ShopOrderRefundStr = af.ShopOrderRefundStr;
|
||||
//afterSale.wxRefundStatus = af.wxRefundStatus;
|
||||
@@ -926,6 +978,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
|
||||
if (isUpdate)
|
||||
{
|
||||
// 如果买手退款成功,仓库不是买手退款成功,则修改仓库售后字段为买手退款成功
|
||||
if (afterSale.AfterSaleStatusStr.Contains("退款成功") || afterSale.AfterSaleStatusStr.Contains("交易已取消"))
|
||||
{
|
||||
if (afterSale.TransitBuyerOrderRefundStatus != "买手退款成功")
|
||||
@@ -943,6 +996,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果中转仓表买手售后状态不等于买手售后单售后,更新仓库买手售后状态
|
||||
else if (afterSale.TransitBuyerOrderRefundStatus != afterSale.AfterSaleStatusStr)
|
||||
{
|
||||
//if (!afterSale.AfterSaleStatusStr.Contains("关闭") && !afterSale.AfterSaleStatusStr.Contains("撤销") && !afterSale.AfterSaleStatusStr.Contains("失败"))
|
||||
@@ -1360,7 +1414,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
// "已取号(更正)", 已取号, 提前取号, 取号失败
|
||||
// 正在处理取号、已取号(包括提前取号更正的订单)、有售后或者没有中转仓(非中转系统订单)的订单,不发送
|
||||
if (order.sendStatus == "已取号" || order.sendStatus == "已取号(更正)" ||
|
||||
order.sendStatus.ParseToString().Contains("售后") || order.TransitWarehouseIdStr.IsNullOrEmpty())
|
||||
order.sendStatus.ParseToString().Contains("已作废") || order.sendStatus.ParseToString().Contains("售后") ||
|
||||
order.TransitWarehouseIdStr.IsNullOrEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1595,9 +1650,13 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
//// 退货详情页
|
||||
////https://mobile.yangkeduo.com/complaint.html?order_sn=260417-357103060621688&after_sales_reason=0&after_sales_type=1&after_sales_code=1001
|
||||
|
||||
if (!order.order_status_prompt.Contains("待发货") && order.after_sales == null)
|
||||
if (!order.order_status_prompt.Contains("待发货"))
|
||||
{
|
||||
var refundRst = SendTransitAfterSaleE57(order, "买手已发货,需手动申请售后");
|
||||
// 如果中转单没记录买手售后,写入买手售后信息
|
||||
if (order.TransitBuyerOrderRefundStatus.IsNullOrEmpty())
|
||||
{
|
||||
var refundRst = SendTransitAfterSaleE57(order, "买手已发货,需手动申请售后");
|
||||
}
|
||||
return "{\"success\":false,\"msg\":\"仅未发货单可以自动退货\"}";
|
||||
}
|
||||
|
||||
@@ -1640,6 +1699,10 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
var refundAmount = BaseRegex.GetIntJson(ref rst, "refundAmount");
|
||||
var newMaxApplyAmount = BaseRegex.GetIntJson(ref rst, "newMaxApplyAmount");
|
||||
var shippingStatus = BaseRegex.GetIntJson(ref rst, "shippingStatus");
|
||||
if (shippingStatus == -1)
|
||||
{
|
||||
return "{\"success\":false,\"msg\":\"订单未付款\"}";
|
||||
}
|
||||
if (shippingStatus == 1 || !rst.Contains("\"shippingStatus\":0,") || !order.order_status_prompt.Contains("待发货"))
|
||||
{
|
||||
return "{\"success\":false,\"msg\":\"仅未发货单可以自动退货\"}";
|
||||
@@ -1663,14 +1726,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
/// <param name="afterSale"></param>
|
||||
public string SendTransitAfterSaleE57(PddBuyerOrderLiteInfo order, string refundStatus = "买手退款成功")
|
||||
{
|
||||
//订单作废接口(作废重拍)
|
||||
//postman request POST 'http://localhost:8088/oms-api/external_procurement/discardOrder' \
|
||||
// --header 'Content-Type: application/json' \
|
||||
// --body '{
|
||||
// "orderNo":"12334534534",
|
||||
// "outOrderNo":"12312312"
|
||||
//}' 成功返回code:0 失败返回code:1
|
||||
|
||||
string url2 = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/purchase/refundStatus";
|
||||
var data = new JObject();
|
||||
data["orderId"] = order.ShopOrderIdStr;
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
<Border Grid.Row="1" Background="#f8f8f9" BorderThickness="1,1,1,0" BorderBrush="#e0e0e0" MinHeight="4" CornerRadius="0,4,0,0">
|
||||
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent"/>
|
||||
</Border>
|
||||
<Border HorizontalAlignment="Left" Background="#e8e8e9" BorderBrush="#e1e1e1" BorderThickness="1,1,1,0" CornerRadius="4,4,0,0" Margin="0,0,0,0">
|
||||
<Border HorizontalAlignment="Left" Cursor="Hand" Background="#e8e8e9" BorderBrush="#e1e1e1" BorderThickness="1,1,1,0" CornerRadius="4,4,0,0" Margin="0,0,0,0">
|
||||
<TabPanel x:Name="HeaderPanel" Background="Transparent" IsItemsHost="True"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
public CheckBox chkSelectAll = null;
|
||||
|
||||
public string headerStr { get; set; } = "";
|
||||
public bool IsAutoReadOrder = true;
|
||||
public DateTime nextGetOrderTime = DateTime.MinValue;
|
||||
|
||||
@@ -221,10 +222,35 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
try
|
||||
{
|
||||
transitOrderList = JsonHelper.DeserializeJsonToList<oms_wei_external_procurement_log>(JObject.Parse(html3)["data"].ParseToString());
|
||||
transitOrderList = transitOrderList.Where(t => t.order_void_status != 1).ToList();
|
||||
// 直接过滤掉仓库作废单
|
||||
//transitOrderList = transitOrderList.Where(t => t.order_void_status != 1).ToList();
|
||||
}
|
||||
catch { }
|
||||
|
||||
// 读取暂时记录的买手订单,后面想办法放到中转订单库里去
|
||||
// 读取中转仓拍单订单
|
||||
var url4 = BaseClass.Build29WxObjString("order/wx_get_buyer_order_list");
|
||||
var data4 = UserLogin.GetSignaturex();
|
||||
data4 += "&wx_order_id_in=" + order_ids;
|
||||
var html4 = GetHtml.PostUtf8(url4, data4);
|
||||
if (string.IsNullOrEmpty(html4) || !html4.Contains("\"code\":200"))
|
||||
GetHtml.PostUtf8(url4, data4);
|
||||
if (string.IsNullOrEmpty(html4) || !html4.Contains("\"code\":200"))
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("订单读取失败 " + BaseRegex.GetStringJson(ref html, "msg"));
|
||||
}));
|
||||
break;
|
||||
}
|
||||
List<order_pdd_buyer_order> pddBuyerOrders = new List<order_pdd_buyer_order>();
|
||||
try
|
||||
{
|
||||
pddBuyerOrders = JsonHelper.DeserializeJsonToList<order_pdd_buyer_order>(JObject.Parse(html4)["data"].ParseToString())
|
||||
.OrderByDescending(p => p.TransitCreateTime).ToList();
|
||||
}
|
||||
catch { }
|
||||
|
||||
|
||||
// 读取关联拍单商品
|
||||
var urlMap = BaseClass.Build29WxObjString("order/wx_get_buy_prod_map");
|
||||
@@ -289,6 +315,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
item.ItemTransitOrders.AddRange(transitOrderList.Where(t => t.order_no == item.order_id && t.order_sku_id == item.sku_id));
|
||||
else
|
||||
item.ItemTransitOrders.AddRange(transitOrderList.Where(t => t.order_no == item.order_id));
|
||||
|
||||
item.PddBuyerOrders = pddBuyerOrders.Where(po => po.wx_order_id == item.order_id && po.wx_sku_id == item.sku_id).ToList();
|
||||
}
|
||||
//装载订单售后详情
|
||||
order.refundItems = new ObservableCollection<oms_wei_refund_info>(refunds.Where(of => of.order_id == order.order_id));
|
||||
@@ -346,7 +374,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}));
|
||||
}
|
||||
|
||||
void disPlayOrderTabCount()
|
||||
public void disPlayOrderTabCount()
|
||||
{
|
||||
var tabItem = this.tabOrderType.Items.Cast<TabItem>().FirstOrDefault(t => t.Header.ParseToString().StartsWith("待采购"));
|
||||
if (tabItem != null)
|
||||
@@ -381,7 +409,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
txtFilterCount.Text = "当前条件共计 " + GlobalConfig.lstFilterOrder.Count() + " 条订单记录";
|
||||
}
|
||||
|
||||
void FilterOrders()
|
||||
public void FilterOrders()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -441,7 +469,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
if (order == null)
|
||||
return true;
|
||||
|
||||
var headerStr = ((tabOrderType.SelectedItem as TabItem)?.Header).ParseToString();
|
||||
// 过滤店铺名称
|
||||
if (!string.IsNullOrEmpty(txtShopName.Text.Trim()) && !(";" + txtShopName.Text.Trim() + ";").Contains(";" + order.shop_name + ";"))
|
||||
{
|
||||
@@ -605,6 +632,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
private void tabOrderType_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
headerStr = ((tabOrderType.SelectedItem as TabItem)?.Header).ParseToString();
|
||||
FilterOrders();
|
||||
}
|
||||
|
||||
|
||||
@@ -223,11 +223,11 @@
|
||||
</Border>
|
||||
<WrapPanel Grid.Row="2" HorizontalAlignment="Center">
|
||||
<Border x:Name="borderBuyStatas" Grid.Row="1" Margin="0,0,0,0" Background="{Binding BuyerWaybillStatusBackColor}" BorderBrush="{Binding BuyerWaybillStatusBorderColor}"
|
||||
BorderThickness="1" MinWidth="30" Height="auto" CornerRadius="2" HorizontalAlignment="Center" Visibility="{Binding BuyerWaybillStatusStr,Converter={StaticResource HasTextVisibility}}">
|
||||
BorderThickness="1" MinWidth="30" Height="auto" CornerRadius="2" HorizontalAlignment="Center" Visibility="{Binding BuyerWaybillStatusStr,Converter={StaticResource HasTextVisibility}}">
|
||||
<TextBox x:Name="txtBuyStatus" Grid.Column="1" Margin="2,0,2,1" Foreground="{Binding BuyerWaybillStatusStrColor}" VerticalContentAlignment="Center" VerticalAlignment="Center"
|
||||
Background="Transparent" IsReadOnly="True" MinWidth="20" Text="{Binding BuyerWaybillStatusStr}" BorderThickness="0" />
|
||||
Background="Transparent" IsReadOnly="True" MinWidth="20" Text="{Binding BuyerWaybillStatusStr}" BorderThickness="0" />
|
||||
</Border>
|
||||
<Border x:Name="borderWarehouseStatas" Grid.Row="1" Margin="8,0,0,0" Background="{Binding WarehouseWaybillStatusBackColor}" BorderBrush="{Binding WarehouseWaybillStatusBorderColor}"
|
||||
<Border x:Name="borderWarehouseStatas" Grid.Row="1" Margin="4,0,0,0" Background="{Binding WarehouseWaybillStatusBackColor}" BorderBrush="{Binding WarehouseWaybillStatusBorderColor}"
|
||||
BorderThickness="1" MinWidth="30" Height="auto" CornerRadius="2" HorizontalAlignment="Center" Visibility="{Binding WarehouseWaybillStatusStr,Converter={StaticResource HasTextVisibility}}">
|
||||
<TextBox x:Name="txtWarehouseStatus" Grid.Column="1" Margin="2,0,2,1" Foreground="{Binding WarehouseWaybillStatusStrColor}" VerticalContentAlignment="Center" VerticalAlignment="Center"
|
||||
Background="Transparent" IsReadOnly="True" MinWidth="20" Text="{Binding WarehouseWaybillStatusStr}" BorderThickness="0" />
|
||||
@@ -243,17 +243,17 @@
|
||||
<!--<TextBox Text="发货:" Grid.Column="1" Grid.Row="1" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"/>
|
||||
<uc:UcWaterMarkTextBox WaterMark="发货" Text="" Grid.Column="1" Grid.Row="1" Margin="0,2,4,2" VerticalAlignment="Top"
|
||||
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>-->
|
||||
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="3">
|
||||
<WrapPanel x:Name="wpBuyAccount" Orientation="Horizontal" Grid.Column="1" Grid.Row="3">
|
||||
<TextBlock Text="采购账户:" IsHitTestVisible="False" Foreground="LightGray" VerticalAlignment="Center"
|
||||
Visibility="{Binding ElementName=txtOutOrderBuyerStr,Path=Text,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>
|
||||
<uc:UcWaterMarkTextBox WaterMark="采购账户:" Text="{Binding ItemTransitOrder.OutOrderBuyerStr}" Grid.Column="1" Grid.Row="1"
|
||||
<uc:UcWaterMarkTextBox WaterMark="采购账户:" Text="{Binding ItemTransitOrderWithFake.OutOrderBuyerStr}" Grid.Column="1" Grid.Row="1"
|
||||
Padding="0" Margin="-2,2" VerticalAlignment="Top" x:Name="txtOutOrderBuyerStr" Background="Transparent"
|
||||
IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Cursor="Hand" Foreground="#0099ff"/>
|
||||
</WrapPanel>
|
||||
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="4">
|
||||
<WrapPanel x:Name="wpBuyOrderId" Orientation="Horizontal" Grid.Column="1" Grid.Row="4">
|
||||
<TextBlock Text="采购单号:" IsHitTestVisible="False" Foreground="LightGray" VerticalAlignment="Center"
|
||||
Visibility="{Binding ElementName=txtOutOrderNumStr,Path=Text,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>
|
||||
<uc:UcWaterMarkTextBox WaterMark="采购单号:" Text="{Binding ItemTransitOrder.OutOrderNumStr}" Grid.Column="1" Grid.Row="1"
|
||||
<uc:UcWaterMarkTextBox WaterMark="采购单号:" Text="{Binding ItemTransitOrderWithFake.OutOrderNumStr}" Grid.Column="1" Grid.Row="1"
|
||||
Padding="0" Margin="-2,2" VerticalAlignment="Top" x:Name="txtOutOrderNumStr" Background="Transparent"
|
||||
IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Cursor="Hand" Foreground="#0099ff"/>
|
||||
<Border Grid.Column="2" Margin="4,0,0,0" Width="12" Background="Transparent" Height="12" VerticalAlignment="Center" Cursor="Hand" Visibility="{Binding ElementName=txtOutOrderBuyerStr,Path=Text,Converter={StaticResource HasTextVisibility}}"
|
||||
@@ -261,7 +261,7 @@
|
||||
<Path Margin="0,0,0,0" Fill="{StaticResource PageLinkBrush}" MouseLeftButtonDown="Path_MouseLeftButtonDown" 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" Stretch="Uniform" />
|
||||
</Border>
|
||||
</WrapPanel>
|
||||
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="5">
|
||||
<WrapPanel x:Name="wpBuyTime" Orientation="Horizontal" Grid.Column="1" Grid.Row="5">
|
||||
<TextBlock Text="采购时间:" IsHitTestVisible="False" Foreground="LightGray" VerticalAlignment="Center"
|
||||
Visibility="{Binding ElementName=txtOutOrderTimeQualifiedStr,Path=Text,Converter={StaticResource NotHasTextVisibility}}"></TextBlock>
|
||||
<uc:UcWaterMarkTextBox WaterMark="采购时间:" Text="{Binding OutOrderTimeQualifiedStr}" Grid.Column="1" Grid.Row="1"
|
||||
@@ -377,17 +377,21 @@
|
||||
<!--<Button Grid.Column="1" Grid.Row="1" Background="Transparent" x:Name="btnBuyOrder" Click="btnBuyOrder_Click"
|
||||
Visibility="{Binding ItemOrder.IsWaitBuy, Converter={StaticResource visibleToVisibilityConverter}}"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" Margin="4,0,0,0" Content="关联拍单" Width="56" Height="24"/>-->
|
||||
<Button Grid.Column="1" Grid.Row="1" x:Name="btnBuyOrder" Click="btnBuyOrder_Click"
|
||||
<WrapPanel Grid.Row="1">
|
||||
|
||||
<Button Grid.Column="1" Grid.Row="1" x:Name="btnBuyOrder" Click="btnBuyOrder_Click"
|
||||
Visibility="{Binding ItemOrder.IsWaitBuy, Converter={StaticResource visibleToVisibilityConverter}}"
|
||||
BorderBrush="{Binding BuyGoodsBtnColor}" Background="{Binding BuyGoodsBtnBackColor}" Foreground="{Binding BuyGoodsBtnColor}"
|
||||
Content="{Binding BuyGoodsBtnTxt}" IsEnabled="{Binding IsBuyGoodsBtnEnabled}" Style="{StaticResource BasePageButtonLightStyle}"
|
||||
HorizontalAlignment="Center" MinWidth="38" Height="24" Margin="4,0,0,0">
|
||||
</Button>
|
||||
</Button>
|
||||
|
||||
<Button Grid.Column="1" Grid.Row="2" x:Name="btnDeleteTransitOrder" Click="btnDeleteTransitOrder_Click"
|
||||
<Button Grid.Column="1" Grid.Row="2" x:Name="btnDeleteTransitOrder" Click="btnDeleteTransitOrder_Click"
|
||||
Visibility="Collapsed" BorderBrush="{Binding BuyGoodsBtnColor}" Background="{Binding BuyGoodsBtnBackColor}" Foreground="{Binding BuyGoodsBtnColor}"
|
||||
Content="删除仓库订单" Style="{StaticResource BasePageButtonLightStyle}" HorizontalAlignment="Center" MinWidth="38" Height="24" Margin="4,0,0,0">
|
||||
</Button>
|
||||
Content="作废重拍" Style="{StaticResource BasePageButtonLightStyle}" HorizontalAlignment="Center" MinWidth="38" Height="24" Margin="4,0,0,0">
|
||||
</Button>
|
||||
|
||||
</WrapPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.Converters;
|
||||
using _29WxOrderWpf.Ctrls.BuyerCtrls;
|
||||
using _29WxOrderWpf.UserControls;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model;
|
||||
using AllBase.Model.Local;
|
||||
using AllBase.Model.Result;
|
||||
using CefSharp.DevTools.DOM;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -465,6 +468,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_item_info order_item)
|
||||
{
|
||||
//btnBuyOrder.Content = "关联拍单";
|
||||
|
||||
// 显示预估利润
|
||||
//if (order_item.BuyMap == null && order_item.ItemOrder.out_amount == 0)
|
||||
// txtProfitForecast.Visibility = Visibility.Visible;
|
||||
@@ -488,10 +493,20 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
imgOrderItem.Source = bImg;
|
||||
}));
|
||||
});
|
||||
|
||||
if (order_item.ItemOrder.status == 20 /*&& order_item.refund_status <= 1*/ && order_item.ItemTransitOrder != null)
|
||||
{
|
||||
btnDeleteTransitOrder.Visibility = Visibility.Visible;
|
||||
}
|
||||
if (MainWindow.Instance.orderListCtrl.headerStr.StartsWith("待采购"))
|
||||
{
|
||||
wpBuyAccount.Visibility = Visibility.Collapsed;
|
||||
wpBuyOrderId.Visibility = Visibility.Collapsed;
|
||||
wpBuyTime.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
btnBuyOrder.Content = "关联拍单";
|
||||
//imgOrderItem.Source = null;
|
||||
}
|
||||
}
|
||||
@@ -603,11 +618,98 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}
|
||||
}
|
||||
|
||||
private void btnDeleteTransitOrder_Click(object sender, RoutedEventArgs e)
|
||||
private async void btnDeleteTransitOrder_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_item_info orderItem)
|
||||
{
|
||||
// 拍单前查询订单是否退款
|
||||
var orderId = orderItem.order_id;
|
||||
var skuId = orderItem.sku_id;
|
||||
await Task.Run(() =>
|
||||
{
|
||||
MainWindow.Instance.orderListCtrl.GetOrder(orderId);
|
||||
var newOrder = GlobalConfig.lstOrder.FirstOrDefault(or => or.order_id == orderId);
|
||||
if (newOrder.orderItems.Count == 1)
|
||||
orderItem = newOrder?.orderItems?.FirstOrDefault();
|
||||
else
|
||||
orderItem = newOrder?.orderItems?.FirstOrDefault(oi => oi.sku_id == skuId);
|
||||
if (orderItem == null)
|
||||
{
|
||||
BaseMsgWindow.ShowError("订单查询失败,请重试");
|
||||
return;
|
||||
}
|
||||
|
||||
if (orderItem.ItemTransitOrder == null)
|
||||
{
|
||||
BaseMsgWindow.ShowError("订单状态已修改,请确认后重试");
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
bool noBuyer = false;
|
||||
var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => b.buyer_name == orderItem.ItemTransitOrder.buyer_account);
|
||||
if (buyer == null)
|
||||
{
|
||||
if (BaseMsgWindow.ShowConfirm("拍单买手不存在,点击确定直接作废中转单并手动取消买手单,点击取消登录买手后重试").DialogResult != true)
|
||||
return;
|
||||
noBuyer = true;
|
||||
}
|
||||
|
||||
// 检测一下买手号
|
||||
if (GlobalConfig.CurrentPddBuyer.status == "在线")
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
|
||||
});
|
||||
}
|
||||
if (GlobalConfig.CurrentPddBuyer.status != "在线")
|
||||
{
|
||||
if (BaseMsgWindow.ShowConfirm("买手掉线,点击确定直接作废中转单并手动取消买手单,点击取消登录买手后重试").DialogResult != true)
|
||||
return;
|
||||
noBuyer = true;
|
||||
}
|
||||
|
||||
if (!noBuyer)
|
||||
{
|
||||
var pddAfterRst = PDDBuyerOrderReadCtrl.SimPddAfterSale(buyer, new PddBuyerOrderLiteInfo() { order_status_prompt = "待发货",
|
||||
order_amount = orderItem.ItemTransitOrder.out_amount, order_sn = orderItem.ItemTransitOrder.out_order_no });
|
||||
if (pddAfterRst.Contains("\"after_sales_status\":1") || pddAfterRst.Contains("该订单已全额退款") || pddAfterRst.Contains("订单未付款"))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
if (BaseMsgWindow.ShowConfirm("买手退款失败,点击确定直接作废中转单并手动取消买手单,点击取消稍候重试").DialogResult != true)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//订单作废接口(作废重拍)
|
||||
//postman request POST 'http://localhost:8088/oms-api/external_procurement/discardOrder' \
|
||||
// --header 'Content-Type: application/json' \
|
||||
// --body '{
|
||||
// "orderNo":"12334534534",
|
||||
// "outOrderNo":"12312312"
|
||||
//}' 成功返回code:0 失败返回code:1
|
||||
|
||||
string url2 = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/discardOrder";
|
||||
var data = new JObject();
|
||||
data["orderNo"] = orderItem.order_id;
|
||||
data["outOrderNo"] = orderItem.ItemTransitOrder.out_order_no;
|
||||
var dataStr2 = JsonHelper.SerializeObject(data);
|
||||
var discardRst = HttpResponseWXBLL.e57PostResponse(url2, dataStr2, "");
|
||||
if (discardRst.Contains("<code>0</code>") || discardRst.Contains("<code>200</code>"))
|
||||
{
|
||||
MainWindow.Instance.orderListCtrl.GetOrder(orderId);
|
||||
MainWindow.Instance.orderListCtrl.FilterOrders();
|
||||
BaseMsgWindow.ShowInfo("订单作废成功,请重新拍单");
|
||||
}
|
||||
else
|
||||
{
|
||||
var msg = BaseRegex.GetStringXml(ref discardRst, "msg");
|
||||
BaseMsgWindow.ShowInfo("订单作废失败,服务端返回 " + msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -169,6 +169,7 @@
|
||||
<Compile Include="Model\Config\BuyConfig.cs" />
|
||||
<Compile Include="Model\Local\ErpMerchantInfo.cs" />
|
||||
<Compile Include="Model\Local\oms_wei_external_procurement_log.cs" />
|
||||
<Compile Include="Model\Local\order_pdd_buyer_order.cs" />
|
||||
<Compile Include="Model\Local\TransitWarehouseParam.cs" />
|
||||
<Compile Include="Model\Local\WaybillHelper.cs" />
|
||||
<Compile Include="Model\Result\PddBuyerAfterSaleLiteInfo.cs" />
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace AllBase
|
||||
/// 版本ID
|
||||
/// </summary>
|
||||
|
||||
public static int VersionCount = 139;
|
||||
public static int VersionCount = 151;
|
||||
|
||||
public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
|
||||
public static string DebugUrl { get; set; } = "http://localhost:9000";
|
||||
|
||||
@@ -56,5 +56,6 @@ namespace AllBase.Model.Local
|
||||
public int? is_transfer_ship { get; set; }
|
||||
public string random_code { get; set; }
|
||||
public int? transfer_refund_status { get; set; }
|
||||
public int? order_void_status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -73,11 +73,34 @@ namespace AllBase.Model.Local
|
||||
get { return status == 30 || status == 100; }
|
||||
set { }
|
||||
}
|
||||
/// <summary>
|
||||
/// 售后订单(含售后关闭)
|
||||
/// </summary>
|
||||
public bool IsRefund
|
||||
{
|
||||
get { return refundItems?.Count > 0; }
|
||||
set { }
|
||||
}
|
||||
/// <summary>
|
||||
/// 紧急订单
|
||||
/// </summary>
|
||||
public bool IsEmergency
|
||||
{
|
||||
get
|
||||
{
|
||||
if (orderItems.Any(oi => oi.refund_status > 0 && oi.ItemTransitOrders.Count > 0 &&
|
||||
oi.ItemTransitOrders.Any(t => !string.IsNullOrEmpty(t.refund_status) &&
|
||||
!t.refund_status.Contains("退款成功") &&
|
||||
!t.refund_status.Contains("关闭") &&
|
||||
!t.refund_status.Contains("撤销"))))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
|
||||
public string orderStatusStr
|
||||
{
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace AllBase.Model.Local
|
||||
else
|
||||
ItemRefund = ItemOrder?.refundItems?.FirstOrDefault(r => r.sku_id == this.sku_id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 采购关联
|
||||
/// </summary>
|
||||
@@ -81,7 +82,19 @@ namespace AllBase.Model.Local
|
||||
public List<oms_wei_external_procurement_log> ItemTransitOrders { get; set; } = new List<oms_wei_external_procurement_log>();
|
||||
public oms_wei_external_procurement_log ItemTransitOrder
|
||||
{
|
||||
get { return ItemTransitOrders.FirstOrDefault(t => t.transfer_refund_status.IsNullOrZero()); }
|
||||
get { return ItemTransitOrders.FirstOrDefault(t => t.order_void_status != 1); }
|
||||
set { }
|
||||
}
|
||||
public oms_wei_external_procurement_log ItemTransitOrderWithFake
|
||||
{
|
||||
get { return ItemTransitOrders.FirstOrDefault(); }
|
||||
set { }
|
||||
}
|
||||
|
||||
public List<order_pdd_buyer_order> PddBuyerOrders { get; set; } = new List<order_pdd_buyer_order>();
|
||||
public order_pdd_buyer_order PddBuyerOrder
|
||||
{
|
||||
get { return PddBuyerOrders.FirstOrDefault(); }
|
||||
set { }
|
||||
}
|
||||
|
||||
@@ -128,64 +141,151 @@ namespace AllBase.Model.Local
|
||||
set { }
|
||||
}
|
||||
|
||||
public string TransitWaybillStatusStr
|
||||
public string BuyerWaybillStatusStr
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((ItemTransitOrder?.pre_allocated_order_no == 1 || ItemTransitOrder?.pre_allocated_order_no == 3) && !ItemTransitOrder.express_2_company.IsNullOrEmpty() && !ItemTransitOrder.express_2_waybill.IsNullOrEmpty())
|
||||
return "仓库已出单";
|
||||
if (PddBuyerOrder?.wx_order_id == "3737506236083093504")
|
||||
{
|
||||
|
||||
}
|
||||
if ((PddBuyerOrder?.order_status_prompt).ParseToString().Contains("已签收"))
|
||||
{
|
||||
return "已到中转仓";
|
||||
}
|
||||
else if ((PddBuyerOrder?.order_status_prompt).ParseToString().Contains("待用户退回商品"))
|
||||
{
|
||||
return "已到中转仓";
|
||||
}
|
||||
else if ((PddBuyerOrder?.order_status_prompt).ParseToString().Contains("待收货"))
|
||||
{
|
||||
return "买手已发货";
|
||||
}
|
||||
|
||||
if (ItemTransitOrder?.pre_allocated_order_no == 1 || ItemTransitOrder?.pre_allocated_order_no == 3)
|
||||
return "买手已出单";
|
||||
return "买手已发货";
|
||||
if (ItemTransitOrder != null)
|
||||
return "买手未出单";
|
||||
return "买手未发货";
|
||||
return "";
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
public SolidColorBrush TransitWaybillStatusStrColor
|
||||
public SolidColorBrush BuyerWaybillStatusStrColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (TransitWaybillStatusStr == "仓库已出单")
|
||||
if (BuyerWaybillStatusStr.StartsWith("已到中转仓"))
|
||||
return new SolidColorBrush(Color.FromRgb(19, 206, 102));
|
||||
if (TransitWaybillStatusStr == "买手已出单")
|
||||
if (BuyerWaybillStatusStr.StartsWith("买手已发货"))
|
||||
return new SolidColorBrush(Color.FromRgb(255, 186, 0));
|
||||
if (TransitWaybillStatusStr == "买手未出单")
|
||||
if (BuyerWaybillStatusStr.StartsWith("买手未发货"))
|
||||
return new SolidColorBrush(Color.FromRgb(255, 73, 73));
|
||||
return new SolidColorBrush(Color.FromRgb(255, 73, 73));
|
||||
}
|
||||
set { }
|
||||
}
|
||||
public SolidColorBrush TransitWaybillStatusBorderColor
|
||||
public SolidColorBrush BuyerWaybillStatusBorderColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (TransitWaybillStatusStr == "仓库已出单")
|
||||
if (BuyerWaybillStatusStr.StartsWith("已到中转仓"))
|
||||
return new SolidColorBrush(Color.FromRgb(208, 245, 224));
|
||||
if (TransitWaybillStatusStr == "买手已出单")
|
||||
if (BuyerWaybillStatusStr.StartsWith("买手已发货"))
|
||||
return new SolidColorBrush(Color.FromRgb(255, 241, 204));
|
||||
if (TransitWaybillStatusStr == "买手未出单")
|
||||
if (BuyerWaybillStatusStr.StartsWith("买手未发货"))
|
||||
return new SolidColorBrush(Color.FromRgb(255, 219, 219));
|
||||
return new SolidColorBrush(Color.FromRgb(255, 219, 219));
|
||||
}
|
||||
set { }
|
||||
}
|
||||
public SolidColorBrush BuyerWaybillStatusBackColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (BuyerWaybillStatusStr.StartsWith("已到中转仓"))
|
||||
return new SolidColorBrush(Color.FromRgb(231, 250, 240));
|
||||
if (BuyerWaybillStatusStr.StartsWith("买手已发货"))
|
||||
return new SolidColorBrush(Color.FromRgb(255, 248, 230));
|
||||
if (BuyerWaybillStatusStr.StartsWith("买手未发货"))
|
||||
return new SolidColorBrush(Color.FromRgb(255, 237, 237));
|
||||
return new SolidColorBrush(Color.FromRgb(255, 237, 237));
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
public string WarehouseWaybillStatusStr
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((ItemTransitOrder?.pre_allocated_order_no == 1 || ItemTransitOrder?.pre_allocated_order_no == 3) && !ItemTransitOrder.express_2_company.IsNullOrEmpty() && !ItemTransitOrder.express_2_waybill.IsNullOrEmpty())
|
||||
return "中转已发货";
|
||||
if (ItemTransitOrder?.pre_allocated_order_no == 1 || ItemTransitOrder?.pre_allocated_order_no == 3)
|
||||
return "待中转发货";
|
||||
if (ItemTransitOrder?.pre_allocated_order_no == 2)
|
||||
return "中转提前取号";
|
||||
if (ItemTransitOrder?.pre_allocated_order_no == 0)
|
||||
return "待中转取号";
|
||||
return "";
|
||||
}
|
||||
set { }
|
||||
}
|
||||
public SolidColorBrush WarehouseWaybillStatusStrColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (WarehouseWaybillStatusStr.StartsWith("中转已发货"))
|
||||
return new SolidColorBrush(Color.FromRgb(19, 206, 102));
|
||||
if (WarehouseWaybillStatusStr.StartsWith("待中转发货") || WarehouseWaybillStatusStr.StartsWith("中转提前取号"))
|
||||
return new SolidColorBrush(Color.FromRgb(255, 186, 0));
|
||||
if (WarehouseWaybillStatusStr.StartsWith("待中转取号"))
|
||||
return new SolidColorBrush(Color.FromRgb(255, 73, 73));
|
||||
return new SolidColorBrush(Color.FromRgb(255, 73, 73));
|
||||
}
|
||||
set { }
|
||||
}
|
||||
public SolidColorBrush WarehouseWaybillStatusBorderColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (WarehouseWaybillStatusStr.StartsWith("中转已发货"))
|
||||
return new SolidColorBrush(Color.FromRgb(208, 245, 224));
|
||||
if (WarehouseWaybillStatusStr.StartsWith("待中转发货") || WarehouseWaybillStatusStr.StartsWith("中转提前取号"))
|
||||
return new SolidColorBrush(Color.FromRgb(255, 241, 204));
|
||||
if (WarehouseWaybillStatusStr.StartsWith("待中转取号"))
|
||||
return new SolidColorBrush(Color.FromRgb(255, 219, 219));
|
||||
return new SolidColorBrush(Color.FromRgb(255, 73, 73));
|
||||
}
|
||||
set { }
|
||||
}
|
||||
public SolidColorBrush TransitWaybillStatusBackColor
|
||||
public SolidColorBrush WarehouseWaybillStatusBackColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (TransitWaybillStatusStr == "仓库已出单")
|
||||
if (WarehouseWaybillStatusStr.StartsWith("中转已发货"))
|
||||
return new SolidColorBrush(Color.FromRgb(231, 250, 240));
|
||||
if (TransitWaybillStatusStr == "买手已出单")
|
||||
if (WarehouseWaybillStatusStr.StartsWith("待中转发货") || WarehouseWaybillStatusStr.StartsWith("中转提前取号"))
|
||||
return new SolidColorBrush(Color.FromRgb(255, 248, 230));
|
||||
if (TransitWaybillStatusStr == "买手未出单")
|
||||
if (WarehouseWaybillStatusStr.StartsWith("待中转取号"))
|
||||
return new SolidColorBrush(Color.FromRgb(255, 237, 237));
|
||||
return new SolidColorBrush(Color.FromRgb(255, 73, 73));
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
public string TransitRefundStatusStr
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ItemTransitOrder?.refund_status))
|
||||
{
|
||||
if (!ItemTransitOrder.refund_status.Contains("需手动申请售后"))
|
||||
return "已申请售后 " + ItemTransitOrder.refund_status.Replace("申请收到,", "");
|
||||
return ItemTransitOrder.refund_status;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
|
||||
// 仓库采购时间是否达标字段
|
||||
@@ -193,14 +293,14 @@ namespace AllBase.Model.Local
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ItemTransitOrder == null)
|
||||
if (ItemTransitOrderWithFake == null)
|
||||
return "";
|
||||
|
||||
if (ItemOrder.createDateTime == null)
|
||||
ItemOrder.createDateTime = BaseClass.StampToDateTime(ItemOrder.create_time);
|
||||
|
||||
string timeStr = "采购时间:" + ItemTransitOrder.created_time.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
if (ItemOrder.createDateTime.Value.Date != ItemTransitOrder.created_time.Date && ItemTransitOrder.created_time > ItemTransitOrder.created_time.Date.AddHours(1.5))
|
||||
string timeStr = "采购时间:" + ItemTransitOrderWithFake.created_time.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
if (ItemOrder.createDateTime.Value.Date != ItemTransitOrderWithFake.created_time.Date && ItemTransitOrderWithFake.created_time > ItemTransitOrderWithFake.created_time.Date.AddHours(1.5))
|
||||
return timeStr + " ×";
|
||||
return timeStr + " √";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Model.Local
|
||||
{
|
||||
public class order_pdd_buyer_order
|
||||
{
|
||||
public long? id { get; set; }
|
||||
public string wx_order_id { get; set; }
|
||||
public string wx_sku_id { get; set; }
|
||||
public DateTime TransitCreateTime { get; set; }
|
||||
public int? pre_allocated_order_no { get; set; }
|
||||
public string buyerId { get; set; }
|
||||
public string buyerName { get; set; }
|
||||
public string order_sn { get; set; }
|
||||
public int? order_amount { get; set; }
|
||||
public long? order_time { get; set; }
|
||||
public string outExpressCompanyCode { get; set; }
|
||||
public string tracking_number { get; set; }
|
||||
/// <summary>
|
||||
/// 订单状态
|
||||
/// </summary>
|
||||
public string order_status_prompt { get; set; }
|
||||
public int? after_sales_status { get; set; }
|
||||
public string order_detail { get; set; }
|
||||
public DateTime add_time { get; set; }
|
||||
public DateTime mdy_time { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using NaiBa.Util.Extension;
|
||||
using AllBase.Model.MvvmBaseClasses;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -7,11 +9,211 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Model.Result
|
||||
{
|
||||
public class PddBuyerAfterSaleLiteInfo
|
||||
public class PddBuyerAfterSaleLiteInfo : PropertyNotifyObject
|
||||
{
|
||||
public string ShopOrderIdStr
|
||||
{
|
||||
get { return this.GetValue(x => x.ShopOrderIdStr); }
|
||||
set { this.SetValue(x => x.ShopOrderIdStr, value); }
|
||||
}
|
||||
public string ShopOrderSkuIdStr
|
||||
{
|
||||
get { return this.GetValue(x => x.ShopOrderSkuIdStr); }
|
||||
set { this.SetValue(x => x.ShopOrderSkuIdStr, value); }
|
||||
}
|
||||
public string ShopOrderSkuNameStr
|
||||
{
|
||||
get { return this.GetValue(x => x.ShopOrderSkuNameStr); }
|
||||
set { this.SetValue(x => x.ShopOrderSkuNameStr, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 店铺售后订单状态 无售后或售后关闭为空 否则为店铺售后
|
||||
/// </summary>
|
||||
public string ShopOrderRefundStr
|
||||
{
|
||||
get { return this.GetValue(x => x.ShopOrderRefundStr); }
|
||||
set { this.SetValue(x => x.ShopOrderRefundStr, value); }
|
||||
}
|
||||
public string TransitBuyerOrderRefundStatus
|
||||
{
|
||||
get { return this.GetValue(x => x.TransitBuyerOrderRefundStatus); }
|
||||
set { this.SetValue(x => x.TransitBuyerOrderRefundStatus, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 中转仓仓库编号
|
||||
/// </summary>
|
||||
public string TransitWarehouseIdStr
|
||||
{
|
||||
get { return this.GetValue(x => x.TransitWarehouseIdStr); }
|
||||
set { this.SetValue(x => x.TransitWarehouseIdStr, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 拍单物流公司编码
|
||||
/// </summary>
|
||||
public string Express1CompanyStr
|
||||
{
|
||||
get { return this.GetValue(x => x.Express1CompanyStr); }
|
||||
set { this.SetValue(x => x.Express1CompanyStr, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 拍单物流
|
||||
/// </summary>
|
||||
public string Express1WaybillStr
|
||||
{
|
||||
get { return this.GetValue(x => x.Express1WaybillStr); }
|
||||
set { this.SetValue(x => x.Express1WaybillStr, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 中转仓物流公司编码(提前取号)
|
||||
/// </summary>
|
||||
public string Express2CompanyStr
|
||||
{
|
||||
get { return this.GetValue(x => x.Express2CompanyStr); }
|
||||
set { this.SetValue(x => x.Express2CompanyStr, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 中转仓物流编码(提前取号)
|
||||
/// </summary>
|
||||
public string Express2WaybillStr
|
||||
{
|
||||
get { return this.GetValue(x => x.Express2WaybillStr); }
|
||||
set { this.SetValue(x => x.Express2WaybillStr, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 中转仓状态:"0" 未使用,"1" 已创建,"2" 创建失败,"3" 处理中(业务方根据此字段处理中转流程)
|
||||
/// 使用此字段判断中转仓库是否已取号
|
||||
/// </summary>
|
||||
public string TransferWareHouseStatus
|
||||
{
|
||||
get { return this.GetValue(x => x.TransferWareHouseStatus); }
|
||||
set { this.SetValue(x => x.TransferWareHouseStatus, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 微信订单作废状态 0 未作废 1已作废 2作废失败
|
||||
/// </summary>
|
||||
public string WxOrderVoidStatus
|
||||
{
|
||||
get { return this.GetValue(x => x.WxOrderVoidStatus); }
|
||||
set { this.SetValue(x => x.WxOrderVoidStatus, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 1 正常取号 2 提前取号 3 已更正
|
||||
/// </summary>
|
||||
public string PreAllocatedOrderNoStr
|
||||
{
|
||||
get { return this.GetValue(x => x.PreAllocatedOrderNoStr); }
|
||||
set { this.SetValue(x => x.PreAllocatedOrderNoStr, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 处理中, "已取号(更正)", 已取号, 提前取号, 取号失败
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string TransitOrderStatus
|
||||
{
|
||||
get
|
||||
{
|
||||
string wareHouseStatusStr = TransferWareHouseStatus == "3" ? " 仓库处理中" : "";
|
||||
//if (TransferWareHouseStatus == "3")
|
||||
//{
|
||||
// return "处理中";
|
||||
//}
|
||||
// 不考虑仓库取号失败情况,只要取号状态不是3或者1,且有仓库订单记录,就处理取号
|
||||
//if (TransferWareHouseStatus == "2")
|
||||
//{
|
||||
// return "取号失败";
|
||||
//}
|
||||
if (PreAllocatedOrderNoStr == "3")
|
||||
{
|
||||
return "已取号(更正)";
|
||||
}
|
||||
if (PreAllocatedOrderNoStr == "1")
|
||||
{
|
||||
//if (OrderTime >= new DateTime(2026, 6, 29))
|
||||
if (orderDate >= 260629)
|
||||
return "已取号";
|
||||
else
|
||||
return "提前取号" + wareHouseStatusStr;
|
||||
}
|
||||
if (PreAllocatedOrderNoStr == "2")
|
||||
{
|
||||
return "提前取号" + wareHouseStatusStr;
|
||||
}
|
||||
|
||||
//if (!TransitWarehouseIdStr.IsNullOrEmpty() && OrderTime < new DateTime(2026, 6, 29))
|
||||
if (!TransitWarehouseIdStr.IsNullOrEmpty() && orderDate < 260629)
|
||||
{
|
||||
return "提前取号(旧订单)" + wareHouseStatusStr;
|
||||
}
|
||||
if (TransitWarehouseIdStr.IsNullOrEmpty())
|
||||
{
|
||||
return "非中转仓订单";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 微信小店订单创建时间
|
||||
/// </summary>
|
||||
public DateTime WxOrderCreateTime
|
||||
{
|
||||
get { return this.GetValue(x => x.WxOrderCreateTime); }
|
||||
set { this.SetValue(x => x.WxOrderCreateTime, value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 中转单创建时间
|
||||
/// </summary>
|
||||
public DateTime TransitCreateTime
|
||||
{
|
||||
get { return this.GetValue(x => x.TransitCreateTime); }
|
||||
set { this.SetValue(x => x.TransitCreateTime, value); }
|
||||
}
|
||||
|
||||
|
||||
public string ProdInfoStr
|
||||
{
|
||||
get
|
||||
{
|
||||
var info = listItemGoodsVO == null ? "" : listItemGoodsVO.goodsName + " " + listItemGoodsVO.spec + " x" + listItemGoodsVO.goodsNumber; // 商品信息
|
||||
return info;
|
||||
}
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public decimal? OrderAmountValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return listItemAmountVO.orderAmount * 0.01m;
|
||||
}
|
||||
set { }
|
||||
}
|
||||
public decimal? RefundAmountValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return listItemAmountVO.refundAmount * 0.01m;
|
||||
}
|
||||
set { }
|
||||
}
|
||||
public string AfterSaleStatusStr
|
||||
{
|
||||
get
|
||||
{
|
||||
return listItemStatusVO.statusText;
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
public string sendStatus { get; set; } = "";
|
||||
public string afterSaleSendStatus { get; set; } = "";
|
||||
|
||||
public string buyerId { get; set; } // 买手Id
|
||||
public string buyerName { get; set; } // 买手名称
|
||||
public string sendStatus { get; set; } = "";
|
||||
public string orderSn
|
||||
{
|
||||
get
|
||||
@@ -19,11 +221,13 @@ namespace AllBase.Model.Result
|
||||
var detailPage = listItemExtraVO.navToDetailPageUrl;
|
||||
return BaseRegex.GetStringQuery(ref detailPage, "order_sn");
|
||||
}
|
||||
set { }
|
||||
}
|
||||
public int? orderDate { get { return orderSn.Split('-').FirstOrDefault().ParseToInt(); } }
|
||||
public int? orderDate { get { return orderSn.Split('-').FirstOrDefault().ParseToInt(); } set { } }
|
||||
|
||||
|
||||
public long? afterSalesId { get; set; } // 20129688312436,
|
||||
|
||||
public ListItemExtraVO listItemExtraVO { get; set; }
|
||||
public ListItemMallVO listItemMallVO { get; set; }
|
||||
public ListItemStatusVO listItemStatusVO { get; set; }
|
||||
|
||||
@@ -111,11 +111,19 @@ namespace AllBase.Model.Result
|
||||
get { return this.GetValue(x => x.ShopOrderSkuNameStr); }
|
||||
set { this.SetValue(x => x.ShopOrderSkuNameStr, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 店铺售后订单状态 无售后或售后关闭为空 否则为"店铺售后"
|
||||
/// </summary>
|
||||
public string ShopOrderRefundStr
|
||||
{
|
||||
get { return this.GetValue(x => x.ShopOrderRefundStr); }
|
||||
set { this.SetValue(x => x.ShopOrderRefundStr, value); }
|
||||
}
|
||||
public string TransitBuyerOrderRefundStatus
|
||||
{
|
||||
get { return this.GetValue(x => x.TransitBuyerOrderRefundStatus); }
|
||||
set { this.SetValue(x => x.TransitBuyerOrderRefundStatus, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 中转仓仓库编号
|
||||
/// </summary>
|
||||
@@ -166,6 +174,14 @@ namespace AllBase.Model.Result
|
||||
set { this.SetValue(x => x.TransferWareHouseStatus, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 店铺订单作废状态 0 未作废 1已作废 2作废失败
|
||||
/// </summary>
|
||||
public string WxOrderVoidStatus
|
||||
{
|
||||
get { return this.GetValue(x => x.WxOrderVoidStatus); }
|
||||
set { this.SetValue(x => x.WxOrderVoidStatus, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 1 正常取号 2 提前取号 3 已更正
|
||||
/// </summary>
|
||||
public string PreAllocatedOrderNoStr
|
||||
|
||||
Reference in new issue
Block a user