Index: APPS/Halux/PPS/Document/impl/common/BatchNaarObjective.cls.xml =================================================================== diff -u -r71684 -r74859 --- APPS/Halux/PPS/Document/impl/common/BatchNaarObjective.cls.xml (.../BatchNaarObjective.cls.xml) (revision 71684) +++ APPS/Halux/PPS/Document/impl/common/BatchNaarObjective.cls.xml (.../BatchNaarObjective.cls.xml) (revision 74859) @@ -2,6 +2,7 @@ 1 +vhLib.Macro APPS.Halux.PPS.Activiteit.impl.UitvoeringInfoLijstVerwerkerBasis @@ -19,13 +20,46 @@ 1 - -APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.OptieGenerator.ToeleveringProductInfoOptiesGenerator + +vhLib.Logger 1 + +TECH.Mail.MailAPI +1 + + + +APPS.Halux.Planning.Pitching.impl.BatchPitchExportedRepository +1 + + + +%Integer +0 +1 + + + +%String +1 + + + +%Integer +1 +1 + + + +%Integer +0 +1 + + -ToeleveringApi:DOM.AKP.ToeleveringAPI="",BatchNaarObjectiveDataGenerator:APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.BatchNaarObjectiveDataGenerator="" +ToeleveringApi:DOM.AKP.ToeleveringAPI="",BatchNaarObjectiveDataGenerator:APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.BatchNaarObjectiveDataGenerator="",MailApi:TECH.Mail.MailAPI="" 1 1 %Status @@ -34,7 +68,9 @@ Set ..ToeleveringApi = $$$Inject(ToeleveringApi,##class(DOM.DomeinContext).Instance().GeefToeleveringAPI()) Set ..BatchNaarObjectiveDataGenerator = $$$Inject(BatchNaarObjectiveDataGenerator, ..GeefBatchNaarObjectiveDataGenerator()) Set ..MESService = ##class(APPS.Halux.PPS.MES.MESService).%New() - Set ..ToeleveringProductInfoOptiesGenerator = ##class(APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.OptieGenerator.ToeleveringProductInfoOptiesGenerator).%New() + Set ..Logger = ##class(vhLib.Logger).%New("APPS.Halux.PPS.Document.impl.LBX.BatchNaarObjective") + Set ..MailApi = $$$Inject(MailApi, ##class(TECH.Context).Instance().GeefMailAPI()) + Set ..BatchPitchExportedRepository = ##class(APPS.Halux.Planning.Pitching.impl.BatchPitchExportedRepository).%New() Quit $$$OK ]]> @@ -48,59 +84,180 @@ -Lijst:APPS.Halux.PPS.dto.UitvoeringInfoLijst +Lijst:APPS.Halux.PPS.dto.UitvoeringInfoLijst,ActiviteitParameters:APPS.Halux.PPS.Activiteit.ActiviteitParameters,ActieParameters:%ListOfDataTypes="",IsTriggerResetBatch:%Boolean=0 APPS.Halux.PPS.dto.UitvoeringResultaat -UitvoeringInfoLijst:APPS.Halux.PPS.dto.UitvoeringInfoLijst +UitvoeringInfoLijst:APPS.Halux.PPS.dto.UitvoeringInfoLijst,SuffixId:%String,UitvoeringLijstNummer:%Integer,FilterToeleveringId:%String="" %ListOfObjects ELEMENTTYPE="APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.dto.BatchNaarObjectiveData" 0) { #dim BatchId As %String = UitvoeringInfoLijst.GetAt(1).BatchID #dim Batch As APPS.Halux.common.Batch = ##class(APPS.ApplicatieContext).Instance().GeefProductieAPI().GeefBatchService().GeefBatch(BatchId) - #dim ToeleveringenIterator As TECH.Iterator = Batch.GeefToeleveringIterator() #dim UitvoeringInfoLijstIterator As TECH.Iterator = ##class(TECH.ListIterator).%New(UitvoeringInfoLijst) - #dim IndexToelevering As %Integer = 0 + #dim CategorTLM As %Boolean = ((Batch.GeefCategorie() = ##class(APPS.Halux.common.enu.Categorie).Tandembox()) ||(Batch.GeefCategorie() = ##class(APPS.Halux.common.enu.Categorie).Legrabox()) ||(Batch.GeefCategorie() = ##class(APPS.Halux.common.enu.Categorie).Merivobox())) - If (..MESService.IsActiefVoorMes(Batch.GeefLijn(), MesFaseActief)) { - While ToeleveringenIterator.HasNext() { - #dim ToeleveringId As %String = ToeleveringenIterator.Next().GeefID() - #dim Toelevering As DOM.AKP.Toelevering = ..ToeleveringApi.GeefToelevering(ToeleveringId) - Set IndexToelevering = IndexToelevering + 1 + If (..MESService.IsActiefVoorMes(Batch.GeefLijn(), MesFaseActief) && CategorTLM) { + If (..BevatBatchVhoss(UitvoeringInfoLijst)) { + Set BatchDataLijst = ..GeefVhossBatchDataLijst(Batch, UitvoeringInfoLijstIterator, UitvoeringInfoLijst.Size, SuffixId, UitvoeringLijstNummer) + } Else { + Set BatchDataLijst = ..GeefStandaardBatchDataLijst(Batch, UitvoeringInfoLijstIterator, SuffixId, FilterToeleveringId) + } + } + } + + Quit BatchDataLijst +]]> + + + +Batch:APPS.Halux.common.Batch,UitvoeringInfoLijstIterator:TECH.Iterator,AantalLades:%Integer,SuffixId:%String,UitvoeringLijstNummer:%Integer +1 + MaximumAantalLadesProductieOrder) + { + Do ..ZendMailMaxAantalLadeBatchOverschreden(Batch.GeefID(), MaximumAantalLadesProductieOrder) + } Else { + #dim ToeleveringenIterator As TECH.Iterator = ..GeefLijstIteratorVanToeleveringenInVolgordeVanSequentieNummer(UitvoeringInfoLijstIterator) + #dim ToeleveringId As %String = ToeleveringenIterator.Next() + #dim Toelevering As DOM.AKP.Toelevering = ..ToeleveringApi.GeefToelevering(ToeleveringId) + #dim BatchData As APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.dto.BatchNaarObjectiveData = ..BatchNaarObjectiveDataGenerator.GenereerDataVoorBatch(Batch, Toelevering, UitvoeringLijstNummer, AantalLades, SuffixId) + Set BatchData.GebruikersVelden.Vlag.IsProductionLineFixed = "false" + + Do ##class(TECH.ListUtils).AppendList(BatchData.Opties, ..BatchNaarObjectiveDataGenerator.GenereerAlgemeneInfoOptiesVoorBatch(Batch)) + Do ##class(TECH.ListUtils).AppendList(BatchData.Opties, ..GeefOptiesVoorToelevering(Toelevering, UitvoeringInfoLijstIterator)) + + While ToeleveringenIterator.HasNext() { + Set ToeleveringId = ToeleveringenIterator.Next() + Set Toelevering = ..ToeleveringApi.GeefToelevering(ToeleveringId) + + Do ##class(TECH.ListUtils).AppendList(BatchData.Opties, ..GeefOptiesVoorToelevering(Toelevering, UitvoeringInfoLijstIterator)) + Set BatchData.GebruikersVelden.Vlag.IsProductionLineFixed = $Select((BatchData.GebruikersVelden.Vlag.IsProductionLineFixed || ..GeefIsMinstensEenStalenRugFastMover(BatchData.Opties)) : "true", 1:"false") + } + + Do BatchDataLijst.Insert(BatchData) + } + Quit BatchDataLijst +]]> + + + +UitvoeringInfoLijstIterator:TECH.Iterator +1 +TECH.Iterator + + + + +Batch:APPS.Halux.common.Batch,UitvoeringInfoLijstIterator:TECH.Iterator,SuffixId:%String,FilterToeleveringId:%String="" +1 + MaximumAantalLadesProductieOrder) + { + Do ..ZendMailMaxAantalLadesToeleveringOverschreden(ToeleveringId, MaximumAantalLadesProductieOrder) + Set Minstens1ToelevMetTeVeelLades = $$$True + } ElseIf (AantalLadesInToelevering > 0) { + Set ..IndexBestanden = ..IndexBestanden + 1 + #dim BatchData As APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.dto.BatchNaarObjectiveData = ..BatchNaarObjectiveDataGenerator.GenereerDataVoorToelevering(Batch, Toelevering, ..IndexBestanden, AantalLadesInToelevering, SuffixId) + Do ##class(TECH.ListUtils).AppendList(BatchData.Opties, ..BatchNaarObjectiveDataGenerator.GenereerAlgemeneInfoOptiesVoorToelevering(Toelevering, Batch.GeefCategorie())) + Do ##class(TECH.ListUtils).AppendList(BatchData.Opties, ..GeefOptiesVoorToelevering(Toelevering, UitvoeringInfoLijstIterator)) + Set BatchData.GebruikersVelden.Vlag.IsProductionLineFixed = $Select(..GeefIsMinstensEenStalenRugFastMover(BatchData.Opties) : "true", 1:"false") - #dim BatchData As APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.dto.BatchNaarObjectiveData = ..GeefBatchData(Batch, Toelevering, IndexToelevering, UitvoeringInfoLijstIterator) Do BatchDataLijst.Insert(BatchData) } } } - + + If (Minstens1ToelevMetTeVeelLades) { + Do BatchDataLijst.Clear() + } + Quit BatchDataLijst ]]> - -Batch:APPS.Halux.common.Batch,Toelevering:DOM.AKP.Toelevering,IndexToelevering:%Integer,UitvoeringInfoLijstIterator:TECH.Iterator + +ToeleveringId:%String,UitvoeringInfoLijstIterator:TECH.Iterator 1 -APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.dto.BatchNaarObjectiveData +%Integer @@ -110,20 +267,17 @@ @@ -132,40 +286,119 @@ BatchDataLijst:%ListOfObjects 1 -BatchId:%String,Index:%Integer,Extensie:TECH.String +BatchId:%String,BatchIndex:%Integer,Extensie:TECH.String 1 TECH.String + + +UitvoeringInfoLijst:APPS.Halux.PPS.dto.UitvoeringInfoLijst +1 +%Boolean + 0) { + #dim UitvoeringInfo As APPS.Halux.PPS.Activiteit.impl.common.dto.BatchNaarObjectiveUitvoeringInfo = UitvoeringInfoLijst.GetAt(1) + #dim ProductId As %String = UitvoeringInfo.ProductID + + Set BevatBatchVhoss = ..BevatVhossVerpakking(ProductId) + } + + Quit BevatBatchVhoss +]]> + + + +1 +ProductId:%String +1 +%Boolean + + + +ToeleveringID:%String,MaximumAantalLadesProductieOrder:%Integer +1 + + + + +BatchID:%String,MaximumAantalLadesProductieOrder:%Integer +1 + + + + +Opties:%ListOfObjects +%Boolean + +