diff --git a/HKCardOUT/Bootstrapper.cs b/HKCardOUT/Bootstrapper.cs index 9d492f2..7b49113 100644 --- a/HKCardOUT/Bootstrapper.cs +++ b/HKCardOUT/Bootstrapper.cs @@ -82,6 +82,7 @@ namespace HKCardOUT RemoteService.PullShopInfo(); //初始化表 DbContext.InitTable(); + //服务器拉取数据 ServiceQueryExcute.QueryExcute.ExtuteMQ("CardStutasChanged", MQEnum.Push); ServiceQueryExcute.QueryExcute.ExtuteMQ("TimeChanged", MQEnum.Push); //服务器拉取数据 @@ -89,6 +90,7 @@ namespace HKCardOUT DataBus.UserListDto = HKLib.Interfaces.HKLibHelper.GetUserListSync(""); RemoteService.GetCardStuatas(); DataBus.saleLogDtos = new System.Collections.Concurrent.ConcurrentQueue(); + RemoteService.GetFoodMenus(); base.Configure(); } diff --git a/HKCardOUT/CardHandle.cs b/HKCardOUT/CardHandle.cs index bb00d9e..4725671 100644 --- a/HKCardOUT/CardHandle.cs +++ b/HKCardOUT/CardHandle.cs @@ -27,4 +27,11 @@ namespace HKCardOUT DataBus.Times = msg.ToModel(); } } + public class TestHandle : IAccept + { + public void AcceptMQ(string msg) + { + var X = msg; + } + } } diff --git a/HKCardOUT/DTO/FoodDto.cs b/HKCardOUT/DTO/FoodDto.cs new file mode 100644 index 0000000..3bcddaa --- /dev/null +++ b/HKCardOUT/DTO/FoodDto.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace DTO +{ + public class FoodDto + { + public List GateFood { get; set; } + } + public class SubFoodDto + { + public string GateId { get; set; } + public List Foods { get; set; } + } +} diff --git a/HKCardOUT/Helper/DataBus.cs b/HKCardOUT/Helper/DataBus.cs index 87ed89a..bb9ae63 100644 --- a/HKCardOUT/Helper/DataBus.cs +++ b/HKCardOUT/Helper/DataBus.cs @@ -43,6 +43,7 @@ namespace HKCardOUT.Helper public static Dictionary AdStatus { get; set; } = new Dictionary(); public static List UserListDto { get; set; } public static ConcurrentQueue saleLogDtos { get; set; } + public static FoodDto Menu { get; set; } } public class ApiRoute { diff --git a/HKCardOUT/Logic/RemoteService.cs b/HKCardOUT/Logic/RemoteService.cs index f8402af..43128f2 100644 --- a/HKCardOUT/Logic/RemoteService.cs +++ b/HKCardOUT/Logic/RemoteService.cs @@ -48,9 +48,6 @@ namespace HKCardOUT.Logic /// public static void SyncTime() { - /* - {"statusCode":200,"data":{"isSuccess":true,"msg":null,"data":{"amStartTime":"17:50","amEndTime":"17:50","pmStartTime":"17:50","pmEndTime":"17:50","atStartTime":"17:50","atEndTime":"17:50"}},"succeeded":true,"errors":null,"extras":null,"timestamp":1665654784093} - */ var data = IHttpMultiClient.HttpMulti.AddNode(t => { t.NodePath = ApiRoute.GetTime; @@ -141,5 +138,24 @@ namespace HKCardOUT.Logic DataBus.StoreInfo = SyncStatic.ReadFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "StoreInfo.json")).ToModel(); } } + /// + /// 获取菜单 + /// + public static void GetFoodMenus() + { + var dtos = new FoodDto + { + GateFood = new List() + }; + SubFoodDto dto1 = new SubFoodDto + { + GateId = "2edbe98d-019c-4c3c-87d8-6876aa866233", + Foods = new List { + "红烧狮子头","蒜苔肉丝","回锅肉","蒜泥白肉","炒白菜","炒茄子" + } + }; + dtos.GateFood.Add(dto1); + DataBus.Menu = dtos; + } } } diff --git a/HKCardOUT/ViewModels/AdWindowViewModel.cs b/HKCardOUT/ViewModels/AdWindowViewModel.cs index 667d069..eb674a4 100644 --- a/HKCardOUT/ViewModels/AdWindowViewModel.cs +++ b/HKCardOUT/ViewModels/AdWindowViewModel.cs @@ -111,7 +111,7 @@ namespace HKCardOUT.ViewModels .Select(x => x.Name).FirstOrDefault(); - if (BindScreen == 2) + if (BindScreen == 0) { LInfo = data.Location == "6" ? data : new ScreenInfoDto(); RInfo = data.Location == "5" ? data : new ScreenInfoDto(); @@ -147,7 +147,7 @@ namespace HKCardOUT.ViewModels LMsg = HKControl.Main.GetInstance.GetIsSwipe(6) ? "设备正常" : "设备异常"; RMsg = HKControl.Main.GetInstance.GetIsSwipe(5) ? "设备正常" : "设备异常"; } - if (BindScreen == 0) + if (BindScreen == 2) { LInfo = data.Location == "4" ? data : new ScreenInfoDto(); RInfo = data.Location == "3" ? data : new ScreenInfoDto(); diff --git a/HKCardOUT/Views/AdWindow.xaml b/HKCardOUT/Views/AdWindow.xaml index a5c1a2c..d2287b9 100644 --- a/HKCardOUT/Views/AdWindow.xaml +++ b/HKCardOUT/Views/AdWindow.xaml @@ -27,7 +27,6 @@ - @@ -67,6 +66,24 @@ + + + + + + + + + + + - diff --git a/HKCardOUT/Views/AdWindow.xaml.cs b/HKCardOUT/Views/AdWindow.xaml.cs index a39f759..57c93e3 100644 --- a/HKCardOUT/Views/AdWindow.xaml.cs +++ b/HKCardOUT/Views/AdWindow.xaml.cs @@ -43,6 +43,21 @@ namespace HKCardOUT.Views { (this.DataContext as AdWindowViewModel).InitData(bindScreen); } + if (bindScreen == 2) + { + this.one.Text = "4号档口"; + this.two.Text = "3号档口"; + } + if (bindScreen == 1) + { + this.one.Text = "2号档口"; + this.two.Text = "1号档口"; + } + if (bindScreen == 0) + { + this.one.Text = "6号档口"; + this.two.Text = "5号档口"; + } InitView2(input); }; this.Closed += (sender, ev) => diff --git a/HKCardOUT/Views/RootView.xaml.cs b/HKCardOUT/Views/RootView.xaml.cs index 68e03c4..956b48b 100644 --- a/HKCardOUT/Views/RootView.xaml.cs +++ b/HKCardOUT/Views/RootView.xaml.cs @@ -16,7 +16,7 @@ namespace HKCardOUT.Views public RootView() { InitializeComponent(); - TurnOn(); + //TurnOn(); if (!StartEXE.IsExistKey("HKCardOUT")) { var Paths = "D:\\HK刷卡端正式环境\\HKCardOUT.exe"; diff --git a/HKCardOUT/options.json b/HKCardOUT/options.json index 1f1081f..b37e3cc 100644 --- a/HKCardOUT/options.json +++ b/HKCardOUT/options.json @@ -21,9 +21,9 @@ //取消单卡刷卡限制 "Cancel": false, //MQ测试地址 内网无法访问需要用正式的MQ地址 - //"MQ": "host=10.2.1.21:5672;username=guest;password=guest" + "MQ": "host=10.2.1.21:5672;username=guest;password=guest", //MQ正式地址 - "MQ": "host=47.108.65.220;username=root;password=pwd", + //"MQ": "host=47.108.65.220;username=root;password=pwd", //超级卡 "Admin": [ 666, 888, 999 ], //刷卡间隔