// // Execution process public void Executer() { // Date du processus DateTime current = DateTime.Now; // Récupérer les échéances du jour à batcher et celles en retard IQueryable<EcheanceContrat> echeances = uow.EcheanceContrat .GetAllABatcher(groupeId) ; if (echeances.Count() > 0) { // Création des opérations var operations = service.ConvertirEcheancesBatch(echeances); // Ajout au contexte foreach (var operation in operations) { uow.Operation.Add(operation); } // Rapprocher échéances et opérations (uniquement caisse) IEcheanceMatchingMachine machine = new EcheanceCaisseMatchingMachine(); var serviceRappro = new RapproEcheancesService(uow, groupeId, machine); IEnumerable<RapproEcheance> rappros = serviceRappro .RapprocherEcheances(operations.AsQueryable(), echeances); // Ajout au contexte foreach (var rappro in rappros) { uow.RapproEcheance.Add(rappro); } // Tracer le processus TracerProcessus(current, echeances); } }
// Exécution du rapprochement public void Executer() { // Enrichir rappros raws avec SpecCandidates this.EnrichirReferentielRapproRaws(compteId); // Rapprocher les raws (le commit a lieu dans le service) var rapproRawFabrique = new RapproRawFabrique(groupeId); var opeFabrique = new OperationFabrique(groupeId, groupe, userName); var s1 = new RapproRawService(uow, fabriqueSpec, opeFabrique, rapproRawFabrique, groupeId); var rapproRaws = s1.RapprocherRaws(); // Récupérer les opés du groupe rapprochées ou non rapprochables, avec echeance et non rapprochées échéances var opes = uow.Operation.GetAllByGroupeId(groupeId) .Where(o => o.EtatId == 3 || o.EtatId == 2) .Where(o => o.AvecEcheance == true) .Where(o => o.RapproEcheance == false) .Where(o => o.AlloueeEcheance == true) ; // Récupérer le échéances du groupes non ralisées e non annulées var echeances = uow.EcheanceContrat.GetAllByGroupeId(groupeId) .Where(e => e.Realisee == false) .Where(e => e.Annulee == false) .Where(e => e.ConvertieOperation == true) ; // Rapprocher les échéances IEcheanceMatchingMachine machine = new EcheanceMatchingMachine(); var s2 = new RapproEcheancesService(uow, groupeId, machine); var rapproEcheances = s2.RapprocherEcheances(opes, echeances); uow.Commit(); // Ajout des rappros au contexte this.CommitRapproEcheances(rapproEcheances); // Rapprocher le chargement chargement.Rapprocher(); // Tracer le processus this.TracerProcessus(rapproRaws); }