Merge branch 'main' of github.com:jtt-fan/29WxOrder

This commit is contained in:
chfei committed 2026-09-18 14:33:08 +08:00
commit 107bf82f97
31 files changed
+2644 -885

No files matched your search

+1
View File
@@ -11,6 +11,7 @@
<converters:HasTextToVisibilityConverter x:Key="HasTextVisibility" />
<converters:TextEllipsisConverter x:Key="TextEllipsisConverter" />
<converters:TextEllipsisConverter26 x:Key="TextEllipsisConverter26" />
<converters:TextEllipsisConverter8 x:Key="TextEllipsisConverter8" />
<converters:NotHasTextToVisibilityConverter x:Key="NotHasTextVisibility" />
<converters:VisibleToVisibilityConverter x:Key="visibleToVisibilityConverter" />
<converters:ImageUrlToBitmapImageConverter x:Key="ImageUrlToBitmapImage" />
+14 -12
View File
@@ -49,14 +49,14 @@ namespace _29WxOrderWpf.BaseWindows
BaseMsgWindow msgBox = null;
Window owner = window ?? MainWindow.Instance;
owner.Dispatcher.Invoke(new Action(() =>
{
//owner.Dispatcher.Invoke(() =>
Application.Current.Dispatcher.Invoke(() =>
{
msgBox = CreateMsgForm(msg, title, wl);
msgBox.imgTip.Source = Application.Current.Resources["imgBaseMsgInfo"] as ImageSource;
msgBox.Owner = owner;
//msgBox.Owner = owner;
msgBox.ShowDialog();
}));
});
return msgBox;
}
@@ -65,13 +65,14 @@ namespace _29WxOrderWpf.BaseWindows
string title = string.IsNullOrEmpty(caption) ? "系统错误" : caption;
BaseMsgWindow msgBox = null;
Window owner = window ?? MainWindow.Instance;
owner.Dispatcher.Invoke(new Action(() =>
{
//owner.Dispatcher.Invoke(() =>
Application.Current.Dispatcher.Invoke(() =>
{
msgBox = CreateMsgForm(msg, title, wl);
msgBox.imgTip.Source = Application.Current.Resources["imgBaseMsgErr"] as ImageSource;
msgBox.Owner = owner;
//msgBox.Owner = owner;
msgBox.ShowDialog();
}));
});
return msgBox;
}
@@ -81,8 +82,9 @@ namespace _29WxOrderWpf.BaseWindows
BaseMsgWindow msgBox = null;
Window owner = window ?? MainWindow.Instance;
owner.Dispatcher.Invoke(() =>
{
//owner.Dispatcher.Invoke(() =>
Application.Current.Dispatcher.Invoke(() =>
{
msgBox = new BaseMsgWindow
{
lblTitle = { Content = title },
@@ -94,7 +96,7 @@ namespace _29WxOrderWpf.BaseWindows
msgBox.Width = (int)MsgWindowLevel.LARGE;
msgBox.Height = 500;
}
msgBox.Owner = owner;
//msgBox.Owner = owner;
msgBox.ShowDialog();
});
return msgBox;
@@ -53,20 +53,36 @@ namespace _29WxOrderWpf.Converters
}
}
/// <summary>
/// 超出26个字的文本显示省略号
/// </summary>
public class TextEllipsisConverter26 : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value.ParseToString().Length > 26)
return string.Join("", value.ParseToString().Take(26)) + "…";
return value.ParseToString();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException(); // 单向绑定可不实现
}
}
/// <summary>
/// 超出26个字的文本显示省略号
/// </summary>
public class TextEllipsisConverter26 : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value.ParseToString().Length > 26)
return string.Join("", value.ParseToString().Take(26)) + "…";
return value.ParseToString();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException(); // 单向绑定可不实现
}
}
/// <summary>
/// 超出10个字的文本显示省略号
/// </summary>
public class TextEllipsisConverter8 : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value.ParseToString().Length > 8)
return string.Join("", value.ParseToString().Take(8)) + "…";
return value.ParseToString();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException(); // 单向绑定可不实现
}
}
}
+139 -36
View File
@@ -596,7 +596,7 @@
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkMapProd_Click"
Content="已关联商品"
Content="选择SKU"
FontSize="12" />
<CheckBox
x:Name="chkMapSku"
@@ -614,21 +614,20 @@
MinWidth="48"
Margin="8,0,4,0"
Padding="4,0"
c:DebugVisibility.Enable="True"
Click="btnAutoBuy_Click"
Content="自动拍单"
FontSize="12"
Style="{StaticResource BasePageButtonStyle}" />
<!-- c:DebugVisibility.Enable="true" -->
<Button
x:Name="btnAutoBuyIntorduction"
Width="Auto"
Height="22"
MinWidth="48"
Margin="0,0,4,0"
Margin="0,0,8,0"
Padding="4,0"
c:DebugVisibility.Enable="True"
Click="btnAutoBuyIntroduction_Click"
Content="自动拍单说明"
Content="自动拍单设置说明"
FontSize="12"
Style="{StaticResource BasePageButtonLightStyle}" />
<Polyline
@@ -667,15 +666,35 @@
Margin="4,0,4,4"
BorderBrush="#e0e0e0"
BorderThickness="0,0,0,1">
<CheckBox
x:Name="chkDirectSendFailed"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkDirectSendFailed_Click"
Content="直拍发货失败"
FontSize="12" />
<WrapPanel>
<CheckBox
x:Name="chkDirectSendFailed"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkDirectSendFailed_Click"
Content="直拍发货失败"
FontSize="12" />
<CheckBox
x:Name="chkWaitSend48HourNoWaybill"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkWaitSendNoWaybill_Click"
Content="48小时未发货"
FontSize="12" />
<CheckBox
x:Name="chkWaitSend72HourNoWaybill"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkWaitSendNoWaybill_Click"
Content="72小时未发货"
FontSize="12" />
</WrapPanel>
</Border>
</TabItem>
<TabItem
@@ -701,15 +720,43 @@
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<CheckBox
x:Name="chkNeedCheckExpress"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkNeedCheckExpress_Click"
Content="需核对物流"
FontSize="12" />
<WrapPanel>
<CheckBox
x:Name="chkNeedCheckExpress"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkNeedCheckExpress_Click"
Content="需核对物流"
FontSize="12" />
<Polyline
Grid.Column="3"
Width="10"
Margin="5,0"
VerticalAlignment="Center"
Points="5,0 5,8 5,0"
Stroke="{StaticResource mainColorBrush}"
StrokeThickness="2" />
<CheckBox
x:Name="chk48HourNoWaybill"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkNoWaybill_Click"
Content="48小时未发货"
FontSize="12" />
<CheckBox
x:Name="chk72HourNoWaybill"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkNoWaybill_Click"
Content="72小时未发货"
FontSize="12" />
</WrapPanel>
<WrapPanel
Grid.Column="2"
d:Opacity="0.2"
@@ -1018,7 +1065,7 @@
</wpf:TitleContent>
<wpf:TitleContent
Title="拦截退回总店状态"
Margin="4,0,4,0"
Margin="8,0,4,0"
VerticalContentAlignment="Center"
FontSize="12"
Foreground="Black"
@@ -1034,7 +1081,7 @@
<ComboBoxItem Content="请选择" />
<ComboBoxItem Content="未拦截" />
<ComboBoxItem Content="拦截中" />
<!--<ComboBoxItem Content="拦截失败" />-->
<ComboBoxItem Content="拦截失败" />
<ComboBoxItem Content="拦截成功" />
</ComboBox>
</wpf:TitleContent>
@@ -1091,17 +1138,7 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<WrapPanel>
<Button
x:Name="btnBatchRefund2"
Grid.Column="1"
Height="20"
MinWidth="48"
Margin="6,6"
Padding="4,0"
Click="btnBatchRefund_Click"
Content="批量申请买手售后"
FontSize="12"
Style="{StaticResource BasePageButtonStyle}" />
<CheckBox
x:Name="chkShopIsRefund"
Grid.Column="0"
@@ -1140,6 +1177,72 @@
Click="chkUpShopAddressAnalyseFailed_Click"
Content="总店地址解析失败"
FontSize="12" />
<Polyline
Grid.Column="14"
Width="10"
Margin="5,0"
VerticalAlignment="Center"
Points="5,0 5,8 5,0"
Stroke="{StaticResource mainColorBrush}"
StrokeThickness="2"
Visibility="Visible" />
<wpf:TitleContent
Title="买手退货状态"
Margin="4,0,4,0"
VerticalContentAlignment="Center"
FontSize="12"
Foreground="Black"
Placement="Left"
TitleVerticalAlignment="Center">
<ComboBox
x:Name="cmbReturnOrderBuyerStatus"
Width="130"
Height="23"
SelectedIndex="0"
SelectionChanged="cmbReturnOrderBuyerStatus_SelectionChanged"
Style="{StaticResource RoundedComboBox}">
<ComboBoxItem Content="请选择" />
<ComboBoxItem Content="买手待申请售后" />
<ComboBoxItem Content="买手待退货" />
<ComboBoxItem Content="买手已寄出待商家退款" />
<ComboBoxItem Content="买手退货失败" />
</ComboBox>
</wpf:TitleContent>
<Button
x:Name="btnBatchRefund2"
Grid.Column="1"
Height="20"
MinWidth="48"
Margin="6,6"
Padding="4,0"
Click="btnBatchRefund_Click"
Content="批量申请买手售后"
FontSize="12"
Style="{StaticResource BasePageButtonStyle}" />
<wpf:TitleContent
Title="退货仓状态"
Margin="8,0,4,0"
VerticalContentAlignment="Center"
FontSize="12"
Foreground="Black"
Placement="Left"
TitleVerticalAlignment="Center">
<ComboBox
x:Name="cmbReturnOrderStatus"
Width="100"
Height="23"
SelectedIndex="0"
SelectionChanged="cmbReturnOrderStatus_SelectionChanged"
Style="{StaticResource RoundedComboBox}">
<ComboBoxItem Content="请选择" />
<ComboBoxItem Content="未创建" />
<ComboBoxItem Content="创建失败" />
<ComboBoxItem Content="已创建未到仓" />
<ComboBoxItem Content="已到仓" />
<ComboBoxItem Content="已发回" />
</ComboBox>
</wpf:TitleContent>
</WrapPanel>
</Grid>
</Border>
@@ -5,6 +5,8 @@ using _29WxOrderWpf.Ctrls.BuyerCtrls;
using _29WxOrderWpf.Ctrls.Statistics;
using _29WxOrderWpf.Services;
using _29WxOrderWpf.Utils;
using _29WxOrderWpf.ViewModels;
using _29WxOrderWpf.Views;
using _29WxOrderWpf.Windows.OrderWindows;
using AllBase;
using AllBase.Extension;
@@ -42,9 +44,9 @@ using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Xml;
using System.Xml.Linq;
using _29WxOrderWpf.ViewModels;
using Work;
using Work._29Tools.BLL;
using Work.BaseForms;
using Work.BuyUsers;
using Work.KJDServer.API.Models;
using WPFCommon.Helpers;
@@ -58,6 +60,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
/// </summary>
public partial class OrderListCtrl : UserControl, INotifyPropertyChanged
{
public static bool IsAutoBuy { get; set; } = false;
public CheckBox chkSelectAll = null;
OrderFilterConfig _orderFilterConfig;
public OrderFilterConfig orderFilterConfig
@@ -304,8 +307,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// 读取关联拍单商品
var buyMapList = GetBuyProdMap(orderItems);
// 读取关联拍单的所有sku
var buyMapSkusList = GetBuyProdMapSkus(orderItems);
// 读取物流轨迹
var ewaybillLst = GetEWaybillPath(order_ids);
// 装载订单
foreach (JObject jObj in jArr)
{
@@ -364,6 +371,15 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// 装载订单售后详情
order.refundItems = new ObservableCollection<oms_wei_refund_info>(refunds.Where(of => of.order_id == order.order_id));
if (order.order_id.Contains("3738794693820307200"))
{
}
// 装载订单物流最后一条信息
order.latestEWaybills = [.. ewaybillLst.Where(ew => ew.order_id == order.order_id.ParseToLong())];
// 读取订单后立即赋值,防止滚动时实时赋值造成卡顿
InitOrderObservableProp(order);
@@ -682,6 +698,37 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
return new List<order_pdd_buyer_after_sale>();
}
public static List<oms_wei_ewaybill_path> GetEWaybillPath(string order_ids)
{
List<oms_wei_ewaybill_path> oms_wei_ewaybill_path_list = null;
if (!string.IsNullOrEmpty(order_ids))
{
try
{
var url = BaseClass.Build29WxObjString("order/wx_get_erp_ewaybill_path_latest_list");
var data = UserLogin.GetSignaturex();
data += "&erp_order_id_in=" + order_ids;
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
BaseMsgWindow.ShowAnimateMessage("物流查询失败 " + BaseRegex.GetStringJson(ref html, "msg"), "Error", 6);
}
else
{
oms_wei_ewaybill_path_list = JsonHelper.DeserializeJsonToList<oms_wei_ewaybill_path>(JObject.Parse(html)["data"].ParseToString()).OrderByDescending(p => p.update_time).ToList();
}
}
catch
{
}
}
if (oms_wei_ewaybill_path_list == null)
oms_wei_ewaybill_path_list = new List<oms_wei_ewaybill_path>();
return oms_wei_ewaybill_path_list;
}
public static List<WXBuyMapInfo> GetBuyProdMap(List<oms_wei_order_item_info> orderItems)
{
//foreach (var item in orderItems.ToList())
@@ -987,7 +1034,19 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
var waybillId = orderItem.ItemTransitOrderAfterSale.downstream_waybill;
var chkRst = AddReturnPddShopPackageInfocheck(buyer, orderSn, afterSalesId, waybillId);
var result = AddReturnPddShopPackageInfo(buyer, orderSn, afterSalesId, waybillId);
var type = 4;
if (chkRst.Contains("\"interactType\":0"))
type = 2;
var result = AddReturnPddShopPackageInfo(buyer, orderSn, afterSalesId, waybillId, "韵达快递", "121", type.ToString());
if (!result.Contains("\"result\":\"ok\""))
{
type = type == 4 ? 2 : 4;
result = AddReturnPddShopPackageInfo(buyer, orderSn, afterSalesId, waybillId, "韵达快递", "121", type.ToString());
}
if (!result.Contains("\"result\":\"ok\""))
{
result = AddReturnPddShopPackageInfo(buyer, orderSn, afterSalesId, waybillId, "韵达快递", "121", "5");
}
if (result.Contains("\"result\":\"ok\""))
{
@@ -1068,6 +1127,10 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
type = type == 4 ? 2 : 4;
result = AddReturnPddShopPackageInfo(buyer, orderSn, afterSalesId, waybillId, "韵达快递", "121", type.ToString());
}
if (!result.Contains("\"result\":\"ok\""))
{
result = AddReturnPddShopPackageInfo(buyer, orderSn, afterSalesId, waybillId, "韵达快递", "121", "5");
}
if (result.Contains("\"result\":\"ok\""))
{
@@ -1149,6 +1212,10 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
type = type == 4 ? 2 : 4;
result = AddReturnPddShopPackageInfo(buyer, orderSn, afterSalesId, waybillId, "韵达快递", "121", type.ToString());
}
if (!result.Contains("\"result\":\"ok\""))
{
result = AddReturnPddShopPackageInfo(buyer, orderSn, afterSalesId, waybillId, "韵达快递", "121", "5");
}
if (result.Contains("\"result\":\"ok\""))
{
@@ -1239,7 +1306,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
if (tabItem != null)
{
var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "异常需重拍"));
Dispatcher.Invoke(new Action(() => { tabItem.Header = "异常需重拍(" + userOrderLst.Where(r => r.isAbnormal).Count() + "|" + filteLstTmp.Count() + ")"; }));
Dispatcher.Invoke(new Action(() => { tabItem.Header = "异常需重拍(" + userOrderLst.Where(r => r.IsAbnormal).Count() + "|" + filteLstTmp.Count() + ")"; }));
}
Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("全部订单")); }));
if (tabItem != null)
@@ -1510,13 +1577,17 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
}
if (filterHeadStr.StartsWith("待采购"))
{
if (order.order_id == "3739161507780018688")
{
}
if (!order.IsWaitBuy)
return true;
if (chkMapSku.IsChecked == true && order.orderItems.All(oi => oi.BuyMap == null && (oi.BuyMapSkus == null || oi.BuyMapSkus.Count == 0)))
if (chkMapSku.IsChecked == true && order.orderItems.Any(oi => oi.BuyMap == null))
return true;
if (chkMapProd.IsChecked == true && order.orderItems.All(oi => oi.BuyMapSkus == null || oi.BuyMapSkus.Count == 0))
if (chkMapProd.IsChecked == true && order.orderItems.All(oi => oi.BuyMapSkus == null || oi.BuyMapSkus.Count == 0 || oi.BuyMap != null))
return true;
if (chkNoMapProd.IsChecked == true && order.orderItems.All(oi => oi.BuyMap != null))
if (chkNoMapProd.IsChecked == true && (order.orderItems.All(oi => oi.BuyMap != null) || order.orderItems.All(oi => oi.BuyMapSkus != null && oi.BuyMapSkus.Count > 0)))
return true;
}
if (filterHeadStr.StartsWith("待发货"))
@@ -1531,6 +1602,35 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
if (!rst2)
return true;
}
if (chkWaitSend72HourNoWaybill.IsChecked == true)
{
if (order.orderItems.Any(oi => oi.DirectPddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && bOrder?.order_time <= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72))))
{ }
// 直发没有单号正常发货才判断中转仓总店是否超时发货
else if (order.orderItems.Any(oi => (oi.DirectPddBuyerOrders?.Count).IsNullOrZero() &&
oi.PddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && bOrder?.order_time <= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72))))
{ }
else
return true;
}
else if (chkWaitSend48HourNoWaybill.IsChecked == true)
{
if (order.orderItems.Any(oi => oi.DirectPddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && (bOrder?.order_time < BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-48)) &&
bOrder.order_time >= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72)))))
{ }
// 直发没有单号才判断中转仓总店是否超时发货
else if (order.orderItems.Any(oi => (oi.DirectPddBuyerOrders?.Count).IsNullOrZero() &&
oi.PddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && (bOrder?.order_time < BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-48)) &&
bOrder.order_time >= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72)))))
{ }
else
return true;
}
}
if (filterHeadStr.StartsWith("待收货"))
{
@@ -1559,8 +1659,41 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
return true;
if (chkWaitReceiveWarehouseIsSendOut.IsChecked == true && order.orderItems.All(oi => oi.WarehouseWaybillStatusStr != "中转已出库"))
return true;
if (chk72HourNoWaybill.IsChecked == true)
{
if (order.order_id == "3739190405314033408")
{
}
// 直发没有单号才判断中转仓总店是否超时发货
if (order.orderItems.Any(oi => oi.DirectPddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && bOrder?.order_time <= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72))))
{ }
else if (order.orderItems.Any(oi => (oi.DirectPddBuyerOrders?.Count).IsNullOrZero() &&
oi.PddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && bOrder?.order_time <= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72))))
{ }
else
return true;
}
else if (chk48HourNoWaybill.IsChecked == true)
{
// 直发没有单号才判断中转仓总店是否超时发货
if (order.orderItems.Any(oi => oi.DirectPddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && (bOrder?.order_time < BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-48)) &&
bOrder.order_time >= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72)))))
{ }
else if (order.orderItems.Any(oi =>(oi.DirectPddBuyerOrders?.Count).IsNullOrZero() &&
oi.PddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && (bOrder?.order_time < BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-48)) &&
bOrder.order_time >= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72)))))
{ }
else
return true;
}
}
if (filterHeadStr.StartsWith("异常需重拍") && !order.isAbnormal)
if (filterHeadStr.StartsWith("异常需重拍") && !order.IsAbnormal)
{
return true;
}
@@ -1657,12 +1790,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
foreach (var orderItem in order.orderItems)
{
for (int i = 0; i < 1000; i++)
{
var receiver = TransitReturnOrderWindow.PddAddressAnalysis(orderItem.PddBuyerAfterSale?.afterSaleAddress);
if (!receiver.receiver_address.IsNullOrEmpty())
return true;
}
var receiver = TransitReturnOrderWindow.PddAddressAnalysis(orderItem.PddBuyerAfterSale?.afterSaleAddress);
if (!receiver.receiver_address.IsNullOrEmpty() && receiver.receiver_name.Length <= 15)
return true;
}
}
else
@@ -1673,11 +1803,34 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
foreach (var orderItem in order.orderItems)
{
var receiver = TransitReturnOrderWindow.PddAddressAnalysis(orderItem.DirectPddBuyerAfterSale?.afterSaleAddress);
if (!receiver.receiver_address.IsNullOrEmpty())
if (!receiver.receiver_address.IsNullOrEmpty() && receiver.receiver_name.Length <= 15)
return true;
}
}
}
var cmbReturnOrderStatusText = cmbReturnOrderStatus.SelectedItem.ParseToString().Replace("System.Windows.Controls.ComboBoxItem: ", "");
if (cmbReturnOrderStatusText == "未创建" && !order.orderItems.Any(oi => oi.AddEditTransitWarehouseReturnOrderStr == "未创建"))
return true;
if (cmbReturnOrderStatusText == "创建失败" && !order.orderItems.Any(oi => oi.AddEditTransitWarehouseReturnOrderStr == "创建失败"))
return true;
if (cmbReturnOrderStatusText == "已创建未到仓" && !order.orderItems.Any(oi => oi.AddEditTransitWarehouseReturnOrderStr.StartsWith("已创建未到仓")))
return true;
if (cmbReturnOrderStatusText == "已到仓" && !order.orderItems.Any(oi => oi.AddEditTransitWarehouseReturnOrderStr.StartsWith("已到仓")))
return true;
if (cmbReturnOrderStatusText == "已发回" && !order.orderItems.Any(oi => oi.AddEditTransitWarehouseReturnOrderStr.StartsWith("已发回")))
return true;
var cmbReturnOrderBuyerStatusText = cmbReturnOrderBuyerStatus.SelectedItem.ParseToString().Replace("System.Windows.Controls.ComboBoxItem: ", "");
if (cmbReturnOrderBuyerStatusText == "买手待申请售后" && order.orderItems.All(oi => !oi.TransitRefundStatusStr.Contains("需手动申请售后")))
return true;
else if (cmbReturnOrderBuyerStatusText == "买手待退货" && order.orderItems.All(oi => !oi.TransitRefundStatusStr.Contains("待用户发货")))
return true;
else if (cmbReturnOrderBuyerStatusText == "买手已寄出待商家退款" && order.orderItems.All(oi => !oi.TransitRefundStatusStr.Contains("商家处理中")))
return true;
else if (cmbReturnOrderBuyerStatusText == "买手退货失败" && order.orderItems.All(oi => !oi.TransitRefundStatusStr.Contains("退款失败")))
return true;
}
if (filterHeadStr.StartsWith("售后完成单"))
{
@@ -2176,7 +2329,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
int index = 0;
foreach (var tmpOrderItem in tmpOrderItems)
{
if (tmpOrderItem.order_id == "3738534855500515072")
if (tmpOrderItem.order_id == "3739068430223324416")
{
}
@@ -2211,7 +2364,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
continue;
}
MainWindow.Instance.orderListCtrl.GetOrder(tmpOrderItem.order_id);
await Task.Run(() => { 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); }));
@@ -2327,7 +2481,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
BaseMsgWindow.ShowAnimateMessage("买手退款信息更新成功" + orderItem.order_id, "Msg", 3);
isSimPddAfterSaleSuccess = true;
Thread.Sleep(Randomx.GetId(10000, 12001));
await Task.Run(() => { Thread.Sleep(Randomx.GetId(10000, 12001)); });
}
else
{
@@ -2342,7 +2496,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
BaseMsgWindow.ShowAnimateMessage("买手退款信息更新成功", "Msg", 3);
isSimPddAfterSaleSuccess = true;
Thread.Sleep(Randomx.GetId(10000, 12001));
await Task.Run(() => { Thread.Sleep(Randomx.GetId(10000, 12001)); });
}
else
{
@@ -2715,16 +2869,57 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
return;
}
IsAutoBuy = true;
foreach (var order in buyOrders)
{
var orderItem = order.orderItems.FirstOrDefault();
await OrderListRowItemCtrl.BuyOrder(orderItem, true);
if (IsAutoBuy == false)
break;
}
IsAutoBuy = false;
}
private void btnAutoBuyIntroduction_Click(object sender, RoutedEventArgs e)
{
AutoBuyIntroductionView autoBuyIntroForm = new AutoBuyIntroductionView();
new DialogWindow()
{
Title = "自动拍单设置说明",
Content = autoBuyIntroForm,
}.ShowDialog();
}
private void chkNoWaybill_Click(object sender, RoutedEventArgs e)
{
if (sender is CheckBox chk)
{
var isCheck = !chk.IsChecked.ParseToBool();
chk48HourNoWaybill.IsChecked = chk72HourNoWaybill.IsChecked = false;
chk.IsChecked = !isCheck;
}
FilterOrders();
}
private void chkWaitSendNoWaybill_Click(object sender, RoutedEventArgs e)
{
if (sender is CheckBox chk)
{
var isCheck = !chk.IsChecked.ParseToBool();
chkWaitSend48HourNoWaybill.IsChecked = chkWaitSend72HourNoWaybill.IsChecked = false;
chk.IsChecked = !isCheck;
}
FilterOrders();
}
private void cmbReturnOrderStatus_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
FilterOrders();
}
private void cmbReturnOrderBuyerStatus_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
FilterOrders();
}
}
@@ -207,6 +207,7 @@
<wpf:TitleContent Title="发货时间:" Visibility="{Binding ItemOrder.ship_done_time_visibility}">
<uc:UcWaterMarkTextBox1
d:Text="00-01-01 01:01:01"
Background="Transparent"
BorderThickness="0"
IsReadOnly="True"
@@ -217,6 +218,7 @@
<wpf:TitleContent Title="退款时间:" Visibility="{Binding RefundTimeVisibility}">
<uc:UcWaterMarkTextBox1
d:Text="00-01-01 01:01:01"
Background="Transparent"
BorderThickness="0"
IsReadOnly="True"
@@ -245,6 +247,16 @@
WaterMark="售价" />
</wpf:TitleContent>
<wpf:TitleContent Title="店铺运费:">
<uc:UcWaterMarkTextBox1
Background="Transparent"
BorderThickness="0"
IsReadOnly="True"
Text="{Binding PostagePriceStr}"
TextWrapping="Wrap"
WaterMark="店铺运费" />
</wpf:TitleContent>
<wpf:TitleContent Title="平台优惠:">
<uc:UcWaterMarkTextBox1
d:Text="¥100.00"
@@ -256,24 +268,25 @@
WaterMark="平台优惠" />
</wpf:TitleContent>
<wpf:TitleContent Title="进价:" Visibility="{Binding purchase_price_visibility}">
<wpf:TitleContent Title="进价:" Visibility="{Binding PurchasePriceVisibility}">
<uc:UcWaterMarkTextBox1
d:Text="¥100.00"
Background="Transparent"
BorderThickness="0"
IsReadOnly="True"
Text="{Binding purchase_price_str}"
Text="{Binding PurchasePriceStr}"
TextWrapping="Wrap"
Visibility="{Binding purchase_price_visibility}"
Visibility="{Binding PurchasePriceVisibility}"
WaterMark="进价" />
</wpf:TitleContent>
<wpf:TitleContent Title="运费:" Visibility="{Binding FreightVisibility}">
<uc:UcWaterMarkTextBox1
d:Text="¥100.00"
Background="Transparent"
BorderThickness="0"
IsReadOnly="True"
Text="{Binding freight_str}"
Text="{Binding FreightStr}"
TextWrapping="Wrap"
Visibility="{Binding FreightVisibility}"
WaterMark="运费" />
@@ -417,15 +430,33 @@
</WrapPanel>
<!-- 售后状态 -->
<TextBlock
x:Name="txtStatusStr"
HorizontalAlignment="Center"
VerticalAlignment="Top"
d:Text="售后状态"
Background="Transparent"
Foreground="{Binding ItemRefund.RefundStatusColor}"
Text="{Binding ItemRefund.RefundStatusStr}"
Visibility="{Binding ElementName=txtStatusStr, Path=Text, Converter={StaticResource HasTextVisibility}}" />
<WrapPanel>
<TextBlock
x:Name="txtOrderItemStatusStr"
HorizontalAlignment="Center"
VerticalAlignment="Top"
d:Text="物品售后状态"
Background="Transparent"
Foreground="{Binding ItemRefund.RefundStatusColor}"
Text="{Binding RefundStatusStr}"
Visibility="{Binding ElementName=txtOrderItemStatusStr, Path=Text, Converter={StaticResource HasTextVisibility}}" />
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Top"
Background="Transparent"
Foreground="{Binding ItemRefund.RefundStatusColor}"
Text=":"
Visibility="{Binding ElementName=txtOrderItemStatusStr, Path=Text, Converter={StaticResource HasTextVisibility}}" />
<TextBlock
x:Name="txtStatusStr"
HorizontalAlignment="Center"
VerticalAlignment="Top"
d:Text="售后状态"
Background="Transparent"
Foreground="{Binding ItemRefund.RefundStatusColor}"
Text="{Binding ItemRefund.RefundStatusStr}"
Visibility="{Binding ElementName=txtStatusStr, Path=Text, Converter={StaticResource HasTextVisibility}}" />
</WrapPanel>
<!-- 售后原因 -->
<TextBlock
x:Name="txtRefundReasonTextStr"
@@ -565,15 +596,10 @@
Orientation="Vertical"
VerticalSpacing="2">
<!-- 状态标签行(原 Row 1-2) -->
<WrapPanel
x:Name="wpTransitBuyerRefundStatus"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<!-- 状态标签行 -->
<WrapPanel
x:Name="wpTransitWaybillStatus"
Margin="0,0,0,4"
Margin="0,0,0,2"
HorizontalAlignment="Center">
<Border
x:Name="borderBuyStatas"
@@ -698,7 +724,7 @@
<WrapPanel Orientation="Horizontal">
<uc:UcWaterMarkTextBox1
x:Name="txtTransitOrderNumStr"
Margin="-2,2"
Margin="-2,0"
Padding="0"
VerticalAlignment="Top"
Background="Transparent"
@@ -736,7 +762,7 @@
Visibility="{Binding ElementName=txtOutOrderTimeQualifiedStr, Path=Text, Converter={StaticResource HasTextVisibility}}">
<uc:UcWaterMarkTextBox1
x:Name="txtOutOrderTimeQualifiedStr"
Margin="-2,2"
Margin="-2,0"
Padding="0"
VerticalAlignment="Top"
Background="Transparent"
@@ -754,7 +780,7 @@
Foreground="{StaticResource PageOkBrush}"
Visibility="{Binding TransitOrderWaybillToWareHouseStr, Converter={StaticResource HasTextVisibility}}">
<uc:UcWaterMarkTextBox1
Margin="-2,2"
Margin="-2,0"
Padding="0"
VerticalAlignment="Top"
Background="Transparent"
@@ -783,16 +809,26 @@
<!-- 仓库物流 -->
<wpf:TitleContent Title="仓库物流:" Visibility="{Binding TransitOrderWaybillFromWareHouseStr, Converter={StaticResource HasTextVisibility}}">
<uc:UcWaterMarkTextBox1
Margin="-2,2"
Padding="0"
VerticalAlignment="Top"
Background="Transparent"
BorderThickness="0"
IsReadOnly="True"
Text="{Binding TransitOrderWaybillFromWareHouseStr}"
TextWrapping="Wrap"
WaterMark="仓库物流" />
<WrapPanel>
<uc:UcWaterMarkTextBox1
Margin="-2,0"
Padding="0"
VerticalAlignment="Center"
Background="Transparent"
BorderThickness="0"
IsReadOnly="True"
Text="{Binding TransitOrderWaybillFromWareHouseStr}"
TextWrapping="Wrap"
WaterMark="仓库物流" />
<Button
x:Name="btnGetTransitWaybillDetail"
Margin="4,0,0,0"
Padding="0,0,0,0"
d:Content="查看"
Click="btnGetTransitWaybillDetail_Click"
Content="{Binding LatestTransitEWaybill.StatusStr}"
Style="{StaticResource LinkButton}" />
</WrapPanel>
</wpf:TitleContent>
<!-- 外采买手 -->
@@ -896,7 +932,7 @@
<uc:UcWaterMarkTextBox1
Margin="-2,2"
Padding="0"
VerticalAlignment="Top"
VerticalAlignment="Center"
Background="Transparent"
BorderThickness="0"
Foreground="{Binding ItemOrder.OutExpressNoBrush}"
@@ -907,7 +943,7 @@
<uc:UcWaterMarkTextBox1
Margin="-2,2"
Padding="0"
VerticalAlignment="Top"
VerticalAlignment="Center"
Background="Transparent"
BorderThickness="0"
Foreground="{Binding ItemOrder.OutExpressNoBrush}"
@@ -918,7 +954,7 @@
<uc:UcWaterMarkTextBox1
Margin="-2,2,4,2"
Padding="0"
VerticalAlignment="Top"
VerticalAlignment="Center"
Background="Transparent"
BorderThickness="0"
Foreground="{Binding ItemOrder.OutExpressNoBrush}"
@@ -926,6 +962,15 @@
Text="{Binding ItemOrder.OutExpressNoStr}"
TextWrapping="Wrap"
WaterMark="外采物流" />
<Button
x:Name="btnGetDirectWaybillDetail"
Margin="4,0,0,0"
Padding="0,0,0,0"
d:Content="查看"
Click="btnGetDirectWaybillDetail_Click"
Content="{Binding LatestDirectEWaybill.StatusStr}"
Style="{StaticResource LinkButton}" />
</WrapPanel>
</wpf:TitleContent>
@@ -996,7 +1041,7 @@
IsReadOnly="True"
Text="{Binding ItemOrder.shop_remark}"
TextWrapping="Wrap"
Visibility="Visible"
Visibility="{Binding ItemOrder.shop_remark, Converter={StaticResource HasTextVisibility}}"
WaterMark="店铺备注" />
<Button
x:Name="btnEditShopRemark"
@@ -1025,6 +1070,7 @@
IsReadOnly="True"
Text="{Binding ItemOrder.soft_remark}"
TextWrapping="Wrap"
Visibility="{Binding ItemOrder.soft_remark, Converter={StaticResource HasTextVisibility}}"
WaterMark="软件备注" />
<Button
x:Name="btnEditAppRemark"
@@ -1053,6 +1099,7 @@
IsReadOnly="True"
Text="{Binding TransitWarehouseRejectSuccessTimeStr}"
TextWrapping="Wrap"
Visibility="{Binding TransitWarehouseRejectSuccessTimeStr, Converter={StaticResource HasTextVisibility}}"
WaterMark="中转仓拒收" />
<Button
x:Name="btnAddEditTransitWarehouseReject"
@@ -1082,6 +1129,7 @@
IsReadOnly="True"
Text="{Binding TransitWarehouseAfterSaleWayBillStr}"
TextWrapping="Wrap"
Visibility="{Binding TransitWarehouseAfterSaleWayBillStr, Converter={StaticResource HasTextVisibility}}"
WaterMark="拦截退回总店" />
<Button
x:Name="btnAddEditTransitWarehouseAfterSale"
@@ -1089,6 +1137,17 @@
Click="btnAddEditTransitWarehouseAfterSale_Click"
Content="{Binding AddEditTransitWarehouseAfterSaleStr}"
Style="{StaticResource LinkButton}" />
<uc:UcWaterMarkTextBox1
x:Name="txtInterceptReturnInfoStr"
Margin="0,1,0,1"
VerticalAlignment="Top"
Background="Transparent"
BorderThickness="1"
IsReadOnly="True"
Text="{Binding InterceptReturnInfoStr, Converter={StaticResource TextEllipsisConverter8}}"
TextWrapping="Wrap"
ToolTip="{Binding InterceptReturnInfoStr}"
Visibility="{Binding InterceptReturnInfoStr, Converter={StaticResource HasTextVisibility}}" />
</WrapPanel>
</wpf:TitleContent>
@@ -1104,10 +1163,11 @@
IsReadOnly="True"
Text="{Binding AddEditTransitWarehouseReturnOrderWaybillStr}"
TextWrapping="Wrap"
Visibility="{Binding AddEditTransitWarehouseReturnOrderWaybillStr, Converter={StaticResource HasTextVisibility}}"
WaterMark="云仓退货" />
<Button
x:Name="btnRetrunOrder"
d:Content="添加"
d:Content="未创建"
Click="btnReturnOrder_Click"
Content="{Binding AddEditTransitWarehouseReturnOrderStr}"
Style="{StaticResource LinkButton}" />
@@ -1170,7 +1230,7 @@
Background="Transparent"
Cursor="Hand"
MouseLeftButtonDown="pathDirectBuyerAfterSaleAddress_MouseLeftButtonDown"
Visibility="{Binding ElementName=txtBuyerRefundAddress, Path=Visibility}">
Visibility="{Binding ElementName=txtDirectBuyerRefundAddress, Path=Visibility}">
<Path
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}"
@@ -1191,7 +1251,7 @@
<wpf:TitleContent>
<Button
x:Name="btnMapSkus"
Height="24"
Height="22"
MinWidth="38"
Margin="4,0,0,0"
HorizontalAlignment="Center"
@@ -1207,7 +1267,7 @@
<Button
x:Name="btnBuyOrder"
Height="24"
Height="22"
MinWidth="38"
Margin="4,0,0,0"
HorizontalAlignment="Center"
@@ -1227,7 +1287,7 @@
<Button
x:Name="btnVoidTransitOrder"
Height="24"
Height="22"
MinWidth="38"
Margin="4,0,0,0"
HorizontalAlignment="Center"
@@ -1239,7 +1299,7 @@
<Button
x:Name="btnAbnormalOrderRebuy"
Height="24"
Height="22"
MinWidth="38"
Margin="4,0,0,0"
HorizontalAlignment="Center"
@@ -1255,7 +1315,7 @@
<wpf:TitleContent>
<Button
x:Name="btnDirectBuyOrder"
Height="24"
Height="22"
MinWidth="38"
Margin="4,0,0,0"
HorizontalAlignment="Center"
@@ -1269,7 +1329,7 @@
<wpf:TitleContent>
<Button
x:Name="btnShipGift"
Height="24"
Height="22"
MinWidth="38"
Margin="4,0,0,0"
HorizontalAlignment="Center"
@@ -1279,7 +1339,19 @@
Style="{StaticResource BasePageButtonLightStyle}"
Visibility="{Binding ItemOrder.IsWaitSend, Converter={StaticResource VisibleToVisibilityConverter}}" />
</wpf:TitleContent>
<wpf:TitleContent>
<Button
x:Name="btnChangeWaybill"
Height="22"
MinWidth="38"
Margin="4,0,0,0"
HorizontalAlignment="Center"
d:Visibility="Visible"
Click="btnChangeWaybill_Click"
Content="修改物流"
Style="{StaticResource BasePageButtonLightStyle}"
Visibility="{Binding ItemOrder.IsShowChangeWaybillBtn, Converter={StaticResource VisibleToVisibilityConverter}}" />
</wpf:TitleContent>
</wpf:SpacingStackPanel>
</Grid>
</Grid>
@@ -3,6 +3,8 @@ using _29WxOrderWpf.Common;
using _29WxOrderWpf.Converters;
using _29WxOrderWpf.Ctrls.BuyerCtrls;
using _29WxOrderWpf.UserControls;
using _29WxOrderWpf.ViewModels;
using _29WxOrderWpf.Views;
using _29WxOrderWpf.Windows.OrderWindows;
using AllBase;
using AllBase.Helper;
@@ -30,7 +32,6 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using _29WxOrderWpf.ViewModels;
using TemuKJD.ToolForms;
using Work;
using Work._29Tools.BLL;
@@ -232,6 +233,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
txtShopRemark.SetValue(WidthProperty, Double.NaN);
txtShopRemark.BorderBrush = new SolidColorBrush(Color.FromArgb(0, 0, 50, 150));
txtShopRemark.IsReadOnly = true;
if (txtShopRemark.Text.IsNullOrEmpty())
txtShopRemark.Visibility = Visibility.Collapsed;
}
else
{
@@ -240,6 +243,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
txtShopRemark.SetValue(WidthProperty, 135.0);
txtShopRemark.BorderBrush = new SolidColorBrush(Color.FromArgb(50, 0, 50, 150));
txtShopRemark.IsReadOnly = false;
txtShopRemark.Visibility = Visibility.Visible;
}
}
}
@@ -251,6 +255,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
txtShopRemark.SetValue(WidthProperty, Double.NaN);
txtShopRemark.BorderBrush = new SolidColorBrush(Color.FromArgb(0, 0, 50, 150));
txtShopRemark.IsReadOnly = true;
if (txtShopRemark.Text.IsNullOrEmpty())
txtShopRemark.Visibility = Visibility.Collapsed;
}
private void btnEditAppRemark_Click(object sender, RoutedEventArgs e)
@@ -288,6 +294,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
txtAppRemark.SetValue(WidthProperty, Double.NaN);
txtAppRemark.BorderBrush = new SolidColorBrush(Color.FromArgb(0, 0, 50, 150));
txtAppRemark.IsReadOnly = true;
if (txtAppRemark.Text.IsNullOrEmpty())
txtAppRemark.Visibility = Visibility.Collapsed;
}
else
{
@@ -295,7 +303,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
btnEditAppRemark.Content = "保存";
txtAppRemark.SetValue(WidthProperty, 135.0);
txtAppRemark.BorderBrush = new SolidColorBrush(Color.FromArgb(50, 0, 50, 150));
txtAppRemark.IsReadOnly = false;
txtAppRemark.IsReadOnly = false;
txtAppRemark.Visibility = Visibility.Visible;
}
}
}
@@ -307,6 +316,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
txtAppRemark.SetValue(WidthProperty, Double.NaN);
txtAppRemark.BorderBrush = new SolidColorBrush(Color.FromArgb(0, 0, 50, 150));
txtAppRemark.IsReadOnly = true;
if (txtAppRemark.Text.IsNullOrEmpty())
txtAppRemark.Visibility = Visibility.Collapsed;
}
private async void btnBuyOrder_Click(object sender, RoutedEventArgs e)
@@ -323,17 +334,20 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
if (orderItem == null)
{
BaseMsgWindow.ShowError("订单信息为空");
if (!isAutoBuy)
BaseMsgWindow.ShowError("订单信息为空");
return;
}
if (GlobalConfig.CurrentPddBuyer == null)
{
BaseMsgWindow.ShowError("请选择买手号");
if (!isAutoBuy)
BaseMsgWindow.ShowError("请选择买手号");
return;
}
if (orderItem.ItemOrder.orderItems.Count > 1)
{
BaseMsgWindow.ShowError("多子单订单中转仓暂不支持");
if (!isAutoBuy)
BaseMsgWindow.ShowError("多子单订单中转仓暂不支持");
return;
}
@@ -342,7 +356,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
OrderListCtrl.InitOrderItemObservableProp(orderItem);
MainWindow.Instance.orderListCtrl.FilterOneOrder(orderItem.ItemOrder);
BaseMsgWindow.ShowError("已存在中转拍单信息,请核对后再拍单");
if (!isAutoBuy)
BaseMsgWindow.ShowError("已存在中转拍单信息,请核对后再拍单");
return;
}
@@ -590,6 +605,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
if (isAbnormalOrder)
buyOrderForm.AbnormalTransitWarehouseOrderInfo = orderItem.ItemTransitOrder;
buyOrderForm.ShowDialog();
OrderListCtrl.IsAutoBuy = buyOrderForm.IsAutoBuy;
}));
});
}
@@ -647,13 +663,11 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
//wpBuyOrderId.Visibility = Visibility.Collapsed;
//wpBuyTime.Visibility = Visibility.Collapsed;
//wpTransitWaybillStatus.Visibility = Visibility.Collapsed;
//wpTransitBuyerRefundStatus.Visibility = Visibility.Collapsed;
wpBuyAccount.Opacity = 0.5;
wpBuyOrderId.Opacity = 0.5;
wpBuyTime.Opacity = 0.5;
wpTransitWaybillStatus.Opacity = 0.5;
wpTransitBuyerRefundStatus.Opacity = 0.5;
}
}
}
@@ -666,7 +680,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
static bool GetIsAbnormalOrderRebuy(oms_wei_order_item_info order_item)
{
// 不是异常单的不可异常重拍
if (order_item?.ItemOrder?.isAbnormal != true)
if (order_item?.ItemOrder?.IsAbnormal != true)
return false;
// 买手未退款的,中转正式取号以后的,不可异常重拍
if (order_item.ItemTransitOrder?.refund_status != "买手退款成功" ||
@@ -1561,7 +1575,56 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
}
}
private void btnChangeWaybill_Click(object sender, RoutedEventArgs e)
{
if (DataContext is oms_wei_order_item_info orderItem && orderItem.ItemOrder != null)
{
ChangeWaybillView changeWaybillView = new ChangeWaybillView(orderItem.ItemOrder);
new DialogWindow()
{
Title = "修改订单物流",
Content = changeWaybillView,
}.ShowDialog();
}
}
private async void btnGetTransitWaybillDetail_Click(object sender, RoutedEventArgs e)
{
if (this.DataContext is oms_wei_order_item_info orderItem && GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == orderItem.shop_id.ParseToString()) is ShopLoginInfo shop)
{
//var url = BaseClass.Build29WxObjString("order/wx_get_erp_ewaybill_path_list");
////var url = BaseClass.Build29WxObjString("order/wx_get_erp_ewaybill_path_latest_list");
//var data = UserLogin.GetSignaturex();
////data += "&erp_order_id_in=" + orderItem.order_id;
//data += "&waybill_id_in=" + orderItem.ItemTransitOrderWithVoid.express_2_waybill;
//var html = GetHtml.PostUtf8(url, data);
//if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
// html = GetHtml.PostUtf8(url, data);
//if (!html.Contains("\"code\":200"))
//{
// BaseMsgForm.ShowError("查询失败请重试");
// return;
//}
var order = orderItem.ItemOrder;
var waybillId = orderItem.ItemTransitOrderWithVoid.express_2_waybill;
var expressName = orderItem.ItemTransitOrderWithVoid.express_2_company;
EWaybillPathView WaybillPathView = new EWaybillPathView(order, waybillId, expressName);
new DialogWindow()
{
Title = "订单 " + orderItem.order_id + " 物流明细",
Content = WaybillPathView,
}.ShowDialog();
}
}
private void btnGetDirectWaybillDetail_Click(object sender, RoutedEventArgs e)
{
}
}
}
+4 -1
View File
@@ -5,6 +5,7 @@ using AllBase.Model.Config;
using AllBase.Model.DBModel;
using NaiBa.Util;
using NaiBa.Util.Helper;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -27,7 +28,9 @@ namespace _29WxOrderWpf
GlobalConfig.lstWXShopTokenInfo = new ConcurrentList<WXShopTokenInfo>();
// 自动拍单支付宝密码
GlobalConfig.AlipayPassword = ConfigHelper.LoadConfig<string>("ali_pay_password");
GlobalConfig.AlipayPassword = ConfigHelper.LoadConfig<List<string>>("ali_pay_password")?.FirstOrDefault();
if (GlobalConfig.AlipayPassword == null)
GlobalConfig.AlipayPassword = "";
new WxOrder.Framework.Startup();
}
@@ -0,0 +1,218 @@
using _29WxOrderWpf.BaseWindows;
using _29WxOrderWpf.Commands;
using AllBase;
using AllBase.Model.DBModel;
using AllBase.Model.MvvmBaseClasses;
using AllBase.Model.Result;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Threading;
using Work;
using Work._29Tools.BLL;
using Work._29Tools.Forms.ShopForms;
namespace _29WxOrderWpf.ViewModels
{
/// <summary>
/// 更改运单号ViewModel
/// </summary>
public class ChangeWaybillViewModel : PropertyNotifyObject
{
public oms_wei_order_info Order
{
get { return this.GetValue(x => x.Order); }
set { this.SetValue(x => x.Order, value); }
}
public string WaybillId
{
get { return this.GetValue(x => x.WaybillId); }
set { this.SetValue(x => x.WaybillId, value); }
}
public bool IsChangeingWaybill
{
get { return this.GetValue(x => x.IsChangeingWaybill); }
set { this.SetValue(x => x.IsChangeingWaybill, value); }
}
public bool ChangeWaybillSuccess
{
get { return this.GetValue(x => x.ChangeWaybillSuccess); }
set { this.SetValue(x => x.ChangeWaybillSuccess, value); }
}
/// <summary>
/// 请求关闭窗口
/// </summary>
public event Action RequestClose;
#region 命令
public ICommand ChangeWaybillCommand { get; }
#endregion
private volatile bool _isWindowLoaded = false;
public ChangeWaybillViewModel(oms_wei_order_info _order)
{
Order = _order;
//IsChangeingWaybill = true;
ChangeWaybillCommand = new DelegateCommand(ChangeWaybill);
}
/// <summary>
/// 窗口加载完成时调用
/// </summary>
public void Start()
{
_isWindowLoaded = true;
}
/// <summary>
/// 窗口关闭时调用,停止后台任务
/// </summary>
public void Stop()
{
_isWindowLoaded = false;
}
public void ChangeWaybill()
{
ChangeWaybillSuccess = false;
string orderId = Order.order_id;
ShopLoginInfo shop = Order.Shop;
Task.Run(async () =>
{
// 查询订单是否在代发货中,如果代发需要取消代发
var apiSearchDropship = new WxApiBLL().WxApiDropshipSearch(shop, orderId, 100);
if (!apiSearchDropship.Contains("\"errcode\":0"))
{
BaseMsgWindow.ShowError("代发查询失败," + BaseRegex.GetStringJsonByRegs(ref apiSearchDropship, apiSearchDropship, "errmsg"));
return;
}
if (apiSearchDropship.Contains("ds_order_id_list") && !apiSearchDropship.Contains("\"ds_order_id_list\":[]"))
{
var dsOrderId = JsonHelper.JObjectParse(apiSearchDropship)["ds_order_id_list"].FirstOrDefault().ParseToString();
var apiCancelDropship = await new WxApiBLL().WxApiDropshipCancel(shop, Order, dsOrderId);
if (!apiCancelDropship.Contains("\"errcode\":0"))
{
IsChangeingWaybill = false;
BaseMsgWindow.ShowError("取消代发失败!请确商品未加入代发!" + BaseRegex.GetStringJsonByRegs(ref apiSearchDropship, apiSearchDropship, "errmsg"));
return;
}
}
IsChangeingWaybill = true;
var rst = WxSimOrderSendBLL.initDeliveryInfo(shop, orderId);
// {"code":0,"orderDetail":{"commonInfo":{"orderId":"3736582386601580032","orderType":0,"statusStr":"待发货","status":20,"originalStatus":11,"openid":"ow5ty7Kyik_dSqtrivr5hY2t4cwY","createTime":1779540820,"createTimeStr":"2026-05-23 20:53","isPayScoreOrder":false,"isPayDone":true,"isVirtualOrder":false,"isAuthorizedAccount":false,"giftOrderType":"","isInspectOrder":false,"isCommissionOrderDone":false,"isRechargeOrder":false,"isExpediteOrder":false,"isOverTimeOrder":2,"isMultiPackage":false,"inspectType":0,"isGiftOrder":false,"isBuyTogetherOrder":false,"isLotteryOrder":false,"isEducationOrder":false,"hideGiftOrderAddressInfo":false,"cosignmentFlag":1,"isNationalSubsidy":0,"isSameCityOrder":false,"isNationalSubsidyMerchant":false,"isSupplyOrder":false},"orderProducts":{"orderProductInfo":[{"productId":"10000863142394","thumbImg":"https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/6a092e3a000107862152a36aa881bc1e000000a100004f50","title":"脂砚斋评石头记(全三册) 烫金珍藏版 彩绘绣像 双色印刷","skuId":"15274875174","saleParam":["默认"],"productType":1,"productCnt":1,"salePrice":"3400","spuCode":"9787555418979","skuCode":"BSEC12302592708637555055A","isPreSale":false,"isIflashbuy":false,"isFreeGift":false,"canAfterSale":true,"realPrice":3350,"perRealPrice":3350,"tags":[{"class":"black","desc":"7天无理由","iconUrl":"","mainUrl":"","tagType":4},{"class":"black","desc":"运费险","iconUrl":"","mainUrl":"","tagType":5}],"icons":[],"perExchangeScore":"","productSource":{"show":false},"afterSaleInfo":{"afterId":"","canAfterSale":true,"canNotAfterSaleReason":"","jumpUrl":"","title":"","content":"","afterSaleDoneStr":"","afterSaleDoneAmountStr":"","afterSaleDoneAmount":0,"afterSaleDoneProductCnt":0,"afterSaleIngProductCnt":0,"isGuaranteeIng":false,"hasFakeOnePayFourDoneGuarantee":false},"changeProduct":0,"afterSaleDoneProductCnt":0,"afterSaleIngProductCnt":0,"supplyProductId":"","supplyNickName":"","supplyOrderId":"","supplyAppid":""}],"priceInfo":{"productPrice":"3400","orderPrice":"3350","freight":0,"originalOrderPrice":"3400","estimateProductPrice":"3350","handingFee":"0","maxUnsplitAmount":"3350","totalDiscountedPrice":"50","merchantReceievePrice":"3350","platformActivityMerchantDiscountedPrice":"50"},"activityInfo":{},"presentFee":{}},"acceptInfo":{"decodeSensitiveTime":0,"editAddrInfo":{"applyEditAddrStatus":0,"applyEditAddrAuditStaff":"","applyEditAddrAuditTimeText":"","negotiationEditTextForB":"","negotiationEditTextForA":"","negotiationEditStatus":0,"negotiationEditHistory":[],"canNegotiation":true,"hasUnResolvedRequest":0,"hasHistoryMerchantEditAddr":0,"editHistory":[]},"customerNotes":"","merchantNotes":"","presentNotes":"","addressInfo":{"cityName":"宝鸡市","countyName":"眉县","provinceName":"陕西省","userName":"刘**","telNumber":"187****9569","detailInfo":"****","virtualOrderTelNumber":""},"virtualNumberInfo":{},"quota":{"code":0,"limit":10,"used":10,"hideSensitiveInfo":true},"rechargeData":{"label":"","content":"","deliverMethod":0},"addressErrType":0},"expressInfo":{"phone":"9569","deliveryProductInfo":[],"orderProductCnt":1,"deliveryCnt":0,"isIntracityOrder":false,"intracityTracking":null,"formatUnshippedProductList":[{"productId":"10000863142394","thumbImg":"https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/6a092e3a000107862152a36aa881bc1e000000a100004f50","title":"脂砚斋评石头记(全三册) 烫金珍藏版 彩绘绣像 双色印刷","skuId":"15274875174","saleParam":["默认"],"productType":1,"productCnt":1,"salePrice":"3400","spuCode":"9787555418979","skuCode":"BSEC12302592708637555055A","isPreSale":false,"isIflashbuy":false,"isFreeGift":false,"canAfterSale":true,"realPrice":3350,"perRealPrice":3350,"tags":[{"class":"black","desc":"7天无理由","iconUrl":"","mainUrl":"","tagType":4},{"class":"black","desc":"运费险","iconUrl":"","mainUrl":"","tagType":5}],"icons":[],"perExchangeScore":"","productSource":1,"afterSaleInfo":{"afterId":"","canAfterSale":true,"canNotAfterSaleReason":"","jumpUrl":"","title":"","content":"","afterSaleDoneStr":"","afterSaleDoneAmountStr":"","afterSaleDoneAmount":0,"afterSaleDoneProductCnt":0,"afterSaleIngProductCnt":0,"isGuaranteeIng":false,"hasFakeOnePayFourDoneGuarantee":false},"changeProduct":0,"afterSaleDoneProductCnt":0,"afterSaleIngProductCnt":0,"supplyProductId":"","supplyNickName":"","supplyOrderId":"","supplyAppid":""}],"product2Img":{"15274875174":"https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/6a092e3a000107862152a36aa881bc1e000000a100004f50"}},"ewaybillInfo":{"isAllPrintOne":false,"isOpen":false,"deliveryId":"","deliveryName":"","waybillId":""}},"sendAddressInfo":{"userName":"陈图书","postalCode":"","provinceName":"安徽省","cityName":"合肥市","countyName":"肥西县","detailInfo":"上派镇中盟电子产业园8栋一单元(东电梯3楼快递指定存放点)","telNumber":"13023098035","lat":0,"lng":0},"deliveryCompanyOptions":[{"label":"极兔Line truncated
if (!rst.Contains("\"code\":0"))
{
var error = BaseRegex.GetStringJsonByRegs(ref rst, rst, "err_msg", "error_msg", "errMsg", "errorMsg", "msg");
IsChangeingWaybill = false;
BaseMsgWindow.ShowInfo("修改订单物流失败 " + error);
return;
}
var statusStr = BaseRegex.GetStringJson(ref rst, "statusStr");
if (statusStr == "待发货")
{
// 待发货暂不处理
//{"orderId":"3736580679658008320","deliveryProduct":{"deliveryId":"YUNDA","waybillId":"313023381086999","isAllProduct":true,"deliverType":1}}
//{"code":0,"errcode":0,"errmsg":"ok"}
rst = WxSimOrderSendBLL.orderSendOut(shop, orderId, WaybillId);
if (!rst.Contains("\"code\":0"))
{
var error = BaseRegex.GetStringJsonByRegs(ref rst, rst, "err_msg", "error_msg", "errMsg", "errorMsg", "msg");
IsChangeingWaybill = false;
BaseMsgWindow.ShowInfo("修改订单物流失败 " + error);
return;
}
var url = BaseClass.Build29WxObjString("order/wx_update_erp_soft_remark");
var data = UserLogin.GetSignaturex();
if (!Order.soft_remark.ParseToString().Contains("已修改物流"))
Order.soft_remark = ("已修改物流 " + Order.soft_remark).Trim();
data += "&order_id=" + Order.order_id;
data += "&soft_remark=" + Order.soft_remark;
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
Application.Current?.Dispatcher.Invoke(new Action(() =>
{
ChangeWaybillSuccess = true;
IsChangeingWaybill = false;
BaseMsgWindow.ShowInfo("修改订单物流成功");
RequestClose?.Invoke();
}));
}
else
{
//{"orderId":"3736580679658008320","changeInfo":[{"old":{"deliveryId":"YUNDA","waybillId":"313023381086999","productInfos":[{"productId":"10000875072190","skuId":"15516018429","productCnt":1}]},"new":{"deliveryId":"OTHER","waybillId":"772064082455686","productInfos":[{"productId":"10000875072190","skuId":"15516018429","productCnt":1}]}}]}
//{"code":0,"errcode":0,"errmsg":""}
var orderExpressInfoObj = JsonHelper.JObjectParse(rst)["orderDetail"]["expressInfo"];
var orderExpressInfo = JsonHelper.DeserializeJsonToObject<WxOrderExpressInfo>(JsonHelper.SerializeObject(orderExpressInfoObj));
UpdateDeliverInfoParam param = new UpdateDeliverInfoParam();
param.orderId = orderId;
param.changeInfo = new List<Dictionary<string, UpdateDeliverChangeInfo>>();
foreach (var deliveryProductInfo in orderExpressInfo.deliveryProductInfo)
{
Dictionary<string, UpdateDeliverChangeInfo> dicChange = new Dictionary<string, UpdateDeliverChangeInfo>();
dicChange["old"] = new UpdateDeliverChangeInfo
{
deliveryId = deliveryProductInfo.deliveryId,
waybillId = deliveryProductInfo.waybillId,
productInfos = new List<UpdateDeliverProductInfo>()
};
dicChange["new"] = new UpdateDeliverChangeInfo
{
deliveryId = "OTHER",
waybillId = WaybillId,
productInfos = new List<UpdateDeliverProductInfo>()
};
foreach (var prod in deliveryProductInfo.productInfos)
{
dicChange["old"].productInfos.Add(new UpdateDeliverProductInfo() { productCnt = prod.productCnt, productId = prod.productId, skuId = prod.skuId });
dicChange["new"].productInfos.Add(new UpdateDeliverProductInfo() { productCnt = prod.productCnt, productId = prod.productId, skuId = prod.skuId });
}
param.changeInfo.Add(dicChange);
}
rst = WxSimOrderSendBLL.updateDeliveryInfo(shop, param);
var str = JsonHelper.SerializeObject(param);
if (!rst.Contains("\"code\":0"))
{
var error = BaseRegex.GetStringJsonByRegs(ref rst, rst, "err_msg", "error_msg", "errMsg", "errorMsg", "msg");
IsChangeingWaybill = false;
BaseMsgWindow.ShowInfo("修改订单物流失败 " + error);
return;
}
var url = BaseClass.Build29WxObjString("order/wx_update_erp_soft_remark");
var data = UserLogin.GetSignaturex();
if (!Order.soft_remark.ParseToString().Contains("已修改物流"))
Order.soft_remark = ("已修改物流 " + Order.soft_remark).Trim();
data += "&order_id=" + Order.order_id;
data += "&soft_remark=" + Order.soft_remark;
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
Application.Current?.Dispatcher.Invoke(new Action(() =>
{
ChangeWaybillSuccess = true;
IsChangeingWaybill = false;
BaseMsgWindow.ShowInfo("修改订单物流成功");
RequestClose?.Invoke();
}));
}
});
}
}
}
@@ -0,0 +1,134 @@
using _29WxOrderWpf.BaseWindows;
using _29WxOrderWpf.Commands;
using AllBase;
using AllBase.Model.DBModel;
using AllBase.Model.MvvmBaseClasses;
using AllBase.Model.Result;
using NaiBa.Util.Extension;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Threading;
using Work;
using Work._29Tools.BLL;
using Work._29Tools.Forms.ShopForms;
using Work.BaseForms;
namespace _29WxOrderWpf.ViewModels
{
/// <summary>
/// 更改运单号ViewModel
/// </summary>
public class EWaybillPathViewModel : PropertyNotifyObject
{
public oms_wei_order_info Order
{
get { return this.GetValue(x => x.Order); }
set { this.SetValue(x => x.Order, value); }
}
public string OrderId
{
get { return this.GetValue(x => x.OrderId); }
set { this.SetValue(x => x.OrderId, value); }
}
public string ExpressName
{
get { return this.GetValue(x => x.ExpressName); }
set { this.SetValue(x => x.ExpressName, value); }
}
public string WaybillId
{
get { return this.GetValue(x => x.WaybillId); }
set { this.SetValue(x => x.WaybillId, value); }
}
public bool IsGetWaybillPath
{
get { return this.GetValue(x => x.IsGetWaybillPath); }
set { this.SetValue(x => x.IsGetWaybillPath, value); }
}
public ObservableCollection<oms_wei_ewaybill_path> WaybillPathInfos
{
get { return this.GetValue(x => x.WaybillPathInfos); }
set { this.SetValue(x => x.WaybillPathInfos, value); }
}
/// <summary>
/// 请求关闭窗口
/// </summary>
public event Action RequestClose;
#region 命令
public ICommand GetEWaybillPathCommand { get; }
#endregion
private volatile bool _isWindowLoaded = false;
public EWaybillPathViewModel(oms_wei_order_info _order, string _waybillId, string _expressName)
{
Order = _order;
OrderId = Order?.order_id;
ExpressName = _expressName;
WaybillId = _waybillId;
IsGetWaybillPath = false;
GetEWaybillPathCommand = new DelegateCommand(GetEWaybillPath);
}
/// <summary>
/// 窗口加载完成时调用
/// </summary>
public void Start()
{
_isWindowLoaded = true;
GetEWaybillPath();
}
/// <summary>
/// 窗口关闭时调用,停止后台任务
/// </summary>
public void Stop()
{
_isWindowLoaded = false;
}
public void GetEWaybillPath()
{
string orderId = Order.order_id;
ShopLoginInfo shop = Order.Shop;
Task.Run(async () =>
{
IsGetWaybillPath = true;
var url = BaseClass.Build29WxObjString("order/wx_get_erp_ewaybill_path_list");
//var url = BaseClass.Build29WxObjString("order/wx_get_erp_ewaybill_path_latest_list");
var data = UserLogin.GetSignaturex();
//data += "&erp_order_id_in=" + order_id;
data += "&waybill_id_in=" + WaybillId;
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (!html.Contains("\"code\":200"))
{
BaseMsgWindow.ShowError("查询失败请重试");
return;
}
this.WaybillPathInfos = new ObservableCollection<oms_wei_ewaybill_path>(
JsonHelper.DeserializeJsonToList<oms_wei_ewaybill_path>(JObject.Parse(html)["data"].ParseToString()).OrderByDescending(p => p.update_time).ToList());
IsGetWaybillPath = false;
});
}
}
}
@@ -2,6 +2,7 @@
x:Class="_29WxOrderWpf.Views.AutoBuyIntroductionView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:UserControls="clr-namespace:_29WxOrderWpf.UserControls"
xmlns:comn="clr-namespace:_29WxOrderWpf.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:_29WxOrderWpf.Views"
@@ -16,47 +17,85 @@
Loaded="AutoBuyInstructionView_Loaded"
mc:Ignorable="d">
<Grid Background="White">
<PasswordBox
Width="120"
Height="24"
Margin="198,79,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top" />
<TextBlock
Margin="70,83,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Text="请输入支付宝支付密码:"
TextWrapping="Wrap" />
<PasswordBox
x:Name="pbxPassWord"
Width="169"
Height="24"
Margin="198,79,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
VerticalContentAlignment="Center"
PasswordChanged="pbxPassWord_PasswordChanged" />
<TextBox
x:Name="txtPassWord"
Width="149"
Height="24"
Margin="198,79,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
VerticalContentAlignment="Center"
d:IsHitTestVisible="True"
d:Opacity="0.3"
d:Text="明文密码"
d:Visibility="Visible"
BorderBrush="Transparent"
IsHitTestVisible="True"
TextChanged="txtPassWord_TextChanged"
Visibility="Collapsed" />
<Button
x:Name="btnSee"
Width="18"
Height="18"
Margin="347,82,0,0"
Padding="0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Background="Transparent"
BorderBrush="Transparent"
Click="btnSee_Click"
Content="👁"
Cursor="Hand"
Foreground="{StaticResource PageLinkBrush}" />
<Button
x:Name="btnSaveAliPass"
Width="Auto"
Height="22"
MinWidth="48"
Margin="323,80,0,348"
Margin="372,80,0,0"
Padding="4,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Click="btnSaveAliPass_Click"
Content="保存密码"
FontSize="12"
Style="{StaticResource BasePageButtonStyle}" />
Style="{StaticResource BasePageButtonStyle}"
Visibility="Visible" />
<Button
x:Name="btnClear"
Width="Auto"
Height="22"
MinWidth="48"
Margin="384,80,0,348"
Margin="433,80,0,0"
Padding="4,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Click="btnClear_Click"
Content="清空密码"
FontSize="12"
Style="{StaticResource BasePageButtonLightStyle}" />
Style="{StaticResource BasePageButtonLightStyle}"
Visibility="Visible" />
<TextBlock
Margin="70,128,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Text="说明:请输入并保存支付宝支付密码(仅记录在本地),首次自动拍单前请手动拍单一次以缓存支付保Cookie"
TextWrapping="Wrap" />
Margin="70,128,70,128"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
TextWrapping="Wrap"><Run Text="说明:"/><Run Text="自动拍单支持已创建sku关联的商品"/><Run Language="zh-cn" Text="。"/><LineBreak/><Run Text=" "/><Run Text="请保存支付宝支付密码(仅记录在本地)供自动拍单支付,首次自动拍单前请手动拍单一次以缓存支付宝Cookie。"/></TextBlock>
</Grid>
</UserControl>
@@ -1,4 +1,9 @@
using System;
using _29WxOrderWpf.BaseWindows;
using AllBase.Helper;
using AllBase.Model.DBModel;
using NaiBa.Util;
using NaiBa.Util.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -12,6 +17,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Work.Pinduoduo;
namespace _29WxOrderWpf.Views
{
@@ -27,17 +33,42 @@ namespace _29WxOrderWpf.Views
private void AutoBuyInstructionView_Loaded(object sender, RoutedEventArgs e)
{
this.pbxPassWord.Password = DataOpenSSL.DecryptString(GlobalConfig.AlipayPassword);
}
private void btnSaveAliPass_Click(object sender, RoutedEventArgs e)
{
GlobalConfig.AlipayPassword = DataOpenSSL.EncryptString(this.pbxPassWord.Password);
ConfigHelper.SaveConfig("ali_pay_password", new List<string>() { GlobalConfig.AlipayPassword });
BaseMsgWindow.ShowInfo("密码保存成功!");
}
private void btnClear_Click(object sender, RoutedEventArgs e)
{
this.pbxPassWord.Password = "";
GlobalConfig.AlipayPassword = "";
ConfigHelper.SaveConfig("ali_pay_password", new List<string>() { GlobalConfig.AlipayPassword });
BaseMsgWindow.ShowInfo("密码已清除!");
}
private void btnSee_Click(object sender, RoutedEventArgs e)
{
if (txtPassWord.Visibility == Visibility.Visible)
txtPassWord.Visibility = Visibility.Collapsed;
else
txtPassWord.Visibility = Visibility.Visible;
}
private void pbxPassWord_PasswordChanged(object sender, RoutedEventArgs e)
{
if (txtPassWord.Text != pbxPassWord.Password)
txtPassWord.Text = pbxPassWord.Password;
}
private void txtPassWord_TextChanged(object sender, TextChangedEventArgs e)
{
if (txtPassWord.Text != pbxPassWord.Password)
pbxPassWord.Password = txtPassWord.Text;
}
}
}
+83
View File
@@ -0,0 +1,83 @@
<UserControl
x:Class="_29WxOrderWpf.Views.ChangeWaybillView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:_29WxOrderWpf.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="ChangeWaybillCtrl"
Width="450"
Height="300"
d:DesignHeight="300"
d:DesignWidth="450"
Loaded="ChangeWaybillView_Loaded"
mc:Ignorable="d">
<Grid Background="White">
<StackPanel Margin="24,24,24,0">
<TextBlock
Margin="0,0,0,20"
HorizontalAlignment="Center"
FontSize="15"
Foreground="#333333"
Text="更改订单运单号" />
<StackPanel>
<TextBlock
Margin="0,0,0,8"
Foreground="#555555"
Text="填写运单号:" />
<TextBox
x:Name="txtWaybillId"
Height="38"
VerticalContentAlignment="Center"
d:Text="1111"
BorderBrush="#D0D0D0"
BorderThickness="1"
FontSize="18"
Text="{Binding WaybillId, UpdateSourceTrigger=PropertyChanged}"
VerticalScrollBarVisibility="Auto" />
<WrapPanel Margin="0,10,0,0" FlowDirection="RightToLeft">
<Button
Width="64"
Height="26"
Margin="0,0,10,0"
HorizontalAlignment="Right"
Command="{Binding ChangeWaybillCommand}"
Content="确定更改"
Style="{StaticResource BasePageButtonStyle}" />
<Image
x:Name="imgLoading"
Width="20"
Height="20"
IsEnabled="False"
Source="{StaticResource imgLoadingPic}"
Visibility="{Binding IsChangeingWaybill, Converter={StaticResource visibleToVisibilityConverter}}">
<Image.RenderTransform>
<RotateTransform Angle="45" CenterX="10" CenterY="10" />
</Image.RenderTransform>
<Image.Triggers>
<EventTrigger RoutedEvent="Image.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
RepeatBehavior="Forever"
Storyboard.TargetName="imgLoading"
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
From="360"
To="0"
Duration="0:0:3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
</WrapPanel>
<TextBlock
d:Text="textBlock"
Text=""
TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
</Grid>
</UserControl>
@@ -0,0 +1,63 @@
using _29WxOrderWpf.ViewModels;
using AllBase.Helper;
using AllBase.Model.DBModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace _29WxOrderWpf.Views;
/// <summary>
/// ChangeWaybillView.xaml 的交互逻辑
/// </summary>
public partial class ChangeWaybillView : UserControl
{
/// <summary>
/// 视图模型
/// </summary>
public ChangeWaybillViewModel ViewModel { get; }
public ChangeWaybillView(oms_wei_order_info _order)
{
InitializeComponent();
ViewModel = new ChangeWaybillViewModel(_order);
ViewModel.RequestClose += ViewModel_RequestClose;
DataContext = ViewModel;
}
private void ChangeWaybillView_Loaded(object sender, RoutedEventArgs e)
{
ViewModel.Start();
}
private void ChangeWaybillView_Closed(object sender, RoutedEventArgs e)
{
ViewModel.Stop();
}
private void ViewModel_RequestClose()
{
Window parentWindow = Window.GetWindow(this);
if (this.IsLoaded && parentWindow != null)
parentWindow.Close();
MainWindow.Instance.orderListCtrl.FilterOneOrder(ViewModel.Order);
}
private void Button_Click(object sender, RoutedEventArgs e)
{
}
}
@@ -0,0 +1,115 @@
<UserControl
x:Class="_29WxOrderWpf.Views.EWaybillPathListView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:_29WxOrderWpf.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Height="auto"
d:DesignHeight="80"
d:DesignWidth="600"
mc:Ignorable="d">
<Grid>
<Border
Margin="4"
BorderBrush="LightGray"
BorderThickness="0,0,0,1"
CornerRadius="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<Image
x:Name="imgSku"
Grid.Row="0"
Grid.Column="0"
Width="20"
Height="20"
Margin="8"
Cursor="Hand"
MouseDown="imgSku_MouseDown"
MouseEnter="imgSku_MouseEnter"
MouseLeave="imgSku_MouseLeave" />
<Grid
Grid.Column="1"
Margin="0,8"
VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" Visibility="{Binding node_desc, Converter={StaticResource HasTextVisibility}}">
<TextBox
VerticalAlignment="Top"
d:Opacity="0.5"
d:Visibility="Visible"
Background="Transparent"
BorderThickness="0"
FontWeight="Bold"
IsReadOnly="True"
Text="物流信息:"
TextWrapping="Wrap"
Visibility="Collapsed" />
<TextBox
Grid.Row="0"
VerticalAlignment="Top"
d:Opacity="0.5"
d:Text="已送达"
Background="Transparent"
BorderThickness="0"
FontWeight="Bold"
IsReadOnly="True"
Text="{Binding node_desc}"
TextWrapping="Wrap" />
</WrapPanel>
<WrapPanel Grid.Row="1" Visibility="{Binding UpdateTimeStr, Converter={StaticResource HasTextVisibility}}" Margin="4">
<TextBox
VerticalAlignment="Top"
d:Opacity="0.5"
d:Visibility="Visible"
Background="Transparent"
BorderThickness="0"
IsReadOnly="True"
Text="更新时间:"
TextWrapping="Wrap"
Visibility="Collapsed" />
<TextBox
Grid.Row="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
d:Opacity="0.5"
d:Text="2000/1/1 0:0:0"
Background="Transparent"
BorderThickness="0"
IsReadOnly="True"
Text="{Binding UpdateTimeStr}"
TextWrapping="Wrap" />
</WrapPanel>
</Grid>
<Button
x:Name="btnAdd"
Grid.Column="100"
MinWidth="18"
MinHeight="28"
Margin="8"
Padding="4"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Content=""
Style="{StaticResource BasePageButtonStyle}"
Visibility="Hidden" />
</Grid>
</Border>
</Grid>
</UserControl>
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace _29WxOrderWpf.Views;
/// <summary>
/// EWaybillPathListView.xaml 的交互逻辑
/// </summary>
public partial class EWaybillPathListView : UserControl
{
public EWaybillPathListView()
{
InitializeComponent();
}
private void imgSku_MouseDown(object sender, MouseButtonEventArgs e)
{
}
private void imgSku_MouseEnter(object sender, MouseEventArgs e)
{
}
private void imgSku_MouseLeave(object sender, MouseEventArgs e)
{
}
}
+138
View File
@@ -0,0 +1,138 @@
<UserControl
x:Class="_29WxOrderWpf.Views.EWaybillPathView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:_29WxOrderWpf.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="EWaybillPathCtrl"
d:DesignHeight="450"
d:DesignWidth="800" Loaded="EWaybillPathCtrl_Loaded"
Background="White"
mc:Ignorable="d">
<Grid Margin="24,24,24,24">
<WrapPanel
Margin="0,0,0,20"
HorizontalAlignment="Center"
VerticalAlignment="top">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Top"
FontSize="15"
Foreground="#333333"
Text="订单 " />
<TextBox
x:Name="txtOrderId"
VerticalContentAlignment="Center"
d:Text="1111111"
BorderBrush="#D0D0D0"
BorderThickness="0"
FontSize="14"
Text="{Binding OrderId, UpdateSourceTrigger=PropertyChanged}"
VerticalScrollBarVisibility="Auto" />
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Top"
FontSize="15"
Foreground="#333333"
Text=" 物流明细" />
</WrapPanel>
<Grid Margin="24,24,24,24">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Margin="24,24,24,24">
<Grid>
<WrapPanel>
<TextBlock FontSize="14" Text="物流公司:" />
<TextBox
x:Name="txtExpressName"
VerticalContentAlignment="Center"
d:Text="物流公司:"
BorderBrush="#D0D0D0"
BorderThickness="0"
FontSize="14"
Text="{Binding ExpressName, UpdateSourceTrigger=PropertyChanged}"
VerticalScrollBarVisibility="Auto" />
</WrapPanel>
<Image
x:Name="imgLoading"
Width="20"
Height="20"
HorizontalAlignment="Right"
IsEnabled="False"
Source="{StaticResource imgLoadingPic}"
Visibility="{Binding IsGetWaybillPath, Converter={StaticResource visibleToVisibilityConverter}}">
<Image.RenderTransform>
<RotateTransform Angle="45" CenterX="10" CenterY="10" />
</Image.RenderTransform>
<Image.Triggers>
<EventTrigger RoutedEvent="Image.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
RepeatBehavior="Forever"
Storyboard.TargetName="imgLoading"
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
From="0"
To="360"
Duration="0:0:3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
</Grid>
<WrapPanel>
<TextBlock FontSize="14" Text="物流编码:" />
<TextBox
x:Name="txtWaybillId"
VerticalContentAlignment="Center"
d:Text="物流编码:"
BorderBrush="#D0D0D0"
BorderThickness="0"
FontSize="14"
Text="{Binding WaybillId, UpdateSourceTrigger=PropertyChanged}"
VerticalScrollBarVisibility="Auto" />
</WrapPanel>
</StackPanel>
<ListBox
x:Name="lbxSku"
Grid.Row="1"
Grid.Column="1"
Margin="7,0,7,0"
HorizontalContentAlignment="Stretch"
BorderThickness="0"
ItemsSource="{Binding WaybillPathInfos}"
ScrollViewer.CanContentScroll="True"
VirtualizingPanel.ScrollUnit="Pixel">
<!-- 使用自定义属性模板去除ListBox高亮显示框 -->
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<ContentPresenter
Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<!-- 此处绑定将数据源传递给子自定义控件OrderListRowCtrl -->
<local:EWaybillPathListView
VerticalAlignment="Center"
VerticalContentAlignment="Center"
DataContext="{Binding}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
</UserControl>
@@ -0,0 +1,42 @@
using _29WxOrderWpf.ViewModels;
using AllBase.Model.DBModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace _29WxOrderWpf.Views;
/// <summary>
/// EWaybillPathView.xaml 的交互逻辑
/// </summary>
public partial class EWaybillPathView : UserControl
{
/// <summary>
/// 视图模型
/// </summary>
public EWaybillPathViewModel ViewModel { get; }
public EWaybillPathView(oms_wei_order_info _order, string _waybillId, string _expressName)
{
InitializeComponent();
ViewModel = new EWaybillPathViewModel(_order, _waybillId, _expressName);
DataContext = ViewModel;
}
private void EWaybillPathCtrl_Loaded(object sender, RoutedEventArgs e)
{
ViewModel.Start();
}
}
@@ -102,16 +102,31 @@ namespace _29WxOrderWpf.Windows.OrderWindows
{
// 回填库内信息
btnAdd.Content = "创 建";
txtProvince.Text = OrderItem.DistribReturnOrderInfo.receiver_province;
txtCity.Text = OrderItem.DistribReturnOrderInfo.receiver_city;
txtCounty.Text = OrderItem.DistribReturnOrderInfo.receiver_area;
txtDetailAddress.Text = OrderItem.DistribReturnOrderInfo.receiver_address;
txtUser.Text = OrderItem.DistribReturnOrderInfo.receiver_name;
txtMobile.Text = OrderItem.DistribReturnOrderInfo.receiver_phone;
if (OrderItem.DistribReturnOrderInfo != null)
{
txtProvince.Text = OrderItem.DistribReturnOrderInfo.receiver_province;
txtCity.Text = OrderItem.DistribReturnOrderInfo.receiver_city;
txtCounty.Text = OrderItem.DistribReturnOrderInfo.receiver_area;
txtDetailAddress.Text = OrderItem.DistribReturnOrderInfo.receiver_address;
txtUser.Text = OrderItem.DistribReturnOrderInfo.receiver_name;
txtMobile.Text = OrderItem.DistribReturnOrderInfo.receiver_phone;
}
}
if (OrderItem.AddEditTransitWarehouseReturnOrderStr == "已创建" || OrderItem.AddEditTransitWarehouseReturnOrderStr == "处理中")
btnAdd.IsEnabled = false;
if (OrderItem.AddEditTransitWarehouseReturnOrderStr == "已创建未到仓" || OrderItem.AddEditTransitWarehouseReturnOrderStr == "已到仓" ||
OrderItem.AddEditTransitWarehouseReturnOrderStr == "已发回")
{
btnAdd.IsEnabled = btnAddressAnalysis.IsEnabled = false;
if (OrderItem.DistribReturnOrderInfo != null)
{
txtProvince.Text = OrderItem.DistribReturnOrderInfo.receiver_province;
txtCity.Text = OrderItem.DistribReturnOrderInfo.receiver_city;
txtCounty.Text = OrderItem.DistribReturnOrderInfo.receiver_area;
txtDetailAddress.Text = OrderItem.DistribReturnOrderInfo.receiver_address;
txtUser.Text = OrderItem.DistribReturnOrderInfo.receiver_name;
txtMobile.Text = OrderItem.DistribReturnOrderInfo.receiver_phone;
}
}
}
}
@@ -133,6 +148,11 @@ namespace _29WxOrderWpf.Windows.OrderWindows
BaseMsgWindow.ShowError("缺少收货人信息!");
return;
}
if (txtUser.Text.Trim().Length > 15)
{
BaseMsgWindow.ShowError("收货人姓名长度不能超过15!");
return;
}
JObject jObj = new JObject();
@@ -254,7 +274,7 @@ namespace _29WxOrderWpf.Windows.OrderWindows
if (wxExpressName.IsNullOrEmpty() || OrderItem.ItemRefund.return_waybill_id.IsNullOrEmpty() || receiver.receiver_name.IsNullOrEmpty() || receiver.receiver_phone.IsNullOrEmpty() ||
receiver.receiver_province.IsNullOrEmpty() || receiver.receiver_city.IsNullOrEmpty() || receiver.receiver_area.IsNullOrEmpty() || receiver.receiver_address.IsNullOrEmpty())
{
if (!string.IsNullOrWhiteSpace(aftersaleAddress))
if (!string.IsNullOrWhiteSpace(aftersaleAddress) || receiver.receiver_name?.Length > 15)
{
// todo 提示地址解析失败请手动提交
OrderItem.AddEditTransitWarehouseReturnOrderStr = "解析失败请手动添加";
+1 -1
View File
@@ -36,7 +36,7 @@ namespace AllBase
/// 版本ID
/// </summary>
public static int VersionCount = 279;
public static int VersionCount = 287;
public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
public static string DebugUrl { get; set; } = "http://localhost:9000";
@@ -0,0 +1,75 @@
using AllBase.Model.MvvmBaseClasses;
using NaiBa.Util.Extension;
using NaiBa.Util.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AllBase.Model.DBModel
{
public class oms_wei_ewaybill_path : PropertyNotifyObject
{
public long id { get; set; }
public long? shop_id { get; set; }
public long? order_id { get; set; }
public string ewaybill_order_id { get; set; }
public string waybill_id { get; set; }
public long update_time
{
get { return this.GetValue(x => x.update_time); }
set
{
this.SetValue(x => x.update_time, value);
this.UpdateTimeStr = BaseClass.StampToDateTime(value.ParseToInt()).ToString("yyyy-MM-dd HH:mm:ss");
}
}
public string UpdateTimeStr
{
get { return this.GetValue(x => x.UpdateTimeStr); }
set { this.SetValue(x => x.UpdateTimeStr, value); }
}
//0待揽件 1揽收 2运输中 3派件 4入柜 5签收 6退回 7转寄 8异常 9出柜 99其他未知
public int status
{
get { return this.GetValue(x => x.status); }
set
{
this.SetValue(x => x.status, value);
try
{
StatusStr = ((oms_wei_ewaybill_path_status_emum)value).ParseToString();
}
catch
{
StatusStr = "其他未知";
}
}
}
public string StatusStr
{
get { return this.GetValue(x => x.StatusStr); }
set { this.SetValue(x => x.StatusStr, value); }
}
public string node_desc { get; set; }
public DateTime create_time { get; set; }
}
public enum oms_wei_ewaybill_path_status_emum
{
待揽件 = 0,
揽收 = 1,
运输中 = 2,
派件 = 3,
入柜 = 4,
签收 = 5,
退回 = 6,
转寄 = 7,
异常 = 8,
出柜 = 9,
其他未知 = 99
}
}
@@ -1,4 +1,5 @@
using System;
using AllBase.Model.MvvmBaseClasses;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -6,8 +7,8 @@ using System.Threading.Tasks;
namespace AllBase.Model.DBModel
{
public class oms_wei_external_procurement_log_info
{
public class oms_wei_external_procurement_log_info : PropertyNotifyObject
{
public string OutOrderNumStr
{
get { return out_order_no; }
+37 -10
View File
@@ -1,5 +1,6 @@
using AllBase.Helper;
using AllBase.Model.MvvmBaseClasses;
using NaiBa.Util;
using NaiBa.Util.Extension;
using NPOI.OpenXmlFormats.Dml.Diagram;
using NPOI.OpenXmlFormats.Spreadsheet;
@@ -43,10 +44,12 @@ namespace AllBase.Model.DBModel
public ObservableCollection<oms_wei_refund_info> refundItems { get; set; } = new ObservableCollection<oms_wei_refund_info>();
/// <summary>
/// 待采购
/// </summary>
public bool IsWaitBuy
public ConcurrentList<oms_wei_ewaybill_path> latestEWaybills { get; set; } = new ConcurrentList<oms_wei_ewaybill_path>();
/// <summary>
/// 待采购
/// </summary>
public bool IsWaitBuy
{
get { return this.GetValue(x => x.IsWaitBuy); }
set { this.SetValue(x => x.IsWaitBuy, value); }
@@ -143,10 +146,16 @@ namespace AllBase.Model.DBModel
/// <summary>
/// 异常单(买手异常退货)异常需重拍
/// </summary>
public bool isAbnormal
public bool IsAbnormal
{
get { return this.GetValue(x => x.isAbnormal); }
set { this.SetValue(x => x.isAbnormal, value); }
get { return this.GetValue(x => x.IsAbnormal); }
set { this.SetValue(x => x.IsAbnormal, value); }
}
public bool IsShowChangeWaybillBtn
{
get { return this.GetValue(x => x.IsShowChangeWaybillBtn); }
set { this.SetValue(x => x.IsShowChangeWaybillBtn, value); }
}
public string orderStatusStr
@@ -207,7 +216,7 @@ namespace AllBase.Model.DBModel
/// </summary>
public string ship_done_time_str
{
get { return BaseClass.StampToDateTime(this.ship_done_time.ParseToInt()).ToString("yyyy-MM-dd HH:mm:ss"); }
get { return BaseClass.StampToDateTime(this.ship_done_time.ParseToInt()).ToString("yy-MM-dd HH:mm:ss"); }
set { }
}
/// <summary>
@@ -666,6 +675,10 @@ namespace AllBase.Model.DBModel
/// 中转仓的状态 0未使用,1已创建,2创建失败(购买失败),3已创建未有上游快递单号,4已创建有上游快递单号
/// </summary>
public decimal? transfer_warehouse_status { get; set; }
/// <summary>
/// 店铺运费
/// </summary>
public int? postage_price { get; set; }
public void SetOrderTextProperty()
{
@@ -699,7 +712,17 @@ namespace AllBase.Model.DBModel
IsWaitBuy = GetIsWaitBuy();
IsWaitSend = GetIsWaitSend();
IsWaitReceive = GetIsWaitReceive();
isAbnormal = GetIsAbnormal();
if (order_id == "3739089000222605568")
{
}
IsAbnormal = GetIsAbnormal();
if (IsWaitBuy || IsWaitSend)
IsShowChangeWaybillBtn = false;
else
IsShowChangeWaybillBtn = true;
}
public bool GetIsWaitBuy()
@@ -773,6 +796,11 @@ namespace AllBase.Model.DBModel
public bool GetIsAbnormal()
{
// 三退或者两退,为退款完成单
//if (orderItems.All(oi => (oi.refund_status == 4 || oi.refund_status == 11) && (oi.ItemTransitOrder != null || string.IsNullOrWhiteSpace(out_order_no)) &&
// (oi.ItemTransitOrder == null || oi.ItemTransitOrder?.refund_status == "买手退款成功") && (string.IsNullOrWhiteSpace(out_order_no) || out_after_sale_status == "退款成功")))
// return false;
// 如果有售后,直接作为售后单处理
if (orderItems.All(oi => oi.refund_status > 1))
return false;
@@ -781,7 +809,6 @@ namespace AllBase.Model.DBModel
return false;
if (gift_order_status == 1 || gift_order_status == 2)
return false;
if (orderItems.Any(oi => !(oi.OrderItemExt?.abnormal_text).IsNullOrEmpty()))
return true;
+157 -51
View File
@@ -227,20 +227,20 @@ namespace AllBase.Model.DBModel
}
public List<order_pdd_buyer_after_sale> PddBuyerAfterSales { get; set; } = new List<order_pdd_buyer_after_sale>();
public order_pdd_buyer_after_sale PddBuyerAfterSale
{
get { return this.GetValue(x => x.PddBuyerAfterSale); }
set { this.SetValue(x => x.PddBuyerAfterSale, value); }
{
get { return this.GetValue(x => x.PddBuyerAfterSale); }
set
{
this.SetValue(x => x.PddBuyerAfterSale, value);
// 云仓买手退货地址
this.PddBuyerAfterSaleAddressStr = this.PddBuyerAfterSale?.afterSaleAddress;
}
}
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()
{
@@ -276,9 +276,9 @@ namespace AllBase.Model.DBModel
else
TransitOrderWaybillFromWareHouseStr = ItemTransitOrder.express_2_company + "-" + ItemTransitOrder.express_2_waybill;
if (order_id == "3738461463336072960")
if (order_id == "3739043283864307968")
{
var xx = ShopWaybillExceptionStr;
}
TransitWarehouseRejectSuccessTimeStr = this.ItemTransitOrderWithVoid?.rejected_time == null ? "" : this.ItemTransitOrderWithVoid.rejected_time.Value.ToString("yy-MM-dd HH:mm");
AddEditTransitWarehouseRejectStr = "申请";
@@ -290,11 +290,12 @@ namespace AllBase.Model.DBModel
AddEditTransitWarehouseRejectStr = "申请拒收成功";
if (this.ItemTransitOrderWithVoid?.has_reject == 5)
AddEditTransitWarehouseRejectStr = "已取消拒收";
if (this.ItemTransitOrderWithVoid == null || this.ItemRefund?.type != "REFUND" || // 仅退款
if (this.ItemTransitOrderWithVoid == null || (this.ItemRefund?.type != "REFUND" && !this.ItemOrder.IsAbnormal) || // 仅退款
TransitRefundStatusStr.Contains("退款成功") ||
!(this.ItemRefund?.return_waybill_id).IsNullOrEmpty() || !(this.ItemRefund?.return_detail).IsNullOrEmpty() ||
(!this.ItemOrder.IsEmergency && !this.ItemOrder.isAbnormal && !this.ItemOrder.IsRefund) ||
(!this.ItemOrder.IsEmergency && !this.ItemOrder.IsAbnormal && !this.ItemOrder.IsRefund) ||
(this.ItemTransitOrderWithVoid.warehouse_status != 0 && this.ItemTransitOrderWithVoid.warehouse_status != 1) ||
/*this.ItemTransitOrderWithVoid.platform == "XDYYWC" ||*/ // 义务仓不能申请拒收
string.IsNullOrEmpty(PddBuyerOrder?.order_sn))
{
if (AddEditTransitWarehouseRejectStr == "申请")
@@ -303,22 +304,28 @@ namespace AllBase.Model.DBModel
// AddEditTransitWarehouseRejectStr = "申请拒收失败*";
}
if (order_id == "3738396781943865344")
if (order_id == "3739154342108377600")
{
}
// 拦截退回操作信息
InterceptReturnInfoStr = "";
if (this.ItemTransitOrderWithVoid != null)
InterceptReturnInfoStr = this.ItemTransitOrderWithVoid.intercept_return_info;
// 仓库物流售后拦截包裹按钮上的文字,仓库作废单不存在仓库物流,所以此处必须是有效的仓库单(含作废失败)
AddEditTransitWarehouseAfterSaleStr = "添加";
if (this.ItemTransitOrderAfterSale != null)
AddEditTransitWarehouseAfterSaleStr = "已添加";
if (this.ItemTransitOrderAfterSale != null && (ItemTransitOrderWithVoid.intercept_return_status == 1 || !string.IsNullOrEmpty(ItemTransitOrderAfterSale.downstream_waybill)))
AddEditTransitWarehouseAfterSaleStr = "拦截成功";
//if (this.ItemTransitOrderAfterSale != null && ItemTransitOrderWithVoid.intercept_return_status == 2)
// AddEditTransitWarehouseAfterSaleStr = "拦截失败";
if (this.ItemTransitOrderWithVoid == null || this.ItemRefund?.type != "REFUND" ||
if (this.ItemTransitOrderAfterSale != null && ItemTransitOrderWithVoid.intercept_return_status == 2)
AddEditTransitWarehouseAfterSaleStr = "拦截失败";
if (this.ItemTransitOrderWithVoid == null || (this.ItemRefund?.type != "REFUND" && !this.ItemOrder.IsAbnormal) ||
TransitRefundStatusStr.Contains("退款成功") ||
!(this.ItemRefund?.return_waybill_id).IsNullOrEmpty() || !(this.ItemRefund?.return_detail).IsNullOrEmpty() ||
(!this.ItemOrder.IsEmergency && !this.ItemOrder.isAbnormal && !this.ItemOrder.IsRefund) ||
(!this.ItemOrder.IsEmergency && !this.ItemOrder.IsAbnormal && !this.ItemOrder.IsRefund) ||
this.ItemTransitOrderWithVoid.warehouse_status == 0 ||
(this.ItemTransitOrderWithVoid.warehouse_status == 1 && !AddEditTransitWarehouseRejectStr.IsNullOrEmpty() && !AddEditTransitWarehouseRejectStr.StartsWith("申请拒收失败")))
{
@@ -326,7 +333,7 @@ namespace AllBase.Model.DBModel
AddEditTransitWarehouseAfterSaleStr = "";
}
// 退货退款的,不能拦截退回总店。如果是退到退货仓,则退货仓流程,否则店家自行收货退回总店。
if (!RefundAddressStr.ParseToString().Trim().IsNullOrEmpty() || this.ItemRefund?.type != "REFUND")
if (!RefundAddressStr.ParseToString().Trim().IsNullOrEmpty() || (this.ItemRefund?.type != "REFUND" && !this.ItemOrder.IsAbnormal))
{
if (AddEditTransitWarehouseAfterSaleStr == "添加")
AddEditTransitWarehouseAfterSaleStr = "";
@@ -334,6 +341,7 @@ namespace AllBase.Model.DBModel
if (this.ItemTransitOrderAfterSale != null)
TransitWarehouseAfterSaleWayBillStr = (this.ItemTransitOrderAfterSale?.downstream_express_code + "-" + this.ItemTransitOrderAfterSale?.downstream_waybill).Trim('-');
AddEditTransitWarehouseReturnOrderStr = "";
if (ItemRefund?.return_detail.StartsWith(GlobalConfig.TransitReturnOrderReturnAddress) == true)
{
@@ -342,22 +350,26 @@ namespace AllBase.Model.DBModel
}
// 关闭中转包裹退回,改为中转分销退货
if (AddEditTransitWarehouseAfterSaleStr == "添加")
AddEditTransitWarehouseAfterSaleStr = "";
AddEditTransitWarehouseReturnOrderStr = DistribReturnOrderInfo == null ? "添加" : "已添加";
AddEditTransitWarehouseReturnOrderStr = DistribReturnOrderInfo == null ? "未创建" : "已添加";
if (DistribReturnOrderInfo?.warehouse_status == 1)
AddEditTransitWarehouseReturnOrderStr = "已创建";
{
if ((DistribReturnOrderInfo?.real_logistics_express_code).IsNullOrEmpty())
AddEditTransitWarehouseReturnOrderStr = "已到仓";
else
AddEditTransitWarehouseReturnOrderStr = "已发回";
}
if (DistribReturnOrderInfo?.warehouse_status == 2)
AddEditTransitWarehouseReturnOrderStr = "创建异常";
AddEditTransitWarehouseReturnOrderStr = "创建失败";
if (DistribReturnOrderInfo?.warehouse_status == 3)
AddEditTransitWarehouseReturnOrderStr = "处理中";
AddEditTransitWarehouseReturnOrderStr = "已创建未到仓";
if (TransitRefundStatusStr.Contains("退款成功"))
{
if (AddEditTransitWarehouseReturnOrderStr == "未创建")
AddEditTransitWarehouseReturnOrderStr = "";
}
}
// 云仓买手退货地址
this.PddBuyerAfterSaleAddressStr = this.PddBuyerAfterSale?.afterSaleAddress;
// 直发买手退货地址
this.DirectPddBuyerAfterSaleAddressStr = this.DirectPddBuyerAfterSale?.afterSaleAddress;
}
/// <summary>
/// 仓库拒收按钮文本参数
@@ -382,6 +394,14 @@ namespace AllBase.Model.DBModel
set { this.SetValue(x => x.AddEditTransitWarehouseAfterSaleStr, value); }
}
/// <summary>
/// 拦截退回操作信息/回调信息 文本
/// </summary>
public string InterceptReturnInfoStr
{
get { return this.GetValue(x => x.InterceptReturnInfoStr); }
set { this.SetValue(x => x.InterceptReturnInfoStr, value); }
}
/// <summary>
/// 仓库分销退货按钮显示文本参数
/// </summary>
public string AddEditTransitWarehouseReturnOrderStr
@@ -849,11 +869,26 @@ namespace AllBase.Model.DBModel
public List<order_pdd_buyer_after_sale> DirectPddBuyerAfterSales { get; set; } = new List<order_pdd_buyer_after_sale>();
public order_pdd_buyer_after_sale DirectPddBuyerAfterSale
{
get { return this.GetValue(x => x.DirectPddBuyerAfterSale); }
set { this.SetValue(x => x.DirectPddBuyerAfterSale, value); }
}
public string DirectRefundStatusStr
{
get { return this.GetValue(x => x.DirectPddBuyerAfterSale); }
set
{
if (order_id == "3738766466298321152")
{
}
this.SetValue(x => x.DirectPddBuyerAfterSale, value);
// 直发买手退货地址
this.DirectPddBuyerAfterSaleAddressStr = DirectPddBuyerAfterSale?.afterSaleAddress;
}
}
public string DirectPddBuyerAfterSaleAddressStr
{
get { return this.GetValue(x => x.DirectPddBuyerAfterSaleAddressStr); }
set { this.SetValue(x => x.DirectPddBuyerAfterSaleAddressStr, value); }
}
public string DirectRefundStatusStr
{
get { return this.GetValue(x => x.DirectRefundStatusStr); }
set { this.SetValue(x => x.DirectRefundStatusStr, value); }
@@ -903,10 +938,24 @@ namespace AllBase.Model.DBModel
DirectOrderBuyTimeStr = DirectPddBuyerOrder != null ? DirectPddBuyerOrder.add_time.ToString("yyyy-MM-dd HH:mm:ss") : "";
}
/// <summary>
/// 订单中所有商品加起来的总售价文本
/// </summary>
public string RealPriceStr
/// <summary> 直发最后一条物流信息 </summary>
public oms_wei_ewaybill_path LatestDirectEWaybill
{
get { return this.GetValue(x => x.LatestDirectEWaybill); }
set { this.SetValue(x => x.LatestDirectEWaybill, value); }
}
/// <summary> 中转仓最后一条物流信息 </summary>
public oms_wei_ewaybill_path LatestTransitEWaybill
{
get { return this.GetValue(x => x.LatestTransitEWaybill); }
set { this.SetValue(x => x.LatestTransitEWaybill, value); }
}
/// <summary>
/// 订单中所有商品加起来的总售价文本
/// </summary>
public string RealPriceStr
{
//get { return "¥" + (order_items.Sum(oi => oi.real_price) * 0.01m).ParseToDecimal().ToString("0.00"); }
get { return "¥" + (real_price * 0.01m).ParseToDecimal().ToString("0.00"); }
@@ -923,11 +972,18 @@ namespace AllBase.Model.DBModel
set { }
}
public string PostagePriceStr
{
get { return "¥" + (ItemOrder?.postage_price * 0.01m / ItemOrder?.orderItems.Count).ParseToDecimal().ToString("0.00"); }
set { }
}
/// <summary>
/// 采购价文本
/// </summary>
public string purchase_price_str
{
public string PurchasePriceStr
{
//get { return "¥" + (order_items.Sum(oi => oi.purchase_price.ParseToInt()) * 0.01m).ParseToDecimal().ToString("0.00"); }
get { return "¥" + (purchase_price * 0.01m).ParseToDecimal().ToString("0.00"); }
set { }
@@ -935,16 +991,20 @@ namespace AllBase.Model.DBModel
/// <summary>
/// 采购价文本是否可见
/// </summary>
public Visibility purchase_price_visibility
public Visibility PurchasePriceVisibility
{
get { if (ItemOrder.out_amount > 0 || ItemTransitOrder?.out_amount > 0) return Visibility.Collapsed; return Visibility.Visible; }
get
{
//if (ItemOrder.out_amount > 0 || ItemTransitOrder?.out_amount > 0) return Visibility.Collapsed; return Visibility.Visible;
return Visibility.Collapsed;
}
set { }
}
/// <summary>
/// 运费文本
/// </summary>
public string freight_str
public string FreightStr
{
//get { return "¥" + (order_items.Sum(oi => oi.freight.ParseToInt()) * 0.01m).ParseToDecimal().ToString("0.00"); }
get { return "¥" + (freight * 0.01m).ParseToDecimal().ToString("0.00"); }
@@ -954,10 +1014,10 @@ namespace AllBase.Model.DBModel
/// 运费文本是否可见
/// </summary>
public Visibility FreightVisibility
{
get { if (ItemOrder.out_amount > 0 || ItemTransitOrder?.out_amount > 0) return Visibility.Collapsed; return Visibility.Visible; }
//get { if (ItemOrder.freight > 0) return Visibility.Visible; return Visibility.Collapsed; }
set { }
{
//get { if (ItemOrder.out_amount > 0 || ItemTransitOrder?.out_amount > 0) return Visibility.Collapsed; return Visibility.Visible; }
get { return Visibility.Collapsed; }
set { }
}
/// <summary>
@@ -1012,7 +1072,9 @@ namespace AllBase.Model.DBModel
{
//ItemOrder.out_amount ItemTransitOrder.out_amount 只有一个有值
var out_amount = ItemTransitOrder?.out_amount ?? ItemOrder.out_amount / ItemOrder.orderItems.Count;
profitCount = ((real_price.ParseToInt() + cash_coupon_discounted_price.ParseToInt() - purchase_price.ParseToInt() - freight.ParseToInt() - predict_commission_fee.ParseToInt() -
var postage_price = ItemOrder?.postage_price ?? ItemOrder.postage_price / ItemOrder.orderItems.Count;
profitCount = ((real_price.ParseToInt() + cash_coupon_discounted_price.ParseToInt() + postage_price -
purchase_price.ParseToInt() - freight.ParseToInt() - predict_commission_fee.ParseToInt() -
commission_amount.ParseToInt() - out_amount.ParseToInt()) * 0.01m).ParseToDecimal();
}
return profitCount;
@@ -1113,7 +1175,7 @@ namespace AllBase.Model.DBModel
// 买手秒退异常重拍
BtnAbnormalBtnVisibility = Visibility.Visible;
// 不是异常单的不可异常重拍
if (this.ItemOrder?.isAbnormal != true)
if (this.ItemOrder?.IsAbnormal != true)
BtnAbnormalBtnVisibility = Visibility.Collapsed;
// 买手未退款的,中转正式取号以后的,不可异常重拍
else if (this.ItemTransitOrder?.refund_status != "买手退款成功" ||
@@ -1145,6 +1207,13 @@ namespace AllBase.Model.DBModel
}
}
public string RefundStatusStr
{
get { return this.GetValue(x => x.RefundStatusStr); }
set { this.SetValue(x => x.RefundStatusStr, value); }
}
/// <summary>
/// 订单商品表数据库id
/// </summary>
@@ -1286,7 +1355,24 @@ namespace AllBase.Model.DBModel
/// <summary>
/// 售后状态 1:无售后或售后关闭,2:售后处理中,3:退款中,4:退款成功,11:已取消(售后完成订单取消)
/// </summary>
public int? refund_status { get; set; }
public int? refund_status
{
get { return this.GetValue(x => x.refund_status); }
set
{
this.SetValue(x => x.refund_status, value);
if (value == 1)
RefundStatusStr = "无售后/售后关闭";
else if (value == 2)
RefundStatusStr = "售后处理中";
else if (value == 3)
RefundStatusStr = "退款中";
else if (value == 4)
RefundStatusStr = "退款成功";
else if (value == 11)
RefundStatusStr = "售后完成订单取消";
}
}
public void SetOrderItemTextProperty()
{
@@ -1312,7 +1398,27 @@ namespace AllBase.Model.DBModel
// 拍单、代发等信息判断并控制拍单按钮
this.UpdateOrderItemBuyButton();
this.SetAbnormalAndDirectBtnVisibility();
}
SetEWaybillInfo();
}
/// <summary> 初始化物流明细信息 </summary>
public void SetEWaybillInfo()
{
if(order_id == "3738794693820307200")
{
}
if (this.ItemOrder?.latestEWaybills?.Count > 0 && !string.IsNullOrEmpty(ItemTransitOrderWithVoid?.express_2_waybill))
LatestTransitEWaybill = ItemOrder.latestEWaybills.FirstOrDefault(ew => ew.waybill_id == ItemTransitOrderWithVoid.express_2_waybill);
else
LatestTransitEWaybill = null;
if (this.ItemOrder?.latestEWaybills?.Count > 0 && !string.IsNullOrEmpty(this.ItemOrder?.out_express_no))
LatestDirectEWaybill = ItemOrder.latestEWaybills.FirstOrDefault(ew => ew.waybill_id == this.ItemOrder?.out_express_no);
else
LatestDirectEWaybill = null;
}
public void UpdateOrderItemBuyButton()
{
+4 -1
View File
@@ -203,7 +203,10 @@ namespace AllBase.Model.Result
set
{
_specs = value;
SpecNameStr = string.Join(",", value.Select(s => s.spec_value));
if (value != null)
SpecNameStr = string.Join(",", value.Select(s => s.spec_value));
else
SpecNameStr = "";
}
}
public int? price { get; set; } // 0,
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AllBase.Model.Result
{
public class WxOrderExpressInfo
{
public int? deliverType { get; set; } // 5,
public string phone { get; set; } // "3859",
public List<WxDeliveryProductInfo> deliveryProductInfo { get; set; } //
public int? orderProductCnt { get; set; } // 1,
public int? deliveryCnt { get; set; } // 1,
public bool? isIntracityOrder { get; set; } // false,
public object intracityTracking { get; set; } // null,
public List<object> formatUnshippedProductList { get; set; } // [ ],
public Dictionary<string, string> product2Img { get; set; } // "15197350020": "https://wst.wxapp.tc.qq.com/161/20304/snscosdownload/SH/reserved/6a080c080007548c0abba40bffc31715000000a100004f50"
}
public class WxDeliveryProductInfo
{
public string waybillId { get; set; } // "772064086780390",
public string deliveryId { get; set; } // "STO",
public List<WxDeliveryProductInfoInfo> productInfos { get; set; }
public string deliveryName { get; set; } // "申通快递",
public string deliveryTime { get; set; } // "1779537701",
public int? deliverType { get; set; } // 5,
public int? waybillStatus { get; set; } // 0
}
public class WxDeliveryProductInfoInfo
{
public string productId { get; set; } // "10000859462312",
public string skuId { get; set; } // "15197350020",
public int? productCnt { get; set; } // 1,
public string supplyProductId { get; set; } // "0",
public string supplySkuId { get; set; } // "0"
}
}
+68 -56
View File
@@ -1,4 +1,5 @@
using AllBase;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.IO;
@@ -78,75 +79,86 @@ namespace Work.Pinduoduo
return plainText;
}
/// <summary>
/// 解密
/// </summary>
/// <param name="cipherText"></param>
/// <returns></returns>
public static string DecryptString(string cipherText)
{
cipherText = cipherText.Replace("-", "+").Replace("_", "/");
var x1 = cipherText.Length % 4;
if (x1 > 0)
{
cipherText = cipherText + "====".Substring(x1);
}
// Instantiate a new Aes object to perform string symmetric encryption
Aes encryptor = Aes.Create();
/// <summary>
/// 解密
/// </summary>
/// <param name="cipherText"></param>
/// <returns></returns>
public static string DecryptString(string cipherText)
{
if (cipherText.IsNullOrEmpty())
return "";
try
{
cipherText = cipherText.Replace("-", "+").Replace("_", "/");
var x1 = cipherText.Length % 4;
if (x1 > 0)
{
cipherText = cipherText + "====".Substring(x1);
}
// Instantiate a new Aes object to perform string symmetric encryption
Aes encryptor = Aes.Create();
encryptor.Mode = CipherMode.CBC;
encryptor.Mode = CipherMode.CBC;
// Set key and IV
byte[] aesKey = new byte[32];
Array.Copy(key, 0, aesKey, 0, 32);
encryptor.Key = aesKey;
encryptor.IV = iv;
// Set key and IV
byte[] aesKey = new byte[32];
Array.Copy(key, 0, aesKey, 0, 32);
encryptor.Key = aesKey;
encryptor.IV = iv;
// Instantiate a new MemoryStream object to contain the encrypted bytes
MemoryStream memoryStream = new MemoryStream();
// Instantiate a new MemoryStream object to contain the encrypted bytes
MemoryStream memoryStream = new MemoryStream();
// Instantiate a new encryptor from our Aes object
ICryptoTransform aesDecryptor = encryptor.CreateDecryptor();
// Instantiate a new encryptor from our Aes object
ICryptoTransform aesDecryptor = encryptor.CreateDecryptor();
// Instantiate a new CryptoStream object to process the data and write it to the
// memory stream
CryptoStream cryptoStream = new CryptoStream(memoryStream, aesDecryptor, CryptoStreamMode.Write);
// Instantiate a new CryptoStream object to process the data and write it to the
// memory stream
CryptoStream cryptoStream = new CryptoStream(memoryStream, aesDecryptor, CryptoStreamMode.Write);
// Will contain decrypted plaintext
string plainText = String.Empty;
// Will contain decrypted plaintext
string plainText = String.Empty;
try
{
// Convert the ciphertext string into a byte array
byte[] cipherBytes = Convert.FromBase64String(cipherText);
try
{
// Convert the ciphertext string into a byte array
byte[] cipherBytes = Convert.FromBase64String(cipherText);
// Decrypt the input ciphertext string
cryptoStream.Write(cipherBytes, 0, cipherBytes.Length);
// Decrypt the input ciphertext string
cryptoStream.Write(cipherBytes, 0, cipherBytes.Length);
// Complete the decryption process
cryptoStream.FlushFinalBlock();
// Complete the decryption process
cryptoStream.FlushFinalBlock();
// Convert the decrypted data from a MemoryStream to a byte array
byte[] plainBytes = memoryStream.ToArray();
// Convert the decrypted data from a MemoryStream to a byte array
byte[] plainBytes = memoryStream.ToArray();
// Convert the decrypted byte array to string
plainText = Encoding.UTF8.GetString(plainBytes, 0, plainBytes.Length);
}
catch (Exception)
{
// Convert the decrypted byte array to string
plainText = Encoding.UTF8.GetString(plainBytes, 0, plainBytes.Length);
}
catch (Exception)
{
//throw;
}
finally
{
// Close both the MemoryStream and the CryptoStream
memoryStream.Close();
cryptoStream.Close();
}
//throw;
}
finally
{
// Close both the MemoryStream and the CryptoStream
memoryStream.Close();
cryptoStream.Close();
}
// Return the decrypted data as a string
return plainText;
}
catch (Exception ex)
{
return cipherText;
}
}
// Return the decrypted data as a string
return plainText;
}
+44
View File
@@ -0,0 +1,44 @@
using AllBase;
using AllBase.Model.DBModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Work._29Tools.Forms.ShopForms;
namespace Work._29Tools.BLL
{
public class WxSimOrderSendBLL
{
public static string initDeliveryInfo(ShopLoginInfo shop, string orderId)
{
string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeorder/ship/cgi/initShipData?token=&lang=zh_CN";
string body = @"{""id"":""" + orderId + @"""}";
string refere = "https://store.weixin.qq.com/shop/order/list";
var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere);
return result;
}
public static string orderSendOut(ShopLoginInfo shop, string orderId, string waybillId)
{
string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeorder/ship/cgi/orderSendOut?token=&lang=zh_CN";
string body = @"{""orderId"":""" + orderId + @""",""deliveryProduct"":{""deliveryId"":""OTHER"",""waybillId"":""" + waybillId + @""",""isAllProduct"":true,""deliverType"":1}}";
string refere = "https://store.weixin.qq.com/shop/order/list?type=3";
var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere);
return result;
}
public static string updateDeliveryInfo(ShopLoginInfo shop, UpdateDeliverInfoParam param)
{
string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeorder/ship/cgi/updateDeliveryInfo?token=&lang=zh_CN";
string body = JsonHelper.SerializeObject(param);
string refere = "https://store.weixin.qq.com/shop/order/list?type=3";
var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere);
return result;
}
}
}
File diff suppressed because it is too large. Load diff
+52 -8
View File
@@ -31,6 +31,7 @@
this.components = new System.ComponentModel.Container();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.pnlMask = new DevComponents.DotNetBar.PanelEx();
this.lblErrMsg = new System.Windows.Forms.Label();
this.btnJumpOrderList = new DevComponents.DotNetBar.PanelEx();
this.txtBuySkuName = new System.Windows.Forms.TextBox();
this.label21 = new System.Windows.Forms.Label();
@@ -83,6 +84,7 @@
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.txtAddress = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.btnCancelAutoBuy = new DevComponents.DotNetBar.PanelEx();
this.panel2 = new System.Windows.Forms.Panel();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.cmbMapSkus = new System.Windows.Forms.ComboBox();
@@ -152,6 +154,7 @@
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.BackColor = System.Drawing.Color.White;
this.splitContainer1.Panel2.Controls.Add(this.lblErrMsg);
this.splitContainer1.Panel2.Controls.Add(this.btnJumpOrderList);
this.splitContainer1.Panel2MinSize = 0;
this.splitContainer1.Size = new System.Drawing.Size(864, 888);
@@ -184,6 +187,17 @@
this.pnlMask.Text = "自动拍单倒计时\r\n8";
this.pnlMask.Visible = false;
//
// lblErrMsg
//
this.lblErrMsg.AutoSize = true;
this.lblErrMsg.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblErrMsg.ForeColor = System.Drawing.Color.Red;
this.lblErrMsg.Location = new System.Drawing.Point(166, 5);
this.lblErrMsg.Name = "lblErrMsg";
this.lblErrMsg.Size = new System.Drawing.Size(87, 17);
this.lblErrMsg.TabIndex = 893;
this.lblErrMsg.Text = "errMsg ";
//
// btnJumpOrderList
//
this.btnJumpOrderList.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -468,11 +482,11 @@
this.label13.TabIndex = 815;
this.label13.Text = "关联商品信息:";
//
// txtUpSpuCode
// txtSpuCode
//
this.txtSpuCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtSpuCode.Location = new System.Drawing.Point(85, 228);
this.txtSpuCode.Name = "txtUpSpuCode";
this.txtSpuCode.Name = "txtSpuCode";
this.txtSpuCode.Size = new System.Drawing.Size(152, 23);
this.txtSpuCode.TabIndex = 814;
//
@@ -485,13 +499,13 @@
this.label12.TabIndex = 813;
this.label12.Text = "平台SKU编码";
//
// txtUpSkuCode
// txtSkuCode
//
this.txtSkuCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtSkuCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtSkuCode.Location = new System.Drawing.Point(321, 228);
this.txtSkuCode.Name = "txtUpSkuCode";
this.txtSkuCode.Name = "txtSkuCode";
this.txtSkuCode.Size = new System.Drawing.Size(152, 23);
this.txtSkuCode.TabIndex = 812;
//
@@ -755,6 +769,7 @@
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.Controls.Add(this.btnCancelAutoBuy);
this.panel1.Controls.Add(this.panel2);
this.panel1.Controls.Add(this.pnlDirectAddressAnalysis);
this.panel1.Controls.Add(this.chkUseAppBalance);
@@ -788,6 +803,31 @@
this.panel1.Size = new System.Drawing.Size(487, 890);
this.panel1.TabIndex = 0;
//
// btnCancelAutoBuy
//
this.btnCancelAutoBuy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancelAutoBuy.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnCancelAutoBuy.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCancelAutoBuy.DisabledBackColor = System.Drawing.Color.Empty;
this.btnCancelAutoBuy.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCancelAutoBuy.Location = new System.Drawing.Point(376, 35);
this.btnCancelAutoBuy.Name = "btnCancelAutoBuy";
this.btnCancelAutoBuy.Size = new System.Drawing.Size(97, 23);
this.btnCancelAutoBuy.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnCancelAutoBuy.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
this.btnCancelAutoBuy.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
this.btnCancelAutoBuy.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnCancelAutoBuy.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnCancelAutoBuy.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnCancelAutoBuy.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnCancelAutoBuy.Style.GradientAngle = 90;
this.btnCancelAutoBuy.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnCancelAutoBuy.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(107)))), ((int)(((byte)(83)))), ((int)(((byte)(147)))));
this.btnCancelAutoBuy.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(107)))), ((int)(((byte)(83)))), ((int)(((byte)(147)))));
this.btnCancelAutoBuy.TabIndex = 887;
this.btnCancelAutoBuy.Text = "取消自动拍单";
this.btnCancelAutoBuy.Click += new System.EventHandler(this.btnCancelAutoBuy_Click);
//
// panel2
//
this.panel2.Controls.Add(this.pictureBox2);
@@ -949,7 +989,7 @@
this.txtShopName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtShopName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtShopName.Location = new System.Drawing.Point(321, 60);
this.txtShopName.Location = new System.Drawing.Point(321, 67);
this.txtShopName.Name = "txtShopName";
this.txtShopName.Size = new System.Drawing.Size(152, 23);
this.txtShopName.TabIndex = 876;
@@ -958,7 +998,7 @@
//
this.label27.AutoSize = true;
this.label27.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label27.Location = new System.Drawing.Point(253, 63);
this.label27.Location = new System.Drawing.Point(253, 70);
this.label27.Name = "label27";
this.label27.Size = new System.Drawing.Size(68, 17);
this.label27.TabIndex = 875;
@@ -968,7 +1008,7 @@
//
this.label26.AutoSize = true;
this.label26.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label26.Location = new System.Drawing.Point(253, 92);
this.label26.Location = new System.Drawing.Point(253, 99);
this.label26.Name = "label26";
this.label26.Size = new System.Drawing.Size(68, 17);
this.label26.TabIndex = 874;
@@ -979,7 +1019,7 @@
this.txtOrderId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtOrderId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtOrderId.Location = new System.Drawing.Point(321, 89);
this.txtOrderId.Location = new System.Drawing.Point(321, 96);
this.txtOrderId.Name = "txtOrderId";
this.txtOrderId.Size = new System.Drawing.Size(152, 23);
this.txtOrderId.TabIndex = 873;
@@ -1078,6 +1118,7 @@
this.txtBuyTransitWarehouse.Name = "txtBuyTransitWarehouse";
this.txtBuyTransitWarehouse.Size = new System.Drawing.Size(388, 23);
this.txtBuyTransitWarehouse.TabIndex = 870;
this.txtBuyTransitWarehouse.TextChanged += new System.EventHandler(this.txtBuyTransitWarehouse_TextChanged);
//
// label29
//
@@ -1154,6 +1195,7 @@
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).EndInit();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
@@ -1259,5 +1301,7 @@
private System.Windows.Forms.ComboBox cmbMapSkus;
private System.Windows.Forms.Label label31;
private System.Windows.Forms.PictureBox pictureBox2;
private DevComponents.DotNetBar.PanelEx btnCancelAutoBuy;
private System.Windows.Forms.Label lblErrMsg;
}
}
+2 -1
View File
@@ -146,7 +146,8 @@ namespace Work._29Tools.Forms.ToolForms
Task.Run(() =>
{
Thread.Sleep(2500);
Invoke(new Action(() => { this.btnCopy.Text = "复制图片"; }));
if (this.Created)
Invoke(new Action(() => { this.btnCopy.Text = "复制图片"; }));
});
//BaseMsgForm.ShowInfo("图片已复制到剪贴板");
}