瀏覽代碼

解决大屏显示bug

master
pengliangyang 1 年之前
父節點
當前提交
0d508ddba5
共有 7 個檔案被更改,包括 93 行新增25 行删除
  1. +28
    -5
      HKCardOUT/CardHandle.cs
  2. +1
    -1
      HKCardOUT/HKCardOUT.csproj
  3. +13
    -7
      HKCardOUT/Helper/BigScreen/DataCenter.cs
  4. +18
    -12
      HKCardOUT/Logic/RemoteService.cs
  5. +24
    -0
      HKLib/HKExpandMethod.cs
  6. +1
    -0
      HKLib/HKLib.csproj
  7. +8
    -0
      HKLib/RabbitMq/Config/MQFactory.cs

+ 28
- 5
HKCardOUT/CardHandle.cs 查看文件

@@ -9,16 +9,24 @@ using System;
using System.Collections.Generic;
using System.Text;
using XExten.Advance.LinqFramework;
using BPA.Helper;
namespace HKCardOUT
{
public class CardHandle : IAccept
{
public void AcceptMQ<T>(string msg)
{
var dto = msg.ToModel<CardStutasDto>();
var res = msg.FromJSON<CardStutasDto>();
if (res == null)
{
if (msg.Contains("add"))
RemoteService.GetFoodMenus();
return;
}

DbContext.Context.Updateable<CardStutas>().SetColumns(t => t.Stutas == dto.Stutas).Where(t => t.CardNo == dto.CardNo).ExecuteCommand();
//var dto = msg.ToModel<CardStutasDto>();
DbContext.Context.Updateable<CardStutas>().SetColumns(t => t.Stutas == res.Stutas).Where(t => t.CardNo == res.CardNo).ExecuteCommand();

new HKCore().GetAllCardStatus();
}
@@ -28,7 +36,13 @@ namespace HKCardOUT
{
public void AcceptMQ<T>(string msg)
{

var res = msg.FromJSON<CardStutas>();
if (res == null)
{
if (msg.Contains("add"))
RemoteService.GetFoodMenus();
return;
}
var data = msg.ToModel<CardStutas>();
HKCore.AddCard(new List<CardStutas> { data });
}
@@ -38,7 +52,16 @@ namespace HKCardOUT
{
public void AcceptMQ<T>(string msg)
{
DataBus.Times = msg.ToModel<TimeSpilte>();
var res = msg.FromJSON<TimeSpilte>();
if (res == null)
{
if (msg.Contains("add"))
RemoteService.GetFoodMenus();
return;
}
DataBus.Times = res;
//DataBus.Times = msg.ToModel<TimeSpilte>();
//RemoteService.SyncTime();
}
}
public class FoodHandle : IAccept


+ 1
- 1
HKCardOUT/HKCardOUT.csproj 查看文件

@@ -34,7 +34,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="BPA.Communication" Version="1.0.42" />
<PackageReference Include="BPA.Helper" Version="1.0.32" />
<PackageReference Include="BPA.Helper" Version="1.0.43" />
<PackageReference Include="BPA.Message" Version="1.0.78" />
<PackageReference Include="CalcBinding" Version="2.5.2" />
<PackageReference Include="HandyControls" Version="3.4.1" />


+ 13
- 7
HKCardOUT/Helper/BigScreen/DataCenter.cs 查看文件

@@ -66,6 +66,13 @@ namespace Helper.BigScreen
sender.WorkStatus_6 = Main.GetInstance.GetIsSwipe(1) ? WorkStatus.工作 : WorkStatus.待机;
var GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == $"05" || t.Address == $"06").Select(t => t.GateId).FirstOrDefault();
var res = DataBus.Menu.GateFood.Where(t => t.GateId == GateId)?.Select(t => t.Foods)?.FirstOrDefault();

sender.SplitMeals_CookType_1 = res;
sender.SplitMeals_CookType_2 = res;
sender.SplitMeals_CookType_3 = res;
sender.SplitMeals_CookType_4 = res;
sender.SplitMeals_CookType_5 = res;
sender.SplitMeals_CookType_6 = res;
if (model.ContainsKey("6"))
{
sender.SplitMeals_CreditCardCount_1 = model["6"];
@@ -88,8 +95,7 @@ namespace Helper.BigScreen
}
}
}

sender.SplitMeals_CookType_1 = res;
//sender.SplitMeals_CookType_2 = res;
}
if (model.ContainsKey("5"))
{
@@ -113,7 +119,7 @@ namespace Helper.BigScreen
}
}
}
sender.SplitMeals_CookType_2 = res;
//sender.SplitMeals_CookType_2 = res;
}
if (model.ContainsKey("4"))
{
@@ -137,7 +143,7 @@ namespace Helper.BigScreen
}
}
}
sender.SplitMeals_CookType_3 = res;
//sender.SplitMeals_CookType_3 = res;
}
if (model.ContainsKey("3"))
{
@@ -161,7 +167,7 @@ namespace Helper.BigScreen
}
}
}
sender.SplitMeals_CookType_4 = res;
//sender.SplitMeals_CookType_4 = res;
}
if (model.ContainsKey("2"))
{
@@ -185,7 +191,7 @@ namespace Helper.BigScreen
}
}
}
sender.SplitMeals_CookType_5 = res;
//sender.SplitMeals_CookType_5 = res;
}
if (model.ContainsKey("1"))
{
@@ -209,7 +215,7 @@ namespace Helper.BigScreen
}
}
}
sender.SplitMeals_CookType_6 = res;
//sender.SplitMeals_CookType_6 = res;
}
var Foods = DataBus.Menu.GateFood.Where(t => t.GateId == GateId)?.Select(t => t.Foods)?.FirstOrDefault();
sender.StatsCount = new List<StatsModel>();


+ 18
- 12
HKCardOUT/Logic/RemoteService.cs 查看文件

@@ -20,6 +20,7 @@ using XExten.Advance.HttpFramework.MultiCommon;
using XExten.Advance.HttpFramework.MultiFactory;
using XExten.Advance.LinqFramework;
using XExten.Advance.StaticFramework;
using BPA.Helper;

namespace HKCardOUT.Logic
{
@@ -66,7 +67,9 @@ namespace HKCardOUT.Logic
t.NodePath = ApiRoute.GetTime;
t.ReqType = MultiType.GET;
}).Build().RunStringFirst();

var dtoTime = data.ToModel<JObject>()["data"]["data"].ToJson().ToModel<TimeSpilteDto>();

var time = GetNetWorkTime();
var tims = $"{time.Year}-{time.Month}-{time.Day}";
DataBus.Times = new TimeSpilte();
@@ -149,10 +152,11 @@ namespace HKCardOUT.Logic
{
if (DataBus.NetWordState)
{
var data = IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = ApiRoute.PullShopInfo;
}).Build().RunStringFirst()
/* var data = IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = ApiRoute.PullShopInfo;
}).Build().RunStringFirst()*/
var data = APIHelper.GetInstance.HttpGetRequest(ApiRoute.PullShopInfo)
.ToModel<JObject>()["data"].ToJson().ToModel<StoreInfoResponse>();
DataBus.StoreInfo = data;
var storeinfo = SyncStatic.CreateFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "StoreInfo.json"));
@@ -171,13 +175,15 @@ namespace HKCardOUT.Logic

if (DataBus.NetWordState)
{
var data = IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = ApiRoute.FoodCtrl;
}).Build().RunStringFirst();
//var data = IHttpMultiClient.HttpMulti.AddNode(t =>
//{
// t.CacheNode = false;
// t.NodePath = ApiRoute.FoodCtrl;
//}).Build().RunStringFirst();

DataBus.Menu = data.ToModel<JObject>()["data"].ToJson().ToModel<FoodDto>();
var data = APIHelper.GetInstance.HttpGetRequest(ApiRoute.FoodCtrl);

DataBus.Menu = data.ToModel<JObject>()["data"].ToJson().ToModel<FoodDto>();
}
}
public static void GetRangeCtrl()
@@ -185,11 +191,11 @@ namespace HKCardOUT.Logic

if (DataBus.NetWordState)
{
var data = IHttpMultiClient.HttpMulti.AddNode(t =>
/*var data = IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = ApiRoute.RangCtrl;
}).Build().RunStringFirst();
}).Build().RunStringFirst();*/
var data = APIHelper.GetInstance.HttpGetRequest(ApiRoute.RangCtrl);
DataBus.RangeCtrl = data.ToModel<JObject>()["data"].ToJson().ToModel<List<GateSetUp>>();

}


+ 24
- 0
HKLib/HKExpandMethod.cs 查看文件

@@ -0,0 +1,24 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace HKLib
{
public static class HKExpandMethod
{
public static bool TryFromJSON<T>(this string str, out T source)
{
try
{
source = JsonConvert.DeserializeObject<T>(str);
return true;
}
catch (Exception ex)
{
source=default(T);
return false;
}
}
}
}

+ 1
- 0
HKLib/HKLib.csproj 查看文件

@@ -6,6 +6,7 @@
<ItemGroup>
<PackageReference Include="EasyNetQ" Version="6.5.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Snowflake.Core" Version="2.0.0" />
<PackageReference Include="SqlSugarCore" Version="5.1.3.27" />
<PackageReference Include="XExten.Advance" Version="1.2.4.2-preview" />


+ 8
- 0
HKLib/RabbitMq/Config/MQFactory.cs 查看文件

@@ -1,5 +1,7 @@
using EasyNetQ;
using EasyNetQ.Topology;
using HKLib.Dto;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Configuration;
@@ -112,5 +114,11 @@ namespace HKLib.RabbitMQ.Config
}
}


}
}

Loading…
取消
儲存