Index: APPS/Halux/Planning/impl/BatchStarter.cls.xml =================================================================== diff -u -r66764 -r74898 --- APPS/Halux/Planning/impl/BatchStarter.cls.xml (.../BatchStarter.cls.xml) (revision 66764) +++ APPS/Halux/Planning/impl/BatchStarter.cls.xml (.../BatchStarter.cls.xml) (revision 74898) @@ -33,8 +33,28 @@ 1 + +APPS.Halux.PPS.DocumentGeneratorService +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 +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 @@ -46,6 +66,10 @@ Set ..Logger = $$$Inject(Logger, ##class(vhLib.Logger).%New()) 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 ]]> @@ -63,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) Do ..MatService.VerwijderMattenInfo(Batch.GeefID()) + Do ..DocumentGeneratorService.VerwijderDocumenten(Batch.GeefID()) Do ..Logger.Error("StartBatch", "Starten van batch ("_Batch.GeefID()_") is mislukt."_$$$CRLF_$$$CRLF_"Exception:"_$$$CRLF_Exception.ToString()) Do ##class(TECH.ExceptionHandler).Throw(Exception) } @@ -104,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 @@ -114,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 + +