Index: APPS/Halux/PPS/Document/impl/common/BatchNaarObjective.cls.xml =================================================================== diff -u -r71684 -r71827 --- 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 71827) @@ -2,6 +2,7 @@ 1 +vhLib.Macro APPS.Halux.PPS.Activiteit.impl.UitvoeringInfoLijstVerwerkerBasis @@ -19,13 +20,18 @@ 1 - -APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.OptieGenerator.ToeleveringProductInfoOptiesGenerator + +vhLib.Logger 1 + +TECH.Mail.MailAPI +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 +40,8 @@ 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()) Quit $$$OK ]]> @@ -68,62 +75,123 @@ 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 - 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 - - #dim BatchData As APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.dto.BatchNaarObjectiveData = ..GeefBatchData(Batch, Toelevering, IndexToelevering, UitvoeringInfoLijstIterator) - Do BatchDataLijst.Insert(BatchData) - } + If (..MESService.IsActiefVoorMes(Batch.GeefLijn(), MesFaseActief)) { + If (..BevatBatchVhoss(UitvoeringInfoLijst)) { + Set BatchDataLijst = ..GeefVhossBatchDataLijst(Batch, UitvoeringInfoLijstIterator) + } Else { + Set BatchDataLijst = ..GeefStandaardBatchDataLijst(Batch, UitvoeringInfoLijstIterator) + } + } } Quit BatchDataLijst ]]> - -Batch:APPS.Halux.common.Batch,Toelevering:DOM.AKP.Toelevering,IndexToelevering:%Integer,UitvoeringInfoLijstIterator:TECH.Iterator + +Batch:APPS.Halux.common.Batch,UitvoeringInfoLijstIterator:TECH.Iterator 1 -APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.dto.BatchNaarObjectiveData + +Batch:APPS.Halux.common.Batch,UitvoeringInfoLijstIterator:TECH.Iterator +1 + + + + +AantalLades:%Integer,BatchId:%String,UitvoeringInfoLijst:APPS.Halux.PPS.dto.UitvoeringInfoLijst,ToeleveringId:%String="" +1 +%Boolean + AantalLadesToegestaan) { + #dim ErrorBoodschap As %String = "Batch '" _ BatchId _ "'" + Set:($$$Not(..BevatBatchVhoss(UitvoeringInfoLijst))) ErrorBoodschap = ErrorBoodschap _ " voor toelevering '" _ ToeleveringId _ "' " + Set ErrorBoodschap = ErrorBoodschap _ "kan niet doorgestuurd worden naar Objective, want deze bevat '" _ AantalLades _ "' lades. Dit is meer dan het toegelaten maximum aantal lades ('" _ AantalLadesToegestaan _ "')." + + Set Exception = ##class(TECH.Exceptions.IllegalArgumentException).%New(ErrorBoodschap) + Do ..Logger.ErrorMail("VerifieerIsAantalLadesToegestaan", Exception.GeefErrorInformatie()) + Do ..ZendMailNaarHalux(Exception.GeefErrorInformatie()) + + Set IsToegestaan = $$$False + } + + Quit IsToegestaan +]]> + + Toelevering:DOM.AKP.Toelevering,UitvoeringInfoLijstIterator:TECH.Iterator 1 @@ -144,7 +212,7 @@ Do FileWriter.WriteXML(BatchData) Do FileWriter.Close() - Do ##class(vhLib.Logger).%New("APPS.Halux.PPS.Document.impl.LBX.BatchNaarObjective").Debug("GenereerBatchDataVoorUitvoeringInfoLijst", "XML bestand gegenereerd voor Batch '" _ BatchData.BatchId _ "' en toelevering '"_ BatchData.ToeleveringId _ "' op locatie '" _ BestandVolledigNaam _ "'") + Do ..Logger.Debug("GenereerBatchDataVoorUitvoeringInfoLijst", "XML bestand gegenereerd voor Batch '" _ BatchData.BatchId _ "' en toelevering '"_ BatchData.ToeleveringId _ "' op locatie '" _ BestandVolledigNaam _ "'") } ]]> @@ -166,6 +234,47 @@ Quit BestandVolledigeNaam ]]> + + +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 +]]> + + + +Inhoud:%String +1 + + + + +1 +ProductId:%String +1 +%Boolean +