public async Task <string> Executar(FiltroRelatorioSincronoDto request) { var filtros = request.ObterObjetoFiltro <RelatorioSondagemComponentesPorTurmaFiltroDto>(); //Obter a data do periodo\\ var dataDoPeriodo = await mediator.Send(new ObterDataPeriodoFimSondagemPorSemestreAnoLetivoQuery(filtros.Semestre, filtros.AnoLetivo)); var alunosDaTurma = await mediator.Send(new ObterAlunosPorTurmaDataSituacaoMatriculaQuery(filtros.TurmaCodigo, dataDoPeriodo)); if (alunosDaTurma == null || !alunosDaTurma.Any()) { throw new NegocioException("Não foi possível localizar os alunos da turma."); } var relatorio = await ObterDadosRelatorio(filtros, alunosDaTurma); if (relatorio == null) { throw new NegocioException("Não foi possível localizar dados com os filtros informados."); } return(await mediator.Send(new GerarRelatorioHtmlParaPdfCommand("RelatorioSondagemComponentesPorTurma", relatorio, Guid.NewGuid(), envioPorRabbit : false))); }
public async Task <string> Executar(FiltroRelatorioSincronoDto request) { var filtros = request.ObterObjetoFiltro <RelatorioSondagemPortuguesConsolidadoLeituraFiltroDto>(); var respostas = !String.IsNullOrEmpty(filtros.GrupoId) ? await ObterRespostasGrupo(filtros) : await ObterRespostasProficiencia(filtros); RelatorioSondagemPortuguesConsolidadoRelatorioDto relatorio = new RelatorioSondagemPortuguesConsolidadoRelatorioDto() { Cabecalho = await ObterCabecalho(filtros), Respostas = respostas }; if (relatorio == null) { throw new NegocioException("Não foi possível localizar dados com os filtros informados."); } var tipoRelatorio = !string.IsNullOrEmpty(filtros.GrupoId) ? (filtros.GrupoId == GrupoSondagemEnum.ProducaoTexto.Name() ? "Produção de texto" : "Leitura em voz alta") : (filtros.ProficienciaId == ProficienciaSondagemEnum.Leitura ? "Leitura" : "Escrita"); GerarGrafico(relatorio, tipoRelatorio); return(await mediator.Send(new GerarRelatorioHtmlParaPdfCommand("RelatorioSondagemPortuguesConsolidado", relatorio, Guid.NewGuid(), envioPorRabbit : false))); }
public async Task <string> Executar(FiltroRelatorioSincronoDto request) { var filtros = request.ObterObjetoFiltro <FiltroRelatorioSondagemPortuguesCapacidadeLeituraDto>(); Dre dre = null; Ue ue = null; Usuario usuario = null; if (!string.IsNullOrEmpty(filtros.UeCodigo)) { ue = await mediator.Send(new ObterUePorCodigoQuery(filtros.UeCodigo)); if (ue == null) { throw new NegocioException("Não foi possível obter a UE."); } } if (filtros.DreCodigo > 0) { dre = await mediator.Send(new ObterDrePorCodigoQuery() { DreCodigo = filtros.DreCodigo.ToString() }); if (dre == null) { throw new NegocioException("Não foi possível obter a DRE."); } } if (!string.IsNullOrEmpty(filtros.UsuarioRf)) { usuario = await mediator.Send(new ObterUsuarioPorCodigoRfQuery() { UsuarioRf = filtros.UsuarioRf }); if (usuario == null) { throw new NegocioException("Não foi possível obter o usuário."); } } var relatorio = await mediator.Send(new ObterRelatorioSondagemPortuguesCapLeituraPorTurmaQuery() { AnoLetivo = filtros.AnoLetivo, Dre = dre, Ue = ue, TurmaAno = int.Parse(filtros.Ano), Usuario = usuario, TurmaCodigo = filtros.TurmaCodigo, Bimestre = filtros.Bimestre }); return(await mediator.Send(new GerarRelatorioHtmlParaPdfCommand("RelatorioSondagemPortuguesCapacidadeLeituraPorTurma", relatorio, Guid.NewGuid(), envioPorRabbit : false))); }
public async Task <string> Executar(FiltroRelatorioSincronoDto request) { var filtros = request.ObterObjetoFiltro <RelatorioSondagemPortuguesPorTurmaFiltroDto>(); if (filtros.ProficienciaId == ProficienciaSondagemEnum.Autoral && filtros.GrupoId == GrupoSondagemEnum.CapacidadeLeitura.Name()) { throw new NegocioException("Grupo fora do esperado."); } var semestre = (filtros.Bimestre <= 2) ? 1 : 2; var dataDoPeriodo = await mediator.Send(new ObterDataPeriodoFimSondagemPorSemestreAnoLetivoQuery(semestre, filtros.AnoLetivo)); var alunosDaTurma = await mediator.Send(new ObterAlunosPorTurmaDataSituacaoMatriculaQuery(Int32.Parse(filtros.TurmaCodigo), dataDoPeriodo)); if (alunosDaTurma == null || !alunosDaTurma.Any()) { throw new NegocioException("Não foi possível localizar os alunos da turma."); } var relatorioPerguntas = await ObterPerguntas(filtros); RelatorioSondagemPortuguesPorTurmaRelatorioDto relatorio = new RelatorioSondagemPortuguesPorTurmaRelatorioDto() { Cabecalho = await ObterCabecalho(filtros, relatorioPerguntas, dataDoPeriodo), Planilha = new RelatorioSondagemPortuguesPorTurmaPlanilhaDto() { Linhas = await ObterLinhas(filtros, alunosDaTurma) } }; if (relatorio == null) { throw new NegocioException("Não foi possível localizar dados com os filtros informados."); } relatorio.GraficosBarras = new List <GraficoBarrasVerticalDto>(); if (filtros.ProficienciaId == ProficienciaSondagemEnum.Leitura || filtros.ProficienciaId == ProficienciaSondagemEnum.Escrita) { var tipoRelatorio = filtros.ProficienciaId == ProficienciaSondagemEnum.Leitura ? "Leitura" : "Escrita"; GerarGraficoLeituraEscrita(relatorio, tipoRelatorio); } if (filtros.ProficienciaId == ProficienciaSondagemEnum.Autoral && (filtros.GrupoId == GrupoSondagemEnum.LeituraVozAlta.Name() || filtros.GrupoId == GrupoSondagemEnum.ProducaoTexto.Name())) { var tipoRelatorio = filtros.GrupoId == GrupoSondagemEnum.LeituraVozAlta.Name() ? "Leitura em voz alta" : "Produção de texto"; GerarGraficoLeituraEmVozAltaProducaoTexto(relatorio, tipoRelatorio); } return(await mediator.Send(new GerarRelatorioHtmlParaPdfCommand("RelatorioSondagemPortuguesPorTurma", relatorio, Guid.NewGuid(), envioPorRabbit : false))); }
public async Task <string> Executar(FiltroRelatorioSincronoDto request) { var filtros = request.ObterObjetoFiltro <RelatorioSondagemPortuguesConsolidadoLeituraFiltroDto>(); if (filtros.GrupoId != GrupoSondagemEnum.CapacidadeLeitura.Name()) { throw new NegocioException($"{ filtros.GrupoId } fora do esperado."); } var semestre = (filtros.Bimestre <= 2) ? 1 : 2; var dataReferencia = await mediator.Send(new ObterDataPeriodoFimSondagemPorSemestreAnoLetivoQuery(semestre, filtros.AnoLetivo)); int alunosPorAno = await mediator.Send(new ObterTotalAlunosPorUeAnoSondagemQuery( filtros.Ano.ToString(), filtros.UeCodigo, filtros.AnoLetivo, dataReferencia, Convert.ToInt64(filtros.DreCodigo) )); RelatorioSondagemPortuguesConsolidadoLeituraRelatorioDto relatorio = new RelatorioSondagemPortuguesConsolidadoLeituraRelatorioDto() { Cabecalho = await ObterCabecalho(filtros), Planilhas = await ObterPlanilhas(filtros, alunosPorAno) }; if (relatorio == null) { throw new NegocioException("Não foi possível localizar dados com os filtros informados."); } GerarGrafico(relatorio, 0); return(await mediator.Send(new GerarRelatorioHtmlParaPdfCommand("RelatorioSondagemPortuguesConsolidadoCapacidadeLeitura", relatorio, Guid.NewGuid(), envioPorRabbit : false))); }
public async Task <string> Executar(FiltroRelatorioSincronoDto request) { var filtros = request.ObterObjetoFiltro <FiltroRelatorioSondagemComponentesMatematicaAditivoMultiplicativoConsolidadoDto>(); Dre dre = null; Ue ue = null; Usuario usuario = null; if (!string.IsNullOrEmpty(filtros.UeCodigo)) { ue = await mediator.Send(new ObterUePorCodigoQuery(filtros.UeCodigo)); if (ue == null) { throw new NegocioException("Não foi possível obter a UE."); } } if (filtros.DreCodigo > 0) { dre = await mediator.Send(new ObterDrePorCodigoQuery() { DreCodigo = filtros.DreCodigo.ToString() }); if (dre == null) { throw new NegocioException("Não foi possível obter a DRE."); } } if (!string.IsNullOrEmpty(filtros.UsuarioRf)) { usuario = await mediator.Send(new ObterUsuarioPorCodigoRfQuery() { UsuarioRf = filtros.UsuarioRf }); if (usuario == null) { throw new NegocioException("Não foi possível obter o usuário."); } } var dataReferencia = await mediator.Send(new ObterDataPeriodoFimSondagemPorSemestreAnoLetivoQuery(filtros.Semestre, filtros.AnoLetivo)); var quantidadeTotalAlunosUeAno = await mediator.Send(new ObterTotalAlunosPorUeAnoSondagemQuery(filtros.Ano, ue?.Codigo, filtros.AnoLetivo, dataReferencia, filtros.DreCodigo)); var relatorio = await mediator.Send(new ObterSondagemMatAditMultiConsolidadoQuery() { AnoLetivo = filtros.AnoLetivo, Dre = dre, Ue = ue, Semestre = filtros.Semestre, TurmaAno = int.Parse(filtros.Ano), Usuario = usuario, QuantidadeTotalAlunos = quantidadeTotalAlunosUeAno, Proficiencia = filtros.ProficienciaId }); return(await mediator.Send(new GerarRelatorioHtmlParaPdfCommand("RelatorioSondagemComponentesMatematicaAditivoMultiplicativoConsolidado", relatorio, Guid.NewGuid(), envioPorRabbit : false))); }
public async Task <string> RelatorioPortuguesConsolidadoLeituraEscritaProducao([FromBody] FiltroRelatorioSincronoDto request, [FromServices] IRelatorioSondagemPtConsolidadoLeitEscProdUseCase relatorioPtConsolidadoLeituraEscritaProducaoUseCase) { return(await relatorioPtConsolidadoLeituraEscritaProducaoUseCase.Executar(request)); }
public async Task <string> RelatorioPortuguesPorTurmaCapacidadeLeitura([FromBody] FiltroRelatorioSincronoDto request, [FromServices] IRelatorioSondagemPtPorTurmaCapLeituraUseCase relatorioSondagemPtPorTurmaCapLeituraUseCase) { return(await relatorioSondagemPtPorTurmaCapLeituraUseCase.Executar(request)); }
public async Task <string> RelatorioMatemicaConsolidade([FromBody] FiltroRelatorioSincronoDto request, [FromServices] IRelatorioSondagemMatConsolidadoAdtMultiUseCase relatorioSondagemMatConsolidadoAdtMultiUseCase) { return(await relatorioSondagemMatConsolidadoAdtMultiUseCase.Executar(request)); }
public async Task <string> RelatorioSondagemComponentesPorTurma([FromBody] FiltroRelatorioSincronoDto request, [FromServices] IRelatorioSondagemComponentesPorTurmaUseCase relatorioSondagemComponentesPorTurmaUseCase) { return(await relatorioSondagemComponentesPorTurmaUseCase.Executar(request)); }