|
|
@@ -69,13 +69,18 @@ namespace BPASmartClient.MorkMV1 |
|
|
|
Random rd = new Random(); |
|
|
|
TaskManage.GetInstance.StartLong(new Action(() => |
|
|
|
{ |
|
|
|
string guid = new Guid().ToString(); |
|
|
|
string guid = Guid.NewGuid().ToString(); |
|
|
|
|
|
|
|
//模拟订单的素菜和荤菜计数。[0]为荤菜,[1]为素菜。 |
|
|
|
int[] materialCount = new int[] { 0, 0 }; |
|
|
|
int allCount = 0; |
|
|
|
|
|
|
|
if (o[0] is List<int> noodleLocs) |
|
|
|
{ |
|
|
|
if (noodleLocs.Count==0) |
|
|
|
//如果是随机素材,则随机添加2到4个素材。 |
|
|
|
if (noodleLocs.Count == 0) |
|
|
|
{ |
|
|
|
for (int i = 0; i < rd.Next(1,5); i++) |
|
|
|
for (int i = 0; i < rd.Next(2, 5); i++) |
|
|
|
{ |
|
|
|
noodleLocs.Add(0); |
|
|
|
} |
|
|
@@ -84,6 +89,7 @@ namespace BPASmartClient.MorkMV1 |
|
|
|
{ |
|
|
|
foreach (var loc in noodleLocs) |
|
|
|
{ |
|
|
|
//如果是随机素材,则每个素材的位置随机。 |
|
|
|
int NoodleLoc = loc == 0 ? rd.Next(1, 6) : loc; |
|
|
|
|
|
|
|
if (NoodleLoc >= 1 && NoodleLoc <= 5) |
|
|
@@ -99,17 +105,30 @@ namespace BPASmartClient.MorkMV1 |
|
|
|
Minute = x.Minute, |
|
|
|
Second = x.Second |
|
|
|
}); |
|
|
|
allCount++; |
|
|
|
materialCount[i]++; |
|
|
|
MessageLog.GetInstance.Show($"添加模拟订单:素材位置【{(ushort)NoodleLoc}】"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1]; |
|
|
|
mORKM.TakeBowlTask.Enqueue(new MOrderLocInfo() { Loc = (ushort)BowlLoc, SuborderId = guid }); |
|
|
|
MessageLog.GetInstance.Show($"添加模拟订单:碗位置【{BowlLoc}】"); |
|
|
|
|
|
|
|
|
|
|
|
//int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1]; |
|
|
|
int BowlLoc = (int)o[1] == 0 ? 11 : (int)o[1]; |
|
|
|
mORKM.TakeBowlTask.Enqueue(new MOrderLocInfo() { Loc = (ushort)BowlLoc, SuborderId = guid }); |
|
|
|
MessageLog.GetInstance.Show($"添加模拟订单:碗位置【{BowlLoc}】"); |
|
|
|
|
|
|
|
if (!mORKM.SuborderCount.ContainsKey(guid)) |
|
|
|
{ |
|
|
|
mORKM.SuborderCount.TryAdd(guid, new SuborderInfo() |
|
|
|
{ |
|
|
|
ActualCount = allCount, |
|
|
|
AcMeatDishesCount = materialCount[0], |
|
|
|
AcVegetableCount = materialCount[1], |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
Thread.Sleep(60000); |
|
|
|
}), "ForOrder"); |
|
|
|
} |
|
|
@@ -1028,6 +1047,9 @@ namespace BPASmartClient.MorkMV1 |
|
|
|
if (@event != null && @event is MorkMV1SimorderModel msm) |
|
|
|
{ |
|
|
|
string guid = Guid.NewGuid().ToString(); |
|
|
|
//模拟订单的素菜和荤菜计数。[0]为荤菜,[1]为素菜。 |
|
|
|
int[] materialCount = new int[] { 0, 0 }; |
|
|
|
int allCount = 0; |
|
|
|
for (int i = 0; i <= 1; i++) |
|
|
|
{ |
|
|
|
foreach (var loc in msm.NoodleLoc) |
|
|
@@ -1045,6 +1067,9 @@ namespace BPASmartClient.MorkMV1 |
|
|
|
Minute = x.Minute, |
|
|
|
Second = x.Second |
|
|
|
}); |
|
|
|
//对菜的数量计数。 |
|
|
|
materialCount[i]++; |
|
|
|
allCount++; |
|
|
|
MessageLog.GetInstance.Show($"添加模拟订单:素材位置【{(ushort)loc}】"); |
|
|
|
} |
|
|
|
} |
|
|
@@ -1058,6 +1083,16 @@ namespace BPASmartClient.MorkMV1 |
|
|
|
MessageLog.GetInstance.Show($"添加模拟订单:碗位置【{(ushort)msm.BowlLoc}】"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!mORKM.SuborderCount.ContainsKey(guid)) |
|
|
|
{ |
|
|
|
mORKM.SuborderCount.TryAdd(guid, new SuborderInfo() |
|
|
|
{ |
|
|
|
ActualCount = allCount, |
|
|
|
AcMeatDishesCount = materialCount[0], |
|
|
|
AcVegetableCount = materialCount[1], |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|