@@ -61,7 +61,7 @@ namespace HKCardOUT | |||
/// </summary> | |||
protected override void Configure() | |||
{ | |||
#if !DEBUG | |||
#if DEBUG | |||
var configer = (new ConfigurationBuilder()).AddJsonFile("options.json").Build(); | |||
#else | |||
var configer = (new ConfigurationBuilder()).AddJsonFile("options.pro.json").Build(); | |||
@@ -85,6 +85,8 @@ namespace HKCardOUT | |||
//服务器拉取数据 | |||
ServiceQueryExcute.QueryExcute.ExtuteMQ<CardHandle, string>("CardStutasChanged", MQEnum.Push); | |||
ServiceQueryExcute.QueryExcute.ExtuteMQ<TimeHandle, string>("TimeChanged", MQEnum.Push); | |||
ServiceQueryExcute.QueryExcute.ExtuteMQ<FoodHandle, string>("GateFood", MQEnum.Push); | |||
ServiceQueryExcute.QueryExcute.ExtuteMQ<RangeHandle, string>("GateSet", MQEnum.Push); | |||
//服务器拉取数据 | |||
RemoteService.SyncTime(); | |||
DataBus.UserListDto = HKLib.Interfaces.HKLibHelper.GetUserListSync(""); | |||
@@ -27,11 +27,19 @@ namespace HKCardOUT | |||
DataBus.Times = msg.ToModel<TimeSpilte>(); | |||
} | |||
} | |||
public class TestHandle : IAccept | |||
public class FoodHandle : IAccept | |||
{ | |||
public void AcceptMQ<T>(string msg) | |||
{ | |||
var X = msg; | |||
RemoteService.GetFoodMenus(); | |||
} | |||
} | |||
public class RangeHandle : IAccept | |||
{ | |||
public void AcceptMQ<T>(string msg) | |||
{ | |||
RemoteService.GetRangeCtrl(); | |||
} | |||
} | |||
} |
@@ -1,4 +1,5 @@ | |||
using System; | |||
using Newtonsoft.Json; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
@@ -6,6 +7,7 @@ namespace DTO | |||
{ | |||
public class FoodDto | |||
{ | |||
[JsonProperty("gateFoodList")] | |||
public List<SubFoodDto> GateFood { get; set; } = new List<SubFoodDto>(); | |||
} | |||
public class SubFoodDto | |||
@@ -1,16 +1,10 @@ | |||
using System; | |||
using Newtonsoft.Json; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace DTO | |||
{ | |||
public class RangeCtrlDto | |||
{ | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
public List<GateSetUp> GateSetUp { get; set; } | |||
} | |||
public class Locs | |||
{ | |||
/// <summary> | |||
@@ -32,6 +26,7 @@ namespace DTO | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
[JsonProperty("locsList")] | |||
public List<Locs> Locs { get; set; } | |||
} | |||
} |
@@ -47,7 +47,7 @@ namespace HKCardOUT.Helper | |||
public static ConcurrentDictionary<string, ConcurrentQueue<SaleLogDto>> SaleLogDtoList { get; set; } = new ConcurrentDictionary<string, ConcurrentQueue<SaleLogDto>>(); | |||
public static FoodDto Menu { get; set; } | |||
public static RangeCtrlDto RangeCtrl { get; set; } | |||
public static List<GateSetUp> RangeCtrl { get; set; } | |||
} | |||
public class ApiRoute | |||
{ | |||
@@ -68,6 +68,14 @@ namespace HKCardOUT.Helper | |||
/// 获取店铺信息 | |||
/// </summary> | |||
public static string PullShopInfo = DataBus.SaasRoute + $"api/StoreHelper/GeBasisGateList?StoreId={DataBus.StoreId}"; | |||
/// <summary> | |||
/// 区域控制 | |||
/// </summary> | |||
public static string RangCtrl = DataBus.SaasRoute + $"api/StoreHelper/GetBasisGateSetUp?StoreId={DataBus.StoreId}"; | |||
/// <summary> | |||
/// 菜品数据 | |||
/// </summary> | |||
public static string FoodCtrl = DataBus.SaasRoute + $"api/StoreHelper/GetBasisGateFoodList?StoreId={DataBus.StoreId}"; | |||
} | |||
public class HKConverter : IValueConverter | |||
{ | |||
@@ -143,66 +143,31 @@ namespace HKCardOUT.Logic | |||
/// </summary> | |||
public static void GetFoodMenus() | |||
{ | |||
var dtos = new FoodDto | |||
{ | |||
GateFood = new List<SubFoodDto>() | |||
}; | |||
//5号档口和6号档口显示的菜品 | |||
SubFoodDto dto1 = new SubFoodDto | |||
{ | |||
GateId = "2edbe98d-019c-4c3c-87d8-6876aa866233", | |||
Foods = new List<string> { | |||
"红烧狮子头","蒜苔肉丝","回锅肉","泥白肉","炒白菜","炒茄子" | |||
} | |||
}; | |||
dtos.GateFood.Add(dto1); | |||
//3号档口和4号档口显示的菜品 | |||
SubFoodDto dto12 = new SubFoodDto | |||
if (DataBus.NetWordState) | |||
{ | |||
GateId = "6ff37c6a-5151-4032-8eca-073a0a900090", | |||
Foods = new List<string> { | |||
"红烧狮子头","蒜苔肉丝","回锅肉","蒜泥白肉","炒白菜","炒茄子" | |||
} | |||
}; | |||
dtos.GateFood.Add(dto12); | |||
var data = IHttpMultiClient.HttpMulti.AddNode(t => | |||
{ | |||
t.NodePath = ApiRoute.FoodCtrl; | |||
}).Build().RunStringFirst(); | |||
//5号档口和6号档口显示的菜品 | |||
SubFoodDto dto123 = new SubFoodDto | |||
{ | |||
GateId = "39eb5b22-98b4-46f6-9c7e-5f0d3bc61058", | |||
Foods = new List<string> { | |||
"红烧狮子头","蒜苔肉丝","回锅肉","蒜泥白肉","炒白菜","炒茄子" | |||
} | |||
}; | |||
dtos.GateFood.Add(dto123); | |||
DataBus.Menu = data.ToModel<JObject>()["data"].ToJson().ToModel<FoodDto>(); | |||
//6ff37c6a-5151-4032-8eca-073a0a900090 | |||
//6ff37c6a-5151-4032-8eca-073a0a900090 | |||
//dtos.GateFood.Add(dto1); | |||
DataBus.Menu = dtos; | |||
} | |||
} | |||
public static void GetRangeCtrl() | |||
{ | |||
RangeCtrlDto dto = new RangeCtrlDto | |||
if (DataBus.NetWordState) | |||
{ | |||
GateSetUp = new List<GateSetUp> { | |||
new GateSetUp | |||
{ | |||
GateId= "2edbe98d-019c-4c3c-87d8-6876aa866233", | |||
Locs= new List<Locs> | |||
{ | |||
new Locs{ IsShow=true,Key="left"}, | |||
new Locs{ IsShow=true,Key="right"}, | |||
new Locs{ IsShow=true,Key="top"}, | |||
new Locs{ IsShow=false,Key="bottom"} | |||
} | |||
} | |||
} | |||
}; | |||
var data = IHttpMultiClient.HttpMulti.AddNode(t => | |||
{ | |||
t.NodePath = ApiRoute.RangCtrl; | |||
}).Build().RunStringFirst(); | |||
DataBus.RangeCtrl = dto; | |||
DataBus.RangeCtrl = data.ToModel<JObject>()["data"].ToJson().ToModel<List<GateSetUp>>(); | |||
} | |||
} | |||
} | |||
} |
@@ -19,10 +19,6 @@ namespace HKCardOUT.ViewModels | |||
public AdWindowViewModel() | |||
{ | |||
for (int i = 0; i < 6; i++) | |||
{ | |||
Foods.Add(""); | |||
} | |||
} | |||
#region 属性 | |||
@@ -33,7 +29,16 @@ namespace HKCardOUT.ViewModels | |||
public AdInfoModel RAdinfo { get { return _mRAdinfo; } set { _mRAdinfo = value; OnPropertyChanged(); } } | |||
private AdInfoModel _mRAdinfo = new AdInfoModel(); | |||
public ObservableCollection<string> Foods { get; set; } = new ObservableCollection<string>(); | |||
ObservableCollection<string> _Foods; | |||
public ObservableCollection<string> Foods | |||
{ | |||
get => _Foods; | |||
set | |||
{ | |||
_Foods = value; | |||
OnPropertyChanged(); | |||
} | |||
} | |||
#endregion | |||
@@ -44,16 +49,19 @@ namespace HKCardOUT.ViewModels | |||
var res = DataBus.Menu.GateFood.Where(t => t.GateId == GateId)?.Select(t => t.Foods)?.FirstOrDefault(); | |||
if (res != null) | |||
{ | |||
Foods.Clear(); | |||
res.ToList()?.ForEach(item => { Foods.Add(item); }); | |||
App.Current.Dispatcher.Invoke(() => | |||
{ | |||
Foods = new ObservableCollection<string>(res); | |||
}); | |||
} | |||
} | |||
public void InitData(int[] BindScreen) | |||
{ | |||
FoodsInit(BindScreen); | |||
ThreadManage.GetInstance().StartLong(() => | |||
{ | |||
FoodsInit(BindScreen); | |||
var model = (new HKCore()).PullDaySaleLog(BindScreen); | |||
LAdInfo.Gate = $"{BindScreen[1]}号档口"; | |||
@@ -220,7 +220,7 @@ | |||
Grid.Row="1" | |||
Background="Transparent" | |||
BorderThickness="0" | |||
ItemsSource="{Binding Foods}" | |||
ItemsSource="{Binding Foods, Mode=TwoWay}" | |||
Style="{StaticResource WrapPanelHorizontalListBox}"> | |||
<ListBox.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
@@ -95,7 +95,7 @@ namespace HKCardOUT.Views | |||
if (BindScreen == 0) | |||
{ | |||
var GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "05" || t.Address == "06").Select(t => t.GateId).FirstOrDefault(); | |||
var area = DataBus.RangeCtrl.GateSetUp.FirstOrDefault(t => t.GateId == GateId).Locs; | |||
var area = DataBus.RangeCtrl.FirstOrDefault(t => t.GateId == GateId).Locs; | |||
foreach (var item in area) | |||
{ | |||
@@ -206,7 +206,7 @@ namespace HKCardOUT.Views | |||
if (BindScreen == 1) | |||
{ | |||
var GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "01" || t.Address == "02").Select(t => t.GateId).FirstOrDefault(); | |||
var area = DataBus.RangeCtrl.GateSetUp.FirstOrDefault(t => t.GateId == GateId).Locs; | |||
var area = DataBus.RangeCtrl.FirstOrDefault(t => t.GateId == GateId).Locs; | |||
foreach (var item in area) | |||
{ | |||
@@ -317,7 +317,7 @@ namespace HKCardOUT.Views | |||
if (BindScreen == 2) | |||
{ | |||
var GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "05" || t.Address == "06").Select(t => t.GateId).FirstOrDefault(); | |||
var area = DataBus.RangeCtrl.GateSetUp.FirstOrDefault(t => t.GateId == GateId).Locs; | |||
var area = DataBus.RangeCtrl.FirstOrDefault(t => t.GateId == GateId).Locs; | |||
foreach (var item in area) | |||
{ | |||
@@ -21,7 +21,7 @@ | |||
//取消单卡刷卡限制 | |||
"Cancel": false, | |||
//MQ测试地址 内网无法访问需要用正式的MQ地址 | |||
"MQ": "host=10.2.1.21:5672;username=guest;password=guest", | |||
"MQ": "host=10.2.1.43:5672;virtualHost=/;username=username;password=pwd", | |||
//MQ正式地址 | |||
//"MQ": "host=47.108.65.220;username=root;password=pwd", | |||
//超级卡 | |||