Index: APPS/Halux/PPS/Document/impl/common/BatchNaarObjective.cls.xml =================================================================== diff -u -r73640 -r73777 --- APPS/Halux/PPS/Document/impl/common/BatchNaarObjective.cls.xml (.../BatchNaarObjective.cls.xml) (revision 73640) +++ APPS/Halux/PPS/Document/impl/common/BatchNaarObjective.cls.xml (.../BatchNaarObjective.cls.xml) (revision 73777) @@ -35,6 +35,29 @@ 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="",MailApi:TECH.Mail.MailAPI="" 1 @@ -70,6 +93,7 @@ Set UitvoeringInfoIterator = ##class(TECH.ListIterator).%New(UitvoeringInfoLijstGesplitst) #dim UitvoeringInfo As APPS.Halux.PPS.Activiteit.impl.common.dto.BatchNaarObjectiveUitvoeringInfo = Lijst.GetAt(1) + Set ..LaatstGebruikteToeleveringID = UitvoeringInfo.ToeleveringID #dim IsBatchAlGeexporteerd As %Boolean = $$$False If $IsObject(UitvoeringInfo) { Set IsBatchAlGeexporteerd = ..BatchPitchExportedRepository.IsBatchExported(UitvoeringInfo.BatchID) @@ -87,16 +111,23 @@ } } + #dim LaatstGebruikteToeleveringID = UitvoeringInfo.ToeleveringID If $$$Not(UitvoeringStatus = ##class(APPS.Halux.PPS.enu.UitvoeringStatus).Fout()) { #dim IndexUitvoeringInfoLijstGesplitst As %Integer = 1 + #dim IndexSuffixId As %Integer = 1 While UitvoeringInfoIterator.HasNext() { #dim UitvoeringInfoLijst As APPS.Halux.PPS.dto.UitvoeringInfoLijst = UitvoeringInfoIterator.Next() + If ($$$Not(LaatstGebruikteToeleveringID = UitvoeringInfoLijst.GetAt(1).ToeleveringID)) { + Set LaatstGebruikteToeleveringID = UitvoeringInfoLijst.GetAt(1).ToeleveringID + Set IndexSuffixId = 1 + } - #dim SuffixId As %String = ..GeefSuffixId(AantalUitSublijstenUitvoeringInfo, IndexUitvoeringInfoLijstGesplitst) + #dim SuffixId As %String = ..GeefSuffixId(AantalUitSublijstenUitvoeringInfo, IndexSuffixId) #dim BatchData As %ListOfObjects = ..GenereerBatchDataVoorUitvoeringInfoLijst(UitvoeringInfoLijst, SuffixId, IndexUitvoeringInfoLijstGesplitst, FilterToeleveringId) Do ..ExporteerDataNaarXmlDocument(BatchData, SuffixId) Set IndexUitvoeringInfoLijstGesplitst = $Increment(IndexUitvoeringInfoLijstGesplitst) + Set IndexSuffixId = $Increment(IndexSuffixId) } Set UitvoeringStatus = ##class(APPS.Halux.PPS.enu.UitvoeringStatus).Succes() @@ -114,19 +145,27 @@ Set UitvoeringInfoLijstGesplitst = ##class(%ListOfObjects).%New() #dim AantalLades = UitvoeringInfoLijst.Size #dim MaximumAantalLadesProductieOrder As %Integer = ##class(TECH.Config.ConfigMgr).Instance().GeefString("APPS.Halux.PPS.Document.impl.BatchNaarObjective_MaximumAantalLadesProductieOrder") - + #dim LaatstGebruikteToeleveringNr = UitvoeringInfoLijst.GetAt(1).ToeleveringID + Set UitvoeringInfoSubLijst = ##class(APPS.Halux.PPS.dto.UitvoeringInfoLijst).%New() #dim Index As %Integer = 1 While (Index <= AantalLades) { - Do UitvoeringInfoSubLijst.Insert(UitvoeringInfoLijst.GetAt(Index)) + Set UitvoeringInfo = UitvoeringInfoLijst.GetAt(Index) - If (Index # MaximumAantalLadesProductieOrder = 0) { + If (($$$Not(LaatstGebruikteToeleveringNr = UitvoeringInfo.ToeleveringID) && $$$Not(..BevatBatchVhoss(UitvoeringInfoLijst))) + || (((UitvoeringInfoSubLijst.Count() # MaximumAantalLadesProductieOrder) = 0) && $$$Not(UitvoeringInfoSubLijst.Count() = 0))) + { Do UitvoeringInfoLijstGesplitst.Insert(UitvoeringInfoSubLijst) - Set UitvoeringInfoSubLijst = ##class(APPS.Halux.PPS.dto.UitvoeringInfoLijst).%New() + Set UitvoeringInfoSubLijst = ##class(APPS.Halux.PPS.dto.UitvoeringInfoLijst).%New() + Do UitvoeringInfoSubLijst.Insert(UitvoeringInfo) + } Else { + Do UitvoeringInfoSubLijst.Insert(UitvoeringInfo) } - Set Index = $Increment(Index) + Set Index = $Increment(Index) + Set LaatstGebruikteToeleveringNr = UitvoeringInfo.ToeleveringID } + Do UitvoeringInfoLijstGesplitst.Insert(UitvoeringInfoSubLijst) Quit UitvoeringInfoLijstGesplitst @@ -162,8 +201,7 @@ Set BatchDataLijst = ..GeefVhossBatchDataLijst(Batch, UitvoeringInfoLijstIterator, UitvoeringInfoLijst.Size, SuffixId, UitvoeringLijstNummer) } Else { Set BatchDataLijst = ..GeefStandaardBatchDataLijst(Batch, UitvoeringInfoLijstIterator, SuffixId, FilterToeleveringId) - } - + } } } @@ -204,21 +242,26 @@ 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)) + + Do BatchDataLijst.Insert(BatchData) + } - Do BatchDataLijst.Insert(BatchData) } } @@ -236,7 +279,6 @@ Do UitvoeringInfoLijstIterator.Reset() While (UitvoeringInfoLijstIterator.HasNext()) { #dim UitvoeringInfo As APPS.Halux.PPS.Activiteit.impl.common.dto.BatchNaarObjectiveUitvoeringInfo = UitvoeringInfoLijstIterator.Next() - If (UitvoeringInfo.ToeleveringID = ToeleveringId) { Set AantalLades = AantalLades + 1 } @@ -278,8 +320,15 @@ While (BatchDataIterator.HasNext()) { #dim BatchData As APPS.Halux.PPS.Document.impl.common.BatchNaarObjective.dto.BatchNaarObjectiveData = BatchDataIterator.Next() - Set BatchDataIndex = BatchDataIndex + 1 - #dim BestandVolledigNaam As %String = ..GeefBestandVolledigeNaam(BatchData.GebruikersVelden.TekstVelden.BatchId, BatchDataIndex, IndexUitvoeringInfoLijstGesplitst, "xml") + If ($$$Not( $Piece(BatchData.Id, "_", 1) = ..LaatstGebruikteToeleveringID)) { + Set ..LaatstGebruikteToeleveringIDIndex = ..LaatstGebruikteToeleveringIDIndex + 1 + Set ..FileIndexVoorToelevering = 1 + Set ..LaatstGebruikteToeleveringID = $Piece(BatchData.Id, "_", 1) + } Else { + Set ..FileIndexVoorToelevering = ..FileIndexVoorToelevering + 1 + } + + #dim BestandVolledigNaam As %String = ..GeefBestandVolledigeNaam(BatchData.GebruikersVelden.TekstVelden.BatchId, ..LaatstGebruikteToeleveringIDIndex, ..FileIndexVoorToelevering, "xml") Do FileWriter.Open(BestandVolledigNaam) Do FileWriter.WriteXML(BatchData) Do FileWriter.Close()