feat: implement new order methods, transport enums, and conveyor telegram overrides

This commit is contained in:
2026-05-16 15:57:04 +02:00
parent 0a36e2c5f9
commit eb82e4e0b2
9 changed files with 482 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
/// <summary>
/// finish this order, related OrdersMiniload, Orders Conveyor and clear the resources
/// </summary>
public void Finish()
{
OrdersConveyor.ToList().ForEach(oc =>
{
if (TransportOrderStatusGroups.Open.Contains(oc.Status))
{
oc.HandleFinished();
using IWcsDbContext db = new WcsDbContextFactory().GetDbContext();
ConveyorTelegrams.SendTordDeleteEtra(db, oc.LeNo);
db.SaveChanges();
}
});
OrdersMiniload.ToList().ForEach(om =>
{
if (TransportOrderStatusGroups.Open.Contains(om.Status))
{
om.HandleFinished();
}
});
Status = TransportOrderStatus.Finished;
UpdateResources(TransportOrderStatus.Finished, null);
}

View File

@@ -0,0 +1,5 @@
public OrdersHost ForceSetStatusInProgress()
{
Status = TransportOrderStatus.InProgress;
return this;
}

View File

@@ -0,0 +1,9 @@
public void UpdateResources(TransportOrderStatus resourceListStatus, List<ResourceList> occupiedBySameLeButDifferentOrder)
{
//If a OrdersHost is Finished or Cancelled all ResourceList for this OH are affected, for other status only entries with same Destination
Resources
.Where(r => !TransportOrderStatusGroups.Complete.Contains(r.Status) && (r.Name == Destination || resourceListStatus == TransportOrderStatus.Finished || resourceListStatus == TransportOrderStatus.Cancelled))
.ToList()
.ForEach(r => r.Status = resourceListStatus);
occupiedBySameLeButDifferentOrder?.ForEach(r => r.Status = TransportOrderStatus.Cancelled);
}