diff --git a/29WxOrderWpf/29WxOrderWpf.csproj b/29WxOrderWpf/29WxOrderWpf.csproj
index ef214a5..336b87b 100644
--- a/29WxOrderWpf/29WxOrderWpf.csproj
+++ b/29WxOrderWpf/29WxOrderWpf.csproj
@@ -28,6 +28,7 @@
+
diff --git a/29WxOrderWpf/Converters/OrderTaskStatusConverter.cs b/29WxOrderWpf/Converters/OrderTaskStatusConverter.cs
index cd86425..baf8b41 100644
--- a/29WxOrderWpf/Converters/OrderTaskStatusConverter.cs
+++ b/29WxOrderWpf/Converters/OrderTaskStatusConverter.cs
@@ -6,7 +6,7 @@ using Work.ERP.API;
namespace _29WxOrderWpf.Converters
{
///
- /// 订单任务状态转换: (int) → 中文描述。
+ /// 订单任务状态转换: (int) → 中文描述。
/// 1=执行中,2=已完成,3=已人为中断。
///
public class OrderTaskStatusConverter : IValueConverter
diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml.cs b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml.cs
index 7bef38e..e588237 100644
--- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml.cs
+++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml.cs
@@ -46,6 +46,7 @@ using TemuKJD.ToolForms;
using Work;
using Work._29Tools.BLL;
using Work.BuyUsers;
+using Work.KJDServer.API.Models;
using WPFCommon.Helpers;
using static _29WxOrderWpf.Services.ShipGiftService;
using static System.Net.Mime.MediaTypeNames;
@@ -62,7 +63,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
public OrderFilterConfig orderFilterConfig
{
get { return _orderFilterConfig; }
- set { if (_orderFilterConfig != value)
+ set
+ {
+ if (_orderFilterConfig != value)
_orderFilterConfig = value;
OnPropertyChanged(new PropertyChangedEventArgs("orderFilterConfig"));
}
@@ -76,7 +79,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
InitializeComponent();
DataContext = this;
- _shipGiftService = new ShipGiftService();
+ _shipGiftService = ShipGiftService.Instance;
}
private void Window_Loaded(object sender, RoutedEventArgs e)
@@ -103,8 +106,13 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
borderFilterRemarkSelect.Visibility = Visibility.Collapsed;
AutoGetOrder();
+
+ TaskService.Instance.Start();
+ TaskService.Instance.TaskChanged += Instance_TaskChanged;
}
+
+
//public void GetOrderTest()
//{
// for (int i = 0; i < 10000; i++)
@@ -837,7 +845,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
}
- if (orderItem.TransitRefundStatusStr.ParseToString().Contains("需手动申请售后") &&
+ if (orderItem.TransitRefundStatusStr.ParseToString().Contains("需手动申请售后") &&
orderItem.ItemTransitOrderWithVoid?.has_reject == 3 && orderItem.ItemTransitOrderWithVoid?.platform != "XDYYWC") // 义乌仓不支持拒收,等于3也是失败
{
// 拒收后24小时才去总店填拒收退货
@@ -1043,7 +1051,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
var type = 4;
if (chkRst.Contains("\"interactType\":0"))
type = 2;
- var result = AddReturnPddShopPackageInfo(buyer, orderSn, afterSalesId, waybillId,"韵达快递", "121", type.ToString());
+ var result = AddReturnPddShopPackageInfo(buyer, orderSn, afterSalesId, waybillId, "韵达快递", "121", type.ToString());
if (!result.Contains("\"result\":\"ok\""))
{
type = type == 4 ? 2 : 4;
@@ -1096,7 +1104,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
TabItem tabItem = null;
List tabItems = this.tabOrderType.Items.Cast().ToList();
- Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("待采购")); }));
+ Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("待采购")); }));
if (tabItem != null)
{
var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "待采购")).ToList();
@@ -1513,7 +1521,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{
Thread.Sleep(5000);
Dispatcher.Invoke(new Action(() => { this.btnSearch.IsEnabled = true; }));
- });
+ });
//Task.Run(() =>
//{
// GetOrder();
@@ -1902,7 +1910,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
public async Task DoReturnOrderBuyerRefendSlient()
{
List emergencyRefundOrders = new List();
- Dispatcher.Invoke(new Action(() =>
+ Dispatcher.Invoke(new Action(() =>
{
emergencyRefundOrders = GlobalConfig.lstOrder.Where(o => o.IsEmergency).ToList();
}));
@@ -2281,7 +2289,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
FilterOrders();
}
-
+
///
///
@@ -2398,7 +2406,27 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// set => SetProperty(ref _IsShipGift, value);
//}
+ private void Instance_TaskChanged(object sender, IEnumerable data)
+ {
+ var giftTaks = data.Where(a => a.TaskType == Work.KJDServer.API.Models.TaskType.Gifts && a.SubTasks != null)
+ .SelectMany(a => a.SubTasks)
+ .GroupBy(a => a.ObjectId)
+ .Select(a => a.OrderByDescending(b => b.CreateTime).First())
+ .ToList();
+ foreach (TaskSubItem item in giftTaks)
+ {
+ oms_wei_order_info order = GlobalConfig.lstOrder.FirstOrDefault(a => a.order_id == item.ObjectId);
+ if (order != null)
+ {
+ order.GiftSuccessed = item.Status == 1;
+ if (order.GiftSuccessed == false)
+ {
+ order.GiftErrorMsg = item.SysMsg;
+ }
+ }
+ }
+ }
}
public class OrderFilterConfig : PropertyNotifyObject
@@ -2408,7 +2436,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
///
/// 隐藏标记
///
- public bool chkHideGreenFlagIsChecked
+ public bool chkHideGreenFlagIsChecked
{
get { return this.GetValue(x => x.chkHideGreenFlagIsChecked); }
set { this.SetValue(x => x.chkHideGreenFlagIsChecked, value); }
diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml
index cab34cd..f7fcc1e 100644
--- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml
+++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml
@@ -1,111 +1,111 @@
-
-
-
-
-
+ x:Class="_29WxOrderWpf.Ctrls.OrderCtrls.OrderListRowItemCtrl"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:conv="clr-namespace:_29WxOrderWpf.Converters"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:uc="clr-namespace:_29WxOrderWpf.UserControls"
+ d:Background="White"
+ d:DesignHeight="220"
+ d:DesignWidth="1300"
+ DataContextChanged="UserControl_DataContextChanged"
+ mc:Ignorable="d">
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
+
-
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderTaskDialogView.xaml b/29WxOrderWpf/Ctrls/OrderCtrls/OrderTaskDialogView.xaml
index c4ec8f5..d4017d5 100644
--- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderTaskDialogView.xaml
+++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderTaskDialogView.xaml
@@ -2,22 +2,29 @@
x:Class="_29WxOrderWpf.Ctrls.OrderCtrls.OrderTaskDialogView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:comn="clr-namespace:_29WxOrderWpf.Common"
xmlns:converters="clr-namespace:_29WxOrderWpf.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:wpf="clr-namespace:_29WxOrderWpf.Common"
- xmlns:wpf1="WPFCommon"
+ xmlns:md="clr-namespace:Work.KJDServer.API.Models;assembly=29WxOrderWork"
+ xmlns:wpf="WPFCommon"
+ xmlns:wpfex="clr-namespace:WPFCommon.Extensions;assembly=WPFCommon"
+ comn:DialogWindowProperty.Height="600"
+ comn:DialogWindowProperty.ResizeMode="CanResizeWithGrip"
+ comn:DialogWindowProperty.ShowMinButton="False"
+ comn:DialogWindowProperty.Width="1300"
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:OrderTaskDialogViewModel}"
d:DesignHeight="600"
d:DesignWidth="1300"
- wpf:DialogWindowProperty.Height="600"
- wpf:DialogWindowProperty.ResizeMode="CanResizeWithGrip"
- wpf:DialogWindowProperty.ShowMinButton="False"
- wpf:DialogWindowProperty.Width="1300"
mc:Ignorable="d">
+
+