Browse Source

叫号系统修改

master
pry 1 year ago
parent
commit
d45e9e65de
11 changed files with 72 additions and 9 deletions
  1. +5
    -1
      BPASmartClient.Business/Plugin/OrderProxy.cs
  2. +5
    -1
      BPASmartClient.CustomResource/Pages/Model/VoiceAPI.cs
  3. +16
    -3
      BPASmartClient.MorkS/Control_Morks.cs
  4. +16
    -0
      BPASmartClient.MorkS/GVL_MORKS.cs
  5. +1
    -0
      BPASmartClient.MorkS/OrderLocInfo.cs
  6. +7
    -2
      BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs
  7. +15
    -0
      BPASmartClient.MorkSUpgradedVer/GVL_MorkSUpgradedVer.cs
  8. +1
    -0
      BPASmartClient.MorkSUpgradedVer/OrderLocInfo.cs
  9. +0
    -1
      BPASmartClient.ViewModel/OrderStatusViewModel.cs
  10. +1
    -1
      BPASmartClient/App.config
  11. +5
    -0
      BPASmartClient/App.xaml.cs

+ 5
- 1
BPASmartClient.Business/Plugin/OrderProxy.cs View File

@@ -56,6 +56,9 @@ namespace BPASmartClient.Business
new OrderStatusChangedEvent() { SortNum = mork.SortNum.ToString(), Status = ORDER_STATUS.COMPLETED_COOK, SubOrderId = mork.SuborderId, GoodName = mork.GoodsName }.Publish();
Thread.Sleep(5000);
new OrderStatusChangedEvent() { SortNum = mork.SortNum.ToString(), Status = ORDER_STATUS.COMPLETED_TAKE, SubOrderId = mork.SuborderId, GoodName = mork.GoodsName }.Publish();
string num = mork.SortNum.ToString().Substring(0, mork.SortNum.ToString().Length - 1);
if (int.TryParse(num, out int sort))
ActionManage.GetInstance.Send("COMPLETED_TAKE_Notify", sort.ToString("0000"));
Thread.Sleep(2000);
}
}
@@ -114,7 +117,8 @@ namespace BPASmartClient.Business
else if (message is StirFryPushMessage frybom)
{
IDevice device = deviceMgr.GetDevices().FirstOrDefault(x => x.DeviceId == 28);
new StirFryGoodsEvent() {
new StirFryGoodsEvent()
{
DeviceId = device.DeviceId,
stirFrymessage = frybom
}.Publish();


+ 5
- 1
BPASmartClient.CustomResource/Pages/Model/VoiceAPI.cs View File

@@ -40,7 +40,11 @@ namespace BPASmartClient.CustomResource
private static ConcurrentQueue<string> msg { get; set; } = new ConcurrentQueue<string>();


public static void Speak(string s) => msg.Enqueue(s);
public static void Speak(string s)
{
if (int.TryParse(s.Substring(0, s.Length - 1), out int num))
msg.Enqueue(num.ToString("0000"));
}


// 系统播放wav格式的文件


+ 16
- 3
BPASmartClient.MorkS/Control_Morks.cs View File

@@ -348,7 +348,14 @@ namespace BPASmartClient.MorkS
if (loc >= 1 && loc <= 5)
{
if (mORKS.RBTakeNoodleTask.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null)
mORKS.RBTakeNoodleTask.Enqueue(new OrderLocInfo() { GoodName = order.MorkOrder.GoodsName, Loc = ushort.Parse(res.BatchingLoc), SuborderId = order.MorkOrder.SuborderId, BatchingId = res.BatchingId });
mORKS.RBTakeNoodleTask.Enqueue(new OrderLocInfo()
{
GoodName = order.MorkOrder.GoodsName,
Loc = ushort.Parse(res.BatchingLoc),
SuborderId = order.MorkOrder.SuborderId,
SortNum = order.MorkOrder.SortNum,
BatchingId = res.BatchingId
});
}
else if (loc >= 10 && loc <= 11)
{
@@ -365,6 +372,7 @@ namespace BPASmartClient.MorkS
GoodName = order.MorkOrder.GoodsName,
Loc = ushort.Parse(res.BatchingLoc),
SuborderId = order.MorkOrder.SuborderId,
SortNum = order.MorkOrder.SortNum,
RecipeNumber = (index >= 1 && index <= 10) ? (ushort)index : (ushort)0
});
}
@@ -417,6 +425,7 @@ namespace BPASmartClient.MorkS
{
mORKS.TakeBowlId = orderLocInfo.SuborderId;
mORKS.TakeBowName = orderLocInfo.GoodName;
mORKS.TakeBowSortNum = orderLocInfo.SortNum;
TakeBowlControl(orderLocInfo.Loc);
SetRecipeNumber(orderLocInfo.RecipeNumber);
OrderChange(mORKS.TakeBowlId, ORDER_STATUS.COOKING);
@@ -631,6 +640,7 @@ namespace BPASmartClient.MorkS
if (!string.IsNullOrEmpty(mORKS.OutMealId)) OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE);
mORKS.OutMealId = mORKS.IngredientsCompleteId;
mORKS.OutMealName = mORKS.IngredientsCompleteName;
mORKS.OutMealSortNum = mORKS.IngredientsCompleteSortNum;
mORKS.IngredientsCompleteId = string.Empty;
mORKS.CookNodelId[loc] = string.Empty;
DeviceProcessLogShow($"{loc + 1} 号位置出餐控制,订单ID:{mORKS.OutMealId}");
@@ -651,8 +661,10 @@ namespace BPASmartClient.MorkS
{
mORKS.IngredientsCompleteId = mORKS.TakeBowlId;
mORKS.IngredientsCompleteName = mORKS.TakeBowName;
mORKS.IngredientsCompleteSortNum = mORKS.TakeBowSortNum;
mORKS.TakeBowlId = string.Empty;
mORKS.TakeBowName = string.Empty;
mORKS.TakeBowSortNum = 0;
DeviceProcessLogShow($"碗到位,允许到面,{mORKS.IngredientsCompleteId}");
mORKS.TakeBowlInterlock = false;
}
@@ -678,11 +690,12 @@ namespace BPASmartClient.MorkS
OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE);
DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成");
ResetCookComplete();
DeviceProcessLogShow($"出餐订单名称【{mORKS.OutMealName}】");
VoiceAPI.Speak(mORKS.OutMealName);
DeviceProcessLogShow($"出餐订单序号【{mORKS.OutMealSortNum}】");
VoiceAPI.Speak(mORKS.OutMealSortNum.ToString());
mORKS.CookCompleteFlatBit = false;
mORKS.OutMealId = string.Empty;
mORKS.OutMealName = string.Empty;
mORKS.OutMealSortNum = 0;
}

//机器人取面完成信号检测


+ 16
- 0
BPASmartClient.MorkS/GVL_MORKS.cs View File

@@ -337,6 +337,11 @@ namespace BPASmartClient.MorkS
/// 取碗订单名称
/// </summary>
public string TakeBowName = string.Empty;
/// <summary>
/// 配料完成订单名称
/// </summary>
public int TakeBowSortNum = 0;


/// <summary>
/// 配料完成订单ID
@@ -346,12 +351,18 @@ namespace BPASmartClient.MorkS
/// 配料完成订单名称
/// </summary>
public string IngredientsCompleteName = string.Empty;
/// <summary>
/// 配料完成订单名称
/// </summary>
public int IngredientsCompleteSortNum = 0;


/// <summary>
/// 煮面口对应的订单ID
/// </summary>
public string[] CookNodelId = new string[6] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, };


/// <summary>
/// 出餐订单ID
/// </summary>
@@ -360,6 +371,11 @@ namespace BPASmartClient.MorkS
/// 出餐订单名称
/// </summary>
public string OutMealName = string.Empty;
/// <summary>
/// 出餐排序号
/// </summary>
public int OutMealSortNum = 0;


/// <summary>
/// 转台位置轮询


+ 1
- 0
BPASmartClient.MorkS/OrderLocInfo.cs View File

@@ -16,6 +16,7 @@ namespace BPASmartClient.MorkS
public string GoodName { get; set; }

public int RecipeId { get; set; }
public int SortNum { get; set; }

public List<int> Recipes { get; set; }



+ 7
- 2
BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs View File

@@ -416,6 +416,7 @@ namespace BPASmartClient.MorkSUpgradedVer
{
mORKS.TakeBowlId = orderLocInfo.SuborderId;
mORKS.TakeBowName = orderLocInfo.GoodName;
mORKS.TakeBowSortNum = orderLocInfo.SortNum;
TakeBowlControl(orderLocInfo.Loc);
OrderChange(mORKS.TakeBowlId, ORDER_STATUS.COOKING);
DeviceProcessLogShow($"订单【{mORKS.TakeBowlId}】执行取碗控制,位置:[{orderLocInfo.Loc}]");
@@ -621,6 +622,7 @@ namespace BPASmartClient.MorkSUpgradedVer
mORKS.CookCompleteFlatBit = true;
mORKS.OutMealId = mORKS.IngredientsCompleteId;
mORKS.OutMealName = mORKS.IngredientsCompleteName;
mORKS.OutMealSortNum = mORKS.IngredientsCompleteSortNum;
mORKS.IngredientsCompleteId = string.Empty;
mORKS.CookNodelId[loc] = string.Empty;
DeviceProcessLogShow($"{loc + 1} 号位置出餐控制,订单ID:{mORKS.OutMealId}");
@@ -640,6 +642,8 @@ namespace BPASmartClient.MorkSUpgradedVer
{
mORKS.IngredientsCompleteId = mORKS.TakeBowlId;
mORKS.IngredientsCompleteName = mORKS.TakeBowName;
mORKS.IngredientsCompleteSortNum = mORKS.TakeBowSortNum;
mORKS.TakeBowSortNum = 0;
mORKS.TakeBowlId = string.Empty;
mORKS.TakeBowName = string.Empty;
DeviceProcessLogShow($"碗到位,允许到面,{mORKS.IngredientsCompleteId}");
@@ -652,11 +656,12 @@ namespace BPASmartClient.MorkSUpgradedVer
OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE);
DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成");
WriteData("M10.1", false);
DeviceProcessLogShow($"出餐订单名称【{mORKS.OutMealName}】");
VoiceAPI.Speak(mORKS.OutMealName);
DeviceProcessLogShow($"出餐订单序号【{mORKS.OutMealSortNum}】");
VoiceAPI.Speak(mORKS.OutMealSortNum.ToString());
mORKS.CookCompleteFlatBit = false;
mORKS.OutMealId = string.Empty;
mORKS.OutMealName = string.Empty;
mORKS.OutMealSortNum = 0;
}

//机器人取面完成信号检测


+ 15
- 0
BPASmartClient.MorkSUpgradedVer/GVL_MorkSUpgradedVer.cs View File

@@ -120,6 +120,11 @@ namespace BPASmartClient.MorkSUpgradedVer
/// 取碗订单名称
/// </summary>
public string TakeBowName { get; set; } = string.Empty;
/// <summary>
/// 配料完成订单名称
/// </summary>
public int TakeBowSortNum { get; set; } = 0;


/// <summary>
/// 允许倒面位置ID
@@ -129,6 +134,11 @@ namespace BPASmartClient.MorkSUpgradedVer
/// 配料完成订单名称
/// </summary>
public string IngredientsCompleteName { get; set; } = string.Empty;
/// <summary>
/// 配料完成订单名称
/// </summary>
public int IngredientsCompleteSortNum { get; set; } = 0;


/// <summary>
/// 煮面口对应的订单ID
@@ -143,6 +153,11 @@ namespace BPASmartClient.MorkSUpgradedVer
/// 出餐订单名称
/// </summary>
public string OutMealName { get; set; } = string.Empty;
/// <summary>
/// 出餐排序号
/// </summary>
public int OutMealSortNum { get; set; } = 0;


/// <summary>
/// 转台位置轮询


+ 1
- 0
BPASmartClient.MorkSUpgradedVer/OrderLocInfo.cs View File

@@ -14,6 +14,7 @@ namespace BPASmartClient.MorkSUpgradedVer
public ushort RecipeNumber { get; set; }
public int BatchingId { get; set; }
public string GoodName { get; set; }
public int SortNum { get; set; }

public int RecipeId { get; set; }



+ 0
- 1
BPASmartClient.ViewModel/OrderStatusViewModel.cs View File

@@ -124,7 +124,6 @@ namespace BPASmartClient.ViewModel
WaitTakeMeal.Insert(0, orderStatusLists.ElementAt(index));
orderStatusLists.RemoveAt(index);
}

});
}



+ 1
- 1
BPASmartClient/App.config View File

@@ -4,7 +4,7 @@

<!--通用配置-->
<!--<add key="ClientId" value="43"/>-->
<add key="IsEnableTest" value="false"/>
<add key="IsEnableTest" value="true"/>

<!--测试环境-->
<add key="apollouri" value="http://10.2.1.21:28080/"/>


+ 5
- 0
BPASmartClient/App.xaml.cs View File

@@ -35,6 +35,11 @@ namespace BPASmartClient
mainView.Show();
SplitScreenDisplay();
NoCompleteOrderInit();
ActionManage.GetInstance.Register(new Action<object>(par =>
{
if (par != null)
VoiceAPI.Speak(par.ToString());
}), "COMPLETED_TAKE_Notify");
}




Loading…
Cancel
Save