|
@@ -22,13 +22,14 @@ namespace Helper.BigScreen |
|
|
{ |
|
|
{ |
|
|
public class DataCenter |
|
|
public class DataCenter |
|
|
{ |
|
|
{ |
|
|
|
|
|
readonly object locker = new(); |
|
|
public static List<string> S1 { get; set; } = new List<string>(2); |
|
|
public static List<string> S1 { get; set; } = new List<string>(2); |
|
|
public static List<string> S2 { get; set; } = new List<string>(2); |
|
|
public static List<string> S2 { get; set; } = new List<string>(2); |
|
|
public static List<string> S3 { get; set; } = new List<string>(2); |
|
|
public static List<string> S3 { get; set; } = new List<string>(2); |
|
|
public static List<string> S4 { get; set; } = new List<string>(2); |
|
|
public static List<string> S4 { get; set; } = new List<string>(2); |
|
|
public static List<string> S5 { get; set; } = new List<string>(2); |
|
|
public static List<string> S5 { get; set; } = new List<string>(2); |
|
|
public static List<string> S6 { get; set; } = new List<string>(2); |
|
|
public static List<string> S6 { get; set; } = new List<string>(2); |
|
|
public static void CreateData() |
|
|
|
|
|
|
|
|
public void CreateData() |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
var sender = new ScreenModelSplitMeals(); |
|
|
var sender = new ScreenModelSplitMeals(); |
|
@@ -63,142 +64,153 @@ namespace Helper.BigScreen |
|
|
sender.WorkStatus_4 = Main.GetInstance.GetIsSwipe(3) ? WorkStatus.工作 : WorkStatus.待机; |
|
|
sender.WorkStatus_4 = Main.GetInstance.GetIsSwipe(3) ? WorkStatus.工作 : WorkStatus.待机; |
|
|
sender.WorkStatus_5 = Main.GetInstance.GetIsSwipe(2) ? WorkStatus.工作 : WorkStatus.待机; |
|
|
sender.WorkStatus_5 = Main.GetInstance.GetIsSwipe(2) ? WorkStatus.工作 : WorkStatus.待机; |
|
|
sender.WorkStatus_6 = Main.GetInstance.GetIsSwipe(1) ? WorkStatus.工作 : WorkStatus.待机; |
|
|
sender.WorkStatus_6 = Main.GetInstance.GetIsSwipe(1) ? WorkStatus.工作 : WorkStatus.待机; |
|
|
|
|
|
|
|
|
sender.SplitMeals_CreditCardCount_1 = model["6"]; |
|
|
|
|
|
if (DataBus.SaleLogDtoList.ContainsKey("6")) |
|
|
|
|
|
|
|
|
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(); |
|
|
|
|
|
if (model.ContainsKey("6")) |
|
|
{ |
|
|
{ |
|
|
if (DataBus.SaleLogDtoList["6"].Count > 0) |
|
|
|
|
|
|
|
|
sender.SplitMeals_CreditCardCount_1 = model["6"]; |
|
|
|
|
|
if (DataBus.SaleLogDtoList.ContainsKey("6")) |
|
|
{ |
|
|
{ |
|
|
if (DataBus.SaleLogDtoList["6"].TryDequeue(out SaleLogDto info)) |
|
|
|
|
|
|
|
|
if (DataBus.SaleLogDtoList["6"].Count > 0) |
|
|
{ |
|
|
{ |
|
|
var Name = DataBus.UserListDto.Where(t => t.Cards.Select(x => x.CardNum).Contains(info.CardNo)).Select(x => x.Name).FirstOrDefault(); |
|
|
|
|
|
if (S1.Count >= 2) |
|
|
|
|
|
|
|
|
if (DataBus.SaleLogDtoList["6"].TryDequeue(out SaleLogDto info)) |
|
|
{ |
|
|
{ |
|
|
S1.RemoveAt(0); |
|
|
|
|
|
S1.Add(Name); |
|
|
|
|
|
|
|
|
var Name = DataBus.UserListDto.Where(t => t.Cards.Select(x => x.CardNum).Contains(info.CardNo)).Select(x => x.Name).FirstOrDefault(); |
|
|
|
|
|
if (S1.Count >= 2) |
|
|
|
|
|
{ |
|
|
|
|
|
S1.RemoveAt(0); |
|
|
|
|
|
S1.Add(Name); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
S1.Add(Name); |
|
|
|
|
|
sender.SplitMeals_CreditCardNameBefore_1 = S1[0]; |
|
|
|
|
|
sender.SplitMeals_CreditCardName_1 = S1.Count >= 2 ? S1[1] : S1[0]; |
|
|
} |
|
|
} |
|
|
else |
|
|
|
|
|
S1.Add(Name); |
|
|
|
|
|
sender.SplitMeals_CreditCardNameBefore_1 = S1[0]; |
|
|
|
|
|
sender.SplitMeals_CreditCardName_1 = S1.Count >= 2 ? S1[1] : S1[0]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
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_CreditCardCount_2 = model["5"]; |
|
|
|
|
|
if (DataBus.SaleLogDtoList.ContainsKey("5")) |
|
|
|
|
|
|
|
|
sender.SplitMeals_CookType_1 = res; |
|
|
|
|
|
} |
|
|
|
|
|
if (model.ContainsKey("5")) |
|
|
{ |
|
|
{ |
|
|
if (DataBus.SaleLogDtoList["5"].Count > 0) |
|
|
|
|
|
|
|
|
sender.SplitMeals_CreditCardCount_2 = model["5"]; |
|
|
|
|
|
if (DataBus.SaleLogDtoList.ContainsKey("5")) |
|
|
{ |
|
|
{ |
|
|
if (DataBus.SaleLogDtoList["5"].TryDequeue(out SaleLogDto info)) |
|
|
|
|
|
|
|
|
if (DataBus.SaleLogDtoList["5"].Count > 0) |
|
|
{ |
|
|
{ |
|
|
var Name = DataBus.UserListDto.Where(t => t.Cards.Select(x => x.CardNum).Contains(info.CardNo)).Select(x => x.Name).FirstOrDefault(); |
|
|
|
|
|
if (S2.Count >= 2) |
|
|
|
|
|
|
|
|
if (DataBus.SaleLogDtoList["5"].TryDequeue(out SaleLogDto info)) |
|
|
{ |
|
|
{ |
|
|
S2.RemoveAt(0); |
|
|
|
|
|
S2.Add(Name); |
|
|
|
|
|
|
|
|
var Name = DataBus.UserListDto.Where(t => t.Cards.Select(x => x.CardNum).Contains(info.CardNo)).Select(x => x.Name).FirstOrDefault(); |
|
|
|
|
|
if (S2.Count >= 2) |
|
|
|
|
|
{ |
|
|
|
|
|
S2.RemoveAt(0); |
|
|
|
|
|
S2.Add(Name); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
S2.Add(Name); |
|
|
|
|
|
sender.SplitMeals_CreditCardNameBefore_2 = S2[0]; |
|
|
|
|
|
sender.SplitMeals_CreditCardName_2 = S2.Count >= 2 ? S2[1] : S2[0]; |
|
|
} |
|
|
} |
|
|
else |
|
|
|
|
|
S2.Add(Name); |
|
|
|
|
|
sender.SplitMeals_CreditCardNameBefore_2 = S2[0]; |
|
|
|
|
|
sender.SplitMeals_CreditCardName_2 = S2.Count >= 2 ? S2[1] : S2[0]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
sender.SplitMeals_CookType_2 = res; |
|
|
} |
|
|
} |
|
|
sender.SplitMeals_CookType_2 = res; |
|
|
|
|
|
|
|
|
|
|
|
sender.SplitMeals_CreditCardCount_3 = model["4"]; |
|
|
|
|
|
if (DataBus.SaleLogDtoList.ContainsKey("4")) |
|
|
|
|
|
|
|
|
if (model.ContainsKey("4")) |
|
|
{ |
|
|
{ |
|
|
if (DataBus.SaleLogDtoList["4"].Count > 0) |
|
|
|
|
|
|
|
|
sender.SplitMeals_CreditCardCount_3 = model["4"]; |
|
|
|
|
|
if (DataBus.SaleLogDtoList.ContainsKey("4")) |
|
|
{ |
|
|
{ |
|
|
if (DataBus.SaleLogDtoList["4"].TryDequeue(out SaleLogDto info)) |
|
|
|
|
|
|
|
|
if (DataBus.SaleLogDtoList["4"].Count > 0) |
|
|
{ |
|
|
{ |
|
|
var Name = DataBus.UserListDto.Where(t => t.Cards.Select(x => x.CardNum).Contains(info.CardNo)).Select(x => x.Name).FirstOrDefault(); |
|
|
|
|
|
if (S3.Count >= 2) |
|
|
|
|
|
|
|
|
if (DataBus.SaleLogDtoList["4"].TryDequeue(out SaleLogDto info)) |
|
|
{ |
|
|
{ |
|
|
S3.RemoveAt(0); |
|
|
|
|
|
S3.Add(Name); |
|
|
|
|
|
|
|
|
var Name = DataBus.UserListDto.Where(t => t.Cards.Select(x => x.CardNum).Contains(info.CardNo)).Select(x => x.Name).FirstOrDefault(); |
|
|
|
|
|
if (S3.Count >= 2) |
|
|
|
|
|
{ |
|
|
|
|
|
S3.RemoveAt(0); |
|
|
|
|
|
S3.Add(Name); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
S3.Add(Name); |
|
|
|
|
|
sender.SplitMeals_CreditCardNameBefore_3 = S3[0]; |
|
|
|
|
|
sender.SplitMeals_CreditCardName_3 = S3.Count >= 2 ? S3[1] : S3[0]; |
|
|
} |
|
|
} |
|
|
else |
|
|
|
|
|
S3.Add(Name); |
|
|
|
|
|
sender.SplitMeals_CreditCardNameBefore_3 = S3[0]; |
|
|
|
|
|
sender.SplitMeals_CreditCardName_3 = S3.Count >= 2 ? S3[1] : S3[0]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
sender.SplitMeals_CookType_3 = res; |
|
|
} |
|
|
} |
|
|
sender.SplitMeals_CookType_3 = res; |
|
|
|
|
|
|
|
|
|
|
|
sender.SplitMeals_CreditCardCount_4 = model["3"]; |
|
|
|
|
|
if (DataBus.SaleLogDtoList.ContainsKey("3")) |
|
|
|
|
|
|
|
|
if (model.ContainsKey("3")) |
|
|
{ |
|
|
{ |
|
|
if (DataBus.SaleLogDtoList["3"].Count > 0) |
|
|
|
|
|
|
|
|
sender.SplitMeals_CreditCardCount_4 = model["3"]; |
|
|
|
|
|
if (DataBus.SaleLogDtoList.ContainsKey("3")) |
|
|
{ |
|
|
{ |
|
|
if (DataBus.SaleLogDtoList["3"].TryDequeue(out SaleLogDto info)) |
|
|
|
|
|
|
|
|
if (DataBus.SaleLogDtoList["3"].Count > 0) |
|
|
{ |
|
|
{ |
|
|
var Name = DataBus.UserListDto.Where(t => t.Cards.Select(x => x.CardNum).Contains(info.CardNo)).Select(x => x.Name).FirstOrDefault(); |
|
|
|
|
|
if (S4.Count >= 2) |
|
|
|
|
|
|
|
|
if (DataBus.SaleLogDtoList["3"].TryDequeue(out SaleLogDto info)) |
|
|
{ |
|
|
{ |
|
|
S4.RemoveAt(0); |
|
|
|
|
|
S4.Add(Name); |
|
|
|
|
|
|
|
|
var Name = DataBus.UserListDto.Where(t => t.Cards.Select(x => x.CardNum).Contains(info.CardNo)).Select(x => x.Name).FirstOrDefault(); |
|
|
|
|
|
if (S4.Count >= 2) |
|
|
|
|
|
{ |
|
|
|
|
|
S4.RemoveAt(0); |
|
|
|
|
|
S4.Add(Name); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
S4.Add(Name); |
|
|
|
|
|
sender.SplitMeals_CreditCardNameBefore_4 = S4[0]; |
|
|
|
|
|
sender.SplitMeals_CreditCardName_4 = S4.Count >= 2 ? S4[1] : S4[0]; |
|
|
} |
|
|
} |
|
|
else |
|
|
|
|
|
S4.Add(Name); |
|
|
|
|
|
sender.SplitMeals_CreditCardNameBefore_4 = S4[0]; |
|
|
|
|
|
sender.SplitMeals_CreditCardName_4 = S4.Count >= 2 ? S4[1] : S4[0]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
sender.SplitMeals_CookType_4 = res; |
|
|
} |
|
|
} |
|
|
sender.SplitMeals_CookType_4 = res; |
|
|
|
|
|
|
|
|
|
|
|
sender.SplitMeals_CreditCardCount_5 = model["2"]; |
|
|
|
|
|
if (DataBus.SaleLogDtoList.ContainsKey("2")) |
|
|
|
|
|
|
|
|
if (model.ContainsKey("2")) |
|
|
{ |
|
|
{ |
|
|
if (DataBus.SaleLogDtoList["2"].Count > 0) |
|
|
|
|
|
|
|
|
sender.SplitMeals_CreditCardCount_5 = model["2"]; |
|
|
|
|
|
if (DataBus.SaleLogDtoList.ContainsKey("2")) |
|
|
{ |
|
|
{ |
|
|
if (DataBus.SaleLogDtoList["2"].TryDequeue(out SaleLogDto info)) |
|
|
|
|
|
|
|
|
if (DataBus.SaleLogDtoList["2"].Count > 0) |
|
|
{ |
|
|
{ |
|
|
var Name = DataBus.UserListDto.Where(t => t.Cards.Select(x => x.CardNum).Contains(info.CardNo)).Select(x => x.Name).FirstOrDefault(); |
|
|
|
|
|
if (S5.Count >= 2) |
|
|
|
|
|
|
|
|
if (DataBus.SaleLogDtoList["2"].TryDequeue(out SaleLogDto info)) |
|
|
{ |
|
|
{ |
|
|
S5.RemoveAt(0); |
|
|
|
|
|
S5.Add(Name); |
|
|
|
|
|
|
|
|
var Name = DataBus.UserListDto.Where(t => t.Cards.Select(x => x.CardNum).Contains(info.CardNo)).Select(x => x.Name).FirstOrDefault(); |
|
|
|
|
|
if (S5.Count >= 2) |
|
|
|
|
|
{ |
|
|
|
|
|
S5.RemoveAt(0); |
|
|
|
|
|
S5.Add(Name); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
S5.Add(Name); |
|
|
|
|
|
sender.SplitMeals_CreditCardNameBefore_5 = S5[0]; |
|
|
|
|
|
sender.SplitMeals_CreditCardName_5 = S5.Count >= 2 ? S5[1] : S5[0]; |
|
|
} |
|
|
} |
|
|
else |
|
|
|
|
|
S5.Add(Name); |
|
|
|
|
|
sender.SplitMeals_CreditCardNameBefore_5 = S5[0]; |
|
|
|
|
|
sender.SplitMeals_CreditCardName_5 = S5.Count >= 2 ? S5[1] : S5[0]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
sender.SplitMeals_CookType_5 = res; |
|
|
} |
|
|
} |
|
|
sender.SplitMeals_CookType_5 = res; |
|
|
|
|
|
|
|
|
|
|
|
sender.SplitMeals_CreditCardCount_6 = model["1"]; |
|
|
|
|
|
if (DataBus.SaleLogDtoList.ContainsKey("1")) |
|
|
|
|
|
|
|
|
if (model.ContainsKey("1")) |
|
|
{ |
|
|
{ |
|
|
if (DataBus.SaleLogDtoList["1"].Count > 0) |
|
|
|
|
|
|
|
|
sender.SplitMeals_CreditCardCount_6 = model["1"]; |
|
|
|
|
|
if (DataBus.SaleLogDtoList.ContainsKey("1")) |
|
|
{ |
|
|
{ |
|
|
if (DataBus.SaleLogDtoList["1"].TryDequeue(out SaleLogDto info)) |
|
|
|
|
|
|
|
|
if (DataBus.SaleLogDtoList["1"].Count > 0) |
|
|
{ |
|
|
{ |
|
|
var Name = DataBus.UserListDto.Where(t => t.Cards.Select(x => x.CardNum).Contains(info.CardNo)).Select(x => x.Name).FirstOrDefault(); |
|
|
|
|
|
if (S6.Count >= 2) |
|
|
|
|
|
|
|
|
if (DataBus.SaleLogDtoList["1"].TryDequeue(out SaleLogDto info)) |
|
|
{ |
|
|
{ |
|
|
S6.RemoveAt(0); |
|
|
|
|
|
S6.Add(Name); |
|
|
|
|
|
|
|
|
var Name = DataBus.UserListDto.Where(t => t.Cards.Select(x => x.CardNum).Contains(info.CardNo)).Select(x => x.Name).FirstOrDefault(); |
|
|
|
|
|
if (S6.Count >= 2) |
|
|
|
|
|
{ |
|
|
|
|
|
S6.RemoveAt(0); |
|
|
|
|
|
S6.Add(Name); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
S6.Add(Name); |
|
|
|
|
|
sender.SplitMeals_CreditCardNameBefore_6 = S6[0]; |
|
|
|
|
|
sender.SplitMeals_CreditCardName_6 = S6.Count >= 2 ? S6[1] : S6[0]; |
|
|
} |
|
|
} |
|
|
else |
|
|
|
|
|
S6.Add(Name); |
|
|
|
|
|
sender.SplitMeals_CreditCardNameBefore_6 = S6[0]; |
|
|
|
|
|
sender.SplitMeals_CreditCardName_6 = S6.Count >= 2 ? S6[1] : S6[0]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
sender.SplitMeals_CookType_6 = res; |
|
|
} |
|
|
} |
|
|
sender.SplitMeals_CookType_6 = res; |
|
|
|
|
|
|
|
|
|
|
|
GateId = DataBus.StoreInfo.Devices.Select(t => t.GateId).FirstOrDefault(); |
|
|
|
|
|
var Foods = DataBus.Menu.GateFood.Where(t => t.GateId == GateId)?.Select(t => t.Foods)?.FirstOrDefault(); |
|
|
var Foods = DataBus.Menu.GateFood.Where(t => t.GateId == GateId)?.Select(t => t.Foods)?.FirstOrDefault(); |
|
|
sender.StatsCount = new List<StatsModel>(); |
|
|
sender.StatsCount = new List<StatsModel>(); |
|
|
foreach (var item in Foods) |
|
|
foreach (var item in Foods) |
|
@@ -209,8 +221,11 @@ namespace Helper.BigScreen |
|
|
Count = model.Values.Sum() |
|
|
Count = model.Values.Sum() |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
MQTTCon.Send(sender); |
|
|
|
|
|
Thread.Sleep(10); |
|
|
|
|
|
|
|
|
lock (locker) |
|
|
|
|
|
{ |
|
|
|
|
|
MQTTCon.Send(sender); |
|
|
|
|
|
} |
|
|
|
|
|
Thread.Sleep(300); |
|
|
}, $"屏幕刷卡信息", true); |
|
|
}, $"屏幕刷卡信息", true); |
|
|
} |
|
|
} |
|
|
public static void InitQueeue() |
|
|
public static void InitQueeue() |
|
|