Index: APPS/Halux/PPS/Document/impl/common/BatchNaarObjective.cls.xml
===================================================================
diff -u -r71782 -r71792
--- APPS/Halux/PPS/Document/impl/common/BatchNaarObjective.cls.xml (.../BatchNaarObjective.cls.xml) (revision 71782)
+++ APPS/Halux/PPS/Document/impl/common/BatchNaarObjective.cls.xml (.../BatchNaarObjective.cls.xml) (revision 71792)
@@ -19,6 +19,11 @@
1
+
+vhLib.Logger
+1
+
+
ToeleveringApi:DOM.AKP.ToeleveringAPI="",BatchNaarObjectiveDataGenerator:APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.BatchNaarObjectiveDataGenerator=""
1
@@ -29,6 +34,7 @@
Set ..ToeleveringApi = $$$Inject(ToeleveringApi,##class(DOM.DomeinContext).Instance().GeefToeleveringAPI())
Set ..BatchNaarObjectiveDataGenerator = $$$Inject(BatchNaarObjectiveDataGenerator, ..GeefBatchNaarObjectiveDataGenerator())
Set ..MESService = ##class(APPS.Halux.PPS.MES.MESService).%New()
+ Set ..Logger = ##class(vhLib.Logger).%New("APPS.Halux.PPS.Document.impl.LBX.BatchNaarObjective")
Quit $$$OK
]]>
@@ -62,13 +68,13 @@
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 UitvoeringInfoLijstIterator As TECH.Iterator = ##class(TECH.ListIterator).%New(UitvoeringInfoLijst)
- If (..MESService.IsActiefVoorMes(Batch.GeefLijn(), MesFaseActief)) {
+ If (..MESService.IsActiefVoorMes(Batch.GeefLijn(), MesFaseActief)) {
If (..BevatBatchVhoss(UitvoeringInfoLijst)) {
Set BatchDataLijst = ..GeefVhossBatchDataLijst(Batch, UitvoeringInfoLijstIterator)
} Else {
@@ -88,23 +94,25 @@
@@ -122,17 +130,43 @@
#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 = ..BatchNaarObjectiveDataGenerator.GenereerDataVoorToelevering(Batch, Toelevering, IndexToelevering)
- Do ##class(TECH.ListUtils).AppendList(BatchData.Opties, ..BatchNaarObjectiveDataGenerator.GenereerAlgemeneInfoOptiesVoorToelevering(Toelevering))
- Do ##class(TECH.ListUtils).AppendList(BatchData.Opties, ..GeefOptiesVoorToelevering(Toelevering, UitvoeringInfoLijstIterator))
+ If (..IsAantalLadesToegestaan(Toelevering.GeefAantalProducten(), Batch.GeefID(), ##class(TECH.ListUtils).IteratorToList(UitvoeringInfoLijstIterator), ToeleveringId)) {
- Do BatchDataLijst.Insert(BatchData)
+ #dim BatchData As APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.dto.BatchNaarObjectiveData = ..BatchNaarObjectiveDataGenerator.GenereerDataVoorToelevering(Batch, Toelevering, IndexToelevering)
+ Do ##class(TECH.ListUtils).AppendList(BatchData.Opties, ..BatchNaarObjectiveDataGenerator.GenereerAlgemeneInfoOptiesVoorToelevering(Toelevering))
+ Do ##class(TECH.ListUtils).AppendList(BatchData.Opties, ..GeefOptiesVoorToelevering(Toelevering, UitvoeringInfoLijstIterator))
+
+ Do BatchDataLijst.Insert(BatchData)
+ }
}
Quit BatchDataLijst
]]>
+
+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.Error("VerifieerIsAantalLadesToegestaan", Exception.GeefErrorInformatie())
+
+ Set IsToegestaan = $$$False
+ }
+
+ Quit IsToegestaan
+]]>
+
+
Toelevering:DOM.AKP.Toelevering,UitvoeringInfoLijstIterator:TECH.Iterator
1
@@ -171,7 +205,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 _ "'")
}
]]>
@@ -200,14 +234,14 @@
%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)
}
-
+ Do ##class(Tools.Wlip).%New(26).String("BevatVhoss: " _ BevatBatchVhoss)
Quit BevatBatchVhoss
]]>