diff --git a/BPASmartClient.Business/BPASmartClient.Business.csproj b/BPASmartClient.Business/BPASmartClient.Business.csproj
index da5bfe70..e150ff8b 100644
--- a/BPASmartClient.Business/BPASmartClient.Business.csproj
+++ b/BPASmartClient.Business/BPASmartClient.Business.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/BPASmartClient.Business/Plugin/OrderProxy.cs b/BPASmartClient.Business/Plugin/OrderProxy.cs
index 2f0a2b36..720a2698 100644
--- a/BPASmartClient.Business/Plugin/OrderProxy.cs
+++ b/BPASmartClient.Business/Plugin/OrderProxy.cs
@@ -45,11 +45,11 @@ namespace BPASmartClient.Business
if (morkOrderPushes.TryDequeue(out MorkOrderPush mork))
{
Thread.Sleep(3000);
- new OrderStatusChangedEvent() { Status = ORDER_STATUS.COOKING, SubOrderId = mork.SuborderId }.Publish();
+ new OrderStatusChangedEvent() { Status = ORDER_STATUS.COOKING, SubOrderId = mork.SuborderId, GoodName = mork.GoodsName }.Publish();
Thread.Sleep(5000);
- new OrderStatusChangedEvent() { Status = ORDER_STATUS.COMPLETED_COOK, SubOrderId = mork.SuborderId }.Publish();
+ new OrderStatusChangedEvent() { Status = ORDER_STATUS.COMPLETED_COOK, SubOrderId = mork.SuborderId, GoodName = mork.GoodsName }.Publish();
Thread.Sleep(5000);
- new OrderStatusChangedEvent() { Status = ORDER_STATUS.COMPLETED_TAKE, SubOrderId = mork.SuborderId }.Publish();
+ new OrderStatusChangedEvent() { Status = ORDER_STATUS.COMPLETED_TAKE, SubOrderId = mork.SuborderId, GoodName = mork.GoodsName }.Publish();
Thread.Sleep(2000);
}
}
@@ -122,7 +122,12 @@ namespace BPASmartClient.Business
{
OrderStatusChangedEvent orderStatusChangedEvent = @event as OrderStatusChangedEvent;
string result = string.Empty;
- OrderStatusChange orderStatusChange = new OrderStatusChange() { CookingStatus = orderStatusChangedEvent.Status, SuborderId = orderStatusChangedEvent.SubOrderId };
+ OrderStatusChange orderStatusChange = new OrderStatusChange()
+ {
+ CookingStatus = orderStatusChangedEvent.Status,
+ SuborderId = orderStatusChangedEvent.SubOrderId,
+ GoodName = orderStatusChangedEvent.GoodName
+ };
#region API 订单状态修改
try
@@ -144,6 +149,7 @@ namespace BPASmartClient.Business
#region MQTT 订单状态修改
var clientId = Plugin.GetInstance().GetPlugin().ClientId;
var temp = BPAPackage.Make(orderStatusChange, clientId, orderStatusChangedEvent.deviceClientType);
+ var q = temp.Serialize(false);
Plugin.GetInstance().GetPlugin().Publish(TOPIC.GetInstance.GetAppTopic(clientId.ToString()), temp.Serialize(false));
#endregion
}
diff --git a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
index f1590991..822d0320 100644
--- a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
+++ b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
@@ -200,7 +200,7 @@
-
+
diff --git a/BPASmartClient.CustomResource/Converters/VisibleTypeConverter.cs b/BPASmartClient.CustomResource/Converters/VisibleTypeConverter.cs
new file mode 100644
index 00000000..1225ef80
--- /dev/null
+++ b/BPASmartClient.CustomResource/Converters/VisibleTypeConverter.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace BPASmartClient.CustomResource.Converters
+{
+ public class VisibleTypeConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null && parameter != null && parameter is string p && value is bool type)
+ {
+ if (p != null)
+ {
+ if (p == "NetworkPort")
+ return type ? Visibility.Visible : Visibility.Collapsed;
+ else if (p == "SerialPort")
+ return !type ? Visibility.Visible : Visibility.Collapsed;
+ }
+ }
+ return Visibility.Collapsed;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/BPASmartClient.CustomResource/RecDictionarys/GlobalStyle.xaml b/BPASmartClient.CustomResource/RecDictionarys/GlobalStyle.xaml
index 2426ffba..8b6a4b0d 100644
--- a/BPASmartClient.CustomResource/RecDictionarys/GlobalStyle.xaml
+++ b/BPASmartClient.CustomResource/RecDictionarys/GlobalStyle.xaml
@@ -4,5 +4,15 @@
xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters">
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BPASmartClient.CustomResource/Themes/GenricStyle.xaml b/BPASmartClient.CustomResource/Themes/GenricStyle.xaml
index 8561efb6..e15e3c81 100644
--- a/BPASmartClient.CustomResource/Themes/GenricStyle.xaml
+++ b/BPASmartClient.CustomResource/Themes/GenricStyle.xaml
@@ -123,6 +123,60 @@
+
+
+
+
-
+
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
-
+
+
-
-
-
-
+ FontSize="20"
+ Foreground="#ff23caca"
+ IsEditable="False"
+ ItemsSource="{Binding Shops}"
+ SelectedIndex="0"
+ SelectionChanged="shop_SelectionChanged"
+ Style="{StaticResource ComboBoxStyle}"
+ Text="{Binding ClientDeviceType}" />
-
-
-
-
-
-
-
-
-
-
-
-
+ Command="{Binding SaveData}"
+ Content="保存配置"
+ FontSize="16"
+ Foreground="{StaticResource TextBlockForeground}"
+ IcoText=""
+ Style="{StaticResource NewButtonStyle}" />
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
-
+ Columns="2"
+ Visibility="Collapsed">
+
+
+
+
-
+
+ Grid.Column="3"
+ Width="170"
+ HorizontalAlignment="Left"
+ Style="{StaticResource TextBoxStyle}"
+ Text="{Binding deviceConfig[0].ShopName}" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Text="请选择设备模块:" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Text="{Binding SelectedValue.DeviceModule, ElementName=tv, Mode=TwoWay}" />
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
-
+ Text="IP地址:" />
+ Width="170"
+ HorizontalAlignment="Left"
+ Style="{StaticResource TextBoxStyle}"
+ Text="{Binding SelectedValue.communicationPar.IPAddress, ElementName=tv, Mode=TwoWay}" />
-
+ Text="端口号:" />
+ Width="170"
+ HorizontalAlignment="Left"
+ Style="{StaticResource TextBoxStyle}"
+ Text="{Binding SelectedValue.communicationPar.IPPort, ElementName=tv, Mode=TwoWay}" />
-
-
-
-
-
+ HorizontalAlignment="Right"
+ Style="{StaticResource TextBlockStyle}"
+ Text="站号:" />
+
+
-
+
- -->
-
-
+
-
-
-
-
+
+
+
+
- -->
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- -->
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- -->
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- -->
-
-
+
+
+
+
+
+
+
-
diff --git a/BPASmartClient/Control/ShopDeviceConfigView.xaml.cs b/BPASmartClient/Control/ShopDeviceConfigView.xaml.cs
index 2cb92a67..a608cd93 100644
--- a/BPASmartClient/Control/ShopDeviceConfigView.xaml.cs
+++ b/BPASmartClient/Control/ShopDeviceConfigView.xaml.cs
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -13,6 +15,10 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using BPASmartClient.DialogWindow;
+using BPASmartClient.Helper;
+using BPASmartClient.ViewModel;
+using BPASmartClient.ViewModel.Model;
+using Newtonsoft.Json;
namespace BPASmartClient.Control
{
@@ -29,7 +35,134 @@ namespace BPASmartClient.Control
private void IcoButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
NewShopWindow newShopWindow = new NewShopWindow();
- newShopWindow.ShowDialog();
+ var res = newShopWindow.ShowDialog();
+
+ if (res != null && res == true)
+ {
+ VisibilityControl();
+ }
+ }
+
+ private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs