|
@@ -9,8 +9,6 @@ using WCS.Entity.Protocol.Protocol.Robot;
|
|
|
using WCS.Entity.Protocol.Robot;
|
|
|
using WCS.Entity.Protocol.Station;
|
|
|
using WCS.WorkEngineering.Extensions;
|
|
|
-using WCS.WorkEngineering.WebApi.Controllers;
|
|
|
-using WCS.WorkEngineering.WebApi.Models.WMS.Response;
|
|
|
using WCS.WorkEngineering.Worlds.环形库.环形库;
|
|
|
using DeviceFlags = WCS.WorkEngineering.Extensions.DeviceFlags;
|
|
|
using TaskStatus = WCS.Entity.TaskStatus;
|
|
@@ -165,9 +163,9 @@ namespace WCS.WorkEngineering.Systems
|
|
|
var arrIn = pickUpDevices.Where(x => x.Item2.All(a => !a.Data.Status.HasFlag(StationStatus.Run)))
|
|
|
.Where(x =>
|
|
|
{
|
|
|
- var a = x.Item2.Any(a => a.Data2.TaskNumber > 0 && a.Data.Status.HasFlag(StationStatus.PH_Status));
|
|
|
- var b = x.Item2.OrderBy(o => o.Entity.Code.ToShort()).First();
|
|
|
- return b.Data2.TaskNumber > 0 && b.Data.Status.HasFlag(StationStatus.PH_Status) && a;
|
|
|
+ var inStock = x.Item2.Any(a => a.Data2.TaskNumber > 0 && a.Data.Status.HasFlag(StationStatus.PH_Status));
|
|
|
+ var minDevice = x.Item2.OrderBy(o => o.Entity.Code.ToShort()).First();
|
|
|
+ return minDevice.Data2.TaskNumber > 0 && minDevice.Data.Status.HasFlag(StationStatus.PH_Status) && minDevice.Data2.CmdType.HasFlag(StationCmd.Res7) && inStock;
|
|
|
}).ToList();
|
|
|
//.OrderBy(x => x.Item1.Data2.TaskNumber)
|
|
|
|
|
@@ -185,7 +183,7 @@ namespace WCS.WorkEngineering.Systems
|
|
|
//跟据设备组中第一个设备任务号最小的一个先执行
|
|
|
var devGroup = arrIn.MinBy(x => x.Item1.Data2.TaskNumber).Item2
|
|
|
.Where(x => x.Data2.TaskNumber > 0 && x.Data.Status.HasFlag(StationStatus.PH_Status));
|
|
|
-
|
|
|
+
|
|
|
if (!devGroup.Any())
|
|
|
{
|
|
|
obj.Entity.SetFlag("InQuantity", 4); //在无有效取货位的情况下,只检查一次,下次直接查询是否有出库任务,避免无效检查周期的产生
|
|
@@ -196,7 +194,7 @@ namespace WCS.WorkEngineering.Systems
|
|
|
{
|
|
|
var task = db.Default.Queryable<WCS_TaskInfo>().First(v => v.Type == TaskType.SetPlate && v.Status == Entity.TaskStatus.FinishOfShunt && dev.Data2.TaskNumber == v.ID);
|
|
|
if (task == null) continue;
|
|
|
-
|
|
|
+
|
|
|
task.Status = Entity.TaskStatus.StackerExecution;
|
|
|
task.LastInteractionPoint = dev.Entity.Code;
|
|
|
task.SrmStation = dev.Entity.Code;
|
|
@@ -498,4 +496,4 @@ namespace WCS.WorkEngineering.Systems
|
|
|
return dev.Code is "Robot1" or "Robot2" or "Robot3" or "Robot4" or "Robot5" or "Robot6";
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|