Index: APPS/Halux/Planning/impl/BatchStarter.cls.xml =================================================================== diff -u -r70541 -r74898 --- APPS/Halux/Planning/impl/BatchStarter.cls.xml (.../BatchStarter.cls.xml) (revision 70541) +++ APPS/Halux/Planning/impl/BatchStarter.cls.xml (.../BatchStarter.cls.xml) (revision 74898) @@ -38,8 +38,23 @@ 1 + +APPS.Halux.common.impl.BatchService +1 + + + +APPS.Halux.Planning.Pitching.impl.BatchPitchDataExporter +1 + + + +APPS.Halux.PPS.MES.MESService +1 + + -BatchBewaarder:APPS.Halux.Planning.BatchBewaarder,BatchSequentieService:APPS.Halux.common.impl.SequentieService,BatchSequentieVerwijderaar:APPS.Halux.Planning.impl.BatchSequentieVerwijderaar,Logger:vhLib.Logger,DnaCodeService:APPS.Halux.AAP.DnaCodeService,MatService:APPS.Halux.PPS.MatService,DocumentGeneratorService:APPS.Halux.PPS.DocumentGeneratorService +BatchBewaarder:APPS.Halux.Planning.BatchBewaarder,BatchSequentieService:APPS.Halux.common.impl.SequentieService,BatchSequentieVerwijderaar:APPS.Halux.Planning.impl.BatchSequentieVerwijderaar,Logger:vhLib.Logger,DnaCodeService:APPS.Halux.AAP.DnaCodeService,MatService:APPS.Halux.PPS.MatService,DocumentGeneratorService:APPS.Halux.PPS.DocumentGeneratorService,BatchService:APPS.Halux.common.impl.BatchService="",BatchPitchDataExporter:APPS.Halux.Planning.Pitching.impl.BatchPitchDataExporter="",MESService:APPS.Halux.PPS.MES.MESService="" 1 1 %Status @@ -52,6 +67,9 @@ Set ..DnaCodeService = $$$Inject(DnaCodeService,##class(APPS.Halux.PPS.Activiteit.impl.TBX.KlantEtiketIoCContainer).Instance().Resolve("DnaCodeService")) Set ..MatService = $$$Inject(MatService, ##class(APPS.Halux.PPS.MatService).%New()) Set ..DocumentGeneratorService = $$$Inject(DocumentGeneratorService, ##class(APPS.Halux.PPS.DocumentGeneratorService).%New()) + Set ..BatchService = $$$Inject(BatchService, ##class(APPS.Halux.common.impl.BatchService).%New()) + Set ..BatchPitchDataExporter = $$$Inject(BatchPitchDataExporter, ##class(APPS.Halux.Planning.Pitching.impl.BatchPitchDataExporter).%New()) + Set ..MESService = $$$Inject(MESService, ##class(APPS.Halux.PPS.MES.MESService).%New()) Quit $$$OK ]]> @@ -69,9 +87,10 @@ -Batch:APPS.Halux.common.Batch +Batch:APPS.Halux.common.Batch,IsTriggerResetBatch:%Boolean=0 1)) { + Do ..UpdateSalesLineStatusNaarKlaargezet(Batch) + } + } + Do Batch.ZetStatus(##class(APPS.Halux.common.enu.BatchStatus).Gestart()) Do ..BatchBewaarder.BewaarBatch(Batch) Do ##class(APPS.Halux.common.event.BatchEventRaiser).RaiseBatchGeslotenEvent(Batch.GeefID()) } Catch { #dim Exception As TECH.Exceptions.Exception = ##class(TECH.ExceptionHandler).Catch() + Do ##class(Tools.Wlip).%New(110).String(Exception.ToString()) Do Batch.ZetStatus(##class(APPS.Halux.common.enu.BatchStatus).StartenGefaald()) + Do ..BatchBewaarder.BewaarBatch(Batch) Do ..BatchSequentieVerwijderaar.VerwijderBatchSequentie(Batch) Do ..DnaCodeService.VerwijderDnaCodesVoorBatch(Batch) @@ -112,6 +142,27 @@ ]]> + +Batch:APPS.Halux.common.Batch +1 +%Boolean + 1) { + Do ..Logger.ErrorMail("StartBatch","Batch "_Batch.GeefID()_" kan niet starten want toelevering " _ Toelevering.GeefID() _ "zit in meerdere batchen, dit zorgt voor fouten. Zie query SELECT ID as BatchID FROM APPS_Halux_common_impl.BatchImpl WHERE FOR SOME %ELEMENT(Toeleveringen) (%VALUE = )") + Set Result = $$$False + } + } + Quit Result +]]> + + MaatWerkBatch:APPS.Halux.Planning.dto.MaatwerkBatch APPS.Halux.Planning.dto.BatchOverzicht @@ -122,6 +173,47 @@ Quit BatchOverzicht ]]> + + +BatchID:%String,IsTriggerResetBatch:%Boolean +1 + + + + +Batch:APPS.Halux.common.Batch +1 + 1) && $$$Not(..IsTestRunTimeContext()) { + #dim CategorTLM As %Boolean = ##class(TECH.StringUtils).Equals(Batch.GeefCategorie(), ##class(APPS.Halux.common.enu.Categorie).Tandembox(), ##class(APPS.Halux.common.enu.Categorie).Legrabox(), ##class(APPS.Halux.common.enu.Categorie).Merivobox()) + + If (CategorTLM) { + #dim ToeleveringIterator As TECH.Iterator = Batch.GeefToeleveringIterator() + + While ToeleveringIterator.HasNext() + { + #dim Toelevering As DOM.AKP.Toelevering = ToeleveringIterator.Next() + #dim ToeleveringLijnIterator As DOM.AKP.impl.DataM.DataMToeleveringLijnIterator = Toelevering.GeefToeleveringLijnIterator() + + While (ToeleveringLijnIterator.HasNext()) { + #dim ProductToeleveringLijn As DOM.AKP.impl.DataM.DataMProductToeleveringLijn = ToeleveringLijnIterator.Next() + Set ProductToeleveringLijnKlaargezetVoorProductieEventData = ##class(BL.Legacy.HaluxProductieOpvolging.ProductToeleveringLijnKlaargezetVoorProductieEventData).%New(Toelevering.GeefID()_";"_ProductToeleveringLijn.GeefID(), "Klaargezet") + Set ProductToeleveringLijnKlaargezetVoorProductieEvent = ##class(BL.Legacy.HaluxProductieOpvolging.ProductToeleveringLijnKlaargezetVoorProductieEvent).%New(ProductToeleveringLijnKlaargezetVoorProductieEventData) + Do ##class(TECH.Context).Instance().GeefPubSubAPI().GeefEventRaiser().RaiseEventAsync(ProductToeleveringLijnKlaargezetVoorProductieEvent) + } + } + } + } +]]> + + + +1 +%Boolean + +