Browse Source

修改数据

Lishi
xxe 2 years ago
parent
commit
dbc95c9ba6
10 changed files with 64 additions and 76 deletions
  1. +3
    -1
      HKCardOUT/Bootstrapper.cs
  2. +10
    -2
      HKCardOUT/CardHandle.cs
  3. +3
    -1
      HKCardOUT/DTO/FoodDto.cs
  4. +3
    -8
      HKCardOUT/DTO/RangeCtrlDto.cs
  5. +9
    -1
      HKCardOUT/Helper/DataBus.cs
  6. +15
    -50
      HKCardOUT/Logic/RemoteService.cs
  7. +16
    -8
      HKCardOUT/ViewModels/AdWindowViewModel.cs
  8. +1
    -1
      HKCardOUT/Views/AdWindow.xaml
  9. +3
    -3
      HKCardOUT/Views/AdWindow.xaml.cs
  10. +1
    -1
      HKCardOUT/options.json

+ 3
- 1
HKCardOUT/Bootstrapper.cs View File

@@ -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("");


+ 10
- 2
HKCardOUT/CardHandle.cs View File

@@ -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();
}
}
}

+ 3
- 1
HKCardOUT/DTO/FoodDto.cs View File

@@ -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


+ 3
- 8
HKCardOUT/DTO/RangeCtrlDto.cs View File

@@ -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; }
}
}

+ 9
- 1
HKCardOUT/Helper/DataBus.cs View File

@@ -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
{


+ 15
- 50
HKCardOUT/Logic/RemoteService.cs View File

@@ -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>>();

}
}
}
}

+ 16
- 8
HKCardOUT/ViewModels/AdWindowViewModel.cs View File

@@ -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]}号档口";


+ 1
- 1
HKCardOUT/Views/AdWindow.xaml View File

@@ -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>


+ 3
- 3
HKCardOUT/Views/AdWindow.xaml.cs View File

@@ -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)
{


+ 1
- 1
HKCardOUT/options.json View File

@@ -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",
//超级卡


Loading…
Cancel
Save