Sfoglia il codice sorgente

解决大屏显示bug

master
pengliangyang 1 anno fa
parent
commit
0d508ddba5
7 ha cambiato i file con 93 aggiunte e 25 eliminazioni
  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 Vedi File

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

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

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

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

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

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

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


}
}

Caricamento…
Annulla
Salva