From eb82e4e0b2e51dcd0ffb4d70ffc8b87abfaedfbe Mon Sep 17 00:00:00 2001 From: Kai Date: Sat, 16 May 2026 15:57:04 +0200 Subject: [PATCH] feat: implement new order methods, transport enums, and conveyor telegram overrides --- .../Common/ConveyorTelegramsOverride.cs | 305 ++++++++++++++++++ .../SetLeRequestDepature.cs | 35 ++ .../SetLeRequestDeparture.cs | 0 .../Code Snippets/Enums/LeStatus.cs | 45 +++ .../Enums/TransportOrderStatus.cs | 16 + .../Code Snippets/Enums/TransportOrderType.cs | 42 +++ .../OrdersHost Methoden/Finish.cs | 25 ++ .../ForceSetStatusInProgress.cs | 5 + .../OrdersHost Methoden/UpdateResources.cs | 9 + 9 files changed, 482 insertions(+) create mode 100644 03_Realisierung/Code Snippets/Common/ConveyorTelegramsOverride.cs create mode 100644 03_Realisierung/Code Snippets/Common/DestinationService/SetLeRequestDepature.cs delete mode 100644 03_Realisierung/Code Snippets/DestinationService/SetLeRequestDeparture.cs diff --git a/03_Realisierung/Code Snippets/Common/ConveyorTelegramsOverride.cs b/03_Realisierung/Code Snippets/Common/ConveyorTelegramsOverride.cs new file mode 100644 index 0000000..b5bacfb --- /dev/null +++ b/03_Realisierung/Code Snippets/Common/ConveyorTelegramsOverride.cs @@ -0,0 +1,305 @@ +using Gebhardt.Shared; +using System.Collections.Generic; +using System.Linq; + +namespace Gebhardt.StoreWare.Wcs.Common +{ + + #region Send Methoden + /// + /// Klasse dient zum Senden von Telegrammen an die SPS + /// + public static partial class ConveyorTelegrams + { + + private static List destinationsOldSystem = new List() { + Constants.MfcAllDestinationsOldSystem.ETXBU, + Constants.MfcAllDestinationsOldSystem.ETXBU_M, + Constants.MfcAllDestinationsOldSystem.ETXBU_S, + Constants.MfcAllDestinationsOldSystem.IPT01, + Constants.MfcAllDestinationsOldSystem.IPT02, + Constants.MfcAllDestinationsOldSystem.IPT03, + Constants.MfcAllDestinationsOldSystem.IPT01, + Constants.MfcAllDestinationsOldSystem.REP01, + Constants.MfcAllDestinationsOldSystem.REP02, + Constants.MfcAllDestinationsOldSystem.REP03, + + Constants.MfcAllDestinationsOldSystem.ETM01, + Constants.MfcAllDestinationsOldSystem.ETM02, + Constants.MfcAllDestinationsOldSystem.ETM03, + Constants.MfcAllDestinationsOldSystem.ETS01, + Constants.MfcAllDestinationsOldSystem.ETS02, + Constants.MfcAllDestinationsOldSystem.ETS03, + Constants.MfcAllDestinationsOldSystem.QCS01, + Constants.MfcAllDestinationsOldSystem.QCS02, + Constants.MfcAllDestinationsOldSystem.ERR01, + Constants.MfcAllDestinationsOldSystem.TOPUP, + //Constants.MfcAllDestinationsOldSystem.ERS01, + Constants.MfcAllDestinationsOldSystem.LOOP3, + Constants.MfcAllDestinationsOldSystem.C0101, + Constants.MfcAllDestinationsOldSystem.C0201, + Constants.MfcAllDestinationsOldSystem.S0300, + Constants.MfcAllDestinationsOldSystem.S0301, + Constants.MfcAllDestinationsOldSystem.S0302, + Constants.MfcAllDestinationsOldSystem.S0303, + Constants.MfcAllDestinationsOldSystem.S0304, + Constants.MfcAllDestinationsOldSystem.S0305, + Constants.MfcAllDestinationsOldSystem.S0400, + Constants.MfcAllDestinationsOldSystem.S0401, + Constants.MfcAllDestinationsOldSystem.S0402, + Constants.MfcAllDestinationsOldSystem.S0403, + Constants.MfcAllDestinationsOldSystem.S0404, + Constants.MfcAllDestinationsOldSystem.S0405, + //Scanner Replenishment + Constants.MfcScannerOldSystem.SC101, + Constants.MfcScannerOldSystem.SC102, + Constants.MfcScannerOldSystem.SC103, + Constants.MfcScannerOldSystem.SC104, + Constants.MfcScannerOldSystem.SC105, + Constants.MfcScannerOldSystem.SC106, + Constants.MfcScannerOldSystem.SC107, + //Scanner Loop+Cranes + Constants.MfcScannerOldSystem.SC201, + Constants.MfcScannerOldSystem.SC202, + Constants.MfcScannerOldSystem.SC203, + Constants.MfcScannerOldSystem.SC204, + Constants.MfcScannerOldSystem.SC205, + Constants.MfcScannerOldSystem.SC206, + Constants.MfcScannerOldSystem.SC207, + Constants.MfcScannerOldSystem.SC208, + Constants.MfcScannerOldSystem.SC209, + Constants.MfcScannerOldSystem.SC210, + Constants.MfcScannerOldSystem.SC211, + + Constants.MfcScannerOldSystem.SC301, + Constants.MfcScannerOldSystem.SC302, + Constants.MfcScannerOldSystem.SC303, + Constants.MfcScannerOldSystem.SC304, + Constants.MfcScannerOldSystem.SC305, + Constants.MfcScannerOldSystem.SC306, + Constants.MfcScannerOldSystem.SC307, + Constants.MfcScannerOldSystem.SC308, + Constants.MfcScannerOldSystem.SC309, + Constants.MfcScannerOldSystem.SC310, + + //MLS Aisles + Constants.MfcScannerOldSystem.SC401, + Constants.MfcScannerOldSystem.SC402, + Constants.MfcScannerOldSystem.SC403, + Constants.MfcScannerOldSystem.SC404, + Constants.MfcScannerOldSystem.SC405, + Constants.MfcScannerOldSystem.SC406, + Constants.MfcScannerOldSystem.SC407, + Constants.MfcScannerOldSystem.SC408, + Constants.MfcScannerOldSystem.SC409, + Constants.MfcScannerOldSystem.SC410, + Constants.MfcScannerOldSystem.SC411, + Constants.MfcScannerOldSystem.SC412, + + //Constants.MfcScannerOldSystem.SC501, + //Constants.MfcScannerOldSystem.SC502, + //Constants.MfcScannerOldSystem.SC503, + //Constants.MfcScannerOldSystem.SC504, + //Constants.MfcScannerOldSystem.SC505, + + //Constants.MfcScannerOldSystem.SC601, + //Constants.MfcScannerOldSystem.SC602, + //Constants.MfcScannerOldSystem.SC603, + //Constants.MfcScannerOldSystem.SC604, + //Constants.MfcScannerOldSystem.SC605 + }; + + #region SendTord Methoden MFRtoSPS + /// + /// Transportorder to device PLCs + /// Richtung : MFRtoSPS + /// pFillContent true + /// Wenn pFillContent True, wird Telegram mit dem Zeichen '0' linksbündig aufgefüllt. + /// + /// Ef Core Database Context + + /// (Lenght:8 PadChar:'*' L/R: L) + /// Source (Lenght:11 PadChar:'-' L/R: R) + /// Destination (Lenght:11 PadChar:'-' L/R: R) + /// LE type from DB (Lenght:10 PadChar:'0' L/R: R) + /// Orders Conveyor ID (Lenght:10 PadChar:'0' L/R: L) + /// + public static bool SendTordEtra(Gebhardt.StoreWare.Wcs.Common.DbAccess.IWcsDbContext db, string pHU, string pSrc, string pDest, string pType, string pToID) + { + bool sent = false; + if (pDest.Contains("EMB") || pSrc.Contains("EMB") || pSrc.Contains(Constants.MfcScanner.SC0505) || pSrc.Contains(Constants.MfcScanner.SC0137) || pSrc.Contains(Constants.MfcScanner.SC0183)) + { + sent = SendTordWithDefaults(db, p_HU: pHU, p_Src: pSrc, p_Dest: pDest, p_Type: pType, p_ToID: pToID, + p_DataDestination: ConveyorTelegramsDataDestination.D_PLC05); + } + else if (pDest.StartsWith("PIC1")) + { + sent = SendTordWithDefaults(db, p_HU: pHU, p_Src: pSrc, p_Dest: pDest, p_Type: pType, p_ToID: pToID, + p_DataDestination: ConveyorTelegramsDataDestination.D_PLC03); + } + else if (pSrc.Contains(Constants.MfcAllDestinations.ERR12) || pSrc.StartsWith("SEQ") || pDest.StartsWith("PIC2")) + { + sent = SendTordWithDefaults(db, p_HU: pHU, p_Src: pSrc, p_Dest: pDest, p_Type: pType, p_ToID: pToID, + p_DataDestination: ConveyorTelegramsDataDestination.D_PLC02); + } + // Old telegrams + // TODO: Fix to send to 01 for real system! + if (destinationsOldSystem.Contains(pSrc) || destinationsOldSystem.Contains(pDest)) + { + var leType = db.LeType.Where(t => t.TypePrefix == pHU.Substring(0, 1)).FirstOrDefault(); + int minWeight = 1000; + int maxWeight = 50000; + if (leType != null) + { + minWeight = leType.TareWeight - 1000; + maxWeight = leType.MaxWeight; + } + string destinationForOldSystem = pDest; + string[] replenishmentArea = new[] + { + Constants.MfcAllDestinationsOldSystem.IPT01, + Constants.MfcAllDestinationsOldSystem.IPT02, + Constants.MfcAllDestinationsOldSystem.IPT03, + Constants.MfcAllDestinationsOldSystem.ETXBU, + Constants.MfcAllDestinationsOldSystem.ETXBU_M, + Constants.MfcAllDestinationsOldSystem.ETXBU_S, + Constants.MfcScannerOldSystem.SC102, + Constants.MfcScannerOldSystem.SC101, + Constants.MfcScannerOldSystem.SC103, + Constants.MfcAllDestinationsOldSystem.TOPUP + }; + + if (!destinationsOldSystem.Contains(pDest)) + { + destinationForOldSystem = Constants.MfcAllDestinationsOldSystem.QCS01; + } + if (replenishmentArea.Contains(pDest) || replenishmentArea.Contains(pSrc)) + { + sent = Send0001WithDefaults(db, ConveyorTelegramsDataSource.S_31, ConveyorTelegramsDataDestination.D_02, pHU, + destinationForOldSystem, p_WgtMin: minWeight.ToString(), p_WgtMax: maxWeight.ToString()); + } + sent = Send0001WithDefaults(db, ConveyorTelegramsDataSource.S_31, ConveyorTelegramsDataDestination.D_01, pHU, + destinationForOldSystem, p_WgtMin: minWeight.ToString(), p_WgtMax: maxWeight.ToString()); + + } + //Don't send to new system if both source and destination are in old system + if (!(destinationsOldSystem.Contains(pSrc) && destinationsOldSystem.Contains(pDest))) + { + //If only Destination is in old system, we need to tell the new system to drive to LOOP3, only this destination is known + if (destinationsOldSystem.Contains(pDest)) + { + pDest = Constants.MfcAllDestinationsOldSystem.LOOP3; + } + sent = SendTordWithDefaults(db, p_HU: pHU, p_Src: pSrc, p_Dest: pDest, p_Type: pType, p_ToID: pToID, + p_DataDestination: ConveyorTelegramsDataDestination.D_PLC01); + } + + return sent; + } + + public static bool SendTordPalletizingEtra(Gebhardt.StoreWare.Wcs.Common.DbAccess.IWcsDbContext db, string pHU, string pSrc, string pToID, List pDestList) + { + //PLC needs the order to be ascending according to transport direction + pDestList = pDestList.OrderBy(d => d.Substring(d.Length - 1, 1)).ToList(); + return SendTordWithDefaults(db, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC02, p_HU: pHU, p_Src: pSrc, p_ToID: pToID, p_DestList: $"[{string.Join(',', pDestList)}]", p_Dest: pDestList[0]); + } + + public static bool SendTordPalletDispatchLineEtra(Gebhardt.StoreWare.Wcs.Common.DbAccess.IWcsDbContext db, string pHU, string pSrc, string pToID, string pDest, bool pWrap, bool pPrint) + { + return SendTordWithDefaults(db, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC07, p_HU: pHU, p_Src: pSrc, p_Dest: pDest, p_ToID: pToID, p_Wrap: pWrap ? "1" : "0", p_Print: pPrint ? "1" : "0"); + } + + #endregion SendTord Methoden MFRtoSPS + + #region SendDeparture Methoden MFRtoSPS + /// + /// Departs immediately + /// Richtung : MFRtoSPS + /// pFillContent true + /// Wenn pFillContent True, wird Telegram mit dem Zeichen '0' linksbündig aufgefüllt. + /// + /// Ef Core Database Context + + /// (Lenght:8 PadChar:'*' L/R: L) + /// (Lenght:11 PadChar:'-' L/R: R) + /// . + public static bool SendDepartureEtra(Gebhardt.StoreWare.Wcs.Common.DbAccess.IWcsDbContext db, string pHU, string pSrc) + { + if (pSrc.StartsWith("PIC1")) + { + return SendDepartureWithDefaults(db, p_HU: pHU, p_Src: pSrc, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC03); + + } + if (pSrc.StartsWith("PIC2") || pSrc.StartsWith(Common.Constants.MfcAllDestinations.ERR12)) + { + return SendDepartureWithDefaults(db, p_HU: pHU, p_Src: pSrc, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC02); + } + if (pSrc.StartsWith(Common.Constants.MfcAllDestinations.ERR11)) + { + return SendDepartureWithDefaults(db, p_HU: pHU, p_Src: pSrc, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC05); + } + + if (destinationsOldSystem.Contains(pSrc)) + { + return Send0006WithDefaults(db, p_HU: pHU, p_Src: pSrc); + } + + return SendDepartureWithDefaults(db, p_HU: pHU, p_Src: pSrc); + } + + #endregion SendDepature Methoden MFRtoSPS + + #region SendTordDelete Methoden MFRtoSPS + /// + /// Delete an order + /// Richtung : MFRtoSPS + /// pFillContent true + /// Wenn pFillContent True, wird Telegram mit dem Zeichen '0' linksbündig aufgefüllt. + /// + /// Ef Core Database Context + + /// (Lenght:12 PadChar:'*' L/R: L) + /// Orders Conveyor ID (Lenght:10 PadChar:'0' L/R: L) + /// + public static bool SendTordDeleteEtra(Gebhardt.StoreWare.Wcs.Common.DbAccess.IWcsDbContext db, string pHU) + { + //Todo: only send Tords to PLCs involved in the transport? + SendTordDeleteWithDefaults(db, p_HU: pHU, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC01); + SendTordDeleteWithDefaults(db, p_HU: pHU, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC02); + SendTordDeleteWithDefaults(db, p_HU: pHU, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC03); + SendTordDeleteWithDefaults(db, p_HU: pHU, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC05); + //Old PLC + Send0002WithDefaults(db, p_HU: pHU, p_DataDestination: ConveyorTelegramsDataDestination.D_01); + Send0002WithDefaults(db, p_HU: pHU, p_DataDestination: ConveyorTelegramsDataDestination.D_02); + return SendTordDeleteWithDefaults(db, p_HU: pHU, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC07); + + } + #endregion SendTordDelete Methoden MFRtoSPS + + #region SendResetData Methoden MFRtoSPS + /// + ///TelegramsContent hat Constant Parameters + /// Reset data + /// Richtung : MFRtoSPS + /// pFillContent true + /// Wenn pFillContent True, wird Telegram mit dem Zeichen '0' linksbündich ausgefüllt. + /// + + /// Ziel + + /// (Lenght:50 PadChar:'§' L/R: R) + /// + public static bool SendResetDataEtra(DbAccess.IWcsDbContext db, Enums.ResetDataInfos p_Info) + { + SendResetDataWithDefaults(db, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC01, p_Info: p_Info.GetEnumDescription()); + SendResetDataWithDefaults(db, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC02, p_Info: p_Info.GetEnumDescription()); + SendResetDataWithDefaults(db, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC03, p_Info: p_Info.GetEnumDescription()); + SendResetDataWithDefaults(db, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC05, p_Info: p_Info.GetEnumDescription()); + Send0004WithDefaults(db); + return SendResetDataWithDefaults(db, p_DataDestination: ConveyorTelegramsDataDestination.D_PLC07, p_Info: p_Info.GetEnumDescription()); + } + + #endregion SendResetData Methoden MFRtoSPS + } + #endregion +} \ No newline at end of file diff --git a/03_Realisierung/Code Snippets/Common/DestinationService/SetLeRequestDepature.cs b/03_Realisierung/Code Snippets/Common/DestinationService/SetLeRequestDepature.cs new file mode 100644 index 0000000..0f7d1c9 --- /dev/null +++ b/03_Realisierung/Code Snippets/Common/DestinationService/SetLeRequestDepature.cs @@ -0,0 +1,35 @@ + public void SetLeRequestDeparture(string leNo, string placeName) + { + using var db = _dbContextFactory.GetDbContext(); + var entry = db.Destination.GetByName(placeName); + NullCheck(entry, typeof(Destination), placeName); + if (!db.Le.Any(l => l.LeNo == leNo)) + { + throw new InvalidOperationException($"LE {leNo} does not exist."); + } + + // only check for regular LE; NoRead can be set in any entry + if (leNo != ConstantsCommon.ConstantsLE.NoRead) + { + db.Destination.GetByLeNo(leNo).ForEach(d => + { + if (d.Name == placeName) + { + if (d.Status != DestinationStatus.LeArrived) + { + Log.Write(LogLevel.Error, + $"{nameof(Le)} {leNo} is set for {nameof(Destination)} {placeName}. But {nameof(Destination.Status)} is {d.Status}."); + } + } + else + { + Log.Write(LogLevel.Error, + $"{nameof(Le)} {leNo} is already set for {nameof(Destination)} {placeName}. {nameof(Destination.Status)} is {d.Status}. Will be deleted from {nameof(Destination)} entry"); + d.SetLeDeparted(); + } + }); + } + + db.Destination.GetByName(placeName)?.SetLeRequestDeparture(leNo); + db.SaveChanges(); + } \ No newline at end of file diff --git a/03_Realisierung/Code Snippets/DestinationService/SetLeRequestDeparture.cs b/03_Realisierung/Code Snippets/DestinationService/SetLeRequestDeparture.cs deleted file mode 100644 index e69de29..0000000 diff --git a/03_Realisierung/Code Snippets/Enums/LeStatus.cs b/03_Realisierung/Code Snippets/Enums/LeStatus.cs index e69de29..a7b42f5 100644 --- a/03_Realisierung/Code Snippets/Enums/LeStatus.cs +++ b/03_Realisierung/Code Snippets/Enums/LeStatus.cs @@ -0,0 +1,45 @@ +public enum LeStatus +{ + Created, + OnConveyor, + InStorage, + OnLhd, + + /// + /// on an input place of a device to which the Le is not directly moved on by the conveyor + /// + OnInputPlace, + InDestinationZone, + + /// + /// on an output place of a device from which the Le is not directly taken by the conveyor + /// + OnOutputPlace, + + /// + /// When the LE leaves the system it is marked as deleted + /// + Deleted, + + /// + /// see + /// + Unmapped +} + +public static class LeStatusGroups +{ + public static readonly LeStatus[] Storage = new[] + { + LeStatus.InStorage, + LeStatus.OnLhd, + LeStatus.OnInputPlace, + LeStatus.OnOutputPlace + }; + + public static readonly LeStatus[] Conveyor = new[] + { + LeStatus.OnConveyor, + LeStatus.InDestinationZone + }; +} \ No newline at end of file diff --git a/03_Realisierung/Code Snippets/Enums/TransportOrderStatus.cs b/03_Realisierung/Code Snippets/Enums/TransportOrderStatus.cs index e69de29..31139d4 100644 --- a/03_Realisierung/Code Snippets/Enums/TransportOrderStatus.cs +++ b/03_Realisierung/Code Snippets/Enums/TransportOrderStatus.cs @@ -0,0 +1,16 @@ +public enum TransportOrderStatus +{ + Initial, + Pending, + InProgress, + Transmitted, + InDestinationZone, + InSequencer, + Finished, + Cancelled, + + /// + /// see + /// + Unmapped +} \ No newline at end of file diff --git a/03_Realisierung/Code Snippets/Enums/TransportOrderType.cs b/03_Realisierung/Code Snippets/Enums/TransportOrderType.cs index e69de29..39fb319 100644 --- a/03_Realisierung/Code Snippets/Enums/TransportOrderType.cs +++ b/03_Realisierung/Code Snippets/Enums/TransportOrderType.cs @@ -0,0 +1,42 @@ +public enum TransportOrderType +{ + /// + /// Used for OrdersHost which is created by Wcs (empty le to buffer or le with no other order back to miniload) + /// + Transport, + + /// + /// Used for OrdersHost which is created via a message from Wms + /// + TransportHost, + + /// + /// Used for OrdersMiniload to store a le from input lane into shelf or drive thru from input lane to output lane + /// + Storage, + + /// + /// used for OrdersMiniload to retrieve a le from shelf and put it to the output lane + /// + Retrieval, + + /// + /// used for OrdersMiniload to restore a le from shelf to shelf + /// + Restorage, + + /// + /// used for clearing a device or storage location. + /// + Clear, + + /// + /// Datenabgleich + /// + DataSync, + + /// + /// see + /// + Unmapped +} \ No newline at end of file diff --git a/03_Realisierung/Code Snippets/OrdersHost Methoden/Finish.cs b/03_Realisierung/Code Snippets/OrdersHost Methoden/Finish.cs index e69de29..c36560f 100644 --- a/03_Realisierung/Code Snippets/OrdersHost Methoden/Finish.cs +++ b/03_Realisierung/Code Snippets/OrdersHost Methoden/Finish.cs @@ -0,0 +1,25 @@ + /// + /// finish this order, related OrdersMiniload, Orders Conveyor and clear the resources + /// + 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); + } \ No newline at end of file diff --git a/03_Realisierung/Code Snippets/OrdersHost Methoden/ForceSetStatusInProgress.cs b/03_Realisierung/Code Snippets/OrdersHost Methoden/ForceSetStatusInProgress.cs index e69de29..81b59c3 100644 --- a/03_Realisierung/Code Snippets/OrdersHost Methoden/ForceSetStatusInProgress.cs +++ b/03_Realisierung/Code Snippets/OrdersHost Methoden/ForceSetStatusInProgress.cs @@ -0,0 +1,5 @@ + public OrdersHost ForceSetStatusInProgress() + { + Status = TransportOrderStatus.InProgress; + return this; + } \ No newline at end of file diff --git a/03_Realisierung/Code Snippets/OrdersHost Methoden/UpdateResources.cs b/03_Realisierung/Code Snippets/OrdersHost Methoden/UpdateResources.cs index e69de29..87d2627 100644 --- a/03_Realisierung/Code Snippets/OrdersHost Methoden/UpdateResources.cs +++ b/03_Realisierung/Code Snippets/OrdersHost Methoden/UpdateResources.cs @@ -0,0 +1,9 @@ + public void UpdateResources(TransportOrderStatus resourceListStatus, List 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); + } \ No newline at end of file