private async Task <ResumoPAPTotalEstudantesDto> ObterTotalEstudantes(FiltroRelatorioResumoPAPDto filtros)
 {
     return(await mediator.Send(
                new ListarTotalAlunosSeriesQuery()
     {
         Periodo = filtros.Periodo,
         DreId = filtros.DreId,
         UeId = filtros.UeId,
         CicloId = filtros.CicloId,
         TurmaId = filtros.TurmaId,
         Ano = filtros.Ano,
         AnoLetivo = filtros.AnoLetivo
     }));
 }
        private async Task <DreUe> ObterDadosDreUe(FiltroRelatorioResumoPAPDto filtros)
        {
            DreUe dreUe = new DreUe();

            if (!string.IsNullOrEmpty(filtros.DreId) && filtros.DreId != "0")
            {
                var dre = await mediator.Send(new ObterDrePorCodigoQuery()
                {
                    DreCodigo = filtros.DreId
                });

                if (dre != null)
                {
                    dreUe.DreCodigo = dre.Codigo;
                    dreUe.DreId     = dre.Id;
                    dreUe.DreNome   = dre.Abreviacao;
                }
            }
            else
            {
                dreUe.DreNome = "Todas";
            }

            if (!string.IsNullOrEmpty(filtros.UeId) && filtros.UeId != "0")
            {
                var ue = await mediator.Send(new ObterUePorCodigoQuery(filtros.UeId));

                if (ue != null)
                {
                    dreUe.UeCodigo = ue.Codigo;
                    dreUe.UeId     = ue.Id;
                    dreUe.UeNome   = ue.NomeComTipoEscola;
                }
            }
            else
            {
                dreUe.UeNome = "Todas";
            }

            if (dreUe == null)
            {
                throw new NegocioException($"Não foi possível localizar dados do Dre e Ue");
            }
            return(dreUe);
        }
Esempio n. 3
0
        public async Task <bool> Executar(FiltroRelatorioResumoPAPDto filtro)
        {
            var usuarioLogado = await mediator.Send(new ObterUsuarioLogadoQuery());

            filtro.UsuarioNome = usuarioLogado.Nome;
            filtro.UsuarioRf   = usuarioLogado.CodigoRf;

            if (usuarioLogado == null)
            {
                throw new NegocioException("Não foi possível identificar o usuário");
            }

            if (!string.IsNullOrEmpty(filtro.TurmaId) && filtro.TurmaId != "0")
            {
                await mediator.Send(new ValidaSeExisteTurmaPorCodigoQuery(filtro.TurmaId));
            }

            return(await mediator.Send(new GerarRelatorioCommand(TipoRelatorio.ResumoPAP, filtro, usuarioLogado)));
        }
        private async Task <Turma> ObterDadosTurma(FiltroRelatorioResumoPAPDto filtros)
        {
            if (!string.IsNullOrEmpty(filtros.TurmaId) && filtros.TurmaId != "0")
            {
                var turma = await mediator.Send(new ObterTurmaQuery()
                {
                    CodigoTurma = filtros.TurmaId
                });

                if (turma == null)
                {
                    throw new NegocioException($"Não foi possível localizar dados da turma");
                }
                return(turma);
            }
            else
            {
                return(new Turma()
                {
                    Nome = "Todas"
                });
            }
        }
        private async Task <TipoCiclo> ObterCiclo(FiltroRelatorioResumoPAPDto filtros)
        {
            if (filtros.CicloId.HasValue && filtros.CicloId.Value > 0)
            {
                var ciclo = await mediator.Send(new ObterCicloPorIdQuery()
                {
                    CicloId = (long)filtros.CicloId.Value
                });

                if (ciclo == null)
                {
                    throw new NegocioException($"Não foi possível localizar dados do ciclo");
                }
                return(ciclo);
            }
            else
            {
                return(new TipoCiclo()
                {
                    Descricao = "Todos"
                });
            }
        }
        private async Task <RecuperacaoParalelaPeriodoDto> ObterPeriodo(FiltroRelatorioResumoPAPDto filtros)
        {
            if (filtros.Periodo.HasValue && filtros.Periodo.Value > 0)
            {
                var periodo = await mediator.Send(new ObterRecuperacaoParalelaPeriodoPorIdQuery()
                {
                    RecuperacaoParalelaPeriodoId = (long)filtros.Periodo.Value
                });

                if (periodo == null)
                {
                    throw new NegocioException($"Não foi possível localizar dados do período");
                }
                return(periodo);
            }
            else
            {
                return(new RecuperacaoParalelaPeriodoDto()
                {
                    Nome = "Todos"
                });
            }
        }
        private async Task <IEnumerable <ResumoPAPTotalResultadoDto> > ObterEncaminhamento(FiltroRelatorioResumoPAPDto filtros)
        {
            if (filtros.Periodo.HasValue && filtros.Periodo.Value != (int)PeriodoRecuperacaoParalela.Encaminhamento)
            {
                return(null);
            }

            return(await mediator.Send(
                       new ListarTotalResultadoEncaminhamentoQuery()
            {
                Periodo = filtros.Periodo,
                DreId = filtros.DreId,
                UeId = filtros.UeId,
                CicloId = filtros.CicloId,
                TurmaId = filtros.TurmaId,
                Ano = filtros.Ano,
                AnoLetivo = filtros.AnoLetivo
            }));
        }
 private async Task <IEnumerable <ResumoPAPTotalResultadoDto> > ObterResultados(FiltroRelatorioResumoPAPDto filtros)
 {
     return(await mediator.Send(
                new ListarTotalResultadoQuery()
     {
         Periodo = filtros.Periodo,
         DreId = filtros.DreId,
         UeId = filtros.UeId,
         CicloId = filtros.CicloId,
         TurmaId = filtros.TurmaId,
         Ano = filtros.Ano,
         AnoLetivo = filtros.AnoLetivo
     }));
 }
 public async Task <IActionResult> GraficoPAP([FromBody] FiltroRelatorioResumoPAPDto filtroRelatorioGraficoPAPDto, [FromServices] IRelatorioGraficoPAPUseCase relatorioGraficoPAPUseCase)
 {
     return(Ok(await relatorioGraficoPAPUseCase.Executar(filtroRelatorioGraficoPAPDto)));
 }