任务限制优化

This commit is contained in:
lsymicc
2026-07-07 14:00:05 +08:00
parent 991893c2d0
commit 6864256202
4 changed files with 38 additions and 23 deletions

View File

@@ -174,6 +174,20 @@ namespace WPFWCSDemo.Schedules.CircleRGV
CreateTime = DateTime.Now,
};
var count = context.Tasks
.Where(t => t.SourceLocation == sourceLocation.ToString() &&
(t.ScheduleState == ScheduleStateCode.Trans_CircleRGV_Ready ||
t.ScheduleState == ScheduleStateCode.Trans_CircleRGV_Picking ||
t.ScheduleState == ScheduleStateCode.Trans_CircleRGV_PickOnTheWay))
.Count();
if (count > 0)
{
Log.Warning($"【提示】任务号:{taskNumber},取货站点:{sourceLocation}(该条可忽略)");
return;
}
context.Tasks.Add(taskRT);
if (sourceLocation == RGVStation.LineGH_Pallets_In)